diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5b66a4f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +## 1.0.2 (2023-07-17) +- Added Coupons route +- Added **previewText** | **string** | Preview text or preheader of the email campaign | [optional] +- language support for Whatsapp template creation +- Making WhatsAppCampaignsApi PSR-4 compliant. + +## 1.0.1 (2023-05-28) +- API's changed from sendinblue.com domain to api brevo.com domain +- For installation follow this process +- Follow reference example in order to use this SDK diff --git a/README.md b/README.md index 8eb17d5..15b1e1f 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,11 @@ Class | Method | HTTP request | Description *ConversationsApi* | [**conversationsPushedMessagesIdGet**](docs/Api/ConversationsApi.md#conversationspushedmessagesidget) | **GET** /conversations/pushedMessages/{id} | Get an automated message *ConversationsApi* | [**conversationsPushedMessagesIdPut**](docs/Api/ConversationsApi.md#conversationspushedmessagesidput) | **PUT** /conversations/pushedMessages/{id} | Update an automated message *ConversationsApi* | [**conversationsPushedMessagesPost**](docs/Api/ConversationsApi.md#conversationspushedmessagespost) | **POST** /conversations/pushedMessages | Send an automated message to a visitor +*CouponsApi* | [**createCouponCollection**](docs/Api/CouponsApi.md#createcouponcollection) | **POST** /couponCollections | Create а coupon collection +*CouponsApi* | [**createCoupons**](docs/Api/CouponsApi.md#createcoupons) | **POST** /coupons | Create coupons for a coupon collection +*CouponsApi* | [**getCouponCollection**](docs/Api/CouponsApi.md#getcouponcollection) | **GET** /couponCollections/{id} | Get a coupon collection by id +*CouponsApi* | [**getCouponCollections**](docs/Api/CouponsApi.md#getcouponcollections) | **GET** /couponCollections | Get all your coupon collections +*CouponsApi* | [**updateCouponCollection**](docs/Api/CouponsApi.md#updatecouponcollection) | **PATCH** /couponCollections/{id} | Update a coupon collection by id *DealsApi* | [**crmAttributesDealsGet**](docs/Api/DealsApi.md#crmattributesdealsget) | **GET** /crm/attributes/deals | Get deal attributes *DealsApi* | [**crmDealsGet**](docs/Api/DealsApi.md#crmdealsget) | **GET** /crm/deals | Get all deals *DealsApi* | [**crmDealsIdDelete**](docs/Api/DealsApi.md#crmdealsiddelete) | **DELETE** /crm/deals/{id} | Delete a deal @@ -159,7 +164,9 @@ Class | Method | HTTP request | Description *DealsApi* | [**crmDealsIdPatch**](docs/Api/DealsApi.md#crmdealsidpatch) | **PATCH** /crm/deals/{id} | Update a deal *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 *DealsApi* | [**crmPipelineDetailsGet**](docs/Api/DealsApi.md#crmpipelinedetailsget) | **GET** /crm/pipeline/details | Get pipeline stages +*DealsApi* | [**crmPipelineDetailsPipelineIDGet**](docs/Api/DealsApi.md#crmpipelinedetailspipelineidget) | **GET** /crm/pipeline/details/{pipelineID} | Get a pipeline *DomainsApi* | [**authenticateDomain**](docs/Api/DomainsApi.md#authenticatedomain) | **PUT** /senders/domains/{domainName}/authenticate | Authenticate a domain *DomainsApi* | [**createDomain**](docs/Api/DomainsApi.md#createdomain) | **POST** /senders/domains | Create a new domain *DomainsApi* | [**deleteDomain**](docs/Api/DomainsApi.md#deletedomain) | **DELETE** /senders/domains/{domainName} | Delete a domain @@ -219,6 +226,7 @@ Class | Method | HTTP request | Description *ListsApi* | [**updateList**](docs/Api/ListsApi.md#updatelist) | **PUT** /contacts/lists/{listId} | Update a list *MasterAccountApi* | [**corporateMasterAccountGet**](docs/Api/MasterAccountApi.md#corporatemasteraccountget) | **GET** /corporate/masterAccount | Get the details of requested master 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 @@ -361,6 +369,8 @@ Class | Method | HTTP request | Description - [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) @@ -448,6 +458,7 @@ Class | Method | HTTP request | Description - [GetContactCampaignStatsUnsubscriptions](docs/Model/GetContactCampaignStatsUnsubscriptions.md) - [GetContactDetails](docs/Model/GetContactDetails.md) - [GetContacts](docs/Model/GetContacts.md) + - [GetCouponCollection](docs/Model/GetCouponCollection.md) - [GetDeviceBrowserStats](docs/Model/GetDeviceBrowserStats.md) - [GetDomainConfigurationModel](docs/Model/GetDomainConfigurationModel.md) - [GetDomainsList](docs/Model/GetDomainsList.md) @@ -545,10 +556,12 @@ Class | Method | HTTP request | Description - [GetWhatsappEventReport](docs/Model/GetWhatsappEventReport.md) - [GetWhatsappEventReportEvents](docs/Model/GetWhatsappEventReportEvents.md) - [InlineResponse200](docs/Model/InlineResponse200.md) + - [InlineResponse2001](docs/Model/InlineResponse2001.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) - [ManageIp](docs/Model/ManageIp.md) - [MasterDetailsResponse](docs/Model/MasterDetailsResponse.md) - [MasterDetailsResponseBillingInfo](docs/Model/MasterDetailsResponseBillingInfo.md) @@ -567,6 +580,7 @@ Class | Method | HTTP request | Description - [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) @@ -579,6 +593,7 @@ Class | Method | HTTP request | Description - [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) @@ -600,6 +615,7 @@ Class | Method | HTTP request | Description - [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) @@ -627,6 +643,7 @@ Class | Method | HTTP request | Description - [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) diff --git a/docs/Api/CouponsApi.md b/docs/Api/CouponsApi.md new file mode 100644 index 0000000..d498434 --- /dev/null +++ b/docs/Api/CouponsApi.md @@ -0,0 +1,303 @@ +# Brevo\Client\CouponsApi + +All URIs are relative to *https://api.brevo.com/v3* + +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\InlineResponse2012 createCouponCollection($createCouponCollection) + +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 + +try { + $result = $apiInstance->createCouponCollection($createCouponCollection); + 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 | + +### Return type + +[**\Brevo\Client\Model\InlineResponse2012**](../Model/InlineResponse2012.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) + +# **createCoupons** +> createCoupons($createCoupons) + +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 + +try { + $apiInstance->createCoupons($createCoupons); +} 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 | + +### 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) + +# **getCouponCollection** +> \Brevo\Client\Model\GetCouponCollection getCouponCollection($id) + +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 + +try { + $result = $apiInstance->getCouponCollection($id); + print_r($result); +} 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 | + +### Return type + +[**\Brevo\Client\Model\GetCouponCollection**](../Model/GetCouponCollection.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) + +# **getCouponCollections** +> \Brevo\Client\Model\GetCouponCollection getCouponCollections($limit, $offset, $sort) + +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. + new GuzzleHttp\Client(), + $config +); +$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 + +try { + $result = $apiInstance->getCouponCollections($limit, $offset, $sort); + 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] + +### Return type + +[**\Brevo\Client\Model\GetCouponCollection**](../Model/GetCouponCollection.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) + +# **updateCouponCollection** +> \Brevo\Client\Model\InlineResponse2001 updateCouponCollection($id, $updateCouponCollection) + +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 + +try { + $result = $apiInstance->updateCouponCollection($id, $updateCouponCollection); + 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 | + +### Return type + +[**\Brevo\Client\Model\InlineResponse2001**](../Model/InlineResponse2001.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/DealsApi.md b/docs/Api/DealsApi.md index a12924f..a9b24ea 100644 --- a/docs/Api/DealsApi.md +++ b/docs/Api/DealsApi.md @@ -11,7 +11,9 @@ Method | HTTP request | Description [**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 # **crmAttributesDealsGet** @@ -68,7 +70,7 @@ This endpoint does not need any parameter. [[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) # **crmDealsGet** -> \Brevo\Client\Model\DealsList crmDealsGet($filtersAttributes, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy) +> \Brevo\Client\Model\DealsList crmDealsGet($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy) Get all deals @@ -92,7 +94,7 @@ $apiInstance = new Brevo\Client\Api\DealsApi( new GuzzleHttp\Client(), $config ); -$filtersAttributes = "filtersAttributes_example"; // string | Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`.\" +$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 @@ -101,7 +103,7 @@ $sort = "sort_example"; // string | Sort the results in the ascending/descending $sortBy = "sortBy_example"; // string | The field used to sort field names. try { - $result = $apiInstance->crmDealsGet($filtersAttributes, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy); + $result = $apiInstance->crmDealsGet($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy); print_r($result); } catch (Exception $e) { echo 'Exception when calling DealsApi->crmDealsGet: ', $e->getMessage(), PHP_EOL; @@ -113,7 +115,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filtersAttributes** | **string**| Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`.\" | [optional] + **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] @@ -422,11 +424,66 @@ Name | Type | Description | Notes [[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** +> \Brevo\Client\Model\Pipelines crmPipelineDetailsAllGet() + +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. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->crmPipelineDetailsAllGet(); + print_r($result); +} 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) + +### 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) + # **crmPipelineDetailsGet** > \Brevo\Client\Model\Pipeline crmPipelineDetailsGet() Get pipeline stages +This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead. + ### Example ```php \Brevo\Client\Model\Pipelines crmPipelineDetailsPipelineIDGet($pipelineID) + +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 | + +try { + $result = $apiInstance->crmPipelineDetailsPipelineIDGet($pipelineID); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DealsApi->crmPipelineDetailsPipelineIDGet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipelineID** | **string**| | + +### Return type + +[**\Brevo\Client\Model\Pipelines**](../Model/Pipelines.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/ExternalFeedsApi.md b/docs/Api/ExternalFeedsApi.md index 58e6914..1a975b9 100644 --- a/docs/Api/ExternalFeedsApi.md +++ b/docs/Api/ExternalFeedsApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **createExternalFeed** -> \Brevo\Client\Model\InlineResponse2013 createExternalFeed($createExternalFeed) +> \Brevo\Client\Model\InlineResponse2014 createExternalFeed($createExternalFeed) Create an external feed @@ -57,7 +57,7 @@ Name | Type | Description | Notes ### Return type -[**\Brevo\Client\Model\InlineResponse2013**](../Model/InlineResponse2013.md) +[**\Brevo\Client\Model\InlineResponse2014**](../Model/InlineResponse2014.md) ### Authorization diff --git a/docs/Api/MasterAccountApi.md b/docs/Api/MasterAccountApi.md index 236d345..0350501 100644 --- a/docs/Api/MasterAccountApi.md +++ b/docs/Api/MasterAccountApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**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 @@ -131,6 +132,66 @@ Name | Type | Description | Notes [[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) +# **corporateSubAccountIdApplicationsTogglePut** +> corporateSubAccountIdApplicationsTogglePut($id, $toggleApplications) + +Enable/disable sub-account application(s) + +API endpoint 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 = 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 + +try { + $apiInstance->corporateSubAccountIdApplicationsTogglePut($id, $toggleApplications); +} catch (Exception $e) { + echo 'Exception when calling MasterAccountApi->corporateSubAccountIdApplicationsTogglePut: ', $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 | + +### 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) + # **corporateSubAccountIdDelete** > corporateSubAccountIdDelete($id) diff --git a/docs/Api/TransactionalWhatsAppApi.md b/docs/Api/TransactionalWhatsAppApi.md index cfd7964..70c0280 100644 --- a/docs/Api/TransactionalWhatsAppApi.md +++ b/docs/Api/TransactionalWhatsAppApi.md @@ -82,7 +82,7 @@ Name | Type | Description | Notes [[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) # **sendWhatsappMessage** -> \Brevo\Client\Model\InlineResponse2012 sendWhatsappMessage($sendWhatsappMessage) +> \Brevo\Client\Model\InlineResponse2013 sendWhatsappMessage($sendWhatsappMessage) Send a WhatsApp message @@ -127,7 +127,7 @@ Name | Type | Description | Notes ### Return type -[**\Brevo\Client\Model\InlineResponse2012**](../Model/InlineResponse2012.md) +[**\Brevo\Client\Model\InlineResponse2013**](../Model/InlineResponse2013.md) ### Authorization diff --git a/docs/Api/WhatsappCampaignsApi.md b/docs/Api/WhatsAppCampaignsApi.md similarity index 99% rename from docs/Api/WhatsappCampaignsApi.md rename to docs/Api/WhatsAppCampaignsApi.md index 94afbf3..de45a10 100644 --- a/docs/Api/WhatsappCampaignsApi.md +++ b/docs/Api/WhatsAppCampaignsApi.md @@ -5,7 +5,7 @@ All URIs are relative to *https://api.brevo.com/v3* 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 +[**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 diff --git a/docs/Model/Body3.md b/docs/Model/Body3.md index 95d96de..35f52e8 100644 --- a/docs/Model/Body3.md +++ b/docs/Model/Body3.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Name of deal | -**attributes** | **object** | Attributes fo\\r deal creation | [optional] +**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/Body4.md b/docs/Model/Body4.md index 18fc071..fde973d 100644 --- a/docs/Model/Body4.md +++ b/docs/Model/Body4.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Name of deal | [optional] -**attributes** | **object** | Attributes for deal update | [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/CreateCouponCollection.md b/docs/Model/CreateCouponCollection.md new file mode 100644 index 0000000..343ba37 --- /dev/null +++ b/docs/Model/CreateCouponCollection.md @@ -0,0 +1,11 @@ +# 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/CreateCoupons.md b/docs/Model/CreateCoupons.md new file mode 100644 index 0000000..10b5195 --- /dev/null +++ b/docs/Model/CreateCoupons.md @@ -0,0 +1,11 @@ +# 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/CreateEmailCampaign.md b/docs/Model/CreateEmailCampaign.md index 403b3be..85dd214 100644 --- a/docs/Model/CreateEmailCampaign.md +++ b/docs/Model/CreateEmailCampaign.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **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] diff --git a/docs/Model/CreateWhatsAppTemplate.md b/docs/Model/CreateWhatsAppTemplate.md index b8e214d..1944e88 100644 --- a/docs/Model/CreateWhatsAppTemplate.md +++ b/docs/Model/CreateWhatsAppTemplate.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Name of the template | -**language** | **string** | Language of the template. For Example : **en** for English | +**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** | diff --git a/docs/Model/GetCampaignOverview.md b/docs/Model/GetCampaignOverview.md index d008233..9e9d9e8 100644 --- a/docs/Model/GetCampaignOverview.md +++ b/docs/Model/GetCampaignOverview.md @@ -6,6 +6,7 @@ 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] diff --git a/docs/Model/GetCouponCollection.md b/docs/Model/GetCouponCollection.md new file mode 100644 index 0000000..29fa4a7 --- /dev/null +++ b/docs/Model/GetCouponCollection.md @@ -0,0 +1,15 @@ +# 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.md) | 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) + + diff --git a/docs/Model/InlineResponse2001.md b/docs/Model/InlineResponse2001.md new file mode 100644 index 0000000..275bb87 --- /dev/null +++ b/docs/Model/InlineResponse2001.md @@ -0,0 +1,12 @@ +# InlineResponse2001 + +## 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/InlineResponse2012.md b/docs/Model/InlineResponse2012.md index 5ee8e3f..ee6c794 100644 --- a/docs/Model/InlineResponse2012.md +++ b/docs/Model/InlineResponse2012.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**messageId** | **string** | messageId of sent message | +**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/InlineResponse2013.md b/docs/Model/InlineResponse2013.md index 7894861..2481a51 100644 --- a/docs/Model/InlineResponse2013.md +++ b/docs/Model/InlineResponse2013.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | ID of the object created | +**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/InlineResponse2014.md b/docs/Model/InlineResponse2014.md new file mode 100644 index 0000000..20ef0ae --- /dev/null +++ b/docs/Model/InlineResponse2014.md @@ -0,0 +1,10 @@ +# InlineResponse2014 + +## 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/Pipeline.md b/docs/Model/Pipeline.md index beeee79..b7d428b 100644 --- a/docs/Model/Pipeline.md +++ b/docs/Model/Pipeline.md @@ -3,6 +3,8 @@ ## 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) diff --git a/docs/Model/Pipelines.md b/docs/Model/Pipelines.md new file mode 100644 index 0000000..948d3d9 --- /dev/null +++ b/docs/Model/Pipelines.md @@ -0,0 +1,9 @@ +# 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/RequestContactImport.md b/docs/Model/RequestContactImport.md index f7d98af..6050b59 100644 --- a/docs/Model/RequestContactImport.md +++ b/docs/Model/RequestContactImport.md @@ -5,7 +5,7 @@ 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** | [**map[string,object][]**](map.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] +**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] diff --git a/docs/Model/RequestContactImportJsonBody.md b/docs/Model/RequestContactImportJsonBody.md new file mode 100644 index 0000000..4dcb144 --- /dev/null +++ b/docs/Model/RequestContactImportJsonBody.md @@ -0,0 +1,11 @@ +# 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/SsoTokenRequest.md b/docs/Model/SsoTokenRequest.md index dbc6791..b13114b 100644 --- a/docs/Model/SsoTokenRequest.md +++ b/docs/Model/SsoTokenRequest.md @@ -6,6 +6,7 @@ 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 new file mode 100644 index 0000000..edc6262 --- /dev/null +++ b/docs/Model/SubAccountAppsToggleRequest.md @@ -0,0 +1,22 @@ +# SubAccountAppsToggleRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inbox** | **bool** | Set this field to enable or disable Inbox on the sub-account | [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) + + diff --git a/docs/Model/UpdateCouponCollection.md b/docs/Model/UpdateCouponCollection.md new file mode 100644 index 0000000..9d99045 --- /dev/null +++ b/docs/Model/UpdateCouponCollection.md @@ -0,0 +1,10 @@ +# 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/UpdateEmailCampaign.md b/docs/Model/UpdateEmailCampaign.md index 51701ed..a7e49ea 100644 --- a/docs/Model/UpdateEmailCampaign.md +++ b/docs/Model/UpdateEmailCampaign.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **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] diff --git a/lib/Api/AttributesApi.php b/lib/Api/AttributesApi.php index ad2efde..add93cd 100644 --- a/lib/Api/AttributesApi.php +++ b/lib/Api/AttributesApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 3.0.0 * Contact: contact@brevo.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.19 + * Swagger Codegen version: 2.4.29 */ /** diff --git a/lib/Api/CRMApi.php b/lib/Api/CRMApi.php index 3c7684e..dd67b49 100644 --- a/lib/Api/CRMApi.php +++ b/lib/Api/CRMApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 3.0.0 * Contact: contact@brevo.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.19 + * Swagger Codegen version: 2.4.29 */ /** diff --git a/lib/Api/CouponsApi.php b/lib/Api/CouponsApi.php new file mode 100644 index 0000000..e1fd9f7 --- /dev/null +++ b/lib/Api/CouponsApi.php @@ -0,0 +1,1593 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createCouponCollection + * + * Create а coupon collection + * + * @param \Brevo\Client\Model\CreateCouponCollection $createCouponCollection Values to create a coupon collection (required) + * + * @throws \Brevo\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Brevo\Client\Model\InlineResponse2012 + */ + public function createCouponCollection($createCouponCollection) + { + list($response) = $this->createCouponCollectionWithHttpInfo($createCouponCollection); + return $response; + } + + /** + * Operation createCouponCollectionWithHttpInfo + * + * Create а coupon collection + * + * @param \Brevo\Client\Model\CreateCouponCollection $createCouponCollection Values to create a coupon collection (required) + * + * @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) + */ + public function createCouponCollectionWithHttpInfo($createCouponCollection) + { + $returnType = '\Brevo\Client\Model\InlineResponse2012'; + $request = $this->createCouponCollectionRequest($createCouponCollection); + + 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\InlineResponse2012', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $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 createCouponCollectionAsync + * + * Create а coupon collection + * + * @param \Brevo\Client\Model\CreateCouponCollection $createCouponCollection Values to create a coupon collection (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createCouponCollectionAsync($createCouponCollection) + { + return $this->createCouponCollectionAsyncWithHttpInfo($createCouponCollection) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createCouponCollectionAsyncWithHttpInfo + * + * Create а coupon collection + * + * @param \Brevo\Client\Model\CreateCouponCollection $createCouponCollection Values to create a coupon collection (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createCouponCollectionAsyncWithHttpInfo($createCouponCollection) + { + $returnType = '\Brevo\Client\Model\InlineResponse2012'; + $request = $this->createCouponCollectionRequest($createCouponCollection); + + 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 'createCouponCollection' + * + * @param \Brevo\Client\Model\CreateCouponCollection $createCouponCollection Values to create a coupon collection (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createCouponCollectionRequest($createCouponCollection) + { + // 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' + ); + } + + $resourcePath = '/couponCollections'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // 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'] + ); + } + + // 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 createCoupons + * + * Create coupons for a coupon collection + * + * @param \Brevo\Client\Model\CreateCoupons $createCoupons Values to create coupons (required) + * + * @throws \Brevo\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function createCoupons($createCoupons) + { + $this->createCouponsWithHttpInfo($createCoupons); + } + + /** + * Operation createCouponsWithHttpInfo + * + * Create coupons for a coupon collection + * + * @param \Brevo\Client\Model\CreateCoupons $createCoupons Values to create coupons (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 createCouponsWithHttpInfo($createCoupons) + { + $returnType = ''; + $request = $this->createCouponsRequest($createCoupons); + + 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; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Brevo\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createCouponsAsync + * + * Create coupons for a coupon collection + * + * @param \Brevo\Client\Model\CreateCoupons $createCoupons Values to create coupons (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createCouponsAsync($createCoupons) + { + return $this->createCouponsAsyncWithHttpInfo($createCoupons) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createCouponsAsyncWithHttpInfo + * + * Create coupons for a coupon collection + * + * @param \Brevo\Client\Model\CreateCoupons $createCoupons Values to create coupons (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createCouponsAsyncWithHttpInfo($createCoupons) + { + $returnType = ''; + $request = $this->createCouponsRequest($createCoupons); + + 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 'createCoupons' + * + * @param \Brevo\Client\Model\CreateCoupons $createCoupons Values to create coupons (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createCouponsRequest($createCoupons) + { + // 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' + ); + } + + $resourcePath = '/coupons'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // 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'] + ); + } + + // 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 getCouponCollection + * + * Get a coupon collection by id + * + * @param string $id Id of the collection to return (required) + * + * @throws \Brevo\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Brevo\Client\Model\GetCouponCollection + */ + public function getCouponCollection($id) + { + list($response) = $this->getCouponCollectionWithHttpInfo($id); + return $response; + } + + /** + * Operation getCouponCollectionWithHttpInfo + * + * Get a coupon collection by id + * + * @param string $id Id of the collection to return (required) + * + * @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) + */ + public function getCouponCollectionWithHttpInfo($id) + { + $returnType = '\Brevo\Client\Model\GetCouponCollection'; + $request = $this->getCouponCollectionRequest($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\GetCouponCollection', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + 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; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Brevo\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCouponCollectionAsync + * + * Get a coupon collection by id + * + * @param string $id Id of the collection to return (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCouponCollectionAsync($id) + { + return $this->getCouponCollectionAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCouponCollectionAsyncWithHttpInfo + * + * Get a coupon collection by id + * + * @param string $id Id of the collection to return (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCouponCollectionAsyncWithHttpInfo($id) + { + $returnType = '\Brevo\Client\Model\GetCouponCollection'; + $request = $this->getCouponCollectionRequest($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 'getCouponCollection' + * + * @param string $id Id of the collection to return (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getCouponCollectionRequest($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 getCouponCollection' + ); + } + + $resourcePath = '/couponCollections/{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 getCouponCollections + * + * 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) + * + * @throws \Brevo\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Brevo\Client\Model\GetCouponCollection + */ + public function getCouponCollections($limit = '50', $offset = '0', $sort = 'desc') + { + list($response) = $this->getCouponCollectionsWithHttpInfo($limit, $offset, $sort); + return $response; + } + + /** + * Operation getCouponCollectionsWithHttpInfo + * + * 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) + * + * @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) + */ + public function getCouponCollectionsWithHttpInfo($limit = '50', $offset = '0', $sort = 'desc') + { + $returnType = '\Brevo\Client\Model\GetCouponCollection'; + $request = $this->getCouponCollectionsRequest($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\GetCouponCollection', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + 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; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Brevo\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getCouponCollectionsAsync + * + * 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) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCouponCollectionsAsync($limit = '50', $offset = '0', $sort = 'desc') + { + return $this->getCouponCollectionsAsyncWithHttpInfo($limit, $offset, $sort) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getCouponCollectionsAsyncWithHttpInfo + * + * 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) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getCouponCollectionsAsyncWithHttpInfo($limit = '50', $offset = '0', $sort = 'desc') + { + $returnType = '\Brevo\Client\Model\GetCouponCollection'; + $request = $this->getCouponCollectionsRequest($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 '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) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getCouponCollectionsRequest($limit = '50', $offset = '0', $sort = 'desc') + { + if ($limit !== null && $limit > 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.'); + } + + if ($offset !== null && $offset < 0) { + throw new \InvalidArgumentException('invalid value for "$offset" when calling CouponsApi.getCouponCollections, must be bigger than or equal to 0.'); + } + + + $resourcePath = '/couponCollections'; + $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 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) + * + * @throws \Brevo\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Brevo\Client\Model\InlineResponse2001 + */ + public function updateCouponCollection($id, $updateCouponCollection) + { + list($response) = $this->updateCouponCollectionWithHttpInfo($id, $updateCouponCollection); + return $response; + } + + /** + * Operation updateCouponCollectionWithHttpInfo + * + * 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) + * + * @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) + */ + public function updateCouponCollectionWithHttpInfo($id, $updateCouponCollection) + { + $returnType = '\Brevo\Client\Model\InlineResponse2001'; + $request = $this->updateCouponCollectionRequest($id, $updateCouponCollection); + + 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\InlineResponse2001', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + 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 updateCouponCollectionAsync + * + * 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) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateCouponCollectionAsync($id, $updateCouponCollection) + { + return $this->updateCouponCollectionAsyncWithHttpInfo($id, $updateCouponCollection) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateCouponCollectionAsyncWithHttpInfo + * + * 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) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateCouponCollectionAsyncWithHttpInfo($id, $updateCouponCollection) + { + $returnType = '\Brevo\Client\Model\InlineResponse2001'; + $request = $this->updateCouponCollectionRequest($id, $updateCouponCollection); + + 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 'updateCouponCollection' + * + * @param string $id Id of the collection to update (required) + * @param \Brevo\Client\Model\UpdateCouponCollection $updateCouponCollection Values to update the coupon collection (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateCouponCollectionRequest($id, $updateCouponCollection) + { + // 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 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 = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // 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'] + ); + } + + // 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 + ); + } + + /** + * 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/DealsApi.php b/lib/Api/DealsApi.php index 2ae1638..a4b3d6c 100644 --- a/lib/Api/DealsApi.php +++ b/lib/Api/DealsApi.php @@ -352,7 +352,7 @@ protected function crmAttributesDealsGetRequest() * * Get all deals * - * @param string $filtersAttributes Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`.\" (optional) + * @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) @@ -364,9 +364,9 @@ protected function crmAttributesDealsGetRequest() * @throws \InvalidArgumentException * @return \Brevo\Client\Model\DealsList */ - public function crmDealsGet($filtersAttributes = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null) + public function crmDealsGet($filtersAttributesDealName = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null) { - list($response) = $this->crmDealsGetWithHttpInfo($filtersAttributes, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy); + list($response) = $this->crmDealsGetWithHttpInfo($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy); return $response; } @@ -375,7 +375,7 @@ public function crmDealsGet($filtersAttributes = null, $filtersLinkedCompaniesId * * Get all deals * - * @param string $filtersAttributes Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`.\" (optional) + * @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) @@ -387,10 +387,10 @@ public function crmDealsGet($filtersAttributes = null, $filtersLinkedCompaniesId * @throws \InvalidArgumentException * @return array of \Brevo\Client\Model\DealsList, HTTP status code, HTTP response headers (array of strings) */ - public function crmDealsGetWithHttpInfo($filtersAttributes = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null) + public function crmDealsGetWithHttpInfo($filtersAttributesDealName = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null) { $returnType = '\Brevo\Client\Model\DealsList'; - $request = $this->crmDealsGetRequest($filtersAttributes, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy); + $request = $this->crmDealsGetRequest($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy); try { $options = $this->createHttpClientOption(); @@ -464,7 +464,7 @@ public function crmDealsGetWithHttpInfo($filtersAttributes = null, $filtersLinke * * Get all deals * - * @param string $filtersAttributes Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`.\" (optional) + * @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) @@ -475,9 +475,9 @@ public function crmDealsGetWithHttpInfo($filtersAttributes = null, $filtersLinke * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function crmDealsGetAsync($filtersAttributes = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null) + public function crmDealsGetAsync($filtersAttributesDealName = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null) { - return $this->crmDealsGetAsyncWithHttpInfo($filtersAttributes, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy) + return $this->crmDealsGetAsyncWithHttpInfo($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy) ->then( function ($response) { return $response[0]; @@ -490,7 +490,7 @@ function ($response) { * * Get all deals * - * @param string $filtersAttributes Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`.\" (optional) + * @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) @@ -501,10 +501,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function crmDealsGetAsyncWithHttpInfo($filtersAttributes = 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 = '50', $sort = null, $sortBy = null) { $returnType = '\Brevo\Client\Model\DealsList'; - $request = $this->crmDealsGetRequest($filtersAttributes, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy); + $request = $this->crmDealsGetRequest($filtersAttributesDealName, $filtersLinkedCompaniesIds, $filtersLinkedContactsIds, $offset, $limit, $sort, $sortBy); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -546,7 +546,7 @@ function ($exception) { /** * Create request for operation 'crmDealsGet' * - * @param string $filtersAttributes Filter by attrbutes. If you have filter for owner on your side please send it as `attributes.owner`.\" (optional) + * @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) @@ -557,7 +557,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function crmDealsGetRequest($filtersAttributes = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null) + protected function crmDealsGetRequest($filtersAttributesDealName = null, $filtersLinkedCompaniesIds = null, $filtersLinkedContactsIds = null, $offset = null, $limit = '50', $sort = null, $sortBy = null) { $resourcePath = '/crm/deals'; @@ -568,8 +568,8 @@ protected function crmDealsGetRequest($filtersAttributes = null, $filtersLinkedC $multipart = false; // query params - if ($filtersAttributes !== null) { - $queryParams['filters[attributes]'] = ObjectSerializer::toQueryValue($filtersAttributes); + if ($filtersAttributesDealName !== null) { + $queryParams['filters[attributes.deal_name]'] = ObjectSerializer::toQueryValue($filtersAttributesDealName); } // query params if ($filtersLinkedCompaniesIds !== null) { @@ -2041,6 +2041,274 @@ protected function crmDealsPostRequest($body) ); } + /** + * Operation crmPipelineDetailsAllGet + * + * Get all pipelines + * + * + * @throws \Brevo\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Brevo\Client\Model\Pipelines + */ + public function crmPipelineDetailsAllGet() + { + list($response) = $this->crmPipelineDetailsAllGetWithHttpInfo(); + return $response; + } + + /** + * Operation crmPipelineDetailsAllGetWithHttpInfo + * + * Get all pipelines + * + * + * @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) + */ + public function crmPipelineDetailsAllGetWithHttpInfo() + { + $returnType = '\Brevo\Client\Model\Pipelines'; + $request = $this->crmPipelineDetailsAllGetRequest(); + + 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\Pipelines', + $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 crmPipelineDetailsAllGetAsync + * + * Get all pipelines + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function crmPipelineDetailsAllGetAsync() + { + return $this->crmPipelineDetailsAllGetAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation crmPipelineDetailsAllGetAsyncWithHttpInfo + * + * Get all pipelines + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function crmPipelineDetailsAllGetAsyncWithHttpInfo() + { + $returnType = '\Brevo\Client\Model\Pipelines'; + $request = $this->crmPipelineDetailsAllGetRequest(); + + 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 'crmPipelineDetailsAllGet' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function crmPipelineDetailsAllGetRequest() + { + + $resourcePath = '/crm/pipeline/details/all'; + $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 crmPipelineDetailsGet * @@ -2301,6 +2569,293 @@ protected function crmPipelineDetailsGetRequest() ); } + /** + * Operation crmPipelineDetailsPipelineIDGet + * + * Get a pipeline + * + * @param string $pipelineID pipelineID (required) + * + * @throws \Brevo\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Brevo\Client\Model\Pipelines + */ + public function crmPipelineDetailsPipelineIDGet($pipelineID) + { + list($response) = $this->crmPipelineDetailsPipelineIDGetWithHttpInfo($pipelineID); + return $response; + } + + /** + * Operation crmPipelineDetailsPipelineIDGetWithHttpInfo + * + * Get a pipeline + * + * @param string $pipelineID (required) + * + * @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) + */ + public function crmPipelineDetailsPipelineIDGetWithHttpInfo($pipelineID) + { + $returnType = '\Brevo\Client\Model\Pipelines'; + $request = $this->crmPipelineDetailsPipelineIDGetRequest($pipelineID); + + 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\Pipelines', + $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 crmPipelineDetailsPipelineIDGetAsync + * + * Get a pipeline + * + * @param string $pipelineID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function crmPipelineDetailsPipelineIDGetAsync($pipelineID) + { + return $this->crmPipelineDetailsPipelineIDGetAsyncWithHttpInfo($pipelineID) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation crmPipelineDetailsPipelineIDGetAsyncWithHttpInfo + * + * Get a pipeline + * + * @param string $pipelineID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function crmPipelineDetailsPipelineIDGetAsyncWithHttpInfo($pipelineID) + { + $returnType = '\Brevo\Client\Model\Pipelines'; + $request = $this->crmPipelineDetailsPipelineIDGetRequest($pipelineID); + + 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 'crmPipelineDetailsPipelineIDGet' + * + * @param string $pipelineID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function crmPipelineDetailsPipelineIDGetRequest($pipelineID) + { + // verify the required parameter 'pipelineID' is set + if ($pipelineID === null || (is_array($pipelineID) && count($pipelineID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $pipelineID when calling crmPipelineDetailsPipelineIDGet' + ); + } + + $resourcePath = '/crm/pipeline/details/{pipelineID}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($pipelineID !== null) { + $resourcePath = str_replace( + '{' . 'pipelineID' . '}', + ObjectSerializer::toPathValue($pipelineID), + $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 + ); + } + /** * Create http client option * diff --git a/lib/Api/ExternalFeedsApi.php b/lib/Api/ExternalFeedsApi.php index 7bd02e1..48f96fc 100644 --- a/lib/Api/ExternalFeedsApi.php +++ b/lib/Api/ExternalFeedsApi.php @@ -96,7 +96,7 @@ public function getConfig() * * @throws \Brevo\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Brevo\Client\Model\InlineResponse2013 + * @return \Brevo\Client\Model\InlineResponse2014 */ public function createExternalFeed($createExternalFeed) { @@ -113,11 +113,11 @@ public function createExternalFeed($createExternalFeed) * * @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) + * @return array of \Brevo\Client\Model\InlineResponse2014, HTTP status code, HTTP response headers (array of strings) */ public function createExternalFeedWithHttpInfo($createExternalFeed) { - $returnType = '\Brevo\Client\Model\InlineResponse2013'; + $returnType = '\Brevo\Client\Model\InlineResponse2014'; $request = $this->createExternalFeedRequest($createExternalFeed); try { @@ -169,7 +169,7 @@ public function createExternalFeedWithHttpInfo($createExternalFeed) case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Brevo\Client\Model\InlineResponse2013', + '\Brevo\Client\Model\InlineResponse2014', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -219,7 +219,7 @@ function ($response) { */ public function createExternalFeedAsyncWithHttpInfo($createExternalFeed) { - $returnType = '\Brevo\Client\Model\InlineResponse2013'; + $returnType = '\Brevo\Client\Model\InlineResponse2014'; $request = $this->createExternalFeedRequest($createExternalFeed); return $this->client diff --git a/lib/Api/FoldersApi.php b/lib/Api/FoldersApi.php index 6419e58..80d50fb 100644 --- a/lib/Api/FoldersApi.php +++ b/lib/Api/FoldersApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 3.0.0 * Contact: contact@brevo.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.19 + * Swagger Codegen version: 2.4.29 */ /** diff --git a/lib/Api/ListsApi.php b/lib/Api/ListsApi.php index aae6957..da332bd 100644 --- a/lib/Api/ListsApi.php +++ b/lib/Api/ListsApi.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 3.0.0 * Contact: contact@brevo.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.19 + * Swagger Codegen version: 2.4.29 */ /** diff --git a/lib/Api/MasterAccountApi.php b/lib/Api/MasterAccountApi.php index 133aa70..049fb99 100644 --- a/lib/Api/MasterAccountApi.php +++ b/lib/Api/MasterAccountApi.php @@ -653,6 +653,278 @@ protected function corporateSubAccountGetRequest($offset, $limit) ); } + /** + * Operation corporateSubAccountIdApplicationsTogglePut + * + * Enable/disable sub-account application(s) + * + * @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) + * + * @throws \Brevo\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function corporateSubAccountIdApplicationsTogglePut($id, $toggleApplications) + { + $this->corporateSubAccountIdApplicationsTogglePutWithHttpInfo($id, $toggleApplications); + } + + /** + * Operation corporateSubAccountIdApplicationsTogglePutWithHttpInfo + * + * Enable/disable sub-account application(s) + * + * @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) + * + * @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 corporateSubAccountIdApplicationsTogglePutWithHttpInfo($id, $toggleApplications) + { + $returnType = ''; + $request = $this->corporateSubAccountIdApplicationsTogglePutRequest($id, $toggleApplications); + + 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 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Brevo\Client\Model\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\Model\SubAccountAppsToggleRequest $toggleApplications List of applications to activate or deactivate on a sub-account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function corporateSubAccountIdApplicationsTogglePutAsync($id, $toggleApplications) + { + return $this->corporateSubAccountIdApplicationsTogglePutAsyncWithHttpInfo($id, $toggleApplications) + ->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\Model\SubAccountAppsToggleRequest $toggleApplications List of applications to activate or deactivate on a sub-account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function corporateSubAccountIdApplicationsTogglePutAsyncWithHttpInfo($id, $toggleApplications) + { + $returnType = ''; + $request = $this->corporateSubAccountIdApplicationsTogglePutRequest($id, $toggleApplications); + + 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 'corporateSubAccountIdApplicationsTogglePut' + * + * @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) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function corporateSubAccountIdApplicationsTogglePutRequest($id, $toggleApplications) + { + // 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 'toggleApplications' is set + if ($toggleApplications === null || (is_array($toggleApplications) && count($toggleApplications) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $toggleApplications 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 + ); + } + + // 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'] + ); + } + + // 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 corporateSubAccountIdDelete * diff --git a/lib/Api/TransactionalEmailsApi.php b/lib/Api/TransactionalEmailsApi.php index eec0ef0..a941ec6 100644 --- a/lib/Api/TransactionalEmailsApi.php +++ b/lib/Api/TransactionalEmailsApi.php @@ -3864,7 +3864,7 @@ 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 string $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) @@ -3884,7 +3884,7 @@ 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 string $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) @@ -3970,7 +3970,7 @@ 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 string $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) @@ -3993,7 +3993,7 @@ function ($response) { * * Get the list of email templates * - * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional) + * @param string $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) @@ -4046,7 +4046,7 @@ function ($exception) { /** * Create request for operation 'getSmtpTemplates' * - * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional) + * @param string $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) diff --git a/lib/Api/TransactionalWhatsAppApi.php b/lib/Api/TransactionalWhatsAppApi.php index fc93312..8b53509 100644 --- a/lib/Api/TransactionalWhatsAppApi.php +++ b/lib/Api/TransactionalWhatsAppApi.php @@ -443,7 +443,7 @@ protected function getWhatsappEventReportRequest($limit = '2500', $offset = '0', * * @throws \Brevo\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Brevo\Client\Model\InlineResponse2012 + * @return \Brevo\Client\Model\InlineResponse2013 */ public function sendWhatsappMessage($sendWhatsappMessage) { @@ -460,11 +460,11 @@ public function sendWhatsappMessage($sendWhatsappMessage) * * @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) + * @return array of \Brevo\Client\Model\InlineResponse2013, HTTP status code, HTTP response headers (array of strings) */ public function sendWhatsappMessageWithHttpInfo($sendWhatsappMessage) { - $returnType = '\Brevo\Client\Model\InlineResponse2012'; + $returnType = '\Brevo\Client\Model\InlineResponse2013'; $request = $this->sendWhatsappMessageRequest($sendWhatsappMessage); try { @@ -516,7 +516,7 @@ public function sendWhatsappMessageWithHttpInfo($sendWhatsappMessage) case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Brevo\Client\Model\InlineResponse2012', + '\Brevo\Client\Model\InlineResponse2013', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -566,7 +566,7 @@ function ($response) { */ public function sendWhatsappMessageAsyncWithHttpInfo($sendWhatsappMessage) { - $returnType = '\Brevo\Client\Model\InlineResponse2012'; + $returnType = '\Brevo\Client\Model\InlineResponse2013'; $request = $this->sendWhatsappMessageRequest($sendWhatsappMessage); return $this->client diff --git a/lib/Api/WhatsappCampaignsApi.php b/lib/Api/WhatsAppCampaignsApi.php similarity index 99% rename from lib/Api/WhatsappCampaignsApi.php rename to lib/Api/WhatsAppCampaignsApi.php index e001437..ccb4538 100644 --- a/lib/Api/WhatsappCampaignsApi.php +++ b/lib/Api/WhatsAppCampaignsApi.php @@ -558,7 +558,7 @@ protected function createWhatsAppTemplateRequest($whatsAppTemplates) ); } - $resourcePath = '/whatsppCampaigns/template'; + $resourcePath = '/whatsappCampaigns/template'; $formParams = []; $queryParams = []; $headerParams = []; diff --git a/lib/Configuration.php b/lib/Configuration.php index 05a96eb..ac19ad2 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -38,7 +38,7 @@ * @link https://github.com/swagger-api/swagger-codegen */ -$GLOBALS['version'] = '1.0.1'; +$GLOBALS['version'] = '1.0.2'; class Configuration { diff --git a/lib/Model/Body3.php b/lib/Model/Body3.php index 070cd9d..31ce42b 100644 --- a/lib/Model/Body3.php +++ b/lib/Model/Body3.php @@ -250,7 +250,7 @@ public function getAttributes() /** * Sets attributes * - * @param object $attributes Attributes fo\\r deal creation + * @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 */ diff --git a/lib/Model/Body4.php b/lib/Model/Body4.php index 0289537..78b3c6a 100644 --- a/lib/Model/Body4.php +++ b/lib/Model/Body4.php @@ -247,7 +247,7 @@ public function getAttributes() /** * Sets attributes * - * @param object $attributes Attributes for deal update + * @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 */ diff --git a/lib/Model/Contact.php b/lib/Model/Contact.php index 64adf0a..a000b88 100644 --- a/lib/Model/Contact.php +++ b/lib/Model/Contact.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 3.0.0 * Contact: contact@brevo.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.12 + * Swagger Codegen version: 2.4.29 */ /** diff --git a/lib/Model/CreateCouponCollection.php b/lib/Model/CreateCouponCollection.php new file mode 100644 index 0000000..d489d57 --- /dev/null +++ b/lib/Model/CreateCouponCollection.php @@ -0,0 +1,341 @@ + '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 new file mode 100644 index 0000000..d082036 --- /dev/null +++ b/lib/Model/CreateCoupons.php @@ -0,0 +1,341 @@ + '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/CreateEmailCampaign.php b/lib/Model/CreateEmailCampaign.php index c9d73f2..5bb1049 100644 --- a/lib/Model/CreateEmailCampaign.php +++ b/lib/Model/CreateEmailCampaign.php @@ -65,6 +65,7 @@ class CreateEmailCampaign implements ModelInterface, ArrayAccess 'templateId' => 'int', 'scheduledAt' => 'string', 'subject' => 'string', + 'previewText' => 'string', 'replyTo' => 'string', 'toField' => 'string', 'recipients' => '\Brevo\Client\Model\CreateEmailCampaignRecipients', @@ -103,6 +104,7 @@ class CreateEmailCampaign implements ModelInterface, ArrayAccess 'templateId' => 'int64', 'scheduledAt' => null, 'subject' => null, + 'previewText' => null, 'replyTo' => 'email', 'toField' => null, 'recipients' => null, @@ -162,6 +164,7 @@ public static function swaggerFormats() 'templateId' => 'templateId', 'scheduledAt' => 'scheduledAt', 'subject' => 'subject', + 'previewText' => 'previewText', 'replyTo' => 'replyTo', 'toField' => 'toField', 'recipients' => 'recipients', @@ -200,6 +203,7 @@ public static function swaggerFormats() 'templateId' => 'setTemplateId', 'scheduledAt' => 'setScheduledAt', 'subject' => 'setSubject', + 'previewText' => 'setPreviewText', 'replyTo' => 'setReplyTo', 'toField' => 'setToField', 'recipients' => 'setRecipients', @@ -238,6 +242,7 @@ public static function swaggerFormats() 'templateId' => 'getTemplateId', 'scheduledAt' => 'getScheduledAt', 'subject' => 'getSubject', + 'previewText' => 'getPreviewText', 'replyTo' => 'getReplyTo', 'toField' => 'getToField', 'recipients' => 'getRecipients', @@ -345,6 +350,7 @@ public function __construct(array $data = 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; @@ -623,6 +629,30 @@ public function setSubject($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 * diff --git a/lib/Model/CreateWhatsAppTemplate.php b/lib/Model/CreateWhatsAppTemplate.php index 2318bbf..7e79dfa 100644 --- a/lib/Model/CreateWhatsAppTemplate.php +++ b/lib/Model/CreateWhatsAppTemplate.php @@ -306,7 +306,7 @@ public function getLanguage() /** * Sets language * - * @param string $language Language of the template. For Example : **en** for English + * @param string $language Language of the template. For Example : **en** for English * * @return $this */ diff --git a/lib/Model/GetCampaignOverview.php b/lib/Model/GetCampaignOverview.php index dd24a31..7c9bf6c 100644 --- a/lib/Model/GetCampaignOverview.php +++ b/lib/Model/GetCampaignOverview.php @@ -60,6 +60,7 @@ class GetCampaignOverview implements ModelInterface, ArrayAccess 'id' => 'int', 'name' => 'string', 'subject' => 'string', + 'previewText' => 'string', 'type' => 'string', 'status' => 'string', 'scheduledAt' => 'string', @@ -81,6 +82,7 @@ class GetCampaignOverview implements ModelInterface, ArrayAccess 'id' => 'int64', 'name' => null, 'subject' => null, + 'previewText' => null, 'type' => null, 'status' => null, 'scheduledAt' => null, @@ -123,6 +125,7 @@ public static function swaggerFormats() 'id' => 'id', 'name' => 'name', 'subject' => 'subject', + 'previewText' => 'previewText', 'type' => 'type', 'status' => 'status', 'scheduledAt' => 'scheduledAt', @@ -144,6 +147,7 @@ public static function swaggerFormats() 'id' => 'setId', 'name' => 'setName', 'subject' => 'setSubject', + 'previewText' => 'setPreviewText', 'type' => 'setType', 'status' => 'setStatus', 'scheduledAt' => 'setScheduledAt', @@ -165,6 +169,7 @@ public static function swaggerFormats() 'id' => 'getId', 'name' => 'getName', 'subject' => 'getSubject', + 'previewText' => 'getPreviewText', 'type' => 'getType', 'status' => 'getStatus', 'scheduledAt' => 'getScheduledAt', @@ -278,6 +283,7 @@ 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; @@ -414,6 +420,30 @@ public function setSubject($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 * diff --git a/lib/Model/GetCouponCollection.php b/lib/Model/GetCouponCollection.php new file mode 100644 index 0000000..69d4b47 --- /dev/null +++ b/lib/Model/GetCouponCollection.php @@ -0,0 +1,473 @@ + '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/GetExtendedContactDetailsStatisticsDelivered.php b/lib/Model/GetExtendedContactDetailsStatisticsDelivered.php index c0f2d45..42aeeec 100644 --- a/lib/Model/GetExtendedContactDetailsStatisticsDelivered.php +++ b/lib/Model/GetExtendedContactDetailsStatisticsDelivered.php @@ -18,7 +18,7 @@ * OpenAPI spec version: 3.0.0 * Contact: contact@brevo.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.19 + * Swagger Codegen version: 2.4.29 */ /** diff --git a/lib/Model/InlineResponse2001.php b/lib/Model/InlineResponse2001.php new file mode 100644 index 0000000..436ecfd --- /dev/null +++ b/lib/Model/InlineResponse2001.php @@ -0,0 +1,374 @@ + '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/InlineResponse2012.php b/lib/Model/InlineResponse2012.php index e52d322..65bca76 100644 --- a/lib/Model/InlineResponse2012.php +++ b/lib/Model/InlineResponse2012.php @@ -57,7 +57,7 @@ class InlineResponse2012 implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'messageId' => 'string' + 'id' => 'string' ]; /** @@ -66,7 +66,7 @@ class InlineResponse2012 implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'messageId' => 'uuidv4' + 'id' => 'uuidv4' ]; /** @@ -96,7 +96,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'messageId' => 'messageId' + 'id' => 'id' ]; /** @@ -105,7 +105,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'messageId' => 'setMessageId' + 'id' => 'setId' ]; /** @@ -114,7 +114,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'messageId' => 'getMessageId' + 'id' => 'getId' ]; /** @@ -177,7 +177,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; } /** @@ -189,8 +189,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['messageId'] === null) { - $invalidProperties[] = "'messageId' can't be null"; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; } return $invalidProperties; } @@ -208,25 +208,25 @@ public function valid() /** - * Gets messageId + * Gets id * * @return string */ - public function getMessageId() + public function getId() { - return $this->container['messageId']; + return $this->container['id']; } /** - * Sets messageId + * Sets id * - * @param string $messageId messageId of sent message + * @param string $id The id of the created collection * * @return $this */ - public function setMessageId($messageId) + public function setId($id) { - $this->container['messageId'] = $messageId; + $this->container['id'] = $id; return $this; } diff --git a/lib/Model/InlineResponse2013.php b/lib/Model/InlineResponse2013.php index 0e24890..c9b1ddb 100644 --- a/lib/Model/InlineResponse2013.php +++ b/lib/Model/InlineResponse2013.php @@ -57,7 +57,7 @@ class InlineResponse2013 implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'string' + 'messageId' => 'string' ]; /** @@ -66,7 +66,7 @@ class InlineResponse2013 implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => 'uuidv4' + 'messageId' => 'uuidv4' ]; /** @@ -96,7 +96,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'id' => 'id' + 'messageId' => 'messageId' ]; /** @@ -105,7 +105,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'id' => 'setId' + 'messageId' => 'setMessageId' ]; /** @@ -114,7 +114,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'id' => 'getId' + 'messageId' => 'getMessageId' ]; /** @@ -177,7 +177,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null; } /** @@ -189,8 +189,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; + if ($this->container['messageId'] === null) { + $invalidProperties[] = "'messageId' can't be null"; } return $invalidProperties; } @@ -208,25 +208,25 @@ public function valid() /** - * Gets id + * Gets messageId * * @return string */ - public function getId() + public function getMessageId() { - return $this->container['id']; + return $this->container['messageId']; } /** - * Sets id + * Sets messageId * - * @param string $id ID of the object created + * @param string $messageId messageId of sent message * * @return $this */ - public function setId($id) + public function setMessageId($messageId) { - $this->container['id'] = $id; + $this->container['messageId'] = $messageId; return $this; } diff --git a/lib/Model/InlineResponse2014.php b/lib/Model/InlineResponse2014.php new file mode 100644 index 0000000..5fd7852 --- /dev/null +++ b/lib/Model/InlineResponse2014.php @@ -0,0 +1,308 @@ + '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/Pipeline.php b/lib/Model/Pipeline.php index e6dbc8a..02ab62c 100644 --- a/lib/Model/Pipeline.php +++ b/lib/Model/Pipeline.php @@ -58,6 +58,8 @@ class Pipeline implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ + 'pipeline' => 'string', + 'pipelineName' => 'string', 'stages' => '\Brevo\Client\Model\PipelineStage[]' ]; @@ -67,6 +69,8 @@ class Pipeline implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ + 'pipeline' => null, + 'pipelineName' => null, 'stages' => null ]; @@ -97,6 +101,8 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ + 'pipeline' => 'pipeline', + 'pipelineName' => 'pipeline_name', 'stages' => 'stages' ]; @@ -106,6 +112,8 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ + 'pipeline' => 'setPipeline', + 'pipelineName' => 'setPipelineName', 'stages' => 'setStages' ]; @@ -115,6 +123,8 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ + 'pipeline' => 'getPipeline', + 'pipelineName' => 'getPipelineName', 'stages' => 'getStages' ]; @@ -178,6 +188,8 @@ public function getModelName() */ 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; } @@ -205,6 +217,54 @@ public function valid() } + /** + * 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 * diff --git a/lib/Model/Pipelines.php b/lib/Model/Pipelines.php new file mode 100644 index 0000000..3578464 --- /dev/null +++ b/lib/Model/Pipelines.php @@ -0,0 +1,281 @@ +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/RequestContactImport.php b/lib/Model/RequestContactImport.php index 2b5b386..640534c 100644 --- a/lib/Model/RequestContactImport.php +++ b/lib/Model/RequestContactImport.php @@ -59,7 +59,7 @@ class RequestContactImport implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'fileUrl' => 'string', 'fileBody' => 'string', - 'jsonBody' => 'map[string,object][]', + 'jsonBody' => '\Brevo\Client\Model\RequestContactImportJsonBody[]', 'listIds' => 'int[]', 'notifyUrl' => 'string', 'newList' => '\Brevo\Client\Model\RequestContactImportNewList', @@ -309,7 +309,7 @@ public function setFileBody($fileBody) /** * Gets jsonBody * - * @return map[string,object][] + * @return \Brevo\Client\Model\RequestContactImportJsonBody[] */ public function getJsonBody() { @@ -319,7 +319,7 @@ public function getJsonBody() /** * Sets jsonBody * - * @param map[string,object][] $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. + * @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 */ diff --git a/lib/Model/RequestContactImportJsonBody.php b/lib/Model/RequestContactImportJsonBody.php new file mode 100644 index 0000000..dca681a --- /dev/null +++ b/lib/Model/RequestContactImportJsonBody.php @@ -0,0 +1,335 @@ + '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/SsoTokenRequest.php b/lib/Model/SsoTokenRequest.php index da8793c..b29cedc 100644 --- a/lib/Model/SsoTokenRequest.php +++ b/lib/Model/SsoTokenRequest.php @@ -59,7 +59,8 @@ class SsoTokenRequest implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'id' => 'int', 'email' => 'string', - 'target' => 'string' + 'target' => 'string', + 'url' => 'string' ]; /** @@ -70,7 +71,8 @@ class SsoTokenRequest implements ModelInterface, ArrayAccess protected static $swaggerFormats = [ 'id' => 'int64', 'email' => null, - 'target' => null + 'target' => null, + 'url' => null ]; /** @@ -102,7 +104,8 @@ public static function swaggerFormats() protected static $attributeMap = [ 'id' => 'id', 'email' => 'email', - 'target' => 'target' + 'target' => 'target', + 'url' => 'url' ]; /** @@ -113,7 +116,8 @@ public static function swaggerFormats() protected static $setters = [ 'id' => 'setId', 'email' => 'setEmail', - 'target' => 'setTarget' + 'target' => 'setTarget', + 'url' => 'setUrl' ]; /** @@ -124,7 +128,8 @@ public static function swaggerFormats() protected static $getters = [ 'id' => 'getId', 'email' => 'getEmail', - 'target' => 'getTarget' + 'target' => 'getTarget', + 'url' => 'getUrl' ]; /** @@ -217,6 +222,7 @@ 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; } /** @@ -334,6 +340,30 @@ public function setTarget($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. * diff --git a/lib/Model/SubAccountAppsToggleRequest.php b/lib/Model/SubAccountAppsToggleRequest.php new file mode 100644 index 0000000..c5d388b --- /dev/null +++ b/lib/Model/SubAccountAppsToggleRequest.php @@ -0,0 +1,666 @@ + '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 + * + * @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/UpdateCouponCollection.php b/lib/Model/UpdateCouponCollection.php new file mode 100644 index 0000000..fe6b87c --- /dev/null +++ b/lib/Model/UpdateCouponCollection.php @@ -0,0 +1,308 @@ + '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 index fc92552..0fc74b8 100644 --- a/lib/Model/UpdateEmailCampaign.php +++ b/lib/Model/UpdateEmailCampaign.php @@ -64,6 +64,7 @@ class UpdateEmailCampaign implements ModelInterface, ArrayAccess 'htmlUrl' => 'string', 'scheduledAt' => 'string', 'subject' => 'string', + 'previewText' => 'string', 'replyTo' => 'string', 'toField' => 'string', 'recipients' => '\Brevo\Client\Model\UpdateEmailCampaignRecipients', @@ -102,6 +103,7 @@ class UpdateEmailCampaign implements ModelInterface, ArrayAccess 'htmlUrl' => 'url', 'scheduledAt' => null, 'subject' => null, + 'previewText' => null, 'replyTo' => 'email', 'toField' => null, 'recipients' => null, @@ -161,6 +163,7 @@ public static function swaggerFormats() 'htmlUrl' => 'htmlUrl', 'scheduledAt' => 'scheduledAt', 'subject' => 'subject', + 'previewText' => 'previewText', 'replyTo' => 'replyTo', 'toField' => 'toField', 'recipients' => 'recipients', @@ -199,6 +202,7 @@ public static function swaggerFormats() 'htmlUrl' => 'setHtmlUrl', 'scheduledAt' => 'setScheduledAt', 'subject' => 'setSubject', + 'previewText' => 'setPreviewText', 'replyTo' => 'setReplyTo', 'toField' => 'setToField', 'recipients' => 'setRecipients', @@ -237,6 +241,7 @@ public static function swaggerFormats() 'htmlUrl' => 'getHtmlUrl', 'scheduledAt' => 'getScheduledAt', 'subject' => 'getSubject', + 'previewText' => 'getPreviewText', 'replyTo' => 'getReplyTo', 'toField' => 'getToField', 'recipients' => 'getRecipients', @@ -344,6 +349,7 @@ public function __construct(array $data = 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; @@ -593,6 +599,30 @@ public function setSubject($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 * diff --git a/test/Api/AttributesApiTest.php b/test/Api/AttributesApiTest.php index ab3b377..705876e 100644 --- a/test/Api/AttributesApiTest.php +++ b/test/Api/AttributesApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 3.0.0 * Contact: contact@brevo.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.19 + * Swagger Codegen version: 2.4.29 */ /** diff --git a/test/Api/CRMApiTest.php b/test/Api/CRMApiTest.php index fe3a781..f4e6d99 100644 --- a/test/Api/CRMApiTest.php +++ b/test/Api/CRMApiTest.php @@ -17,7 +17,7 @@ * OpenAPI spec version: 3.0.0 * Contact: contact@brevo.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.19 + * Swagger Codegen version: 2.4.29 */ /** diff --git a/test/Api/CouponsApiTest.php b/test/Api/CouponsApiTest.php new file mode 100644 index 0000000..498536f --- /dev/null +++ b/test/Api/CouponsApiTest.php @@ -0,0 +1,123 @@ +