diff --git a/README.md b/README.md index 820939fd..b06ef418 100644 --- a/README.md +++ b/README.md @@ -113,9 +113,11 @@ Class | Method | HTTP request | Description *EmailCampaignsApi* | [**createEmailCampaign**](docs/Api/EmailCampaignsApi.md#createemailcampaign) | **POST** /emailCampaigns | Create an email campaign *EmailCampaignsApi* | [**deleteEmailCampaign**](docs/Api/EmailCampaignsApi.md#deleteemailcampaign) | **DELETE** /emailCampaigns/{campaignId} | Delete an email campaign *EmailCampaignsApi* | [**emailExportRecipients**](docs/Api/EmailCampaignsApi.md#emailexportrecipients) | **POST** /emailCampaigns/{campaignId}/exportRecipients | Export the recipients of a campaign +*EmailCampaignsApi* | [**getAbTestCampaignResult**](docs/Api/EmailCampaignsApi.md#getabtestcampaignresult) | **GET** /emailCampaigns/{campaignId}/abTestCampaignResult | Get A/B test email campaign result *EmailCampaignsApi* | [**getEmailCampaign**](docs/Api/EmailCampaignsApi.md#getemailcampaign) | **GET** /emailCampaigns/{campaignId} | Get campaign informations *EmailCampaignsApi* | [**getEmailCampaigns**](docs/Api/EmailCampaignsApi.md#getemailcampaigns) | **GET** /emailCampaigns | Return all your created campaigns -*EmailCampaignsApi* | [**sendEmailCampaignNow**](docs/Api/EmailCampaignsApi.md#sendemailcampaignnow) | **POST** /emailCampaigns/{campaignId}/sendNow | Send an email campaign id of the campaign immediately +*EmailCampaignsApi* | [**getSharedTemplateUrl**](docs/Api/EmailCampaignsApi.md#getsharedtemplateurl) | **GET** /emailCampaigns/{campaignId}/sharedUrl | Get a shared template url +*EmailCampaignsApi* | [**sendEmailCampaignNow**](docs/Api/EmailCampaignsApi.md#sendemailcampaignnow) | **POST** /emailCampaigns/{campaignId}/sendNow | Send an email campaign immediately, based on campaignId *EmailCampaignsApi* | [**sendReport**](docs/Api/EmailCampaignsApi.md#sendreport) | **POST** /emailCampaigns/{campaignId}/sendReport | Send the report of a campaigns *EmailCampaignsApi* | [**sendTestEmail**](docs/Api/EmailCampaignsApi.md#sendtestemail) | **POST** /emailCampaigns/{campaignId}/sendTest | Send an email campaign to your test list *EmailCampaignsApi* | [**updateCampaignStatus**](docs/Api/EmailCampaignsApi.md#updatecampaignstatus) | **PUT** /emailCampaigns/{campaignId}/status | Update a campaign status @@ -144,6 +146,7 @@ Class | Method | HTTP request | Description *ResellerApi* | [**deleteChildDomain**](docs/Api/ResellerApi.md#deletechilddomain) | **DELETE** /reseller/children/{childAuthKey}/domains/{domainName} | Deletes the sender domain of the reseller child based on the childAuthKey and domainName passed *ResellerApi* | [**deleteResellerChild**](docs/Api/ResellerApi.md#deleteresellerchild) | **DELETE** /reseller/children/{childAuthKey} | Deletes a single reseller child based on the childAuthKey supplied *ResellerApi* | [**dissociateIpFromChild**](docs/Api/ResellerApi.md#dissociateipfromchild) | **POST** /reseller/children/{childAuthKey}/ips/dissociate | Dissociate a dedicated IP to the child +*ResellerApi* | [**getChildAccountCreationStatus**](docs/Api/ResellerApi.md#getchildaccountcreationstatus) | **GET** /reseller/children/{childAuthKey}/accountCreationStatus | Returns the status of reseller's child account creation, whether it is successfully created (exists) or not based on the childAuthKey supplied *ResellerApi* | [**getChildDomains**](docs/Api/ResellerApi.md#getchilddomains) | **GET** /reseller/children/{childAuthKey}/domains | Gets all the sender domains of a specific child account *ResellerApi* | [**getChildInfo**](docs/Api/ResellerApi.md#getchildinfo) | **GET** /reseller/children/{childAuthKey} | Gets the info about a specific child account *ResellerApi* | [**getResellerChilds**](docs/Api/ResellerApi.md#getresellerchilds) | **GET** /reseller/children | Gets the list of all reseller's children accounts @@ -162,18 +165,23 @@ Class | Method | HTTP request | Description *SMSCampaignsApi* | [**sendTestSms**](docs/Api/SMSCampaignsApi.md#sendtestsms) | **POST** /smsCampaigns/{campaignId}/sendTest | Send an SMS *SMSCampaignsApi* | [**updateSmsCampaign**](docs/Api/SMSCampaignsApi.md#updatesmscampaign) | **PUT** /smsCampaigns/{campaignId} | Updates an SMS campaign *SMSCampaignsApi* | [**updateSmsCampaignStatus**](docs/Api/SMSCampaignsApi.md#updatesmscampaignstatus) | **PUT** /smsCampaigns/{campaignId}/status | Update the campaign status -*SMTPApi* | [**createSmtpTemplate**](docs/Api/SMTPApi.md#createsmtptemplate) | **POST** /smtp/templates | Create an smtp template +*SMTPApi* | [**createSmtpTemplate**](docs/Api/SMTPApi.md#createsmtptemplate) | **POST** /smtp/templates | Create a transactional email template *SMTPApi* | [**deleteHardbounces**](docs/Api/SMTPApi.md#deletehardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces -*SMTPApi* | [**deleteSmtpTemplate**](docs/Api/SMTPApi.md#deletesmtptemplate) | **DELETE** /smtp/templates/{templateId} | Delete an inactive smtp template -*SMTPApi* | [**getAggregatedSmtpReport**](docs/Api/SMTPApi.md#getaggregatedsmtpreport) | **GET** /smtp/statistics/aggregatedReport | Get your SMTP activity aggregated over a period of time -*SMTPApi* | [**getEmailEventReport**](docs/Api/SMTPApi.md#getemaileventreport) | **GET** /smtp/statistics/events | Get all your SMTP activity (unaggregated events) -*SMTPApi* | [**getSmtpReport**](docs/Api/SMTPApi.md#getsmtpreport) | **GET** /smtp/statistics/reports | Get your SMTP activity aggregated per day +*SMTPApi* | [**deleteSmtpTemplate**](docs/Api/SMTPApi.md#deletesmtptemplate) | **DELETE** /smtp/templates/{templateId} | Delete an inactive transactional email template +*SMTPApi* | [**getAggregatedSmtpReport**](docs/Api/SMTPApi.md#getaggregatedsmtpreport) | **GET** /smtp/statistics/aggregatedReport | Get your transactional email activity aggregated over a period of time +*SMTPApi* | [**getEmailEventReport**](docs/Api/SMTPApi.md#getemaileventreport) | **GET** /smtp/statistics/events | Get all your transactional email activity (unaggregated events) +*SMTPApi* | [**getSmtpReport**](docs/Api/SMTPApi.md#getsmtpreport) | **GET** /smtp/statistics/reports | Get your transactional email activity aggregated per day *SMTPApi* | [**getSmtpTemplate**](docs/Api/SMTPApi.md#getsmtptemplate) | **GET** /smtp/templates/{templateId} | Returns the template informations -*SMTPApi* | [**getSmtpTemplates**](docs/Api/SMTPApi.md#getsmtptemplates) | **GET** /smtp/templates | Get the list of SMTP templates +*SMTPApi* | [**getSmtpTemplates**](docs/Api/SMTPApi.md#getsmtptemplates) | **GET** /smtp/templates | Get the list of transactional email templates +*SMTPApi* | [**getTransacBlockedContacts**](docs/Api/SMTPApi.md#gettransacblockedcontacts) | **GET** /smtp/blockedContacts | Get the list of blocked or unsubscribed transactional contacts +*SMTPApi* | [**getTransacEmailContent**](docs/Api/SMTPApi.md#gettransacemailcontent) | **GET** /smtp/emails/{uuid} | Get the personalized content of a sent transactional email +*SMTPApi* | [**getTransacEmailsList**](docs/Api/SMTPApi.md#gettransacemailslist) | **GET** /smtp/emails | Get the list of transactional emails on the basis of allowed filters *SMTPApi* | [**sendTemplate**](docs/Api/SMTPApi.md#sendtemplate) | **POST** /smtp/templates/{templateId}/send | Send a template *SMTPApi* | [**sendTestTemplate**](docs/Api/SMTPApi.md#sendtesttemplate) | **POST** /smtp/templates/{templateId}/sendTest | Send a template to your test list *SMTPApi* | [**sendTransacEmail**](docs/Api/SMTPApi.md#sendtransacemail) | **POST** /smtp/email | Send a transactional email -*SMTPApi* | [**updateSmtpTemplate**](docs/Api/SMTPApi.md#updatesmtptemplate) | **PUT** /smtp/templates/{templateId} | Updates an smtp templates +*SMTPApi* | [**smtpBlockedContactsEmailDelete**](docs/Api/SMTPApi.md#smtpblockedcontactsemaildelete) | **DELETE** /smtp/blockedContacts/{email} | Unblock or resubscribe a transactional contact +*SMTPApi* | [**smtpLogMessageIdDelete**](docs/Api/SMTPApi.md#smtplogmessageiddelete) | **DELETE** /smtp/log/{messageId} | Delete an SMTP transactional log +*SMTPApi* | [**updateSmtpTemplate**](docs/Api/SMTPApi.md#updatesmtptemplate) | **PUT** /smtp/templates/{templateId} | Updates a transactional email templates *SendersApi* | [**createSender**](docs/Api/SendersApi.md#createsender) | **POST** /senders | Create a new sender *SendersApi* | [**deleteSender**](docs/Api/SendersApi.md#deletesender) | **DELETE** /senders/{senderId} | Delete a sender *SendersApi* | [**getIps**](docs/Api/SendersApi.md#getips) | **GET** /senders/ips | Return all the dedicated IPs for your account @@ -193,6 +201,7 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AbTestCampaignResult](docs/Model/AbTestCampaignResult.md) - [AddChildDomain](docs/Model/AddChildDomain.md) - [AddContactToList](docs/Model/AddContactToList.md) - [AddCredits](docs/Model/AddCredits.md) @@ -232,6 +241,7 @@ Class | Method | HTTP request | Description - [GetCampaignOverview](docs/Model/GetCampaignOverview.md) - [GetCampaignRecipients](docs/Model/GetCampaignRecipients.md) - [GetCampaignStats](docs/Model/GetCampaignStats.md) + - [GetChildAccountCreationStatus](docs/Model/GetChildAccountCreationStatus.md) - [GetChildDomain](docs/Model/GetChildDomain.md) - [GetChildDomains](docs/Model/GetChildDomains.md) - [GetChildInfoApiKeys](docs/Model/GetChildInfoApiKeys.md) @@ -248,6 +258,8 @@ Class | Method | HTTP request | Description - [GetContactCampaignStatsUnsubscriptions](docs/Model/GetContactCampaignStatsUnsubscriptions.md) - [GetContactDetails](docs/Model/GetContactDetails.md) - [GetContacts](docs/Model/GetContacts.md) + - [GetDeviceBrowserStats](docs/Model/GetDeviceBrowserStats.md) + - [GetEmailCampaign](docs/Model/GetEmailCampaign.md) - [GetEmailCampaigns](docs/Model/GetEmailCampaigns.md) - [GetEmailEventReport](docs/Model/GetEmailEventReport.md) - [GetEmailEventReportEvents](docs/Model/GetEmailEventReportEvents.md) @@ -279,6 +291,7 @@ Class | Method | HTTP request | Description - [GetSendersList](docs/Model/GetSendersList.md) - [GetSendersListIps](docs/Model/GetSendersListIps.md) - [GetSendersListSenders](docs/Model/GetSendersListSenders.md) + - [GetSharedTemplateUrl](docs/Model/GetSharedTemplateUrl.md) - [GetSmsCampaignOverview](docs/Model/GetSmsCampaignOverview.md) - [GetSmsCampaignStats](docs/Model/GetSmsCampaignStats.md) - [GetSmsCampaigns](docs/Model/GetSmsCampaigns.md) @@ -288,8 +301,17 @@ Class | Method | HTTP request | Description - [GetSmtpTemplateOverviewSender](docs/Model/GetSmtpTemplateOverviewSender.md) - [GetSmtpTemplates](docs/Model/GetSmtpTemplates.md) - [GetSsoToken](docs/Model/GetSsoToken.md) + - [GetStatsByBrowser](docs/Model/GetStatsByBrowser.md) + - [GetStatsByDevice](docs/Model/GetStatsByDevice.md) - [GetStatsByDomain](docs/Model/GetStatsByDomain.md) - [GetTransacAggregatedSmsReport](docs/Model/GetTransacAggregatedSmsReport.md) + - [GetTransacBlockedContacts](docs/Model/GetTransacBlockedContacts.md) + - [GetTransacBlockedContactsContacts](docs/Model/GetTransacBlockedContactsContacts.md) + - [GetTransacBlockedContactsReason](docs/Model/GetTransacBlockedContactsReason.md) + - [GetTransacEmailContent](docs/Model/GetTransacEmailContent.md) + - [GetTransacEmailContentEvents](docs/Model/GetTransacEmailContentEvents.md) + - [GetTransacEmailsList](docs/Model/GetTransacEmailsList.md) + - [GetTransacEmailsListTransactionalEmails](docs/Model/GetTransacEmailsListTransactionalEmails.md) - [GetTransacSmsReport](docs/Model/GetTransacSmsReport.md) - [GetTransacSmsReportReports](docs/Model/GetTransacSmsReportReports.md) - [GetWebhook](docs/Model/GetWebhook.md) @@ -305,6 +327,7 @@ Class | Method | HTTP request | Description - [RemoveContactFromList](docs/Model/RemoveContactFromList.md) - [RemoveCredits](docs/Model/RemoveCredits.md) - [RequestContactExport](docs/Model/RequestContactExport.md) + - [RequestContactExportCustomContactFilter](docs/Model/RequestContactExportCustomContactFilter.md) - [RequestContactImport](docs/Model/RequestContactImport.md) - [RequestContactImportNewList](docs/Model/RequestContactImportNewList.md) - [RequestSmsRecipientExport](docs/Model/RequestSmsRecipientExport.md) diff --git a/docs/Api/EmailCampaignsApi.md b/docs/Api/EmailCampaignsApi.md index ac37f62f..04cc0c96 100644 --- a/docs/Api/EmailCampaignsApi.md +++ b/docs/Api/EmailCampaignsApi.md @@ -7,9 +7,11 @@ Method | HTTP request | Description [**createEmailCampaign**](EmailCampaignsApi.md#createEmailCampaign) | **POST** /emailCampaigns | Create an email campaign [**deleteEmailCampaign**](EmailCampaignsApi.md#deleteEmailCampaign) | **DELETE** /emailCampaigns/{campaignId} | Delete an email campaign [**emailExportRecipients**](EmailCampaignsApi.md#emailExportRecipients) | **POST** /emailCampaigns/{campaignId}/exportRecipients | Export the recipients of a campaign +[**getAbTestCampaignResult**](EmailCampaignsApi.md#getAbTestCampaignResult) | **GET** /emailCampaigns/{campaignId}/abTestCampaignResult | Get A/B test email campaign result [**getEmailCampaign**](EmailCampaignsApi.md#getEmailCampaign) | **GET** /emailCampaigns/{campaignId} | Get campaign informations [**getEmailCampaigns**](EmailCampaignsApi.md#getEmailCampaigns) | **GET** /emailCampaigns | Return all your created campaigns -[**sendEmailCampaignNow**](EmailCampaignsApi.md#sendEmailCampaignNow) | **POST** /emailCampaigns/{campaignId}/sendNow | Send an email campaign id of the campaign immediately +[**getSharedTemplateUrl**](EmailCampaignsApi.md#getSharedTemplateUrl) | **GET** /emailCampaigns/{campaignId}/sharedUrl | Get a shared template url +[**sendEmailCampaignNow**](EmailCampaignsApi.md#sendEmailCampaignNow) | **POST** /emailCampaigns/{campaignId}/sendNow | Send an email campaign immediately, based on campaignId [**sendReport**](EmailCampaignsApi.md#sendReport) | **POST** /emailCampaigns/{campaignId}/sendReport | Send the report of a campaigns [**sendTestEmail**](EmailCampaignsApi.md#sendTestEmail) | **POST** /emailCampaigns/{campaignId}/sendTest | Send an email campaign to your test list [**updateCampaignStatus**](EmailCampaignsApi.md#updateCampaignStatus) | **PUT** /emailCampaigns/{campaignId}/status | Update a campaign status @@ -188,6 +190,65 @@ 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) +# **getAbTestCampaignResult** +> \SendinBlue\Client\Model\AbTestCampaignResult getAbTestCampaignResult($campaignId) + +Get A/B test email campaign result + +Obtain winning version of an A/B test email campaign + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// Configure API key authorization: partner-key +$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer'); + +$apiInstance = new SendinBlue\Client\Api\EmailCampaignsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$campaignId = 789; // int | Id of the A/B test campaign + +try { + $result = $apiInstance->getAbTestCampaignResult($campaignId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmailCampaignsApi->getAbTestCampaignResult: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **campaignId** | **int**| Id of the A/B test campaign | + +### Return type + +[**\SendinBlue\Client\Model\AbTestCampaignResult**](../Model/AbTestCampaignResult.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) + # **getEmailCampaign** > \SendinBlue\Client\Model\GetEmailCampaign getEmailCampaign($campaignId) @@ -312,10 +373,69 @@ 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) +# **getSharedTemplateUrl** +> \SendinBlue\Client\Model\GetSharedTemplateUrl getSharedTemplateUrl($campaignId) + +Get a shared template url + +Get a unique URL to share & import an email template from one Sendinblue account to another. + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// Configure API key authorization: partner-key +$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer'); + +$apiInstance = new SendinBlue\Client\Api\EmailCampaignsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$campaignId = 789; // int | Id of the campaign or template + +try { + $result = $apiInstance->getSharedTemplateUrl($campaignId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmailCampaignsApi->getSharedTemplateUrl: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **campaignId** | **int**| Id of the campaign or template | + +### Return type + +[**\SendinBlue\Client\Model\GetSharedTemplateUrl**](../Model/GetSharedTemplateUrl.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) + # **sendEmailCampaignNow** > sendEmailCampaignNow($campaignId) -Send an email campaign id of the campaign immediately +Send an email campaign immediately, based on campaignId ### Example ```php diff --git a/docs/Api/ResellerApi.md b/docs/Api/ResellerApi.md index 43167fb8..906a9f1e 100644 --- a/docs/Api/ResellerApi.md +++ b/docs/Api/ResellerApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**deleteChildDomain**](ResellerApi.md#deleteChildDomain) | **DELETE** /reseller/children/{childAuthKey}/domains/{domainName} | Deletes the sender domain of the reseller child based on the childAuthKey and domainName passed [**deleteResellerChild**](ResellerApi.md#deleteResellerChild) | **DELETE** /reseller/children/{childAuthKey} | Deletes a single reseller child based on the childAuthKey supplied [**dissociateIpFromChild**](ResellerApi.md#dissociateIpFromChild) | **POST** /reseller/children/{childAuthKey}/ips/dissociate | Dissociate a dedicated IP to the child +[**getChildAccountCreationStatus**](ResellerApi.md#getChildAccountCreationStatus) | **GET** /reseller/children/{childAuthKey}/accountCreationStatus | Returns the status of reseller's child account creation, whether it is successfully created (exists) or not based on the childAuthKey supplied [**getChildDomains**](ResellerApi.md#getChildDomains) | **GET** /reseller/children/{childAuthKey}/domains | Gets all the sender domains of a specific child account [**getChildInfo**](ResellerApi.md#getChildInfo) | **GET** /reseller/children/{childAuthKey} | Gets the info about a specific child account [**getResellerChilds**](ResellerApi.md#getResellerChilds) | **GET** /reseller/children | Gets the list of all reseller's children accounts @@ -164,7 +165,7 @@ $apiInstance = new SendinBlue\Client\Api\ResellerApi( $config ); $childAuthKey = "childAuthKey_example"; // string | auth key of reseller's child -$addChildDomain = new \SendinBlue\Client\Model\AddChildDomain(); // \SendinBlue\Client\Model\AddChildDomain | Sender domain to add for a specific child account +$addChildDomain = new \SendinBlue\Client\Model\AddChildDomain(); // \SendinBlue\Client\Model\AddChildDomain | Sender domain to add for a specific child account. This will not be displayed to the parent account. try { $apiInstance->createChildDomain($childAuthKey, $addChildDomain); @@ -179,7 +180,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **childAuthKey** | **string**| auth key of reseller's child | - **addChildDomain** | [**\SendinBlue\Client\Model\AddChildDomain**](../Model/AddChildDomain.md)| Sender domain to add for a specific child account | + **addChildDomain** | [**\SendinBlue\Client\Model\AddChildDomain**](../Model/AddChildDomain.md)| Sender domain to add for a specific child account. This will not be displayed to the parent account. | ### Return type @@ -425,6 +426,63 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **getChildAccountCreationStatus** +> \SendinBlue\Client\Model\GetChildAccountCreationStatus getChildAccountCreationStatus($childAuthKey) + +Returns the status of reseller's child account creation, whether it is successfully created (exists) or not based on the childAuthKey supplied + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// Configure API key authorization: partner-key +$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer'); + +$apiInstance = new SendinBlue\Client\Api\ResellerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$childAuthKey = "childAuthKey_example"; // string | auth key of reseller's child + +try { + $result = $apiInstance->getChildAccountCreationStatus($childAuthKey); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ResellerApi->getChildAccountCreationStatus: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **childAuthKey** | **string**| auth key of reseller's child | + +### Return type + +[**\SendinBlue\Client\Model\GetChildAccountCreationStatus**](../Model/GetChildAccountCreationStatus.md) + +### Authorization + +[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **getChildDomains** > \SendinBlue\Client\Model\GetChildDomains getChildDomains($childAuthKey) @@ -540,7 +598,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) # **getResellerChilds** -> \SendinBlue\Client\Model\GetChildrenList getResellerChilds() +> \SendinBlue\Client\Model\GetChildrenList getResellerChilds($limit, $offset) Gets the list of all reseller's children accounts @@ -564,9 +622,11 @@ $apiInstance = new SendinBlue\Client\Api\ResellerApi( new GuzzleHttp\Client(), $config ); +$limit = 10; // int | Number of documents for child accounts information per page +$offset = 0; // int | Index of the first document in the page try { - $result = $apiInstance->getResellerChilds(); + $result = $apiInstance->getResellerChilds($limit, $offset); print_r($result); } catch (Exception $e) { echo 'Exception when calling ResellerApi->getResellerChilds: ', $e->getMessage(), PHP_EOL; @@ -575,7 +635,11 @@ try { ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Number of documents for child accounts information per page | [optional] [default to 10] + **offset** | **int**| Index of the first document in the page | [optional] [default to 0] ### Return type diff --git a/docs/Api/SMTPApi.md b/docs/Api/SMTPApi.md index 72bf07f9..12b5dd08 100644 --- a/docs/Api/SMTPApi.md +++ b/docs/Api/SMTPApi.md @@ -4,24 +4,29 @@ All URIs are relative to *https://api.sendinblue.com/v3* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createSmtpTemplate**](SMTPApi.md#createSmtpTemplate) | **POST** /smtp/templates | Create an smtp template +[**createSmtpTemplate**](SMTPApi.md#createSmtpTemplate) | **POST** /smtp/templates | Create a transactional email template [**deleteHardbounces**](SMTPApi.md#deleteHardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces -[**deleteSmtpTemplate**](SMTPApi.md#deleteSmtpTemplate) | **DELETE** /smtp/templates/{templateId} | Delete an inactive smtp template -[**getAggregatedSmtpReport**](SMTPApi.md#getAggregatedSmtpReport) | **GET** /smtp/statistics/aggregatedReport | Get your SMTP activity aggregated over a period of time -[**getEmailEventReport**](SMTPApi.md#getEmailEventReport) | **GET** /smtp/statistics/events | Get all your SMTP activity (unaggregated events) -[**getSmtpReport**](SMTPApi.md#getSmtpReport) | **GET** /smtp/statistics/reports | Get your SMTP activity aggregated per day +[**deleteSmtpTemplate**](SMTPApi.md#deleteSmtpTemplate) | **DELETE** /smtp/templates/{templateId} | Delete an inactive transactional email template +[**getAggregatedSmtpReport**](SMTPApi.md#getAggregatedSmtpReport) | **GET** /smtp/statistics/aggregatedReport | Get your transactional email activity aggregated over a period of time +[**getEmailEventReport**](SMTPApi.md#getEmailEventReport) | **GET** /smtp/statistics/events | Get all your transactional email activity (unaggregated events) +[**getSmtpReport**](SMTPApi.md#getSmtpReport) | **GET** /smtp/statistics/reports | Get your transactional email activity aggregated per day [**getSmtpTemplate**](SMTPApi.md#getSmtpTemplate) | **GET** /smtp/templates/{templateId} | Returns the template informations -[**getSmtpTemplates**](SMTPApi.md#getSmtpTemplates) | **GET** /smtp/templates | Get the list of SMTP templates +[**getSmtpTemplates**](SMTPApi.md#getSmtpTemplates) | **GET** /smtp/templates | Get the list of transactional email templates +[**getTransacBlockedContacts**](SMTPApi.md#getTransacBlockedContacts) | **GET** /smtp/blockedContacts | Get the list of blocked or unsubscribed transactional contacts +[**getTransacEmailContent**](SMTPApi.md#getTransacEmailContent) | **GET** /smtp/emails/{uuid} | Get the personalized content of a sent transactional email +[**getTransacEmailsList**](SMTPApi.md#getTransacEmailsList) | **GET** /smtp/emails | Get the list of transactional emails on the basis of allowed filters [**sendTemplate**](SMTPApi.md#sendTemplate) | **POST** /smtp/templates/{templateId}/send | Send a template [**sendTestTemplate**](SMTPApi.md#sendTestTemplate) | **POST** /smtp/templates/{templateId}/sendTest | Send a template to your test list [**sendTransacEmail**](SMTPApi.md#sendTransacEmail) | **POST** /smtp/email | Send a transactional email -[**updateSmtpTemplate**](SMTPApi.md#updateSmtpTemplate) | **PUT** /smtp/templates/{templateId} | Updates an smtp templates +[**smtpBlockedContactsEmailDelete**](SMTPApi.md#smtpBlockedContactsEmailDelete) | **DELETE** /smtp/blockedContacts/{email} | Unblock or resubscribe a transactional contact +[**smtpLogMessageIdDelete**](SMTPApi.md#smtpLogMessageIdDelete) | **DELETE** /smtp/log/{messageId} | Delete an SMTP transactional log +[**updateSmtpTemplate**](SMTPApi.md#updateSmtpTemplate) | **PUT** /smtp/templates/{templateId} | Updates a transactional email templates # **createSmtpTemplate** > \SendinBlue\Client\Model\CreateModel createSmtpTemplate($smtpTemplate) -Create an smtp template +Create a transactional email template ### Example ```php @@ -43,7 +48,7 @@ $apiInstance = new SendinBlue\Client\Api\SMTPApi( new GuzzleHttp\Client(), $config ); -$smtpTemplate = new \SendinBlue\Client\Model\CreateSmtpTemplate(); // \SendinBlue\Client\Model\CreateSmtpTemplate | values to update in smtp template +$smtpTemplate = new \SendinBlue\Client\Model\CreateSmtpTemplate(); // \SendinBlue\Client\Model\CreateSmtpTemplate | values to update in transactional email template try { $result = $apiInstance->createSmtpTemplate($smtpTemplate); @@ -58,7 +63,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **smtpTemplate** | [**\SendinBlue\Client\Model\CreateSmtpTemplate**](../Model/CreateSmtpTemplate.md)| values to update in smtp template | + **smtpTemplate** | [**\SendinBlue\Client\Model\CreateSmtpTemplate**](../Model/CreateSmtpTemplate.md)| values to update in transactional email template | ### Return type @@ -136,7 +141,7 @@ void (empty response body) # **deleteSmtpTemplate** > deleteSmtpTemplate($templateId) -Delete an inactive smtp template +Delete an inactive transactional email template ### Example ```php @@ -192,7 +197,7 @@ void (empty response body) # **getAggregatedSmtpReport** > \SendinBlue\Client\Model\GetAggregatedReport getAggregatedSmtpReport($startDate, $endDate, $days, $tag) -Get your SMTP activity aggregated over a period of time +Get your transactional email activity aggregated over a period of time ### Example ```php @@ -255,7 +260,7 @@ Name | Type | Description | Notes # **getEmailEventReport** > \SendinBlue\Client\Model\GetEmailEventReport getEmailEventReport($limit, $offset, $startDate, $endDate, $days, $email, $event, $tags, $messageId, $templateId) -Get all your SMTP activity (unaggregated events) +Get all your transactional email activity (unaggregated events) ### Example ```php @@ -330,7 +335,7 @@ Name | Type | Description | Notes # **getSmtpReport** > \SendinBlue\Client\Model\GetReports getSmtpReport($limit, $offset, $startDate, $endDate, $days, $tag) -Get your SMTP activity aggregated per day +Get your transactional email activity aggregated per day ### Example ```php @@ -352,7 +357,7 @@ $apiInstance = new SendinBlue\Client\Api\SMTPApi( new GuzzleHttp\Client(), $config ); -$limit = 50; // int | Number of documents returned per page +$limit = 10; // int | Number of documents returned per page $offset = 0; // int | Index of the first document on the page $startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) $endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) @@ -372,7 +377,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **limit** | **int**| Number of documents returned per page | [optional] [default to 50] + **limit** | **int**| Number of documents returned per page | [optional] [default to 10] **offset** | **int**| Index of the first document on the page | [optional] [default to 0] **startDate** | **string**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) | [optional] **endDate** | **string**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) | [optional] @@ -454,7 +459,7 @@ Name | Type | Description | Notes # **getSmtpTemplates** > \SendinBlue\Client\Model\GetSmtpTemplates getSmtpTemplates($templateStatus, $limit, $offset) -Get the list of SMTP templates +Get the list of transactional email templates ### Example ```php @@ -512,6 +517,195 @@ 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) +# **getTransacBlockedContacts** +> \SendinBlue\Client\Model\GetTransacBlockedContacts getTransacBlockedContacts($startDate, $endDate, $limit, $offset, $senders) + +Get the list of blocked or unsubscribed transactional contacts + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// Configure API key authorization: partner-key +$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer'); + +$apiInstance = new SendinBlue\Client\Api\SMTPApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts +$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts +$limit = 50; // int | Number of documents returned per page +$offset = 0; // int | Index of the first document on the page +$senders = array("senders_example"); // string[] | Comma separated list of emails of the senders from which contacts are blocked or unsubscribed + +try { + $result = $apiInstance->getTransacBlockedContacts($startDate, $endDate, $limit, $offset, $senders); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SMTPApi->getTransacBlockedContacts: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts | [optional] + **endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts | [optional] + **limit** | **int**| Number of documents returned per page | [optional] [default to 50] + **offset** | **int**| Index of the first document on the page | [optional] [default to 0] + **senders** | [**string[]**](../Model/string.md)| Comma separated list of emails of the senders from which contacts are blocked or unsubscribed | [optional] + +### Return type + +[**\SendinBlue\Client\Model\GetTransacBlockedContacts**](../Model/GetTransacBlockedContacts.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) + +# **getTransacEmailContent** +> \SendinBlue\Client\Model\GetTransacEmailContent getTransacEmailContent($uuid) + +Get the personalized content of a sent transactional email + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// Configure API key authorization: partner-key +$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer'); + +$apiInstance = new SendinBlue\Client\Api\SMTPApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$uuid = "uuid_example"; // string | Unique id of the transactional email that has been sent to a particular contact + +try { + $result = $apiInstance->getTransacEmailContent($uuid); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SMTPApi->getTransacEmailContent: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **uuid** | **string**| Unique id of the transactional email that has been sent to a particular contact | + +### Return type + +[**\SendinBlue\Client\Model\GetTransacEmailContent**](../Model/GetTransacEmailContent.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) + +# **getTransacEmailsList** +> \SendinBlue\Client\Model\GetTransacEmailsList getTransacEmailsList($email, $templateId, $messageId, $startDate, $endDate) + +Get the list of transactional emails on the basis of allowed filters + +This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// Configure API key authorization: partner-key +$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer'); + +$apiInstance = new SendinBlue\Client\Api\SMTPApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$email = "email_example"; // string | Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. +$templateId = 789; // int | Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. +$messageId = "messageId_example"; // string | Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. +$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. +$endDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. + +try { + $result = $apiInstance->getTransacEmailsList($email, $templateId, $messageId, $startDate, $endDate); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SMTPApi->getTransacEmailsList: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **email** | **string**| Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. | [optional] + **templateId** | **int**| Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. | [optional] + **messageId** | **string**| Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. | [optional] + **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. | [optional] + **endDate** | **\DateTime**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. | [optional] + +### Return type + +[**\SendinBlue\Client\Model\GetTransacEmailsList**](../Model/GetTransacEmailsList.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) + # **sendTemplate** > \SendinBlue\Client\Model\SendTemplateEmail sendTemplate($templateId, $sendEmail) @@ -688,10 +882,122 @@ 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) +# **smtpBlockedContactsEmailDelete** +> smtpBlockedContactsEmailDelete($email) + +Unblock or resubscribe a transactional contact + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// Configure API key authorization: partner-key +$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer'); + +$apiInstance = new SendinBlue\Client\Api\SMTPApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$email = "email_example"; // string | contact email (urlencoded) to unblock. + +try { + $apiInstance->smtpBlockedContactsEmailDelete($email); +} catch (Exception $e) { + echo 'Exception when calling SMTPApi->smtpBlockedContactsEmailDelete: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **email** | **string**| contact email (urlencoded) to unblock. | + +### 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) + +# **smtpLogMessageIdDelete** +> smtpLogMessageIdDelete($messageId) + +Delete an SMTP transactional log + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// Configure API key authorization: partner-key +$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer'); + +$apiInstance = new SendinBlue\Client\Api\SMTPApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$messageId = "messageId_example"; // string | MessageId of the transactional log to delete + +try { + $apiInstance->smtpLogMessageIdDelete($messageId); +} catch (Exception $e) { + echo 'Exception when calling SMTPApi->smtpLogMessageIdDelete: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **messageId** | **string**| MessageId of the transactional log to delete | + +### Return type + +void (empty response body) + +### Authorization + +[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **updateSmtpTemplate** > updateSmtpTemplate($templateId, $smtpTemplate) -Updates an smtp templates +Updates a transactional email templates ### Example ```php @@ -714,7 +1020,7 @@ $apiInstance = new SendinBlue\Client\Api\SMTPApi( $config ); $templateId = 789; // int | id of the template -$smtpTemplate = new \SendinBlue\Client\Model\UpdateSmtpTemplate(); // \SendinBlue\Client\Model\UpdateSmtpTemplate | values to update in smtp template +$smtpTemplate = new \SendinBlue\Client\Model\UpdateSmtpTemplate(); // \SendinBlue\Client\Model\UpdateSmtpTemplate | values to update in transactional email template try { $apiInstance->updateSmtpTemplate($templateId, $smtpTemplate); @@ -729,7 +1035,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **templateId** | **int**| id of the template | - **smtpTemplate** | [**\SendinBlue\Client\Model\UpdateSmtpTemplate**](../Model/UpdateSmtpTemplate.md)| values to update in smtp template | + **smtpTemplate** | [**\SendinBlue\Client\Model\UpdateSmtpTemplate**](../Model/UpdateSmtpTemplate.md)| values to update in transactional email template | ### Return type diff --git a/docs/Model/AbTestCampaignResult.md b/docs/Model/AbTestCampaignResult.md new file mode 100644 index 00000000..3df1a969 --- /dev/null +++ b/docs/Model/AbTestCampaignResult.md @@ -0,0 +1,14 @@ +# AbTestCampaignResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**winningVersion** | **string** | Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. | [optional] +**winningCriteria** | **string** | Criteria choosen for winning version (Open/Click) | [optional] +**winningSubjectLine** | **string** | Subject Line of current winning version | [optional] +**openRate** | **string** | Open rate for current winning version | [optional] +**clickRate** | **string** | Click rate for current winning version | [optional] +**winningVersionRate** | **string** | Open/Click rate for the winner version | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/CreateContact.md b/docs/Model/CreateContact.md index 511f778e..5c158785 100644 --- a/docs/Model/CreateContact.md +++ b/docs/Model/CreateContact.md @@ -3,13 +3,13 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email** | **string** | Email address of the user. Mandatory if \"sms\" field is not passed in \"attributes\" parameter' | [optional] -**attributes** | **object** | Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For example, `{\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"}` | [optional] +**email** | **string** | Email address of the user. Mandatory if \"SMS\" field is not passed in \"attributes\" parameter. Mobile Number in \"SMS\" field should be passed with proper country code. For example {'SMS':'+91xxxxxxxxxx'} or {'SMS':'0091xxxxxxxxxx'} | [optional] +**attributes** | **object** | Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. `{\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"}` | [optional] **emailBlacklisted** | **bool** | Set this field to blacklist the contact for emails (emailBlacklisted = true) | [optional] **smsBlacklisted** | **bool** | Set this field to blacklist the contact for SMS (smsBlacklisted = true) | [optional] **listIds** | **int[]** | Ids of the lists to add the contact to | [optional] **updateEnabled** | **bool** | Facilitate to update the existing contact in the same request (updateEnabled = true) | [optional] [default to false] -**smtpBlacklistSender** | **string[]** | SMTP forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) | [optional] +**smtpBlacklistSender** | **string[]** | transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateEmailCampaign.md b/docs/Model/CreateEmailCampaign.md index cbd7f280..9feec76e 100644 --- a/docs/Model/CreateEmailCampaign.md +++ b/docs/Model/CreateEmailCampaign.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **name** | **string** | Name of the campaign | **htmlContent** | **string** | Mandatory if htmlUrl and templateId are empty. Body of the message (HTML) | [optional] **htmlUrl** | **string** | Mandatory if htmlContent and templateId are empty. Url to the message (HTML) | [optional] -**templateId** | **int** | Mandatory if htmlContent and htmlUrl are empty. Id of the SMTP template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. | [optional] +**templateId** | **int** | Mandatory if htmlContent and htmlUrl are empty. Id of the transactional email template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. | [optional] **scheduledAt** | [**\DateTime**] | 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] **replyTo** | **string** | Email on which the campaign recipients will be able to reply to | [optional] @@ -28,6 +28,9 @@ Name | Type | Description | Notes **splitRule** | **int** | Add the size of your test groups. Mandatory if abTesting = true & 'recipients' is passed. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else | [optional] **winnerCriteria** | **string** | Choose the metrics that will determinate the winning version. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed | [optional] **winnerDelay** | **int** | Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed | [optional] +**ipWarmupEnable** | **bool** | Available for dedicated ip clients. Set this to true if you wish to warm up your ip. | [optional] [default to false] +**initialQuota** | **int** | Mandatory if ipWarmupEnable is set to true. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. | [optional] +**increaseRate** | **int** | Mandatory if ipWarmupEnable is set to true. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. | [optional] [[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/CreateEmailCampaignSender.md b/docs/Model/CreateEmailCampaignSender.md index 11399025..2892c2ec 100644 --- a/docs/Model/CreateEmailCampaignSender.md +++ b/docs/Model/CreateEmailCampaignSender.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Sender Name | [optional] **email** | **string** | Sender email | +**id** | **int** | Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateSmtpEmail.md b/docs/Model/CreateSmtpEmail.md index 0d459bd1..7b106bb4 100644 --- a/docs/Model/CreateSmtpEmail.md +++ b/docs/Model/CreateSmtpEmail.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**messageId** | **string** | Message ID of the SMTP Email sent | +**messageId** | **string** | Message ID of the transactional email sent | [[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/CreateSmtpTemplateSender.md b/docs/Model/CreateSmtpTemplateSender.md index 886a8aec..b308c0b9 100644 --- a/docs/Model/CreateSmtpTemplateSender.md +++ b/docs/Model/CreateSmtpTemplateSender.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Name of the sender. If not passed, will be set to default | [optional] **email** | **string** | Email of the sender | +**id** | **int** | Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetAccountRelay.md b/docs/Model/GetAccountRelay.md index 570d10a3..c869cd2a 100644 --- a/docs/Model/GetAccountRelay.md +++ b/docs/Model/GetAccountRelay.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**enabled** | **bool** | Status of your SMTP Account (true=Enabled, false=Disabled) | +**enabled** | **bool** | Status of your transactional email Account (true=Enabled, false=Disabled) | **data** | [**\SendinBlue\Client\Model\GetAccountRelayData**](GetAccountRelayData.md) | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetAccountRelayData.md b/docs/Model/GetAccountRelayData.md index 7c7c7770..ff92c004 100644 --- a/docs/Model/GetAccountRelayData.md +++ b/docs/Model/GetAccountRelayData.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**userName** | **string** | Email to use as login on SMTP | +**userName** | **string** | Email to use as login on transactional platform | **relay** | **string** | URL of the SMTP Relay | **port** | **int** | Port used for SMTP Relay | diff --git a/docs/Model/GetChildAccountCreationStatus.md b/docs/Model/GetChildAccountCreationStatus.md new file mode 100644 index 00000000..1d572573 --- /dev/null +++ b/docs/Model/GetChildAccountCreationStatus.md @@ -0,0 +1,9 @@ +# GetChildAccountCreationStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**childAccountCreated** | **bool** | Status of child account creation whether it is successfully created (exists) or not. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/GetChildrenList.md b/docs/Model/GetChildrenList.md index d950876a..7fe64f73 100644 --- a/docs/Model/GetChildrenList.md +++ b/docs/Model/GetChildrenList.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **children** | **object[]** | Your children's account information | [optional] +**count** | **int** | Number of child accounts | [[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/GetDeviceBrowserStats.md b/docs/Model/GetDeviceBrowserStats.md new file mode 100644 index 00000000..0c169482 --- /dev/null +++ b/docs/Model/GetDeviceBrowserStats.md @@ -0,0 +1,12 @@ +# GetDeviceBrowserStats + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**clickers** | **int** | Number of total clicks for the campaign using the particular browser | +**uniqueClicks** | **int** | Number of unique clicks for the campaign using the particular browser | +**viewed** | **int** | Number of openings for the campaign using the particular browser | +**uniqueViews** | **int** | Number of unique openings for the campaign using the particular browser | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/GetExtendedCampaignOverviewSender.md b/docs/Model/GetExtendedCampaignOverviewSender.md index 943e7e6e..047508a5 100644 --- a/docs/Model/GetExtendedCampaignOverviewSender.md +++ b/docs/Model/GetExtendedCampaignOverviewSender.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Sender name of the campaign | [optional] **email** | **string** | Sender email of the campaign | [optional] +**id** | **string** | Sender id of the campaign | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetExtendedCampaignStats.md b/docs/Model/GetExtendedCampaignStats.md index ad600158..edd35886 100644 --- a/docs/Model/GetExtendedCampaignStats.md +++ b/docs/Model/GetExtendedCampaignStats.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **remaining** | **int** | Number of remaning emails to send | **linksStats** | **object** | Statistics about the number of clicks for the links | **statsByDomain** | [**\SendinBlue\Client\Model\GetStatsByDomain**](GetStatsByDomain.md) | | +**statsByDevice** | [**\SendinBlue\Client\Model\GetStatsByDevice**](GetStatsByDevice.md) | Statistics about the campaign on the basis of various devices | +**statsByBrowser** | [**\SendinBlue\Client\Model\GetStatsByBrowser**](GetStatsByBrowser.md) | Statistics about the campaign on the basis of various browsers | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetSharedTemplateUrl.md b/docs/Model/GetSharedTemplateUrl.md new file mode 100644 index 00000000..432a898c --- /dev/null +++ b/docs/Model/GetSharedTemplateUrl.md @@ -0,0 +1,9 @@ +# GetSharedTemplateUrl + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sharedUrl** | **string** | A unique URL for the email campaign or transactional template. This URL can be shared with other Sendinblue users. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/GetSmtpTemplateOverviewSender.md b/docs/Model/GetSmtpTemplateOverviewSender.md index ab0e8659..0697d2d3 100644 --- a/docs/Model/GetSmtpTemplateOverviewSender.md +++ b/docs/Model/GetSmtpTemplateOverviewSender.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | From email for the template | [optional] **email** | **string** | From email for the template | [optional] +**id** | **string** | Sender id of the template | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetSmtpTemplates.md b/docs/Model/GetSmtpTemplates.md index 4f0c2dd5..51ecd1ad 100644 --- a/docs/Model/GetSmtpTemplates.md +++ b/docs/Model/GetSmtpTemplates.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**count** | **int** | Count of smtp templates | [optional] +**count** | **int** | Count of transactional email templates | [optional] **templates** | [**\SendinBlue\Client\Model\GetSmtpTemplateOverview[]**](GetSmtpTemplateOverview.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetStatsByBrowser.md b/docs/Model/GetStatsByBrowser.md new file mode 100644 index 00000000..79703bd0 --- /dev/null +++ b/docs/Model/GetStatsByBrowser.md @@ -0,0 +1,8 @@ +# GetStatsByBrowser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/GetStatsByDevice.md b/docs/Model/GetStatsByDevice.md new file mode 100644 index 00000000..8c61ebf6 --- /dev/null +++ b/docs/Model/GetStatsByDevice.md @@ -0,0 +1,12 @@ +# GetStatsByDevice + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**desktop** | [**map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats]**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of desktop devices | [optional] +**mobile** | [**map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats]**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of mobile devices | [optional] +**tablet** | [**map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats]**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of tablet devices | [optional] +**unknown** | [**map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats]**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of unknown devices | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/GetTransacBlockedContacts.md b/docs/Model/GetTransacBlockedContacts.md new file mode 100644 index 00000000..e314832f --- /dev/null +++ b/docs/Model/GetTransacBlockedContacts.md @@ -0,0 +1,10 @@ +# GetTransacBlockedContacts + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | Count of blocked or unsubscribed contact | [optional] +**contacts** | [**\SendinBlue\Client\Model\GetTransacBlockedContactsContacts[]**](GetTransacBlockedContactsContacts.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/GetTransacBlockedContactsContacts.md b/docs/Model/GetTransacBlockedContactsContacts.md new file mode 100644 index 00000000..b0f7b75c --- /dev/null +++ b/docs/Model/GetTransacBlockedContactsContacts.md @@ -0,0 +1,13 @@ +# GetTransacBlockedContactsContacts + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **string** | Email address of the blocked or unsubscribed contact | +**senderEmail** | **string** | Sender email address of the blocked or unsubscribed contact | +**reason** | [**\SendinBlue\Client\Model\GetTransacBlockedContactsReason**](GetTransacBlockedContactsReason.md) | | +**blockedAt** | [**\DateTime**](\DateTime.md) | Date when the contact was blocked or unsubscribed on | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/GetTransacBlockedContactsReason.md b/docs/Model/GetTransacBlockedContactsReason.md new file mode 100644 index 00000000..fcb8fb2b --- /dev/null +++ b/docs/Model/GetTransacBlockedContactsReason.md @@ -0,0 +1,11 @@ +# GetTransacBlockedContactsReason + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | Reason code for blocking / unsubscribing (This code is safe for comparison) | [optional] +**message** | **string** | Reason for blocking / unsubscribing (This string is not safe for comparison) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/GetTransacEmailContent.md b/docs/Model/GetTransacEmailContent.md new file mode 100644 index 00000000..8d492629 --- /dev/null +++ b/docs/Model/GetTransacEmailContent.md @@ -0,0 +1,15 @@ +# GetTransacEmailContent + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **string** | Email address to which transactional email has been sent | +**subject** | **string** | Subject of the sent email | +**templateId** | **int** | Id of the template | [optional] +**date** | [**\DateTime**] | Date on which transactional email was sent | +**events** | [**\SendinBlue\Client\Model\GetTransacEmailContentEvents[]**](GetTransacEmailContentEvents.md) | Series of events which occurred on the transactional email | +**body** | **string** | Actual content of the transactional email that has been sent | +**attachmentCount** | **int** | Count of the attachments that were sent in the email | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/GetTransacEmailContentEvents.md b/docs/Model/GetTransacEmailContentEvents.md new file mode 100644 index 00000000..ff5bc98b --- /dev/null +++ b/docs/Model/GetTransacEmailContentEvents.md @@ -0,0 +1,11 @@ +# GetTransacEmailContentEvents + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Name of the event that occurred on the sent email | +**time** | [**\DateTime**](\DateTime.md) | Time at which the event occurred | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/GetTransacEmailsList.md b/docs/Model/GetTransacEmailsList.md new file mode 100644 index 00000000..cb4ab50d --- /dev/null +++ b/docs/Model/GetTransacEmailsList.md @@ -0,0 +1,9 @@ +# GetTransacEmailsList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transactionalEmails** | [**\SendinBlue\Client\Model\GetTransacEmailsListTransactionalEmails[]**](GetTransacEmailsListTransactionalEmails.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/GetTransacEmailsListTransactionalEmails.md b/docs/Model/GetTransacEmailsListTransactionalEmails.md new file mode 100644 index 00000000..d32d8d62 --- /dev/null +++ b/docs/Model/GetTransacEmailsListTransactionalEmails.md @@ -0,0 +1,15 @@ +# GetTransacEmailsListTransactionalEmails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **string** | Email address to which transactional email has been sent | +**subject** | **string** | Subject of the sent email | +**templateId** | **int** | Id of the template | [optional] +**messageId** | **string** | Message Id of the sent email | +**uuid** | **string** | Unique id of the email sent to a particular contact | +**date** | [**\DateTime**](\DateTime.md) | Date on which transactional email was sent | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/RequestContactExport.md b/docs/Model/RequestContactExport.md index be193dbc..21cba2c0 100644 --- a/docs/Model/RequestContactExport.md +++ b/docs/Model/RequestContactExport.md @@ -4,7 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **exportAttributes** | **string[]** | List of all the attributes that you want to export. These attributes must be present in your contact database. For example, ['fname', 'lname', 'email']. | [optional] -**contactFilter** | **object** | Set the filter for the contacts to be exported. For example, `{\"blacklisted\":true}` will export all the blacklisted contacts. | +**contactFilter** | **object** | This attribute has been deprecated and will be removed by January 1st, 2021. Only one of the two filter options (contactFilter or customContactFilter) can be passed in the request. Set the filter for the contacts to be exported. For example, `{\"blacklisted\":true}` will export all the blacklisted contacts. | [optional] +**customContactFilter** | [**\SendinBlue\Client\Model\RequestContactExportCustomContactFilter**](RequestContactExportCustomContactFilter.md) | | [optional] **notifyUrl** | **string** | Webhook that will be called once the export process is finished | [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/RequestContactExportCustomContactFilter.md b/docs/Model/RequestContactExportCustomContactFilter.md new file mode 100644 index 00000000..0195a685 --- /dev/null +++ b/docs/Model/RequestContactExportCustomContactFilter.md @@ -0,0 +1,15 @@ +# RequestContactExportCustomContactFilter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**actionForContacts** | **string** | Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on contacts as per the list id. * allContacts - Fetch the list of all contacts for a particular list. * subscribed & unsubscribed - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * unsubscribedPerList - Fetch the list of contacts that are unsubscribed from a particular list only. | [optional] +**actionForEmailCampaigns** | **string** | Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on email campaigns. * openers & nonOpeners - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * clickers & nonClickers - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * unsubscribed - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * hardBounces & softBounces - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). | [optional] +**actionForSmsCampaigns** | **string** | Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed. This will export the contacts on the basis of provided action applied on sms campaigns. * unsubscribed - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * hardBounces & softBounces - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. | [optional] +**listId** | **int** | Mandatory if actionForContacts is passed, ignored otherwise. Id of the list for which the corresponding action shall be applied in the filter. | [optional] +**emailCampaignId** | **int** | Considered only if actionForEmailCampaigns is passed, ignored otherwise. Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed. The id of the email campaign for which the corresponding action shall be applied in the filter. | [optional] +**smsCampaignId** | **int** | Considered only if actionForSmsCampaigns is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Model/SendSmtpEmail.md b/docs/Model/SendSmtpEmail.md index 4c9639e4..1e74b14b 100644 --- a/docs/Model/SendSmtpEmail.md +++ b/docs/Model/SendSmtpEmail.md @@ -11,10 +11,10 @@ Name | Type | Description | Notes **textContent** | **string** | Plain Text body of the message ( Ignored if 'templateId' is passed ) | [optional] **subject** | **string** | Subject of the message. Mandatory if 'templateId' is not passed | [optional] **replyTo** | [**\SendinBlue\Client\Model\SendSmtpEmailReplyTo**](SendSmtpEmailReplyTo.md) | | [optional] -**attachment** | [**\SendinBlue\Client\Model\SendSmtpEmailAttachment[]**](SendSmtpEmailAttachment.md) | Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"My attachment 1\"}, {\"content\":\"base64 exmaple content\", \"name\":\"My attachment 2\"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps and odt ( If 'templateId' is passed and is in New Template Language format then only attachment url is accepted. If template is in Old template Language format, then 'attachment' is ignored ) | [optional] -**headers** | **object** | Pass the set of headers that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, `{\"Content-Type\":\"text/html\", \"charset\":\"iso-8859-1\", \"sender.ip\":\"1.2.3.4\"}` | [optional] +**attachment** | [**\SendinBlue\Client\Model\SendSmtpEmailAttachment[]**](SendSmtpEmailAttachment.md) | Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"My attachment 1\"}, {\"content\":\"base64 exmaple content\", \"name\":\"My attachment 2\"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg and wmv ( If 'templateId' is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then 'attachment' is ignored ) | [optional] +**headers** | **object** | Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, `{\"sender.ip\":\"1.2.3.4\", \"X-Mailin-custom\":\"some_custom_header\"}`. | [optional] **templateId** | **int** | Id of the template | [optional] -**params** | **object** | Pass the set of attributes to customize the template. For example, `{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}`. It's considered only if template is in New Template Language format. | [optional] +**params** | **object** | Pass the set of attributes to customize the template. For example, `{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}`. It's considered only if template is in New Template Language format. Alternatively, you can pass the set of attributes to customize the template for each recipient. For this the email will be the key and its value will be a JSON containing attributes specific to each recipient. For example, `{\"abc@example.com\":{\"name\":\"ABC\", \"age\":21}, \"xyz@example.com\":{\"name\":\"XYZ\", \"age\":25}}` | [optional] **tags** | **string[]** | Tag your emails to find them more easily | [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/SendSmtpEmailBcc.md b/docs/Model/SendSmtpEmailBcc.md index aa9d574a..38046449 100644 --- a/docs/Model/SendSmtpEmailBcc.md +++ b/docs/Model/SendSmtpEmailBcc.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **string** | Email address of the recipient in bcc | -**name** | **string** | Name of the recipient in bcc | [optional] +**name** | **string** | Name of the recipient in bcc. Maximum allowed characters are 70. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SendSmtpEmailCc.md b/docs/Model/SendSmtpEmailCc.md index 6787358d..a36ff0d9 100644 --- a/docs/Model/SendSmtpEmailCc.md +++ b/docs/Model/SendSmtpEmailCc.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **string** | Email address of the recipient in cc | -**name** | **string** | Name of the recipient in cc | [optional] +**name** | **string** | Name of the recipient in cc. Maximum allowed characters are 70. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SendSmtpEmailReplyTo.md b/docs/Model/SendSmtpEmailReplyTo.md index fa49b7ca..1dc896b2 100644 --- a/docs/Model/SendSmtpEmailReplyTo.md +++ b/docs/Model/SendSmtpEmailReplyTo.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **string** | Email address in reply to | -**name** | **string** | Name in reply to | [optional] +**name** | **string** | Name in reply to. Maximum allowed characters are 70. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SendSmtpEmailSender.md b/docs/Model/SendSmtpEmailSender.md index ab8a02e7..58112567 100644 --- a/docs/Model/SendSmtpEmailSender.md +++ b/docs/Model/SendSmtpEmailSender.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **string** | Name of the sender from which the emails will be sent | [optional] +**name** | **string** | Name of the sender from which the emails will be sent. Maximum allowed characters are 70. | [optional] **email** | **string** | Email of the sender from which the emails will be sent | [[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/SendSmtpEmailTo.md b/docs/Model/SendSmtpEmailTo.md index 78546de7..bbba303b 100644 --- a/docs/Model/SendSmtpEmailTo.md +++ b/docs/Model/SendSmtpEmailTo.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **string** | Email address of the recipient | -**name** | **string** | Name of the recipient | [optional] +**name** | **string** | Name of the recipient. Maximum allowed characters are 70. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateContact.md b/docs/Model/UpdateContact.md index aac79c87..8e0760df 100644 --- a/docs/Model/UpdateContact.md +++ b/docs/Model/UpdateContact.md @@ -3,12 +3,12 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**attributes** | **object** | Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, `{ 'EMAIL':'newemail@domain.com', 'FNAME':'Ellie', 'LNAME':'Roger'}` | [optional] +**attributes** | **object** | Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, `{ 'EMAIL':'newemail@domain.com', 'FNAME':'Ellie', 'LNAME':'Roger'}` `{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}`. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in \"SMS\" field should be passed with proper country code. For example `{'SMS':'+91xxxxxxxxxx'}` or `{'SMS':'0091xxxxxxxxxx'}` | [optional] **emailBlacklisted** | **bool** | Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) | [optional] **smsBlacklisted** | **bool** | Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) | [optional] **listIds** | **int[]** | Ids of the lists to add the contact to | [optional] **unlinkListIds** | **int[]** | Ids of the lists to remove the contact from | [optional] -**smtpBlacklistSender** | **string[]** | SMTP forbidden sender for contact. Use only for email Contact | [optional] +**smtpBlacklistSender** | **string[]** | transactional email forbidden sender for contact. Use only for email Contact | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateEmailCampaign.md b/docs/Model/UpdateEmailCampaign.md index cbc5aa35..0cdfeb47 100644 --- a/docs/Model/UpdateEmailCampaign.md +++ b/docs/Model/UpdateEmailCampaign.md @@ -28,6 +28,9 @@ Name | Type | Description | Notes **splitRule** | **int** | Add the size of your test groups. Considered if abTesting = true. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else | [optional] **winnerCriteria** | **string** | Choose the metrics that will determinate the winning version. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed or alreday exist in record | [optional] **winnerDelay** | **int** | Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed or alreday exist in record | [optional] +**ipWarmupEnable** | **bool** | Available for dedicated ip clients. Set this to true if you wish to warm up your ip. | [optional] [default to false] +**initialQuota** | **int** | Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. | [optional] +**increaseRate** | **int** | Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. | [optional] [[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/UpdateEmailCampaignSender.md b/docs/Model/UpdateEmailCampaignSender.md index a04658aa..4ebcd4ed 100644 --- a/docs/Model/UpdateEmailCampaignSender.md +++ b/docs/Model/UpdateEmailCampaignSender.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Sender Name from which the campaign emails are sent | [optional] **email** | **string** | Sender email from which the campaign emails are sent | [optional] +**id** | **int** | Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateSmtpTemplateSender.md b/docs/Model/UpdateSmtpTemplateSender.md index 431a5f8c..267f6f7a 100644 --- a/docs/Model/UpdateSmtpTemplateSender.md +++ b/docs/Model/UpdateSmtpTemplateSender.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | Name of the sender | [optional] **email** | **string** | Email of the sender | [optional] +**id** | **int** | Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/AccountApi.php b/lib/Api/AccountApi.php index 18cc8ed0..cce00029 100644 --- a/lib/Api/AccountApi.php +++ b/lib/Api/AccountApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ class AccountApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -279,9 +284,16 @@ protected function getAccountRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/Api/AttributesApi.php b/lib/Api/AttributesApi.php index a0b5df36..fc332c6d 100644 --- a/lib/Api/AttributesApi.php +++ b/lib/Api/AttributesApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -238,19 +238,19 @@ function ($exception) { protected function createAttributeRequest($attributeCategory, $attributeName, $createAttribute) { // verify the required parameter 'attributeCategory' is set - if ($attributeCategory === null) { + if ($attributeCategory === null || (is_array($attributeCategory) && count($attributeCategory) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $attributeCategory when calling createAttribute' ); } // verify the required parameter 'attributeName' is set - if ($attributeName === null) { + if ($attributeName === null || (is_array($attributeName) && count($attributeName) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $attributeName when calling createAttribute' ); } // verify the required parameter 'createAttribute' is set - if ($createAttribute === null) { + if ($createAttribute === null || (is_array($createAttribute) && count($createAttribute) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $createAttribute when calling createAttribute' ); @@ -302,9 +302,16 @@ protected function createAttributeRequest($attributeCategory, $attributeName, $c if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -517,13 +524,13 @@ function ($exception) { protected function deleteAttributeRequest($attributeCategory, $attributeName) { // verify the required parameter 'attributeCategory' is set - if ($attributeCategory === null) { + if ($attributeCategory === null || (is_array($attributeCategory) && count($attributeCategory) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $attributeCategory when calling deleteAttribute' ); } // verify the required parameter 'attributeName' is set - if ($attributeName === null) { + if ($attributeName === null || (is_array($attributeName) && count($attributeName) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $attributeName when calling deleteAttribute' ); @@ -572,9 +579,16 @@ protected function deleteAttributeRequest($attributeCategory, $attributeName) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -825,9 +839,16 @@ protected function getAttributesRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1045,19 +1066,19 @@ function ($exception) { protected function updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute) { // verify the required parameter 'attributeCategory' is set - if ($attributeCategory === null) { + if ($attributeCategory === null || (is_array($attributeCategory) && count($attributeCategory) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $attributeCategory when calling updateAttribute' ); } // verify the required parameter 'attributeName' is set - if ($attributeName === null) { + if ($attributeName === null || (is_array($attributeName) && count($attributeName) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $attributeName when calling updateAttribute' ); } // verify the required parameter 'updateAttribute' is set - if ($updateAttribute === null) { + if ($updateAttribute === null || (is_array($updateAttribute) && count($updateAttribute) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $updateAttribute when calling updateAttribute' ); @@ -1109,9 +1130,16 @@ protected function updateAttributeRequest($attributeCategory, $attributeName, $u if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/Api/ContactsApi.php b/lib/Api/ContactsApi.php index f8cadee3..37d589c3 100644 --- a/lib/Api/ContactsApi.php +++ b/lib/Api/ContactsApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ class ContactsApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -278,13 +283,13 @@ function ($exception) { protected function addContactToListRequest($listId, $contactEmails) { // verify the required parameter 'listId' is set - if ($listId === null) { + if ($listId === null || (is_array($listId) && count($listId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $listId when calling addContactToList' ); } // verify the required parameter 'contactEmails' is set - if ($contactEmails === null) { + if ($contactEmails === null || (is_array($contactEmails) && count($contactEmails) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $contactEmails when calling addContactToList' ); @@ -328,9 +333,16 @@ protected function addContactToListRequest($listId, $contactEmails) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -540,19 +552,19 @@ function ($exception) { protected function createAttributeRequest($attributeCategory, $attributeName, $createAttribute) { // verify the required parameter 'attributeCategory' is set - if ($attributeCategory === null) { + if ($attributeCategory === null || (is_array($attributeCategory) && count($attributeCategory) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $attributeCategory when calling createAttribute' ); } // verify the required parameter 'attributeName' is set - if ($attributeName === null) { + if ($attributeName === null || (is_array($attributeName) && count($attributeName) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $attributeName when calling createAttribute' ); } // verify the required parameter 'createAttribute' is set - if ($createAttribute === null) { + if ($createAttribute === null || (is_array($createAttribute) && count($createAttribute) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $createAttribute when calling createAttribute' ); @@ -604,9 +616,16 @@ protected function createAttributeRequest($attributeCategory, $attributeName, $c if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -851,7 +870,7 @@ function ($exception) { protected function createContactRequest($createContact) { // verify the required parameter 'createContact' is set - if ($createContact === null) { + if ($createContact === null || (is_array($createContact) && count($createContact) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $createContact when calling createContact' ); @@ -887,9 +906,16 @@ protected function createContactRequest($createContact) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1126,7 +1152,7 @@ function ($exception) { protected function createFolderRequest($createFolder) { // verify the required parameter 'createFolder' is set - if ($createFolder === null) { + if ($createFolder === null || (is_array($createFolder) && count($createFolder) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $createFolder when calling createFolder' ); @@ -1162,9 +1188,16 @@ protected function createFolderRequest($createFolder) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1401,7 +1434,7 @@ function ($exception) { protected function createListRequest($createList) { // verify the required parameter 'createList' is set - if ($createList === null) { + if ($createList === null || (is_array($createList) && count($createList) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $createList when calling createList' ); @@ -1437,9 +1470,16 @@ protected function createListRequest($createList) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1652,13 +1692,13 @@ function ($exception) { protected function deleteAttributeRequest($attributeCategory, $attributeName) { // verify the required parameter 'attributeCategory' is set - if ($attributeCategory === null) { + if ($attributeCategory === null || (is_array($attributeCategory) && count($attributeCategory) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $attributeCategory when calling deleteAttribute' ); } // verify the required parameter 'attributeName' is set - if ($attributeName === null) { + if ($attributeName === null || (is_array($attributeName) && count($attributeName) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $attributeName when calling deleteAttribute' ); @@ -1707,9 +1747,16 @@ protected function deleteAttributeRequest($attributeCategory, $attributeName) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1925,7 +1972,7 @@ function ($exception) { protected function deleteContactRequest($email) { // verify the required parameter 'email' is set - if ($email === null) { + if ($email === null || (is_array($email) && count($email) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $email when calling deleteContact' ); @@ -1966,9 +2013,16 @@ protected function deleteContactRequest($email) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2176,7 +2230,7 @@ function ($exception) { protected function deleteFolderRequest($folderId) { // verify the required parameter 'folderId' is set - if ($folderId === null) { + if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $folderId when calling deleteFolder' ); @@ -2217,9 +2271,16 @@ protected function deleteFolderRequest($folderId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2427,7 +2488,7 @@ function ($exception) { protected function deleteListRequest($listId) { // verify the required parameter 'listId' is set - if ($listId === null) { + if ($listId === null || (is_array($listId) && count($listId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $listId when calling deleteList' ); @@ -2468,9 +2529,16 @@ protected function deleteListRequest($listId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2721,9 +2789,16 @@ protected function getAttributesRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2968,7 +3043,7 @@ function ($exception) { protected function getContactInfoRequest($email) { // verify the required parameter 'email' is set - if ($email === null) { + if ($email === null || (is_array($email) && count($email) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $email when calling getContactInfo' ); @@ -3009,9 +3084,16 @@ protected function getContactInfoRequest($email) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -3256,7 +3338,7 @@ function ($exception) { protected function getContactStatsRequest($email) { // verify the required parameter 'email' is set - if ($email === null) { + if ($email === null || (is_array($email) && count($email) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $email when calling getContactStats' ); @@ -3297,9 +3379,16 @@ protected function getContactStatsRequest($email) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -3589,9 +3678,16 @@ protected function getContactsRequest($limit = '50', $offset = '0', $modifiedSin if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -3851,7 +3947,7 @@ function ($exception) { protected function getContactsFromListRequest($listId, $modifiedSince = null, $limit = '50', $offset = '0') { // verify the required parameter 'listId' is set - if ($listId === null) { + if ($listId === null || (is_array($listId) && count($listId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $listId when calling getContactsFromList' ); @@ -3908,9 +4004,16 @@ protected function getContactsFromListRequest($listId, $modifiedSince = null, $l if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -4155,7 +4258,7 @@ function ($exception) { protected function getFolderRequest($folderId) { // verify the required parameter 'folderId' is set - if ($folderId === null) { + if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $folderId when calling getFolder' ); @@ -4196,9 +4299,16 @@ protected function getFolderRequest($folderId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -4453,7 +4563,7 @@ function ($exception) { protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0') { // verify the required parameter 'folderId' is set - if ($folderId === null) { + if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $folderId when calling getFolderLists' ); @@ -4506,9 +4616,16 @@ protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0' if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -4750,7 +4867,7 @@ function ($exception) { protected function getFoldersRequest($limit, $offset) { // verify the required parameter 'limit' is set - if ($limit === null) { + if ($limit === null || (is_array($limit) && count($limit) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $limit when calling getFolders' ); @@ -4760,7 +4877,7 @@ protected function getFoldersRequest($limit, $offset) } // verify the required parameter 'offset' is set - if ($offset === null) { + if ($offset === null || (is_array($offset) && count($offset) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $offset when calling getFolders' ); @@ -4801,9 +4918,16 @@ protected function getFoldersRequest($limit, $offset) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -5048,7 +5172,7 @@ function ($exception) { protected function getListRequest($listId) { // verify the required parameter 'listId' is set - if ($listId === null) { + if ($listId === null || (is_array($listId) && count($listId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $listId when calling getList' ); @@ -5089,9 +5213,16 @@ protected function getListRequest($listId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -5372,9 +5503,16 @@ protected function getListsRequest($limit = '10', $offset = '0') if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -5611,7 +5749,7 @@ function ($exception) { protected function importContactsRequest($requestContactImport) { // verify the required parameter 'requestContactImport' is set - if ($requestContactImport === null) { + if ($requestContactImport === null || (is_array($requestContactImport) && count($requestContactImport) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $requestContactImport when calling importContacts' ); @@ -5647,9 +5785,16 @@ protected function importContactsRequest($requestContactImport) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -5899,13 +6044,13 @@ function ($exception) { protected function removeContactFromListRequest($listId, $contactEmails) { // verify the required parameter 'listId' is set - if ($listId === null) { + if ($listId === null || (is_array($listId) && count($listId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $listId when calling removeContactFromList' ); } // verify the required parameter 'contactEmails' is set - if ($contactEmails === null) { + if ($contactEmails === null || (is_array($contactEmails) && count($contactEmails) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $contactEmails when calling removeContactFromList' ); @@ -5949,9 +6094,16 @@ protected function removeContactFromListRequest($listId, $contactEmails) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -6188,7 +6340,7 @@ function ($exception) { protected function requestContactExportRequest($requestContactExport) { // verify the required parameter 'requestContactExport' is set - if ($requestContactExport === null) { + if ($requestContactExport === null || (is_array($requestContactExport) && count($requestContactExport) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $requestContactExport when calling requestContactExport' ); @@ -6224,9 +6376,16 @@ protected function requestContactExportRequest($requestContactExport) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -6444,19 +6603,19 @@ function ($exception) { protected function updateAttributeRequest($attributeCategory, $attributeName, $updateAttribute) { // verify the required parameter 'attributeCategory' is set - if ($attributeCategory === null) { + if ($attributeCategory === null || (is_array($attributeCategory) && count($attributeCategory) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $attributeCategory when calling updateAttribute' ); } // verify the required parameter 'attributeName' is set - if ($attributeName === null) { + if ($attributeName === null || (is_array($attributeName) && count($attributeName) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $attributeName when calling updateAttribute' ); } // verify the required parameter 'updateAttribute' is set - if ($updateAttribute === null) { + if ($updateAttribute === null || (is_array($updateAttribute) && count($updateAttribute) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $updateAttribute when calling updateAttribute' ); @@ -6508,9 +6667,16 @@ protected function updateAttributeRequest($attributeCategory, $attributeName, $u if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -6723,13 +6889,13 @@ function ($exception) { protected function updateContactRequest($email, $updateContact) { // verify the required parameter 'email' is set - if ($email === null) { + if ($email === null || (is_array($email) && count($email) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $email when calling updateContact' ); } // verify the required parameter 'updateContact' is set - if ($updateContact === null) { + if ($updateContact === null || (is_array($updateContact) && count($updateContact) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $updateContact when calling updateContact' ); @@ -6773,9 +6939,16 @@ protected function updateContactRequest($email, $updateContact) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -6988,13 +7161,13 @@ function ($exception) { protected function updateFolderRequest($folderId, $updateFolder) { // verify the required parameter 'folderId' is set - if ($folderId === null) { + if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $folderId when calling updateFolder' ); } // verify the required parameter 'updateFolder' is set - if ($updateFolder === null) { + if ($updateFolder === null || (is_array($updateFolder) && count($updateFolder) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $updateFolder when calling updateFolder' ); @@ -7038,9 +7211,16 @@ protected function updateFolderRequest($folderId, $updateFolder) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -7253,13 +7433,13 @@ function ($exception) { protected function updateListRequest($listId, $updateList) { // verify the required parameter 'listId' is set - if ($listId === null) { + if ($listId === null || (is_array($listId) && count($listId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $listId when calling updateList' ); } // verify the required parameter 'updateList' is set - if ($updateList === null) { + if ($updateList === null || (is_array($updateList) && count($updateList) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $updateList when calling updateList' ); @@ -7303,9 +7483,16 @@ protected function updateListRequest($listId, $updateList) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/Api/EmailCampaignsApi.php b/lib/Api/EmailCampaignsApi.php index 049f9df9..932876d3 100644 --- a/lib/Api/EmailCampaignsApi.php +++ b/lib/Api/EmailCampaignsApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ class EmailCampaignsApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -265,7 +270,7 @@ function ($exception) { protected function createEmailCampaignRequest($emailCampaigns) { // verify the required parameter 'emailCampaigns' is set - if ($emailCampaigns === null) { + if ($emailCampaigns === null || (is_array($emailCampaigns) && count($emailCampaigns) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $emailCampaigns when calling createEmailCampaign' ); @@ -301,9 +306,16 @@ protected function createEmailCampaignRequest($emailCampaigns) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -511,7 +523,7 @@ function ($exception) { protected function deleteEmailCampaignRequest($campaignId) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling deleteEmailCampaign' ); @@ -552,9 +564,16 @@ protected function deleteEmailCampaignRequest($campaignId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -804,13 +823,614 @@ function ($exception) { protected function emailExportRecipientsRequest($campaignId, $recipientExport = null) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling emailExportRecipients' + ); + } + + $resourcePath = '/emailCampaigns/{campaignId}/exportRecipients'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($recipientExport)) { + $_tempBody = $recipientExport; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // 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\build_query($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\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getAbTestCampaignResult + * + * Get A/B test email campaign result + * + * @param int $campaignId Id of the A/B test campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\AbTestCampaignResult + */ + public function getAbTestCampaignResult($campaignId) + { + list($response) = $this->getAbTestCampaignResultWithHttpInfo($campaignId); + return $response; + } + + /** + * Operation getAbTestCampaignResultWithHttpInfo + * + * Get A/B test email campaign result + * + * @param int $campaignId Id of the A/B test campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\AbTestCampaignResult, HTTP status code, HTTP response headers (array of strings) + */ + public function getAbTestCampaignResultWithHttpInfo($campaignId) + { + $returnType = '\SendinBlue\Client\Model\AbTestCampaignResult'; + $request = $this->getAbTestCampaignResultRequest($campaignId); + + 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(), + '\SendinBlue\Client\Model\AbTestCampaignResult', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getAbTestCampaignResultAsync + * + * Get A/B test email campaign result + * + * @param int $campaignId Id of the A/B test campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAbTestCampaignResultAsync($campaignId) + { + return $this->getAbTestCampaignResultAsyncWithHttpInfo($campaignId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getAbTestCampaignResultAsyncWithHttpInfo + * + * Get A/B test email campaign result + * + * @param int $campaignId Id of the A/B test campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAbTestCampaignResultAsyncWithHttpInfo($campaignId) + { + $returnType = '\SendinBlue\Client\Model\AbTestCampaignResult'; + $request = $this->getAbTestCampaignResultRequest($campaignId); + + 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 'getAbTestCampaignResult' + * + * @param int $campaignId Id of the A/B test campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getAbTestCampaignResultRequest($campaignId) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling getAbTestCampaignResult' + ); + } + + $resourcePath = '/emailCampaigns/{campaignId}/abTestCampaignResult'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $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\build_query($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\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEmailCampaign + * + * Get campaign informations + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetEmailCampaign + */ + public function getEmailCampaign($campaignId) + { + list($response) = $this->getEmailCampaignWithHttpInfo($campaignId); + return $response; + } + + /** + * Operation getEmailCampaignWithHttpInfo + * + * Get campaign informations + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetEmailCampaign, HTTP status code, HTTP response headers (array of strings) + */ + public function getEmailCampaignWithHttpInfo($campaignId) + { + $returnType = '\SendinBlue\Client\Model\GetEmailCampaign'; + $request = $this->getEmailCampaignRequest($campaignId); + + 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(), + '\SendinBlue\Client\Model\GetEmailCampaign', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getEmailCampaignAsync + * + * Get campaign informations + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getEmailCampaignAsync($campaignId) + { + return $this->getEmailCampaignAsyncWithHttpInfo($campaignId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getEmailCampaignAsyncWithHttpInfo + * + * Get campaign informations + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getEmailCampaignAsyncWithHttpInfo($campaignId) + { + $returnType = '\SendinBlue\Client\Model\GetEmailCampaign'; + $request = $this->getEmailCampaignRequest($campaignId); + + 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 'getEmailCampaign' + * + * @param int $campaignId Id of the campaign (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getEmailCampaignRequest($campaignId) + { + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling emailExportRecipients' + 'Missing the required parameter $campaignId when calling getEmailCampaign' ); } - $resourcePath = '/emailCampaigns/{campaignId}/exportRecipients'; + $resourcePath = '/emailCampaigns/{campaignId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -829,9 +1449,6 @@ protected function emailExportRecipientsRequest($campaignId, $recipientExport = // body params $_tempBody = null; - if (isset($recipientExport)) { - $_tempBody = $recipientExport; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -848,9 +1465,16 @@ protected function emailExportRecipientsRequest($campaignId, $recipientExport = if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -897,7 +1521,7 @@ protected function emailExportRecipientsRequest($campaignId, $recipientExport = $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -905,37 +1529,47 @@ protected function emailExportRecipientsRequest($campaignId, $recipientExport = } /** - * Operation getEmailCampaign + * Operation getEmailCampaigns * - * Get campaign informations + * Return all your created campaigns * - * @param int $campaignId Id of the campaign (required) + * @param string $type Filter on the type of the campaigns (optional) + * @param string $status Filter on the status of the campaign (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number of documents per page (optional, default to 500) + * @param int $offset Index of the first document in the page (optional, default to 0) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SendinBlue\Client\Model\GetEmailCampaign + * @return \SendinBlue\Client\Model\GetEmailCampaigns */ - public function getEmailCampaign($campaignId) + public function getEmailCampaigns($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') { - list($response) = $this->getEmailCampaignWithHttpInfo($campaignId); + list($response) = $this->getEmailCampaignsWithHttpInfo($type, $status, $startDate, $endDate, $limit, $offset); return $response; } /** - * Operation getEmailCampaignWithHttpInfo + * Operation getEmailCampaignsWithHttpInfo * - * Get campaign informations + * Return all your created campaigns * - * @param int $campaignId Id of the campaign (required) + * @param string $type Filter on the type of the campaigns (optional) + * @param string $status Filter on the status of the campaign (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number of documents per page (optional, default to 500) + * @param int $offset Index of the first document in the page (optional, default to 0) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SendinBlue\Client\Model\GetEmailCampaign, HTTP status code, HTTP response headers (array of strings) + * @return array of \SendinBlue\Client\Model\GetEmailCampaigns, HTTP status code, HTTP response headers (array of strings) */ - public function getEmailCampaignWithHttpInfo($campaignId) + public function getEmailCampaignsWithHttpInfo($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') { - $returnType = '\SendinBlue\Client\Model\GetEmailCampaign'; - $request = $this->getEmailCampaignRequest($campaignId); + $returnType = '\SendinBlue\Client\Model\GetEmailCampaigns'; + $request = $this->getEmailCampaignsRequest($type, $status, $startDate, $endDate, $limit, $offset); try { $options = $this->createHttpClientOption(); @@ -986,7 +1620,7 @@ public function getEmailCampaignWithHttpInfo($campaignId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SendinBlue\Client\Model\GetEmailCampaign', + '\SendinBlue\Client\Model\GetEmailCampaigns', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -999,32 +1633,29 @@ public function getEmailCampaignWithHttpInfo($campaignId) ); $e->setResponseObject($data); break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\SendinBlue\Client\Model\ErrorModel', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation getEmailCampaignAsync + * Operation getEmailCampaignsAsync * - * Get campaign informations + * Return all your created campaigns * - * @param int $campaignId Id of the campaign (required) + * @param string $type Filter on the type of the campaigns (optional) + * @param string $status Filter on the status of the campaign (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number of documents per page (optional, default to 500) + * @param int $offset Index of the first document in the page (optional, default to 0) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEmailCampaignAsync($campaignId) + public function getEmailCampaignsAsync($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') { - return $this->getEmailCampaignAsyncWithHttpInfo($campaignId) + return $this->getEmailCampaignsAsyncWithHttpInfo($type, $status, $startDate, $endDate, $limit, $offset) ->then( function ($response) { return $response[0]; @@ -1033,19 +1664,24 @@ function ($response) { } /** - * Operation getEmailCampaignAsyncWithHttpInfo + * Operation getEmailCampaignsAsyncWithHttpInfo * - * Get campaign informations + * Return all your created campaigns * - * @param int $campaignId Id of the campaign (required) + * @param string $type Filter on the type of the campaigns (optional) + * @param string $status Filter on the status of the campaign (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number of documents per page (optional, default to 500) + * @param int $offset Index of the first document in the page (optional, default to 0) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEmailCampaignAsyncWithHttpInfo($campaignId) + public function getEmailCampaignsAsyncWithHttpInfo($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') { - $returnType = '\SendinBlue\Client\Model\GetEmailCampaign'; - $request = $this->getEmailCampaignRequest($campaignId); + $returnType = '\SendinBlue\Client\Model\GetEmailCampaigns'; + $request = $this->getEmailCampaignsRequest($type, $status, $startDate, $endDate, $limit, $offset); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1085,39 +1721,58 @@ function ($exception) { } /** - * Create request for operation 'getEmailCampaign' + * Create request for operation 'getEmailCampaigns' * - * @param int $campaignId Id of the campaign (required) + * @param string $type Filter on the type of the campaigns (optional) + * @param string $status Filter on the status of the campaign (optional) + * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) + * @param int $limit Number of documents per page (optional, default to 500) + * @param int $offset Index of the first document in the page (optional, default to 0) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getEmailCampaignRequest($campaignId) + protected function getEmailCampaignsRequest($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') { - // verify the required parameter 'campaignId' is set - if ($campaignId === null) { - throw new \InvalidArgumentException( - 'Missing the required parameter $campaignId when calling getEmailCampaign' - ); + if ($limit !== null && $limit > 1000) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling EmailCampaignsApi.getEmailCampaigns, must be smaller than or equal to 1000.'); } - $resourcePath = '/emailCampaigns/{campaignId}'; + + $resourcePath = '/emailCampaigns'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - // path params - if ($campaignId !== null) { - $resourcePath = str_replace( - '{' . 'campaignId' . '}', - ObjectSerializer::toPathValue($campaignId), - $resourcePath - ); + // query params + if ($type !== null) { + $queryParams['type'] = ObjectSerializer::toQueryValue($type); + } + // query params + if ($status !== null) { + $queryParams['status'] = ObjectSerializer::toQueryValue($status); + } + // query params + if ($startDate !== null) { + $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate); + } + // query params + if ($endDate !== null) { + $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate); + } + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); } + // body params $_tempBody = null; @@ -1136,9 +1791,16 @@ protected function getEmailCampaignRequest($campaignId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1193,47 +1855,37 @@ protected function getEmailCampaignRequest($campaignId) } /** - * Operation getEmailCampaigns + * Operation getSharedTemplateUrl * - * Return all your created campaigns + * Get a shared template url * - * @param string $type Filter on the type of the campaigns (optional) - * @param string $status Filter on the status of the campaign (optional) - * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - * @param int $limit Number of documents per page (optional, default to 500) - * @param int $offset Index of the first document in the page (optional, default to 0) + * @param int $campaignId Id of the campaign or template (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SendinBlue\Client\Model\GetEmailCampaigns + * @return \SendinBlue\Client\Model\GetSharedTemplateUrl */ - public function getEmailCampaigns($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + public function getSharedTemplateUrl($campaignId) { - list($response) = $this->getEmailCampaignsWithHttpInfo($type, $status, $startDate, $endDate, $limit, $offset); + list($response) = $this->getSharedTemplateUrlWithHttpInfo($campaignId); return $response; } /** - * Operation getEmailCampaignsWithHttpInfo + * Operation getSharedTemplateUrlWithHttpInfo * - * Return all your created campaigns + * Get a shared template url * - * @param string $type Filter on the type of the campaigns (optional) - * @param string $status Filter on the status of the campaign (optional) - * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - * @param int $limit Number of documents per page (optional, default to 500) - * @param int $offset Index of the first document in the page (optional, default to 0) + * @param int $campaignId Id of the campaign or template (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SendinBlue\Client\Model\GetEmailCampaigns, HTTP status code, HTTP response headers (array of strings) + * @return array of \SendinBlue\Client\Model\GetSharedTemplateUrl, HTTP status code, HTTP response headers (array of strings) */ - public function getEmailCampaignsWithHttpInfo($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + public function getSharedTemplateUrlWithHttpInfo($campaignId) { - $returnType = '\SendinBlue\Client\Model\GetEmailCampaigns'; - $request = $this->getEmailCampaignsRequest($type, $status, $startDate, $endDate, $limit, $offset); + $returnType = '\SendinBlue\Client\Model\GetSharedTemplateUrl'; + $request = $this->getSharedTemplateUrlRequest($campaignId); try { $options = $this->createHttpClientOption(); @@ -1284,7 +1936,7 @@ public function getEmailCampaignsWithHttpInfo($type = null, $status = null, $sta case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SendinBlue\Client\Model\GetEmailCampaigns', + '\SendinBlue\Client\Model\GetSharedTemplateUrl', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1297,29 +1949,32 @@ public function getEmailCampaignsWithHttpInfo($type = null, $status = null, $sta ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation getEmailCampaignsAsync + * Operation getSharedTemplateUrlAsync * - * Return all your created campaigns + * Get a shared template url * - * @param string $type Filter on the type of the campaigns (optional) - * @param string $status Filter on the status of the campaign (optional) - * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - * @param int $limit Number of documents per page (optional, default to 500) - * @param int $offset Index of the first document in the page (optional, default to 0) + * @param int $campaignId Id of the campaign or template (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEmailCampaignsAsync($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + public function getSharedTemplateUrlAsync($campaignId) { - return $this->getEmailCampaignsAsyncWithHttpInfo($type, $status, $startDate, $endDate, $limit, $offset) + return $this->getSharedTemplateUrlAsyncWithHttpInfo($campaignId) ->then( function ($response) { return $response[0]; @@ -1328,24 +1983,19 @@ function ($response) { } /** - * Operation getEmailCampaignsAsyncWithHttpInfo + * Operation getSharedTemplateUrlAsyncWithHttpInfo * - * Return all your created campaigns + * Get a shared template url * - * @param string $type Filter on the type of the campaigns (optional) - * @param string $status Filter on the status of the campaign (optional) - * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - * @param int $limit Number of documents per page (optional, default to 500) - * @param int $offset Index of the first document in the page (optional, default to 0) + * @param int $campaignId Id of the campaign or template (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEmailCampaignsAsyncWithHttpInfo($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + public function getSharedTemplateUrlAsyncWithHttpInfo($campaignId) { - $returnType = '\SendinBlue\Client\Model\GetEmailCampaigns'; - $request = $this->getEmailCampaignsRequest($type, $status, $startDate, $endDate, $limit, $offset); + $returnType = '\SendinBlue\Client\Model\GetSharedTemplateUrl'; + $request = $this->getSharedTemplateUrlRequest($campaignId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1385,57 +2035,38 @@ function ($exception) { } /** - * Create request for operation 'getEmailCampaigns' + * Create request for operation 'getSharedTemplateUrl' * - * @param string $type Filter on the type of the campaigns (optional) - * @param string $status Filter on the status of the campaign (optional) - * @param \DateTime $startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) (optional) - * @param int $limit Number of documents per page (optional, default to 500) - * @param int $offset Index of the first document in the page (optional, default to 0) + * @param int $campaignId Id of the campaign or template (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getEmailCampaignsRequest($type = null, $status = null, $startDate = null, $endDate = null, $limit = '500', $offset = '0') + protected function getSharedTemplateUrlRequest($campaignId) { - if ($limit !== null && $limit > 1000) { - throw new \InvalidArgumentException('invalid value for "$limit" when calling EmailCampaignsApi.getEmailCampaigns, must be smaller than or equal to 1000.'); + // verify the required parameter 'campaignId' is set + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $campaignId when calling getSharedTemplateUrl' + ); } - - $resourcePath = '/emailCampaigns'; + $resourcePath = '/emailCampaigns/{campaignId}/sharedUrl'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($type !== null) { - $queryParams['type'] = ObjectSerializer::toQueryValue($type); - } - // query params - if ($status !== null) { - $queryParams['status'] = ObjectSerializer::toQueryValue($status); - } - // query params - if ($startDate !== null) { - $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate); - } - // query params - if ($endDate !== null) { - $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate); - } - // query params - if ($limit !== null) { - $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); - } - // query params - if ($offset !== null) { - $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); - } + // path params + if ($campaignId !== null) { + $resourcePath = str_replace( + '{' . 'campaignId' . '}', + ObjectSerializer::toPathValue($campaignId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -1455,9 +2086,16 @@ protected function getEmailCampaignsRequest($type = null, $status = null, $start if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1514,7 +2152,7 @@ protected function getEmailCampaignsRequest($type = null, $status = null, $start /** * Operation sendEmailCampaignNow * - * Send an email campaign id of the campaign immediately + * Send an email campaign immediately, based on campaignId * * @param int $campaignId Id of the campaign (required) * @@ -1530,7 +2168,7 @@ public function sendEmailCampaignNow($campaignId) /** * Operation sendEmailCampaignNowWithHttpInfo * - * Send an email campaign id of the campaign immediately + * Send an email campaign immediately, based on campaignId * * @param int $campaignId Id of the campaign (required) * @@ -1607,7 +2245,7 @@ public function sendEmailCampaignNowWithHttpInfo($campaignId) /** * Operation sendEmailCampaignNowAsync * - * Send an email campaign id of the campaign immediately + * Send an email campaign immediately, based on campaignId * * @param int $campaignId Id of the campaign (required) * @@ -1627,7 +2265,7 @@ function ($response) { /** * Operation sendEmailCampaignNowAsyncWithHttpInfo * - * Send an email campaign id of the campaign immediately + * Send an email campaign immediately, based on campaignId * * @param int $campaignId Id of the campaign (required) * @@ -1673,7 +2311,7 @@ function ($exception) { protected function sendEmailCampaignNowRequest($campaignId) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling sendEmailCampaignNow' ); @@ -1714,9 +2352,16 @@ protected function sendEmailCampaignNowRequest($campaignId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1929,13 +2574,13 @@ function ($exception) { protected function sendReportRequest($campaignId, $sendReport) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling sendReport' ); } // verify the required parameter 'sendReport' is set - if ($sendReport === null) { + if ($sendReport === null || (is_array($sendReport) && count($sendReport) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $sendReport when calling sendReport' ); @@ -1979,9 +2624,16 @@ protected function sendReportRequest($campaignId, $sendReport) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2194,13 +2846,13 @@ function ($exception) { protected function sendTestEmailRequest($campaignId, $emailTo) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling sendTestEmail' ); } // verify the required parameter 'emailTo' is set - if ($emailTo === null) { + if ($emailTo === null || (is_array($emailTo) && count($emailTo) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $emailTo when calling sendTestEmail' ); @@ -2244,9 +2896,16 @@ protected function sendTestEmailRequest($campaignId, $emailTo) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2459,13 +3118,13 @@ function ($exception) { protected function updateCampaignStatusRequest($campaignId, $status) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling updateCampaignStatus' ); } // verify the required parameter 'status' is set - if ($status === null) { + if ($status === null || (is_array($status) && count($status) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $status when calling updateCampaignStatus' ); @@ -2509,9 +3168,16 @@ protected function updateCampaignStatusRequest($campaignId, $status) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2724,13 +3390,13 @@ function ($exception) { protected function updateEmailCampaignRequest($campaignId, $emailCampaign) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling updateEmailCampaign' ); } // verify the required parameter 'emailCampaign' is set - if ($emailCampaign === null) { + if ($emailCampaign === null || (is_array($emailCampaign) && count($emailCampaign) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $emailCampaign when calling updateEmailCampaign' ); @@ -2774,9 +3440,16 @@ protected function updateEmailCampaignRequest($campaignId, $emailCampaign) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/Api/FoldersApi.php b/lib/Api/FoldersApi.php index df789541..09ab731b 100644 --- a/lib/Api/FoldersApi.php +++ b/lib/Api/FoldersApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ class FoldersApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -265,7 +270,7 @@ function ($exception) { protected function createFolderRequest($createFolder) { // verify the required parameter 'createFolder' is set - if ($createFolder === null) { + if ($createFolder === null || (is_array($createFolder) && count($createFolder) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $createFolder when calling createFolder' ); @@ -301,9 +306,16 @@ protected function createFolderRequest($createFolder) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -511,7 +523,7 @@ function ($exception) { protected function deleteFolderRequest($folderId) { // verify the required parameter 'folderId' is set - if ($folderId === null) { + if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $folderId when calling deleteFolder' ); @@ -552,9 +564,16 @@ protected function deleteFolderRequest($folderId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -799,7 +818,7 @@ function ($exception) { protected function getFolderRequest($folderId) { // verify the required parameter 'folderId' is set - if ($folderId === null) { + if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $folderId when calling getFolder' ); @@ -840,9 +859,16 @@ protected function getFolderRequest($folderId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1097,7 +1123,7 @@ function ($exception) { protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0') { // verify the required parameter 'folderId' is set - if ($folderId === null) { + if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $folderId when calling getFolderLists' ); @@ -1150,9 +1176,16 @@ protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0' if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1394,7 +1427,7 @@ function ($exception) { protected function getFoldersRequest($limit, $offset) { // verify the required parameter 'limit' is set - if ($limit === null) { + if ($limit === null || (is_array($limit) && count($limit) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $limit when calling getFolders' ); @@ -1404,7 +1437,7 @@ protected function getFoldersRequest($limit, $offset) } // verify the required parameter 'offset' is set - if ($offset === null) { + if ($offset === null || (is_array($offset) && count($offset) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $offset when calling getFolders' ); @@ -1445,9 +1478,16 @@ protected function getFoldersRequest($limit, $offset) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1660,13 +1700,13 @@ function ($exception) { protected function updateFolderRequest($folderId, $updateFolder) { // verify the required parameter 'folderId' is set - if ($folderId === null) { + if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $folderId when calling updateFolder' ); } // verify the required parameter 'updateFolder' is set - if ($updateFolder === null) { + if ($updateFolder === null || (is_array($updateFolder) && count($updateFolder) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $updateFolder when calling updateFolder' ); @@ -1710,9 +1750,16 @@ protected function updateFolderRequest($folderId, $updateFolder) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/Api/ListsApi.php b/lib/Api/ListsApi.php index 206c4815..6e27807e 100644 --- a/lib/Api/ListsApi.php +++ b/lib/Api/ListsApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ class ListsApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -278,13 +283,13 @@ function ($exception) { protected function addContactToListRequest($listId, $contactEmails) { // verify the required parameter 'listId' is set - if ($listId === null) { + if ($listId === null || (is_array($listId) && count($listId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $listId when calling addContactToList' ); } // verify the required parameter 'contactEmails' is set - if ($contactEmails === null) { + if ($contactEmails === null || (is_array($contactEmails) && count($contactEmails) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $contactEmails when calling addContactToList' ); @@ -328,9 +333,16 @@ protected function addContactToListRequest($listId, $contactEmails) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -567,7 +579,7 @@ function ($exception) { protected function createListRequest($createList) { // verify the required parameter 'createList' is set - if ($createList === null) { + if ($createList === null || (is_array($createList) && count($createList) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $createList when calling createList' ); @@ -603,9 +615,16 @@ protected function createListRequest($createList) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -813,7 +832,7 @@ function ($exception) { protected function deleteListRequest($listId) { // verify the required parameter 'listId' is set - if ($listId === null) { + if ($listId === null || (is_array($listId) && count($listId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $listId when calling deleteList' ); @@ -854,9 +873,16 @@ protected function deleteListRequest($listId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1116,7 +1142,7 @@ function ($exception) { protected function getContactsFromListRequest($listId, $modifiedSince = null, $limit = '50', $offset = '0') { // verify the required parameter 'listId' is set - if ($listId === null) { + if ($listId === null || (is_array($listId) && count($listId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $listId when calling getContactsFromList' ); @@ -1173,9 +1199,16 @@ protected function getContactsFromListRequest($listId, $modifiedSince = null, $l if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1430,7 +1463,7 @@ function ($exception) { protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0') { // verify the required parameter 'folderId' is set - if ($folderId === null) { + if ($folderId === null || (is_array($folderId) && count($folderId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $folderId when calling getFolderLists' ); @@ -1483,9 +1516,16 @@ protected function getFolderListsRequest($folderId, $limit = '10', $offset = '0' if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1730,7 +1770,7 @@ function ($exception) { protected function getListRequest($listId) { // verify the required parameter 'listId' is set - if ($listId === null) { + if ($listId === null || (is_array($listId) && count($listId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $listId when calling getList' ); @@ -1771,9 +1811,16 @@ protected function getListRequest($listId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2054,9 +2101,16 @@ protected function getListsRequest($limit = '10', $offset = '0') if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2306,13 +2360,13 @@ function ($exception) { protected function removeContactFromListRequest($listId, $contactEmails) { // verify the required parameter 'listId' is set - if ($listId === null) { + if ($listId === null || (is_array($listId) && count($listId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $listId when calling removeContactFromList' ); } // verify the required parameter 'contactEmails' is set - if ($contactEmails === null) { + if ($contactEmails === null || (is_array($contactEmails) && count($contactEmails) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $contactEmails when calling removeContactFromList' ); @@ -2356,9 +2410,16 @@ protected function removeContactFromListRequest($listId, $contactEmails) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2571,13 +2632,13 @@ function ($exception) { protected function updateListRequest($listId, $updateList) { // verify the required parameter 'listId' is set - if ($listId === null) { + if ($listId === null || (is_array($listId) && count($listId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $listId when calling updateList' ); } // verify the required parameter 'updateList' is set - if ($updateList === null) { + if ($updateList === null || (is_array($updateList) && count($updateList) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $updateList when calling updateList' ); @@ -2621,9 +2682,16 @@ protected function updateListRequest($listId, $updateList) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/Api/ProcessApi.php b/lib/Api/ProcessApi.php index a8f1cd89..b734edd4 100644 --- a/lib/Api/ProcessApi.php +++ b/lib/Api/ProcessApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ class ProcessApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -273,7 +278,7 @@ function ($exception) { protected function getProcessRequest($processId) { // verify the required parameter 'processId' is set - if ($processId === null) { + if ($processId === null || (is_array($processId) && count($processId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $processId when calling getProcess' ); @@ -314,9 +319,16 @@ protected function getProcessRequest($processId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -597,9 +609,16 @@ protected function getProcessesRequest($limit = '10', $offset = '0') if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/Api/ResellerApi.php b/lib/Api/ResellerApi.php index cf7cf832..721ac395 100644 --- a/lib/Api/ResellerApi.php +++ b/lib/Api/ResellerApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ class ResellerApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -286,13 +291,13 @@ function ($exception) { protected function addCreditsRequest($childAuthKey, $addCredits) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling addCredits' ); } // verify the required parameter 'addCredits' is set - if ($addCredits === null) { + if ($addCredits === null || (is_array($addCredits) && count($addCredits) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $addCredits when calling addCredits' ); @@ -336,9 +341,16 @@ protected function addCreditsRequest($childAuthKey, $addCredits) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -551,13 +563,13 @@ function ($exception) { protected function associateIpToChildRequest($childAuthKey, $ip) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling associateIpToChild' ); } // verify the required parameter 'ip' is set - if ($ip === null) { + if ($ip === null || (is_array($ip) && count($ip) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $ip when calling associateIpToChild' ); @@ -601,9 +613,16 @@ protected function associateIpToChildRequest($childAuthKey, $ip) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -663,7 +682,7 @@ protected function associateIpToChildRequest($childAuthKey, $ip) * Creates a domain for a child account * * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account (required) + * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -680,7 +699,7 @@ public function createChildDomain($childAuthKey, $addChildDomain) * Creates a domain for a child account * * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account (required) + * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -758,7 +777,7 @@ public function createChildDomainWithHttpInfo($childAuthKey, $addChildDomain) * Creates a domain for a child account * * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account (required) + * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -779,7 +798,7 @@ function ($response) { * Creates a domain for a child account * * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account (required) + * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -816,7 +835,7 @@ function ($exception) { * Create request for operation 'createChildDomain' * * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account (required) + * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -824,13 +843,13 @@ function ($exception) { protected function createChildDomainRequest($childAuthKey, $addChildDomain) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling createChildDomain' ); } // verify the required parameter 'addChildDomain' is set - if ($addChildDomain === null) { + if ($addChildDomain === null || (is_array($addChildDomain) && count($addChildDomain) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $addChildDomain when calling createChildDomain' ); @@ -874,9 +893,16 @@ protected function createChildDomainRequest($childAuthKey, $addChildDomain) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1151,9 +1177,16 @@ protected function createResellerChildRequest($resellerChild = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1374,13 +1407,13 @@ function ($exception) { protected function deleteChildDomainRequest($childAuthKey, $domainName) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling deleteChildDomain' ); } // verify the required parameter 'domainName' is set - if ($domainName === null) { + if ($domainName === null || (is_array($domainName) && count($domainName) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $domainName when calling deleteChildDomain' ); @@ -1429,9 +1462,16 @@ protected function deleteChildDomainRequest($childAuthKey, $domainName) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1647,7 +1687,7 @@ function ($exception) { protected function deleteResellerChildRequest($childAuthKey) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling deleteResellerChild' ); @@ -1688,9 +1728,16 @@ protected function deleteResellerChildRequest($childAuthKey) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1903,13 +1950,13 @@ function ($exception) { protected function dissociateIpFromChildRequest($childAuthKey, $ip) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling dissociateIpFromChild' ); } // verify the required parameter 'ip' is set - if ($ip === null) { + if ($ip === null || (is_array($ip) && count($ip) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $ip when calling dissociateIpFromChild' ); @@ -1953,9 +2000,16 @@ protected function dissociateIpFromChildRequest($childAuthKey, $ip) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2009,6 +2063,309 @@ protected function dissociateIpFromChildRequest($childAuthKey, $ip) ); } + /** + * Operation getChildAccountCreationStatus + * + * Returns the status of reseller's child account creation, whether it is successfully created (exists) or not based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\GetChildAccountCreationStatus + */ + public function getChildAccountCreationStatus($childAuthKey) + { + list($response) = $this->getChildAccountCreationStatusWithHttpInfo($childAuthKey); + return $response; + } + + /** + * Operation getChildAccountCreationStatusWithHttpInfo + * + * Returns the status of reseller's child account creation, whether it is successfully created (exists) or not based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\GetChildAccountCreationStatus, HTTP status code, HTTP response headers (array of strings) + */ + public function getChildAccountCreationStatusWithHttpInfo($childAuthKey) + { + $returnType = '\SendinBlue\Client\Model\GetChildAccountCreationStatus'; + $request = $this->getChildAccountCreationStatusRequest($childAuthKey); + + 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(), + '\SendinBlue\Client\Model\GetChildAccountCreationStatus', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getChildAccountCreationStatusAsync + * + * Returns the status of reseller's child account creation, whether it is successfully created (exists) or not based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChildAccountCreationStatusAsync($childAuthKey) + { + return $this->getChildAccountCreationStatusAsyncWithHttpInfo($childAuthKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getChildAccountCreationStatusAsyncWithHttpInfo + * + * Returns the status of reseller's child account creation, whether it is successfully created (exists) or not based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getChildAccountCreationStatusAsyncWithHttpInfo($childAuthKey) + { + $returnType = '\SendinBlue\Client\Model\GetChildAccountCreationStatus'; + $request = $this->getChildAccountCreationStatusRequest($childAuthKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getChildAccountCreationStatus' + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function getChildAccountCreationStatusRequest($childAuthKey) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling getChildAccountCreationStatus' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/accountCreationStatus'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $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\build_query($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\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getChildDomains * @@ -2208,7 +2565,7 @@ function ($exception) { protected function getChildDomainsRequest($childAuthKey) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling getChildDomains' ); @@ -2249,9 +2606,16 @@ protected function getChildDomainsRequest($childAuthKey) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2504,7 +2868,7 @@ function ($exception) { protected function getChildInfoRequest($childAuthKey) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling getChildInfo' ); @@ -2545,9 +2909,16 @@ protected function getChildInfoRequest($childAuthKey) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2606,14 +2977,16 @@ protected function getChildInfoRequest($childAuthKey) * * Gets the list of all reseller's children accounts * + * @param int $limit Number of documents for child accounts information per page (optional, default to 10) + * @param int $offset Index of the first document in the page (optional, default to 0) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \SendinBlue\Client\Model\GetChildrenList */ - public function getResellerChilds() + public function getResellerChilds($limit = '10', $offset = '0') { - list($response) = $this->getResellerChildsWithHttpInfo(); + list($response) = $this->getResellerChildsWithHttpInfo($limit, $offset); return $response; } @@ -2622,15 +2995,17 @@ public function getResellerChilds() * * Gets the list of all reseller's children accounts * + * @param int $limit Number of documents for child accounts information per page (optional, default to 10) + * @param int $offset Index of the first document in the page (optional, default to 0) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \SendinBlue\Client\Model\GetChildrenList, HTTP status code, HTTP response headers (array of strings) */ - public function getResellerChildsWithHttpInfo() + public function getResellerChildsWithHttpInfo($limit = '10', $offset = '0') { $returnType = '\SendinBlue\Client\Model\GetChildrenList'; - $request = $this->getResellerChildsRequest(); + $request = $this->getResellerChildsRequest($limit, $offset); try { $options = $this->createHttpClientOption(); @@ -2704,13 +3079,15 @@ public function getResellerChildsWithHttpInfo() * * Gets the list of all reseller's children accounts * + * @param int $limit Number of documents for child accounts information per page (optional, default to 10) + * @param int $offset Index of the first document in the page (optional, default to 0) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getResellerChildsAsync() + public function getResellerChildsAsync($limit = '10', $offset = '0') { - return $this->getResellerChildsAsyncWithHttpInfo() + return $this->getResellerChildsAsyncWithHttpInfo($limit, $offset) ->then( function ($response) { return $response[0]; @@ -2723,14 +3100,16 @@ function ($response) { * * Gets the list of all reseller's children accounts * + * @param int $limit Number of documents for child accounts information per page (optional, default to 10) + * @param int $offset Index of the first document in the page (optional, default to 0) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getResellerChildsAsyncWithHttpInfo() + public function getResellerChildsAsyncWithHttpInfo($limit = '10', $offset = '0') { $returnType = '\SendinBlue\Client\Model\GetChildrenList'; - $request = $this->getResellerChildsRequest(); + $request = $this->getResellerChildsRequest($limit, $offset); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2772,12 +3151,18 @@ function ($exception) { /** * Create request for operation 'getResellerChilds' * + * @param int $limit Number of documents for child accounts information per page (optional, default to 10) + * @param int $offset Index of the first document in the page (optional, default to 0) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getResellerChildsRequest() + protected function getResellerChildsRequest($limit = '10', $offset = '0') { + if ($limit !== null && $limit > 20) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ResellerApi.getResellerChilds, must be smaller than or equal to 20.'); + } + $resourcePath = '/reseller/children'; $formParams = []; @@ -2786,6 +3171,14 @@ protected function getResellerChildsRequest() $httpBody = ''; $multipart = false; + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } // body params @@ -2806,9 +3199,16 @@ protected function getResellerChildsRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -3061,7 +3461,7 @@ function ($exception) { protected function getSsoTokenRequest($childAuthKey) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling getSsoToken' ); @@ -3102,9 +3502,16 @@ protected function getSsoTokenRequest($childAuthKey) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -3362,13 +3769,13 @@ function ($exception) { protected function removeCreditsRequest($childAuthKey, $removeCredits) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling removeCredits' ); } // verify the required parameter 'removeCredits' is set - if ($removeCredits === null) { + if ($removeCredits === null || (is_array($removeCredits) && count($removeCredits) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $removeCredits when calling removeCredits' ); @@ -3412,9 +3819,16 @@ protected function removeCreditsRequest($childAuthKey, $removeCredits) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -3635,13 +4049,13 @@ function ($exception) { protected function updateChildAccountStatusRequest($childAuthKey, $updateChildAccountStatus) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling updateChildAccountStatus' ); } // verify the required parameter 'updateChildAccountStatus' is set - if ($updateChildAccountStatus === null) { + if ($updateChildAccountStatus === null || (is_array($updateChildAccountStatus) && count($updateChildAccountStatus) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $updateChildAccountStatus when calling updateChildAccountStatus' ); @@ -3685,9 +4099,16 @@ protected function updateChildAccountStatusRequest($childAuthKey, $updateChildAc if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -3913,19 +4334,19 @@ function ($exception) { protected function updateChildDomainRequest($childAuthKey, $domainName, $updateChildDomain) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling updateChildDomain' ); } // verify the required parameter 'domainName' is set - if ($domainName === null) { + if ($domainName === null || (is_array($domainName) && count($domainName) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $domainName when calling updateChildDomain' ); } // verify the required parameter 'updateChildDomain' is set - if ($updateChildDomain === null) { + if ($updateChildDomain === null || (is_array($updateChildDomain) && count($updateChildDomain) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $updateChildDomain when calling updateChildDomain' ); @@ -3977,9 +4398,16 @@ protected function updateChildDomainRequest($childAuthKey, $domainName, $updateC if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -4200,13 +4628,13 @@ function ($exception) { protected function updateResellerChildRequest($childAuthKey, $resellerChild) { // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { + if ($childAuthKey === null || (is_array($childAuthKey) && count($childAuthKey) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $childAuthKey when calling updateResellerChild' ); } // verify the required parameter 'resellerChild' is set - if ($resellerChild === null) { + if ($resellerChild === null || (is_array($resellerChild) && count($resellerChild) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $resellerChild when calling updateResellerChild' ); @@ -4250,9 +4678,16 @@ protected function updateResellerChildRequest($childAuthKey, $resellerChild) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/Api/SMSCampaignsApi.php b/lib/Api/SMSCampaignsApi.php index 31345a88..16833fd2 100644 --- a/lib/Api/SMSCampaignsApi.php +++ b/lib/Api/SMSCampaignsApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ class SMSCampaignsApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -265,7 +270,7 @@ function ($exception) { protected function createSmsCampaignRequest($createSmsCampaign) { // verify the required parameter 'createSmsCampaign' is set - if ($createSmsCampaign === null) { + if ($createSmsCampaign === null || (is_array($createSmsCampaign) && count($createSmsCampaign) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $createSmsCampaign when calling createSmsCampaign' ); @@ -301,9 +306,16 @@ protected function createSmsCampaignRequest($createSmsCampaign) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -511,7 +523,7 @@ function ($exception) { protected function deleteSmsCampaignRequest($campaignId) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling deleteSmsCampaign' ); @@ -552,9 +564,16 @@ protected function deleteSmsCampaignRequest($campaignId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -799,7 +818,7 @@ function ($exception) { protected function getSmsCampaignRequest($campaignId) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling getSmsCampaign' ); @@ -840,9 +859,16 @@ protected function getSmsCampaignRequest($campaignId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1150,9 +1176,16 @@ protected function getSmsCampaignsRequest($status = null, $startDate = null, $en if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1402,7 +1435,7 @@ function ($exception) { protected function requestSmsRecipientExportRequest($campaignId, $recipientExport = null) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling requestSmsRecipientExport' ); @@ -1446,9 +1479,16 @@ protected function requestSmsRecipientExportRequest($campaignId, $recipientExpor if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1664,7 +1704,7 @@ function ($exception) { protected function sendSmsCampaignNowRequest($campaignId) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling sendSmsCampaignNow' ); @@ -1705,9 +1745,16 @@ protected function sendSmsCampaignNowRequest($campaignId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1920,13 +1967,13 @@ function ($exception) { protected function sendSmsReportRequest($campaignId, $sendReport) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling sendSmsReport' ); } // verify the required parameter 'sendReport' is set - if ($sendReport === null) { + if ($sendReport === null || (is_array($sendReport) && count($sendReport) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $sendReport when calling sendSmsReport' ); @@ -1970,9 +2017,16 @@ protected function sendSmsReportRequest($campaignId, $sendReport) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2185,13 +2239,13 @@ function ($exception) { protected function sendTestSmsRequest($campaignId, $phoneNumber) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling sendTestSms' ); } // verify the required parameter 'phoneNumber' is set - if ($phoneNumber === null) { + if ($phoneNumber === null || (is_array($phoneNumber) && count($phoneNumber) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $phoneNumber when calling sendTestSms' ); @@ -2235,9 +2289,16 @@ protected function sendTestSmsRequest($campaignId, $phoneNumber) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2450,13 +2511,13 @@ function ($exception) { protected function updateSmsCampaignRequest($campaignId, $updateSmsCampaign) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling updateSmsCampaign' ); } // verify the required parameter 'updateSmsCampaign' is set - if ($updateSmsCampaign === null) { + if ($updateSmsCampaign === null || (is_array($updateSmsCampaign) && count($updateSmsCampaign) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $updateSmsCampaign when calling updateSmsCampaign' ); @@ -2500,9 +2561,16 @@ protected function updateSmsCampaignRequest($campaignId, $updateSmsCampaign) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2715,13 +2783,13 @@ function ($exception) { protected function updateSmsCampaignStatusRequest($campaignId, $status) { // verify the required parameter 'campaignId' is set - if ($campaignId === null) { + if ($campaignId === null || (is_array($campaignId) && count($campaignId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaignId when calling updateSmsCampaignStatus' ); } // verify the required parameter 'status' is set - if ($status === null) { + if ($status === null || (is_array($status) && count($status) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $status when calling updateSmsCampaignStatus' ); @@ -2765,9 +2833,16 @@ protected function updateSmsCampaignStatusRequest($campaignId, $status) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/Api/SMTPApi.php b/lib/Api/SMTPApi.php index 6789ffbb..62cc00a4 100644 --- a/lib/Api/SMTPApi.php +++ b/lib/Api/SMTPApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ class SMTPApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -85,9 +90,9 @@ public function getConfig() /** * Operation createSmtpTemplate * - * Create an smtp template + * Create a transactional email template * - * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in transactional email template (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -102,9 +107,9 @@ public function createSmtpTemplate($smtpTemplate) /** * Operation createSmtpTemplateWithHttpInfo * - * Create an smtp template + * Create a transactional email template * - * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in transactional email template (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -185,9 +190,9 @@ public function createSmtpTemplateWithHttpInfo($smtpTemplate) /** * Operation createSmtpTemplateAsync * - * Create an smtp template + * Create a transactional email template * - * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in transactional email template (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -205,9 +210,9 @@ function ($response) { /** * Operation createSmtpTemplateAsyncWithHttpInfo * - * Create an smtp template + * Create a transactional email template * - * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in transactional email template (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -257,7 +262,7 @@ function ($exception) { /** * Create request for operation 'createSmtpTemplate' * - * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * @param \SendinBlue\Client\Model\CreateSmtpTemplate $smtpTemplate values to update in transactional email template (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -265,7 +270,7 @@ function ($exception) { protected function createSmtpTemplateRequest($smtpTemplate) { // verify the required parameter 'smtpTemplate' is set - if ($smtpTemplate === null) { + if ($smtpTemplate === null || (is_array($smtpTemplate) && count($smtpTemplate) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $smtpTemplate when calling createSmtpTemplate' ); @@ -301,9 +306,16 @@ protected function createSmtpTemplateRequest($smtpTemplate) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -533,9 +545,16 @@ protected function deleteHardbouncesRequest($deleteHardbounces = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -592,7 +611,7 @@ protected function deleteHardbouncesRequest($deleteHardbounces = null) /** * Operation deleteSmtpTemplate * - * Delete an inactive smtp template + * Delete an inactive transactional email template * * @param int $templateId id of the template (required) * @@ -608,7 +627,7 @@ public function deleteSmtpTemplate($templateId) /** * Operation deleteSmtpTemplateWithHttpInfo * - * Delete an inactive smtp template + * Delete an inactive transactional email template * * @param int $templateId id of the template (required) * @@ -677,7 +696,7 @@ public function deleteSmtpTemplateWithHttpInfo($templateId) /** * Operation deleteSmtpTemplateAsync * - * Delete an inactive smtp template + * Delete an inactive transactional email template * * @param int $templateId id of the template (required) * @@ -697,7 +716,7 @@ function ($response) { /** * Operation deleteSmtpTemplateAsyncWithHttpInfo * - * Delete an inactive smtp template + * Delete an inactive transactional email template * * @param int $templateId id of the template (required) * @@ -743,7 +762,7 @@ function ($exception) { protected function deleteSmtpTemplateRequest($templateId) { // verify the required parameter 'templateId' is set - if ($templateId === null) { + if ($templateId === null || (is_array($templateId) && count($templateId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $templateId when calling deleteSmtpTemplate' ); @@ -784,9 +803,16 @@ protected function deleteSmtpTemplateRequest($templateId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -843,7 +869,7 @@ protected function deleteSmtpTemplateRequest($templateId) /** * Operation getAggregatedSmtpReport * - * Get your SMTP activity aggregated over a period of time + * Get your transactional email activity aggregated over a period of time * * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) @@ -863,7 +889,7 @@ public function getAggregatedSmtpReport($startDate = null, $endDate = null, $day /** * Operation getAggregatedSmtpReportWithHttpInfo * - * Get your SMTP activity aggregated over a period of time + * Get your transactional email activity aggregated over a period of time * * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) @@ -949,7 +975,7 @@ public function getAggregatedSmtpReportWithHttpInfo($startDate = null, $endDate /** * Operation getAggregatedSmtpReportAsync * - * Get your SMTP activity aggregated over a period of time + * Get your transactional email activity aggregated over a period of time * * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) @@ -972,7 +998,7 @@ function ($response) { /** * Operation getAggregatedSmtpReportAsyncWithHttpInfo * - * Get your SMTP activity aggregated over a period of time + * Get your transactional email activity aggregated over a period of time * * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) @@ -1081,9 +1107,16 @@ protected function getAggregatedSmtpReportRequest($startDate = null, $endDate = if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1140,7 +1173,7 @@ protected function getAggregatedSmtpReportRequest($startDate = null, $endDate = /** * Operation getEmailEventReport * - * Get all your SMTP activity (unaggregated events) + * Get all your transactional email activity (unaggregated events) * * @param int $limit Number limitation for the result returned (optional, default to 50) * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) @@ -1166,7 +1199,7 @@ public function getEmailEventReport($limit = '50', $offset = '0', $startDate = n /** * Operation getEmailEventReportWithHttpInfo * - * Get all your SMTP activity (unaggregated events) + * Get all your transactional email activity (unaggregated events) * * @param int $limit Number limitation for the result returned (optional, default to 50) * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) @@ -1258,7 +1291,7 @@ public function getEmailEventReportWithHttpInfo($limit = '50', $offset = '0', $s /** * Operation getEmailEventReportAsync * - * Get all your SMTP activity (unaggregated events) + * Get all your transactional email activity (unaggregated events) * * @param int $limit Number limitation for the result returned (optional, default to 50) * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) @@ -1287,7 +1320,7 @@ function ($response) { /** * Operation getEmailEventReportAsyncWithHttpInfo * - * Get all your SMTP activity (unaggregated events) + * Get all your transactional email activity (unaggregated events) * * @param int $limit Number limitation for the result returned (optional, default to 50) * @param int $offset Beginning point in the list to retrieve from. (optional, default to 0) @@ -1436,9 +1469,16 @@ protected function getEmailEventReportRequest($limit = '50', $offset = '0', $sta if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1495,9 +1535,9 @@ protected function getEmailEventReportRequest($limit = '50', $offset = '0', $sta /** * Operation getSmtpReport * - * Get your SMTP activity aggregated per day + * Get your transactional email activity aggregated per day * - * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $limit Number of documents returned per page (optional, default to 10) * @param int $offset Index of the first document on the page (optional, default to 0) * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) @@ -1508,7 +1548,7 @@ protected function getEmailEventReportRequest($limit = '50', $offset = '0', $sta * @throws \InvalidArgumentException * @return \SendinBlue\Client\Model\GetReports */ - public function getSmtpReport($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) + public function getSmtpReport($limit = '10', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) { list($response) = $this->getSmtpReportWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $tag); return $response; @@ -1517,9 +1557,9 @@ public function getSmtpReport($limit = '50', $offset = '0', $startDate = null, $ /** * Operation getSmtpReportWithHttpInfo * - * Get your SMTP activity aggregated per day + * Get your transactional email activity aggregated per day * - * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $limit Number of documents returned per page (optional, default to 10) * @param int $offset Index of the first document on the page (optional, default to 0) * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) @@ -1530,7 +1570,7 @@ public function getSmtpReport($limit = '50', $offset = '0', $startDate = null, $ * @throws \InvalidArgumentException * @return array of \SendinBlue\Client\Model\GetReports, HTTP status code, HTTP response headers (array of strings) */ - public function getSmtpReportWithHttpInfo($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) + public function getSmtpReportWithHttpInfo($limit = '10', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) { $returnType = '\SendinBlue\Client\Model\GetReports'; $request = $this->getSmtpReportRequest($limit, $offset, $startDate, $endDate, $days, $tag); @@ -1605,9 +1645,9 @@ public function getSmtpReportWithHttpInfo($limit = '50', $offset = '0', $startDa /** * Operation getSmtpReportAsync * - * Get your SMTP activity aggregated per day + * Get your transactional email activity aggregated per day * - * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $limit Number of documents returned per page (optional, default to 10) * @param int $offset Index of the first document on the page (optional, default to 0) * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) @@ -1617,7 +1657,7 @@ public function getSmtpReportWithHttpInfo($limit = '50', $offset = '0', $startDa * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSmtpReportAsync($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) + public function getSmtpReportAsync($limit = '10', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) { return $this->getSmtpReportAsyncWithHttpInfo($limit, $offset, $startDate, $endDate, $days, $tag) ->then( @@ -1630,9 +1670,9 @@ function ($response) { /** * Operation getSmtpReportAsyncWithHttpInfo * - * Get your SMTP activity aggregated per day + * Get your transactional email activity aggregated per day * - * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $limit Number of documents returned per page (optional, default to 10) * @param int $offset Index of the first document on the page (optional, default to 0) * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) @@ -1642,7 +1682,7 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSmtpReportAsyncWithHttpInfo($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) + public function getSmtpReportAsyncWithHttpInfo($limit = '10', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) { $returnType = '\SendinBlue\Client\Model\GetReports'; $request = $this->getSmtpReportRequest($limit, $offset, $startDate, $endDate, $days, $tag); @@ -1687,7 +1727,7 @@ function ($exception) { /** * Create request for operation 'getSmtpReport' * - * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $limit Number of documents returned per page (optional, default to 10) * @param int $offset Index of the first document on the page (optional, default to 0) * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) @@ -1697,10 +1737,10 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getSmtpReportRequest($limit = '50', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) + protected function getSmtpReportRequest($limit = '10', $offset = '0', $startDate = null, $endDate = null, $days = null, $tag = null) { - if ($limit !== null && $limit > 100) { - throw new \InvalidArgumentException('invalid value for "$limit" when calling SMTPApi.getSmtpReport, must be smaller than or equal to 100.'); + if ($limit !== null && $limit > 30) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling SMTPApi.getSmtpReport, must be smaller than or equal to 30.'); } @@ -1755,9 +1795,16 @@ protected function getSmtpReportRequest($limit = '50', $offset = '0', $startDate if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2002,7 +2049,7 @@ function ($exception) { protected function getSmtpTemplateRequest($templateId) { // verify the required parameter 'templateId' is set - if ($templateId === null) { + if ($templateId === null || (is_array($templateId) && count($templateId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $templateId when calling getSmtpTemplate' ); @@ -2043,9 +2090,16 @@ protected function getSmtpTemplateRequest($templateId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2102,7 +2156,7 @@ protected function getSmtpTemplateRequest($templateId) /** * Operation getSmtpTemplates * - * Get the list of SMTP templates + * Get the list of transactional email templates * * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional) * @param int $limit Number of documents returned per page (optional, default to 50) @@ -2121,7 +2175,7 @@ public function getSmtpTemplates($templateStatus = null, $limit = '50', $offset /** * Operation getSmtpTemplatesWithHttpInfo * - * Get the list of SMTP templates + * Get the list of transactional email templates * * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional) * @param int $limit Number of documents returned per page (optional, default to 50) @@ -2206,7 +2260,7 @@ public function getSmtpTemplatesWithHttpInfo($templateStatus = null, $limit = '5 /** * Operation getSmtpTemplatesAsync * - * Get the list of SMTP templates + * Get the list of transactional email templates * * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional) * @param int $limit Number of documents returned per page (optional, default to 50) @@ -2228,7 +2282,7 @@ function ($response) { /** * Operation getSmtpTemplatesAsyncWithHttpInfo * - * Get the list of SMTP templates + * Get the list of transactional email templates * * @param bool $templateStatus Filter on the status of the template. Active = true, inactive = false (optional) * @param int $limit Number of documents returned per page (optional, default to 50) @@ -2335,9 +2389,16 @@ protected function getSmtpTemplatesRequest($templateStatus = null, $limit = '50' if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2392,39 +2453,45 @@ protected function getSmtpTemplatesRequest($templateStatus = null, $limit = '50' } /** - * Operation sendTemplate + * Operation getTransacBlockedContacts * - * Send a template + * Get the list of blocked or unsubscribed transactional contacts * - * @param int $templateId Id of the template (required) - * @param \SendinBlue\Client\Model\SendEmail $sendEmail sendEmail (required) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document on the page (optional, default to 0) + * @param string[] $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SendinBlue\Client\Model\SendTemplateEmail + * @return \SendinBlue\Client\Model\GetTransacBlockedContacts */ - public function sendTemplate($templateId, $sendEmail) + public function getTransacBlockedContacts($startDate = null, $endDate = null, $limit = '50', $offset = '0', $senders = null) { - list($response) = $this->sendTemplateWithHttpInfo($templateId, $sendEmail); + list($response) = $this->getTransacBlockedContactsWithHttpInfo($startDate, $endDate, $limit, $offset, $senders); return $response; } /** - * Operation sendTemplateWithHttpInfo + * Operation getTransacBlockedContactsWithHttpInfo * - * Send a template + * Get the list of blocked or unsubscribed transactional contacts * - * @param int $templateId Id of the template (required) - * @param \SendinBlue\Client\Model\SendEmail $sendEmail (required) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document on the page (optional, default to 0) + * @param string[] $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SendinBlue\Client\Model\SendTemplateEmail, HTTP status code, HTTP response headers (array of strings) + * @return array of \SendinBlue\Client\Model\GetTransacBlockedContacts, HTTP status code, HTTP response headers (array of strings) */ - public function sendTemplateWithHttpInfo($templateId, $sendEmail) + public function getTransacBlockedContactsWithHttpInfo($startDate = null, $endDate = null, $limit = '50', $offset = '0', $senders = null) { - $returnType = '\SendinBlue\Client\Model\SendTemplateEmail'; - $request = $this->sendTemplateRequest($templateId, $sendEmail); + $returnType = '\SendinBlue\Client\Model\GetTransacBlockedContacts'; + $request = $this->getTransacBlockedContactsRequest($startDate, $endDate, $limit, $offset, $senders); try { $options = $this->createHttpClientOption(); @@ -2472,23 +2539,15 @@ public function sendTemplateWithHttpInfo($templateId, $sendEmail) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SendinBlue\Client\Model\SendTemplateEmail', + '\SendinBlue\Client\Model\GetTransacBlockedContacts', $e->getResponseHeaders() ); $e->setResponseObject($data); break; case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\SendinBlue\Client\Model\PostSendFailed', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', @@ -2502,19 +2561,22 @@ public function sendTemplateWithHttpInfo($templateId, $sendEmail) } /** - * Operation sendTemplateAsync + * Operation getTransacBlockedContactsAsync * - * Send a template + * Get the list of blocked or unsubscribed transactional contacts * - * @param int $templateId Id of the template (required) - * @param \SendinBlue\Client\Model\SendEmail $sendEmail (required) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document on the page (optional, default to 0) + * @param string[] $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendTemplateAsync($templateId, $sendEmail) + public function getTransacBlockedContactsAsync($startDate = null, $endDate = null, $limit = '50', $offset = '0', $senders = null) { - return $this->sendTemplateAsyncWithHttpInfo($templateId, $sendEmail) + return $this->getTransacBlockedContactsAsyncWithHttpInfo($startDate, $endDate, $limit, $offset, $senders) ->then( function ($response) { return $response[0]; @@ -2523,20 +2585,23 @@ function ($response) { } /** - * Operation sendTemplateAsyncWithHttpInfo + * Operation getTransacBlockedContactsAsyncWithHttpInfo * - * Send a template + * Get the list of blocked or unsubscribed transactional contacts * - * @param int $templateId Id of the template (required) - * @param \SendinBlue\Client\Model\SendEmail $sendEmail (required) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document on the page (optional, default to 0) + * @param string[] $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendTemplateAsyncWithHttpInfo($templateId, $sendEmail) + public function getTransacBlockedContactsAsyncWithHttpInfo($startDate = null, $endDate = null, $limit = '50', $offset = '0', $senders = null) { - $returnType = '\SendinBlue\Client\Model\SendTemplateEmail'; - $request = $this->sendTemplateRequest($templateId, $sendEmail); + $returnType = '\SendinBlue\Client\Model\GetTransacBlockedContacts'; + $request = $this->getTransacBlockedContactsRequest($startDate, $endDate, $limit, $offset, $senders); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2576,51 +2641,58 @@ function ($exception) { } /** - * Create request for operation 'sendTemplate' + * Create request for operation 'getTransacBlockedContacts' * - * @param int $templateId Id of the template (required) - * @param \SendinBlue\Client\Model\SendEmail $sendEmail (required) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts (optional) + * @param int $limit Number of documents returned per page (optional, default to 50) + * @param int $offset Index of the first document on the page (optional, default to 0) + * @param string[] $senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function sendTemplateRequest($templateId, $sendEmail) + protected function getTransacBlockedContactsRequest($startDate = null, $endDate = null, $limit = '50', $offset = '0', $senders = null) { - // verify the required parameter 'templateId' is set - if ($templateId === null) { - throw new \InvalidArgumentException( - 'Missing the required parameter $templateId when calling sendTemplate' - ); - } - // verify the required parameter 'sendEmail' is set - if ($sendEmail === null) { - throw new \InvalidArgumentException( - 'Missing the required parameter $sendEmail when calling sendTemplate' - ); + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling SMTPApi.getTransacBlockedContacts, must be smaller than or equal to 100.'); } - $resourcePath = '/smtp/templates/{templateId}/send'; + + $resourcePath = '/smtp/blockedContacts'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - // path params - if ($templateId !== null) { - $resourcePath = str_replace( - '{' . 'templateId' . '}', - ObjectSerializer::toPathValue($templateId), - $resourcePath - ); + // query params + if ($startDate !== null) { + $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate); + } + // query params + if ($endDate !== null) { + $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate); + } + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset); + } + // query params + if (is_array($senders)) { + $queryParams['senders'] = $senders; + } else + if ($senders !== null) { + $queryParams['senders'] = ObjectSerializer::toQueryValue($senders); } + // body params $_tempBody = null; - if (isset($sendEmail)) { - $_tempBody = $sendEmail; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2637,9 +2709,16 @@ protected function sendTemplateRequest($templateId, $sendEmail) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2686,7 +2765,7 @@ protected function sendTemplateRequest($templateId, $sendEmail) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2694,38 +2773,37 @@ protected function sendTemplateRequest($templateId, $sendEmail) } /** - * Operation sendTestTemplate + * Operation getTransacEmailContent * - * Send a template to your test list + * Get the personalized content of a sent transactional email * - * @param int $templateId Id of the template (required) - * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail sendTestEmail (required) + * @param string $uuid Unique id of the transactional email that has been sent to a particular contact (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \SendinBlue\Client\Model\GetTransacEmailContent */ - public function sendTestTemplate($templateId, $sendTestEmail) + public function getTransacEmailContent($uuid) { - $this->sendTestTemplateWithHttpInfo($templateId, $sendTestEmail); + list($response) = $this->getTransacEmailContentWithHttpInfo($uuid); + return $response; } /** - * Operation sendTestTemplateWithHttpInfo + * Operation getTransacEmailContentWithHttpInfo * - * Send a template to your test list + * Get the personalized content of a sent transactional email * - * @param int $templateId Id of the template (required) - * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail (required) + * @param string $uuid Unique id of the transactional email that has been sent to a particular contact (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \SendinBlue\Client\Model\GetTransacEmailContent, HTTP status code, HTTP response headers (array of strings) */ - public function sendTestTemplateWithHttpInfo($templateId, $sendTestEmail) + public function getTransacEmailContentWithHttpInfo($uuid) { - $returnType = ''; - $request = $this->sendTestTemplateRequest($templateId, $sendTestEmail); + $returnType = '\SendinBlue\Client\Model\GetTransacEmailContent'; + $request = $this->getTransacEmailContentRequest($uuid); try { $options = $this->createHttpClientOption(); @@ -2755,22 +2833,28 @@ public function sendTestTemplateWithHttpInfo($templateId, $sendTestEmail) ); } - return [null, $statusCode, $response->getHeaders()]; + $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 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\SendinBlue\Client\Model\PostSendFailed', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SendinBlue\Client\Model\ErrorModel', + '\SendinBlue\Client\Model\GetTransacEmailContent', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2781,19 +2865,18 @@ public function sendTestTemplateWithHttpInfo($templateId, $sendTestEmail) } /** - * Operation sendTestTemplateAsync + * Operation getTransacEmailContentAsync * - * Send a template to your test list + * Get the personalized content of a sent transactional email * - * @param int $templateId Id of the template (required) - * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail (required) + * @param string $uuid Unique id of the transactional email that has been sent to a particular contact (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendTestTemplateAsync($templateId, $sendTestEmail) + public function getTransacEmailContentAsync($uuid) { - return $this->sendTestTemplateAsyncWithHttpInfo($templateId, $sendTestEmail) + return $this->getTransacEmailContentAsyncWithHttpInfo($uuid) ->then( function ($response) { return $response[0]; @@ -2802,26 +2885,39 @@ function ($response) { } /** - * Operation sendTestTemplateAsyncWithHttpInfo + * Operation getTransacEmailContentAsyncWithHttpInfo * - * Send a template to your test list + * Get the personalized content of a sent transactional email * - * @param int $templateId Id of the template (required) - * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail (required) + * @param string $uuid Unique id of the transactional email that has been sent to a particular contact (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendTestTemplateAsyncWithHttpInfo($templateId, $sendTestEmail) + public function getTransacEmailContentAsyncWithHttpInfo($uuid) { - $returnType = ''; - $request = $this->sendTestTemplateRequest($templateId, $sendTestEmail); + $returnType = '\SendinBlue\Client\Model\GetTransacEmailContent'; + $request = $this->getTransacEmailContentRequest($uuid); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $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(); @@ -2841,30 +2937,23 @@ function ($exception) { } /** - * Create request for operation 'sendTestTemplate' + * Create request for operation 'getTransacEmailContent' * - * @param int $templateId Id of the template (required) - * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail (required) + * @param string $uuid Unique id of the transactional email that has been sent to a particular contact (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function sendTestTemplateRequest($templateId, $sendTestEmail) + protected function getTransacEmailContentRequest($uuid) { - // verify the required parameter 'templateId' is set - if ($templateId === null) { + // verify the required parameter 'uuid' is set + if ($uuid === null || (is_array($uuid) && count($uuid) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $templateId when calling sendTestTemplate' - ); - } - // verify the required parameter 'sendTestEmail' is set - if ($sendTestEmail === null) { - throw new \InvalidArgumentException( - 'Missing the required parameter $sendTestEmail when calling sendTestTemplate' + 'Missing the required parameter $uuid when calling getTransacEmailContent' ); } - $resourcePath = '/smtp/templates/{templateId}/sendTest'; + $resourcePath = '/smtp/emails/{uuid}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2873,19 +2962,16 @@ protected function sendTestTemplateRequest($templateId, $sendTestEmail) // path params - if ($templateId !== null) { + if ($uuid !== null) { $resourcePath = str_replace( - '{' . 'templateId' . '}', - ObjectSerializer::toPathValue($templateId), + '{' . 'uuid' . '}', + ObjectSerializer::toPathValue($uuid), $resourcePath ); } // body params $_tempBody = null; - if (isset($sendTestEmail)) { - $_tempBody = $sendTestEmail; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2902,9 +2988,16 @@ protected function sendTestTemplateRequest($templateId, $sendTestEmail) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -2951,7 +3044,7 @@ protected function sendTestTemplateRequest($templateId, $sendTestEmail) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2959,37 +3052,45 @@ protected function sendTestTemplateRequest($templateId, $sendTestEmail) } /** - * Operation sendTransacEmail + * Operation getTransacEmailsList * - * Send a transactional email + * Get the list of transactional emails on the basis of allowed filters * - * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * @param string $email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) + * @param int $templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) + * @param string $messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SendinBlue\Client\Model\CreateSmtpEmail + * @return \SendinBlue\Client\Model\GetTransacEmailsList */ - public function sendTransacEmail($sendSmtpEmail) + public function getTransacEmailsList($email = null, $templateId = null, $messageId = null, $startDate = null, $endDate = null) { - list($response) = $this->sendTransacEmailWithHttpInfo($sendSmtpEmail); + list($response) = $this->getTransacEmailsListWithHttpInfo($email, $templateId, $messageId, $startDate, $endDate); return $response; } /** - * Operation sendTransacEmailWithHttpInfo + * Operation getTransacEmailsListWithHttpInfo * - * Send a transactional email + * Get the list of transactional emails on the basis of allowed filters * - * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * @param string $email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) + * @param int $templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) + * @param string $messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SendinBlue\Client\Model\CreateSmtpEmail, HTTP status code, HTTP response headers (array of strings) + * @return array of \SendinBlue\Client\Model\GetTransacEmailsList, HTTP status code, HTTP response headers (array of strings) */ - public function sendTransacEmailWithHttpInfo($sendSmtpEmail) + public function getTransacEmailsListWithHttpInfo($email = null, $templateId = null, $messageId = null, $startDate = null, $endDate = null) { - $returnType = '\SendinBlue\Client\Model\CreateSmtpEmail'; - $request = $this->sendTransacEmailRequest($sendSmtpEmail); + $returnType = '\SendinBlue\Client\Model\GetTransacEmailsList'; + $request = $this->getTransacEmailsListRequest($email, $templateId, $messageId, $startDate, $endDate); try { $options = $this->createHttpClientOption(); @@ -3037,10 +3138,10 @@ public function sendTransacEmailWithHttpInfo($sendSmtpEmail) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SendinBlue\Client\Model\CreateSmtpEmail', + '\SendinBlue\Client\Model\GetTransacEmailsList', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3059,18 +3160,22 @@ public function sendTransacEmailWithHttpInfo($sendSmtpEmail) } /** - * Operation sendTransacEmailAsync + * Operation getTransacEmailsListAsync * - * Send a transactional email + * Get the list of transactional emails on the basis of allowed filters * - * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * @param string $email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) + * @param int $templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) + * @param string $messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendTransacEmailAsync($sendSmtpEmail) + public function getTransacEmailsListAsync($email = null, $templateId = null, $messageId = null, $startDate = null, $endDate = null) { - return $this->sendTransacEmailAsyncWithHttpInfo($sendSmtpEmail) + return $this->getTransacEmailsListAsyncWithHttpInfo($email, $templateId, $messageId, $startDate, $endDate) ->then( function ($response) { return $response[0]; @@ -3079,19 +3184,23 @@ function ($response) { } /** - * Operation sendTransacEmailAsyncWithHttpInfo + * Operation getTransacEmailsListAsyncWithHttpInfo * - * Send a transactional email + * Get the list of transactional emails on the basis of allowed filters * - * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * @param string $email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) + * @param int $templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) + * @param string $messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendTransacEmailAsyncWithHttpInfo($sendSmtpEmail) + public function getTransacEmailsListAsyncWithHttpInfo($email = null, $templateId = null, $messageId = null, $startDate = null, $endDate = null) { - $returnType = '\SendinBlue\Client\Model\CreateSmtpEmail'; - $request = $this->sendTransacEmailRequest($sendSmtpEmail); + $returnType = '\SendinBlue\Client\Model\GetTransacEmailsList'; + $request = $this->getTransacEmailsListRequest($email, $templateId, $messageId, $startDate, $endDate); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3131,37 +3240,1431 @@ function ($exception) { } /** - * Create request for operation 'sendTransacEmail' + * Create request for operation 'getTransacEmailsList' * - * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * @param string $email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. (optional) + * @param int $templateId Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. (optional) + * @param string $messageId Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month. (optional) + * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function sendTransacEmailRequest($sendSmtpEmail) + protected function getTransacEmailsListRequest($email = null, $templateId = null, $messageId = null, $startDate = null, $endDate = null) { - // verify the required parameter 'sendSmtpEmail' is set - if ($sendSmtpEmail === null) { - throw new \InvalidArgumentException( - 'Missing the required parameter $sendSmtpEmail when calling sendTransacEmail' - ); - } - $resourcePath = '/smtp/email'; + $resourcePath = '/smtp/emails'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - - // body params + // query params + if ($email !== null) { + $queryParams['email'] = ObjectSerializer::toQueryValue($email); + } + // query params + if ($templateId !== null) { + $queryParams['templateId'] = ObjectSerializer::toQueryValue($templateId); + } + // query params + if ($messageId !== null) { + $queryParams['messageId'] = ObjectSerializer::toQueryValue($messageId); + } + // query params + if ($startDate !== null) { + $queryParams['startDate'] = ObjectSerializer::toQueryValue($startDate); + } + // query params + if ($endDate !== null) { + $queryParams['endDate'] = ObjectSerializer::toQueryValue($endDate); + } + + + // 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\build_query($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\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendTemplate + * + * Send a template + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendEmail $sendEmail sendEmail (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\SendTemplateEmail + */ + public function sendTemplate($templateId, $sendEmail) + { + list($response) = $this->sendTemplateWithHttpInfo($templateId, $sendEmail); + return $response; + } + + /** + * Operation sendTemplateWithHttpInfo + * + * Send a template + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendEmail $sendEmail (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\SendTemplateEmail, HTTP status code, HTTP response headers (array of strings) + */ + public function sendTemplateWithHttpInfo($templateId, $sendEmail) + { + $returnType = '\SendinBlue\Client\Model\SendTemplateEmail'; + $request = $this->sendTemplateRequest($templateId, $sendEmail); + + 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(), + '\SendinBlue\Client\Model\SendTemplateEmail', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\PostSendFailed', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendTemplateAsync + * + * Send a template + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendEmail $sendEmail (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTemplateAsync($templateId, $sendEmail) + { + return $this->sendTemplateAsyncWithHttpInfo($templateId, $sendEmail) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendTemplateAsyncWithHttpInfo + * + * Send a template + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendEmail $sendEmail (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTemplateAsyncWithHttpInfo($templateId, $sendEmail) + { + $returnType = '\SendinBlue\Client\Model\SendTemplateEmail'; + $request = $this->sendTemplateRequest($templateId, $sendEmail); + + 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 'sendTemplate' + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendEmail $sendEmail (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendTemplateRequest($templateId, $sendEmail) + { + // verify the required parameter 'templateId' is set + if ($templateId === null || (is_array($templateId) && count($templateId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $templateId when calling sendTemplate' + ); + } + // verify the required parameter 'sendEmail' is set + if ($sendEmail === null || (is_array($sendEmail) && count($sendEmail) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sendEmail when calling sendTemplate' + ); + } + + $resourcePath = '/smtp/templates/{templateId}/send'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($templateId !== null) { + $resourcePath = str_replace( + '{' . 'templateId' . '}', + ObjectSerializer::toPathValue($templateId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($sendEmail)) { + $_tempBody = $sendEmail; + } + + 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\build_query($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\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendTestTemplate + * + * Send a template to your test list + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail sendTestEmail (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function sendTestTemplate($templateId, $sendTestEmail) + { + $this->sendTestTemplateWithHttpInfo($templateId, $sendTestEmail); + } + + /** + * Operation sendTestTemplateWithHttpInfo + * + * Send a template to your test list + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function sendTestTemplateWithHttpInfo($templateId, $sendTestEmail) + { + $returnType = ''; + $request = $this->sendTestTemplateRequest($templateId, $sendTestEmail); + + 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(), + '\SendinBlue\Client\Model\PostSendFailed', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendTestTemplateAsync + * + * Send a template to your test list + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTestTemplateAsync($templateId, $sendTestEmail) + { + return $this->sendTestTemplateAsyncWithHttpInfo($templateId, $sendTestEmail) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendTestTemplateAsyncWithHttpInfo + * + * Send a template to your test list + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTestTemplateAsyncWithHttpInfo($templateId, $sendTestEmail) + { + $returnType = ''; + $request = $this->sendTestTemplateRequest($templateId, $sendTestEmail); + + 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 'sendTestTemplate' + * + * @param int $templateId Id of the template (required) + * @param \SendinBlue\Client\Model\SendTestEmail $sendTestEmail (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendTestTemplateRequest($templateId, $sendTestEmail) + { + // verify the required parameter 'templateId' is set + if ($templateId === null || (is_array($templateId) && count($templateId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $templateId when calling sendTestTemplate' + ); + } + // verify the required parameter 'sendTestEmail' is set + if ($sendTestEmail === null || (is_array($sendTestEmail) && count($sendTestEmail) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sendTestEmail when calling sendTestTemplate' + ); + } + + $resourcePath = '/smtp/templates/{templateId}/sendTest'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($templateId !== null) { + $resourcePath = str_replace( + '{' . 'templateId' . '}', + ObjectSerializer::toPathValue($templateId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($sendTestEmail)) { + $_tempBody = $sendTestEmail; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // 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\build_query($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\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sendTransacEmail + * + * Send a transactional email + * + * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateSmtpEmail + */ + public function sendTransacEmail($sendSmtpEmail) + { + list($response) = $this->sendTransacEmailWithHttpInfo($sendSmtpEmail); + return $response; + } + + /** + * Operation sendTransacEmailWithHttpInfo + * + * Send a transactional email + * + * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateSmtpEmail, HTTP status code, HTTP response headers (array of strings) + */ + public function sendTransacEmailWithHttpInfo($sendSmtpEmail) + { + $returnType = '\SendinBlue\Client\Model\CreateSmtpEmail'; + $request = $this->sendTransacEmailRequest($sendSmtpEmail); + + 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(), + '\SendinBlue\Client\Model\CreateSmtpEmail', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sendTransacEmailAsync + * + * Send a transactional email + * + * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTransacEmailAsync($sendSmtpEmail) + { + return $this->sendTransacEmailAsyncWithHttpInfo($sendSmtpEmail) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sendTransacEmailAsyncWithHttpInfo + * + * Send a transactional email + * + * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sendTransacEmailAsyncWithHttpInfo($sendSmtpEmail) + { + $returnType = '\SendinBlue\Client\Model\CreateSmtpEmail'; + $request = $this->sendTransacEmailRequest($sendSmtpEmail); + + 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 'sendTransacEmail' + * + * @param \SendinBlue\Client\Model\SendSmtpEmail $sendSmtpEmail Values to send a transactional email (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sendTransacEmailRequest($sendSmtpEmail) + { + // verify the required parameter 'sendSmtpEmail' is set + if ($sendSmtpEmail === null || (is_array($sendSmtpEmail) && count($sendSmtpEmail) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sendSmtpEmail when calling sendTransacEmail' + ); + } + + $resourcePath = '/smtp/email'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($sendSmtpEmail)) { + $_tempBody = $sendSmtpEmail; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // 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\build_query($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\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation smtpBlockedContactsEmailDelete + * + * Unblock or resubscribe a transactional contact + * + * @param string $email contact email (urlencoded) to unblock. (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function smtpBlockedContactsEmailDelete($email) + { + $this->smtpBlockedContactsEmailDeleteWithHttpInfo($email); + } + + /** + * Operation smtpBlockedContactsEmailDeleteWithHttpInfo + * + * Unblock or resubscribe a transactional contact + * + * @param string $email contact email (urlencoded) to unblock. (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function smtpBlockedContactsEmailDeleteWithHttpInfo($email) + { + $returnType = ''; + $request = $this->smtpBlockedContactsEmailDeleteRequest($email); + + 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(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation smtpBlockedContactsEmailDeleteAsync + * + * Unblock or resubscribe a transactional contact + * + * @param string $email contact email (urlencoded) to unblock. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function smtpBlockedContactsEmailDeleteAsync($email) + { + return $this->smtpBlockedContactsEmailDeleteAsyncWithHttpInfo($email) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation smtpBlockedContactsEmailDeleteAsyncWithHttpInfo + * + * Unblock or resubscribe a transactional contact + * + * @param string $email contact email (urlencoded) to unblock. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function smtpBlockedContactsEmailDeleteAsyncWithHttpInfo($email) + { + $returnType = ''; + $request = $this->smtpBlockedContactsEmailDeleteRequest($email); + + 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 'smtpBlockedContactsEmailDelete' + * + * @param string $email contact email (urlencoded) to unblock. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function smtpBlockedContactsEmailDeleteRequest($email) + { + // verify the required parameter 'email' is set + if ($email === null || (is_array($email) && count($email) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $email when calling smtpBlockedContactsEmailDelete' + ); + } + + $resourcePath = '/smtp/blockedContacts/{email}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($email !== null) { + $resourcePath = str_replace( + '{' . 'email' . '}', + ObjectSerializer::toPathValue($email), + $resourcePath + ); + } + + // body params $_tempBody = null; - if (isset($sendSmtpEmail)) { - $_tempBody = $sendSmtpEmail; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // 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\build_query($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\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation smtpLogMessageIdDelete + * + * Delete an SMTP transactional log + * + * @param string $messageId MessageId of the transactional log to delete (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function smtpLogMessageIdDelete($messageId) + { + $this->smtpLogMessageIdDeleteWithHttpInfo($messageId); + } + + /** + * Operation smtpLogMessageIdDeleteWithHttpInfo + * + * Delete an SMTP transactional log + * + * @param string $messageId MessageId of the transactional log to delete (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function smtpLogMessageIdDeleteWithHttpInfo($messageId) + { + $returnType = ''; + $request = $this->smtpLogMessageIdDeleteRequest($messageId); + + 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(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation smtpLogMessageIdDeleteAsync + * + * Delete an SMTP transactional log + * + * @param string $messageId MessageId of the transactional log to delete (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function smtpLogMessageIdDeleteAsync($messageId) + { + return $this->smtpLogMessageIdDeleteAsyncWithHttpInfo($messageId) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation smtpLogMessageIdDeleteAsyncWithHttpInfo + * + * Delete an SMTP transactional log + * + * @param string $messageId MessageId of the transactional log to delete (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function smtpLogMessageIdDeleteAsyncWithHttpInfo($messageId) + { + $returnType = ''; + $request = $this->smtpLogMessageIdDeleteRequest($messageId); + + 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 'smtpLogMessageIdDelete' + * + * @param string $messageId MessageId of the transactional log to delete (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function smtpLogMessageIdDeleteRequest($messageId) + { + // verify the required parameter 'messageId' is set + if ($messageId === null || (is_array($messageId) && count($messageId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $messageId when calling smtpLogMessageIdDelete' + ); + } + + $resourcePath = '/smtp/log/{messageId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($messageId !== null) { + $resourcePath = str_replace( + '{' . 'messageId' . '}', + ObjectSerializer::toPathValue($messageId), + $resourcePath + ); } + // body params + $_tempBody = null; + if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] @@ -3177,9 +4680,16 @@ protected function sendTransacEmailRequest($sendSmtpEmail) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -3226,7 +4736,7 @@ protected function sendTransacEmailRequest($sendSmtpEmail) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3236,10 +4746,10 @@ protected function sendTransacEmailRequest($sendSmtpEmail) /** * Operation updateSmtpTemplate * - * Updates an smtp templates + * Updates a transactional email templates * * @param int $templateId id of the template (required) - * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in transactional email template (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3253,10 +4763,10 @@ public function updateSmtpTemplate($templateId, $smtpTemplate) /** * Operation updateSmtpTemplateWithHttpInfo * - * Updates an smtp templates + * Updates a transactional email templates * * @param int $templateId id of the template (required) - * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in transactional email template (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3323,10 +4833,10 @@ public function updateSmtpTemplateWithHttpInfo($templateId, $smtpTemplate) /** * Operation updateSmtpTemplateAsync * - * Updates an smtp templates + * Updates a transactional email templates * * @param int $templateId id of the template (required) - * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in transactional email template (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3344,10 +4854,10 @@ function ($response) { /** * Operation updateSmtpTemplateAsyncWithHttpInfo * - * Updates an smtp templates + * Updates a transactional email templates * * @param int $templateId id of the template (required) - * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in transactional email template (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -3384,7 +4894,7 @@ function ($exception) { * Create request for operation 'updateSmtpTemplate' * * @param int $templateId id of the template (required) - * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in smtp template (required) + * @param \SendinBlue\Client\Model\UpdateSmtpTemplate $smtpTemplate values to update in transactional email template (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request @@ -3392,13 +4902,13 @@ function ($exception) { protected function updateSmtpTemplateRequest($templateId, $smtpTemplate) { // verify the required parameter 'templateId' is set - if ($templateId === null) { + if ($templateId === null || (is_array($templateId) && count($templateId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $templateId when calling updateSmtpTemplate' ); } // verify the required parameter 'smtpTemplate' is set - if ($smtpTemplate === null) { + if ($smtpTemplate === null || (is_array($smtpTemplate) && count($smtpTemplate) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $smtpTemplate when calling updateSmtpTemplate' ); @@ -3442,9 +4952,16 @@ protected function updateSmtpTemplateRequest($templateId, $smtpTemplate) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/Api/SendersApi.php b/lib/Api/SendersApi.php index fade455f..4a2cde4a 100644 --- a/lib/Api/SendersApi.php +++ b/lib/Api/SendersApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ class SendersApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -295,9 +300,16 @@ protected function createSenderRequest($sender = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -505,7 +517,7 @@ function ($exception) { protected function deleteSenderRequest($senderId) { // verify the required parameter 'senderId' is set - if ($senderId === null) { + if ($senderId === null || (is_array($senderId) && count($senderId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $senderId when calling deleteSender' ); @@ -546,9 +558,16 @@ protected function deleteSenderRequest($senderId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -799,9 +818,16 @@ protected function getIpsRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1046,7 +1072,7 @@ function ($exception) { protected function getIpsFromSenderRequest($senderId) { // verify the required parameter 'senderId' is set - if ($senderId === null) { + if ($senderId === null || (is_array($senderId) && count($senderId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $senderId when calling getIpsFromSender' ); @@ -1087,9 +1113,16 @@ protected function getIpsFromSenderRequest($senderId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1366,9 +1399,16 @@ protected function getSendersRequest($ip = null, $domain = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1581,7 +1621,7 @@ function ($exception) { protected function updateSenderRequest($senderId, $sender = null) { // verify the required parameter 'senderId' is set - if ($senderId === null) { + if ($senderId === null || (is_array($senderId) && count($senderId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $senderId when calling updateSender' ); @@ -1625,9 +1665,16 @@ protected function updateSenderRequest($senderId, $sender = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/Api/TransactionalSMSApi.php b/lib/Api/TransactionalSMSApi.php index 3391fdfb..b316d6d6 100644 --- a/lib/Api/TransactionalSMSApi.php +++ b/lib/Api/TransactionalSMSApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ class TransactionalSMSApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -363,9 +368,16 @@ protected function getSmsEventsRequest($limit = '50', $startDate = null, $endDat if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -660,9 +672,16 @@ protected function getTransacAggregatedSmsReportRequest($startDate = null, $endD if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -957,9 +976,16 @@ protected function getTransacSmsReportRequest($startDate = null, $endDate = null if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1204,7 +1230,7 @@ function ($exception) { protected function sendTransacSmsRequest($sendTransacSms) { // verify the required parameter 'sendTransacSms' is set - if ($sendTransacSms === null) { + if ($sendTransacSms === null || (is_array($sendTransacSms) && count($sendTransacSms) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $sendTransacSms when calling sendTransacSms' ); @@ -1240,9 +1266,16 @@ protected function sendTransacSmsRequest($sendTransacSms) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/Api/WebhooksApi.php b/lib/Api/WebhooksApi.php index 38c7116e..b3453709 100644 --- a/lib/Api/WebhooksApi.php +++ b/lib/Api/WebhooksApi.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ class WebhooksApi */ protected $config; + /** + * @var HeaderSelector + */ + protected $headerSelector; + /** * @param ClientInterface $client * @param Configuration $config @@ -265,7 +270,7 @@ function ($exception) { protected function createWebhookRequest($createWebhook) { // verify the required parameter 'createWebhook' is set - if ($createWebhook === null) { + if ($createWebhook === null || (is_array($createWebhook) && count($createWebhook) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $createWebhook when calling createWebhook' ); @@ -301,9 +306,16 @@ protected function createWebhookRequest($createWebhook) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -511,7 +523,7 @@ function ($exception) { protected function deleteWebhookRequest($webhookId) { // verify the required parameter 'webhookId' is set - if ($webhookId === null) { + if ($webhookId === null || (is_array($webhookId) && count($webhookId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $webhookId when calling deleteWebhook' ); @@ -552,9 +564,16 @@ protected function deleteWebhookRequest($webhookId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -799,7 +818,7 @@ function ($exception) { protected function getWebhookRequest($webhookId) { // verify the required parameter 'webhookId' is set - if ($webhookId === null) { + if ($webhookId === null || (is_array($webhookId) && count($webhookId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $webhookId when calling getWebhook' ); @@ -840,9 +859,16 @@ protected function getWebhookRequest($webhookId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1110,9 +1136,16 @@ protected function getWebhooksRequest($type = 'transactional') if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { @@ -1325,13 +1358,13 @@ function ($exception) { protected function updateWebhookRequest($webhookId, $updateWebhook) { // verify the required parameter 'webhookId' is set - if ($webhookId === null) { + if ($webhookId === null || (is_array($webhookId) && count($webhookId) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $webhookId when calling updateWebhook' ); } // verify the required parameter 'updateWebhook' is set - if ($updateWebhook === null) { + if ($updateWebhook === null || (is_array($updateWebhook) && count($updateWebhook) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $updateWebhook when calling updateWebhook' ); @@ -1375,9 +1408,16 @@ protected function updateWebhookRequest($webhookId, $updateWebhook) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($httpBody); + + 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) { diff --git a/lib/ApiException.php b/lib/ApiException.php index ff45e00f..f9783cc5 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/lib/Configuration.php b/lib/Configuration.php index 06d6bb5e..f99275fc 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index 214dff62..56b557d8 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/lib/Model/AbTestCampaignResult.php b/lib/Model/AbTestCampaignResult.php new file mode 100644 index 00000000..1b81c77e --- /dev/null +++ b/lib/Model/AbTestCampaignResult.php @@ -0,0 +1,515 @@ + 'string', + 'winningCriteria' => 'string', + 'winningSubjectLine' => 'string', + 'openRate' => 'string', + 'clickRate' => 'string', + 'winningVersionRate' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'winningVersion' => null, + 'winningCriteria' => null, + 'winningSubjectLine' => null, + 'openRate' => null, + 'clickRate' => null, + 'winningVersionRate' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'winningVersion' => 'winningVersion', + 'winningCriteria' => 'winningCriteria', + 'winningSubjectLine' => 'winningSubjectLine', + 'openRate' => 'openRate', + 'clickRate' => 'clickRate', + 'winningVersionRate' => 'winningVersionRate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'winningVersion' => 'setWinningVersion', + 'winningCriteria' => 'setWinningCriteria', + 'winningSubjectLine' => 'setWinningSubjectLine', + 'openRate' => 'setOpenRate', + 'clickRate' => 'setClickRate', + 'winningVersionRate' => 'setWinningVersionRate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'winningVersion' => 'getWinningVersion', + 'winningCriteria' => 'getWinningCriteria', + 'winningSubjectLine' => 'getWinningSubjectLine', + 'openRate' => 'getOpenRate', + 'clickRate' => 'getClickRate', + 'winningVersionRate' => 'getWinningVersionRate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const WINNING_VERSION_NOT_AVAILABLE = 'notAvailable'; + const WINNING_VERSION_PENDING = 'pending'; + const WINNING_VERSION_TIE = 'tie'; + const WINNING_VERSION_A = 'A'; + const WINNING_VERSION_B = 'B'; + const WINNING_CRITERIA_OPEN = 'Open'; + const WINNING_CRITERIA_CLICK = 'Click'; + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getWinningVersionAllowableValues() + { + return [ + self::WINNING_VERSION_NOT_AVAILABLE, + self::WINNING_VERSION_PENDING, + self::WINNING_VERSION_TIE, + self::WINNING_VERSION_A, + self::WINNING_VERSION_B, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getWinningCriteriaAllowableValues() + { + return [ + self::WINNING_CRITERIA_OPEN, + self::WINNING_CRITERIA_CLICK, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['winningVersion'] = isset($data['winningVersion']) ? $data['winningVersion'] : null; + $this->container['winningCriteria'] = isset($data['winningCriteria']) ? $data['winningCriteria'] : null; + $this->container['winningSubjectLine'] = isset($data['winningSubjectLine']) ? $data['winningSubjectLine'] : null; + $this->container['openRate'] = isset($data['openRate']) ? $data['openRate'] : null; + $this->container['clickRate'] = isset($data['clickRate']) ? $data['clickRate'] : null; + $this->container['winningVersionRate'] = isset($data['winningVersionRate']) ? $data['winningVersionRate'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getWinningVersionAllowableValues(); + if (!is_null($this->container['winningVersion']) && !in_array($this->container['winningVersion'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'winningVersion', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getWinningCriteriaAllowableValues(); + if (!is_null($this->container['winningCriteria']) && !in_array($this->container['winningCriteria'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'winningCriteria', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets winningVersion + * + * @return string + */ + public function getWinningVersion() + { + return $this->container['winningVersion']; + } + + /** + * Sets winningVersion + * + * @param string $winningVersion Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. + * + * @return $this + */ + public function setWinningVersion($winningVersion) + { + $allowedValues = $this->getWinningVersionAllowableValues(); + if (!is_null($winningVersion) && !in_array($winningVersion, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'winningVersion', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['winningVersion'] = $winningVersion; + + return $this; + } + + /** + * Gets winningCriteria + * + * @return string + */ + public function getWinningCriteria() + { + return $this->container['winningCriteria']; + } + + /** + * Sets winningCriteria + * + * @param string $winningCriteria Criteria choosen for winning version (Open/Click) + * + * @return $this + */ + public function setWinningCriteria($winningCriteria) + { + $allowedValues = $this->getWinningCriteriaAllowableValues(); + if (!is_null($winningCriteria) && !in_array($winningCriteria, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'winningCriteria', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['winningCriteria'] = $winningCriteria; + + return $this; + } + + /** + * Gets winningSubjectLine + * + * @return string + */ + public function getWinningSubjectLine() + { + return $this->container['winningSubjectLine']; + } + + /** + * Sets winningSubjectLine + * + * @param string $winningSubjectLine Subject Line of current winning version + * + * @return $this + */ + public function setWinningSubjectLine($winningSubjectLine) + { + $this->container['winningSubjectLine'] = $winningSubjectLine; + + return $this; + } + + /** + * Gets openRate + * + * @return string + */ + public function getOpenRate() + { + return $this->container['openRate']; + } + + /** + * Sets openRate + * + * @param string $openRate Open rate for current winning version + * + * @return $this + */ + public function setOpenRate($openRate) + { + $this->container['openRate'] = $openRate; + + return $this; + } + + /** + * Gets clickRate + * + * @return string + */ + public function getClickRate() + { + return $this->container['clickRate']; + } + + /** + * Sets clickRate + * + * @param string $clickRate Click rate for current winning version + * + * @return $this + */ + public function setClickRate($clickRate) + { + $this->container['clickRate'] = $clickRate; + + return $this; + } + + /** + * Gets winningVersionRate + * + * @return string + */ + public function getWinningVersionRate() + { + return $this->container['winningVersionRate']; + } + + /** + * Sets winningVersionRate + * + * @param string $winningVersionRate Open/Click rate for the winner version + * + * @return $this + */ + public function setWinningVersionRate($winningVersionRate) + { + $this->container['winningVersionRate'] = $winningVersionRate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/lib/Model/AddChildDomain.php b/lib/Model/AddChildDomain.php index 3c24c860..b1392512 100644 --- a/lib/Model/AddChildDomain.php +++ b/lib/Model/AddChildDomain.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/AddContactToList.php b/lib/Model/AddContactToList.php index 673e1ed8..fb832968 100644 --- a/lib/Model/AddContactToList.php +++ b/lib/Model/AddContactToList.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/AddCredits.php b/lib/Model/AddCredits.php index 1714ad18..cbf0dde5 100644 --- a/lib/Model/AddCredits.php +++ b/lib/Model/AddCredits.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -206,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateAttribute.php b/lib/Model/CreateAttribute.php index 86a338ad..da409c8f 100644 --- a/lib/Model/CreateAttribute.php +++ b/lib/Model/CreateAttribute.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -225,7 +225,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'type', must be one of '%s'", implode("', '", $allowedValues) @@ -243,12 +243,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -320,7 +315,7 @@ public function getType() public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($type) && !in_array($type, $allowedValues)) { + if (!is_null($type) && !in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'type', must be one of '%s'", diff --git a/lib/Model/CreateAttributeEnumeration.php b/lib/Model/CreateAttributeEnumeration.php index fad0af87..61e60d6e 100644 --- a/lib/Model/CreateAttributeEnumeration.php +++ b/lib/Model/CreateAttributeEnumeration.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['value'] === null) { - return false; - } - if ($this->container['label'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateChild.php b/lib/Model/CreateChild.php index 5e5c9807..6fb54a39 100644 --- a/lib/Model/CreateChild.php +++ b/lib/Model/CreateChild.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -239,23 +239,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - if ($this->container['firstName'] === null) { - return false; - } - if ($this->container['lastName'] === null) { - return false; - } - if ($this->container['companyName'] === null) { - return false; - } - if ($this->container['password'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateContact.php b/lib/Model/CreateContact.php index c362203f..fcf0bd7f 100644 --- a/lib/Model/CreateContact.php +++ b/lib/Model/CreateContact.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -236,8 +236,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -254,7 +253,7 @@ public function getEmail() /** * Sets email * - * @param string $email Email address of the user. Mandatory if \"sms\" field is not passed in \"attributes\" parameter' + * @param string $email Email address of the user. Mandatory if \"SMS\" field is not passed in \"attributes\" parameter. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} * * @return $this */ @@ -278,7 +277,7 @@ public function getAttributes() /** * Sets attributes * - * @param object $attributes Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For example, `{\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"}` + * @param object $attributes Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. `{\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"}` * * @return $this */ @@ -398,7 +397,7 @@ public function getSmtpBlacklistSender() /** * Sets smtpBlacklistSender * - * @param string[] $smtpBlacklistSender SMTP forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) + * @param string[] $smtpBlacklistSender transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) * * @return $this */ diff --git a/lib/Model/CreateEmailCampaign.php b/lib/Model/CreateEmailCampaign.php index 572ab1ba..db00ac93 100644 --- a/lib/Model/CreateEmailCampaign.php +++ b/lib/Model/CreateEmailCampaign.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -81,7 +81,10 @@ class CreateEmailCampaign implements ModelInterface, ArrayAccess 'subjectB' => 'string', 'splitRule' => 'int', 'winnerCriteria' => 'string', - 'winnerDelay' => 'int' + 'winnerDelay' => 'int', + 'ipWarmupEnable' => 'bool', + 'initialQuota' => 'int', + 'increaseRate' => 'int' ]; /** @@ -114,7 +117,10 @@ class CreateEmailCampaign implements ModelInterface, ArrayAccess 'subjectB' => null, 'splitRule' => 'int64', 'winnerCriteria' => null, - 'winnerDelay' => 'int64' + 'winnerDelay' => 'int64', + 'ipWarmupEnable' => null, + 'initialQuota' => 'int64', + 'increaseRate' => 'int64' ]; /** @@ -168,7 +174,10 @@ public static function swaggerFormats() 'subjectB' => 'subjectB', 'splitRule' => 'splitRule', 'winnerCriteria' => 'winnerCriteria', - 'winnerDelay' => 'winnerDelay' + 'winnerDelay' => 'winnerDelay', + 'ipWarmupEnable' => 'ipWarmupEnable', + 'initialQuota' => 'initialQuota', + 'increaseRate' => 'increaseRate' ]; /** @@ -201,7 +210,10 @@ public static function swaggerFormats() 'subjectB' => 'setSubjectB', 'splitRule' => 'setSplitRule', 'winnerCriteria' => 'setWinnerCriteria', - 'winnerDelay' => 'setWinnerDelay' + 'winnerDelay' => 'setWinnerDelay', + 'ipWarmupEnable' => 'setIpWarmupEnable', + 'initialQuota' => 'setInitialQuota', + 'increaseRate' => 'setIncreaseRate' ]; /** @@ -234,7 +246,10 @@ public static function swaggerFormats() 'subjectB' => 'getSubjectB', 'splitRule' => 'getSplitRule', 'winnerCriteria' => 'getWinnerCriteria', - 'winnerDelay' => 'getWinnerDelay' + 'winnerDelay' => 'getWinnerDelay', + 'ipWarmupEnable' => 'getIpWarmupEnable', + 'initialQuota' => 'getInitialQuota', + 'increaseRate' => 'getIncreaseRate' ]; /** @@ -337,6 +352,9 @@ public function __construct(array $data = null) $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null; $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null; $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null; + $this->container['ipWarmupEnable'] = isset($data['ipWarmupEnable']) ? $data['ipWarmupEnable'] : false; + $this->container['initialQuota'] = isset($data['initialQuota']) ? $data['initialQuota'] : null; + $this->container['increaseRate'] = isset($data['increaseRate']) ? $data['increaseRate'] : null; } /** @@ -363,7 +381,7 @@ public function listInvalidProperties() } $allowedValues = $this->getWinnerCriteriaAllowableValues(); - if (!in_array($this->container['winnerCriteria'], $allowedValues)) { + if (!is_null($this->container['winnerCriteria']) && !in_array($this->container['winnerCriteria'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'winnerCriteria', must be one of '%s'", implode("', '", $allowedValues) @@ -378,6 +396,14 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'winnerDelay', must be bigger than or equal to 1."; } + if (!is_null($this->container['increaseRate']) && ($this->container['increaseRate'] > 100)) { + $invalidProperties[] = "invalid value for 'increaseRate', must be smaller than or equal to 100."; + } + + if (!is_null($this->container['increaseRate']) && ($this->container['increaseRate'] < 0)) { + $invalidProperties[] = "invalid value for 'increaseRate', must be bigger than or equal to 0."; + } + return $invalidProperties; } @@ -389,30 +415,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['sender'] === null) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - if ($this->container['splitRule'] > 50) { - return false; - } - if ($this->container['splitRule'] < 1) { - return false; - } - $allowedValues = $this->getWinnerCriteriaAllowableValues(); - if (!in_array($this->container['winnerCriteria'], $allowedValues)) { - return false; - } - if ($this->container['winnerDelay'] > 168) { - return false; - } - if ($this->container['winnerDelay'] < 1) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -549,7 +552,7 @@ public function getTemplateId() /** * Sets templateId * - * @param int $templateId Mandatory if htmlContent and htmlUrl are empty. Id of the SMTP template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. + * @param int $templateId Mandatory if htmlContent and htmlUrl are empty. Id of the transactional email template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. * * @return $this */ @@ -645,7 +648,7 @@ public function getToField() /** * Sets toField * - * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add `{FNAME} {LNAME}`. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use `{{contact.FNAME}} {{contact.LNAME}}` for personalization + * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization * * @return $this */ @@ -996,7 +999,7 @@ public function getWinnerCriteria() public function setWinnerCriteria($winnerCriteria) { $allowedValues = $this->getWinnerCriteriaAllowableValues(); - if (!is_null($winnerCriteria) && !in_array($winnerCriteria, $allowedValues)) { + if (!is_null($winnerCriteria) && !in_array($winnerCriteria, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'winnerCriteria', must be one of '%s'", @@ -1040,6 +1043,86 @@ public function setWinnerDelay($winnerDelay) return $this; } + + /** + * Gets ipWarmupEnable + * + * @return bool + */ + public function getIpWarmupEnable() + { + return $this->container['ipWarmupEnable']; + } + + /** + * Sets ipWarmupEnable + * + * @param bool $ipWarmupEnable Available for dedicated ip clients. Set this to true if you wish to warm up your ip. + * + * @return $this + */ + public function setIpWarmupEnable($ipWarmupEnable) + { + $this->container['ipWarmupEnable'] = $ipWarmupEnable; + + return $this; + } + + /** + * Gets initialQuota + * + * @return int + */ + public function getInitialQuota() + { + return $this->container['initialQuota']; + } + + /** + * Sets initialQuota + * + * @param int $initialQuota Mandatory if ipWarmupEnable is set to true. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. + * + * @return $this + */ + public function setInitialQuota($initialQuota) + { + $this->container['initialQuota'] = $initialQuota; + + return $this; + } + + /** + * Gets increaseRate + * + * @return int + */ + public function getIncreaseRate() + { + return $this->container['increaseRate']; + } + + /** + * Sets increaseRate + * + * @param int $increaseRate Mandatory if ipWarmupEnable is set to true. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. + * + * @return $this + */ + public function setIncreaseRate($increaseRate) + { + + if (!is_null($increaseRate) && ($increaseRate > 100)) { + throw new \InvalidArgumentException('invalid value for $increaseRate when calling CreateEmailCampaign., must be smaller than or equal to 100.'); + } + if (!is_null($increaseRate) && ($increaseRate < 0)) { + throw new \InvalidArgumentException('invalid value for $increaseRate when calling CreateEmailCampaign., must be bigger than or equal to 0.'); + } + + $this->container['increaseRate'] = $increaseRate; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/CreateEmailCampaignRecipients.php b/lib/Model/CreateEmailCampaignRecipients.php index eb831456..719be7a8 100644 --- a/lib/Model/CreateEmailCampaignRecipients.php +++ b/lib/Model/CreateEmailCampaignRecipients.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -207,8 +207,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateEmailCampaignSender.php b/lib/Model/CreateEmailCampaignSender.php index 71fe1a39..6bb3c640 100644 --- a/lib/Model/CreateEmailCampaignSender.php +++ b/lib/Model/CreateEmailCampaignSender.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -36,7 +36,7 @@ * CreateEmailCampaignSender Class Doc Comment * * @category Class - * @description Sender details including email and name (optional). For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` + * @description Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` * @package SendinBlue\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -59,7 +59,8 @@ class CreateEmailCampaignSender implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'name' => 'string', - 'email' => 'string' + 'email' => 'string', + 'id' => 'int' ]; /** @@ -69,7 +70,8 @@ class CreateEmailCampaignSender implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'name' => null, - 'email' => 'email' + 'email' => 'email', + 'id' => 'int64' ]; /** @@ -100,7 +102,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'email' => 'email' + 'email' => 'email', + 'id' => 'id' ]; /** @@ -110,7 +113,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'name' => 'setName', - 'email' => 'setEmail' + 'email' => 'setEmail', + 'id' => 'setId' ]; /** @@ -120,7 +124,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'name' => 'getName', - 'email' => 'getEmail' + 'email' => 'getEmail', + 'id' => 'getId' ]; /** @@ -185,6 +190,7 @@ public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; } /** @@ -210,11 +216,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -265,6 +267,30 @@ public function setEmail($email) return $this; } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/CreateList.php b/lib/Model/CreateList.php index f3698d9d..d6a812d2 100644 --- a/lib/Model/CreateList.php +++ b/lib/Model/CreateList.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['name'] === null) { - return false; - } - if ($this->container['folderId'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateModel.php b/lib/Model/CreateModel.php index 15a1cf40..fe5ab299 100644 --- a/lib/Model/CreateModel.php +++ b/lib/Model/CreateModel.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -203,11 +203,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateReseller.php b/lib/Model/CreateReseller.php index b384daa3..1dff8d02 100644 --- a/lib/Model/CreateReseller.php +++ b/lib/Model/CreateReseller.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -203,11 +203,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['authKey'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateSender.php b/lib/Model/CreateSender.php index 87cb01e4..7eb24ee4 100644 --- a/lib/Model/CreateSender.php +++ b/lib/Model/CreateSender.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -218,14 +218,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['name'] === null) { - return false; - } - if ($this->container['email'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateSenderIps.php b/lib/Model/CreateSenderIps.php index 82b885ba..9df80df8 100644 --- a/lib/Model/CreateSenderIps.php +++ b/lib/Model/CreateSenderIps.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -226,20 +226,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['ip'] === null) { - return false; - } - if ($this->container['domain'] === null) { - return false; - } - if ($this->container['weight'] > 100) { - return false; - } - if ($this->container['weight'] < 1) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateSenderModel.php b/lib/Model/CreateSenderModel.php index 597078b3..0f6be5f4 100644 --- a/lib/Model/CreateSenderModel.php +++ b/lib/Model/CreateSenderModel.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -215,11 +215,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateSmsCampaign.php b/lib/Model/CreateSmsCampaign.php index 09502e6c..a02aeb71 100644 --- a/lib/Model/CreateSmsCampaign.php +++ b/lib/Model/CreateSmsCampaign.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -219,7 +219,7 @@ public function listInvalidProperties() if ($this->container['sender'] === null) { $invalidProperties[] = "'sender' can't be null"; } - if ((strlen($this->container['sender']) > 11)) { + if ((mb_strlen($this->container['sender']) > 11)) { $invalidProperties[] = "invalid value for 'sender', the character length must be smaller than or equal to 11."; } @@ -237,20 +237,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['name'] === null) { - return false; - } - if ($this->container['sender'] === null) { - return false; - } - if (strlen($this->container['sender']) > 11) { - return false; - } - if ($this->container['content'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -297,7 +284,7 @@ public function getSender() */ public function setSender($sender) { - if ((strlen($sender) > 11)) { + if ((mb_strlen($sender) > 11)) { throw new \InvalidArgumentException('invalid length for $sender when calling CreateSmsCampaign., must be smaller than or equal to 11.'); } diff --git a/lib/Model/CreateSmsCampaignRecipients.php b/lib/Model/CreateSmsCampaignRecipients.php index 90b817d8..c34dc297 100644 --- a/lib/Model/CreateSmsCampaignRecipients.php +++ b/lib/Model/CreateSmsCampaignRecipients.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -209,11 +209,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['listIds'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateSmtpEmail.php b/lib/Model/CreateSmtpEmail.php index 63a4d013..8ac8729f 100644 --- a/lib/Model/CreateSmtpEmail.php +++ b/lib/Model/CreateSmtpEmail.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -203,11 +203,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['messageId'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -224,7 +220,7 @@ public function getMessageId() /** * Sets messageId * - * @param string $messageId Message ID of the SMTP Email sent + * @param string $messageId Message ID of the transactional email sent * * @return $this */ diff --git a/lib/Model/CreateSmtpTemplate.php b/lib/Model/CreateSmtpTemplate.php index bea4d64f..26b8bbdf 100644 --- a/lib/Model/CreateSmtpTemplate.php +++ b/lib/Model/CreateSmtpTemplate.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -263,17 +263,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['sender'] === null) { - return false; - } - if ($this->container['templateName'] === null) { - return false; - } - if ($this->container['subject'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -458,7 +448,7 @@ public function getToField() /** * Sets toField * - * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add `{FNAME} {LNAME}`. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use `{{contact.FNAME}} {{contact.LNAME}}` for personalization + * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization * * @return $this */ diff --git a/lib/Model/CreateSmtpTemplateSender.php b/lib/Model/CreateSmtpTemplateSender.php index f4f048ff..e0bbe0e3 100644 --- a/lib/Model/CreateSmtpTemplateSender.php +++ b/lib/Model/CreateSmtpTemplateSender.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -36,7 +36,7 @@ * CreateSmtpTemplateSender Class Doc Comment * * @category Class - * @description Sender details including email and name (optional). For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` + * @description Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` * @package SendinBlue\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -59,7 +59,8 @@ class CreateSmtpTemplateSender implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'name' => 'string', - 'email' => 'string' + 'email' => 'string', + 'id' => 'int' ]; /** @@ -69,7 +70,8 @@ class CreateSmtpTemplateSender implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'name' => null, - 'email' => 'email' + 'email' => 'email', + 'id' => 'int64' ]; /** @@ -100,7 +102,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'email' => 'email' + 'email' => 'email', + 'id' => 'id' ]; /** @@ -110,7 +113,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'name' => 'setName', - 'email' => 'setEmail' + 'email' => 'setEmail', + 'id' => 'setId' ]; /** @@ -120,7 +124,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'name' => 'getName', - 'email' => 'getEmail' + 'email' => 'getEmail', + 'id' => 'getId' ]; /** @@ -185,6 +190,7 @@ public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; } /** @@ -210,11 +216,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -265,6 +267,30 @@ public function setEmail($email) return $this; } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/CreateUpdateContactModel.php b/lib/Model/CreateUpdateContactModel.php index 91980654..fced0ded 100644 --- a/lib/Model/CreateUpdateContactModel.php +++ b/lib/Model/CreateUpdateContactModel.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateUpdateFolder.php b/lib/Model/CreateUpdateFolder.php index e51e62a3..b1312a7d 100644 --- a/lib/Model/CreateUpdateFolder.php +++ b/lib/Model/CreateUpdateFolder.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/CreateWebhook.php b/lib/Model/CreateWebhook.php index 21524b0b..d76a8aa7 100644 --- a/lib/Model/CreateWebhook.php +++ b/lib/Model/CreateWebhook.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -186,6 +186,8 @@ public function getModelName() const EVENTS_UNIQUE_OPENED = 'uniqueOpened'; const EVENTS_UNSUBSCRIBED = 'unsubscribed'; const EVENTS_LIST_ADDITION = 'listAddition'; + const EVENTS_CONTACT_UPDATED = 'contactUpdated'; + const EVENTS_CONTACT_DELETED = 'contactDeleted'; const TYPE_TRANSACTIONAL = 'transactional'; const TYPE_MARKETING = 'marketing'; @@ -212,6 +214,8 @@ public function getEventsAllowableValues() self::EVENTS_UNIQUE_OPENED, self::EVENTS_UNSUBSCRIBED, self::EVENTS_LIST_ADDITION, + self::EVENTS_CONTACT_UPDATED, + self::EVENTS_CONTACT_DELETED, ]; } @@ -266,7 +270,7 @@ public function listInvalidProperties() $invalidProperties[] = "'events' can't be null"; } $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'type', must be one of '%s'", implode("', '", $allowedValues) @@ -284,18 +288,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['url'] === null) { - return false; - } - if ($this->container['events'] === null) { - return false; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -400,7 +393,7 @@ public function getType() public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($type) && !in_array($type, $allowedValues)) { + if (!is_null($type) && !in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'type', must be one of '%s'", diff --git a/lib/Model/CreatedProcessId.php b/lib/Model/CreatedProcessId.php index dcf6ecf2..d1ed5a44 100644 --- a/lib/Model/CreatedProcessId.php +++ b/lib/Model/CreatedProcessId.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -203,11 +203,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['processId'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/DeleteHardbounces.php b/lib/Model/DeleteHardbounces.php index 5b87d5ef..335e0da3 100644 --- a/lib/Model/DeleteHardbounces.php +++ b/lib/Model/DeleteHardbounces.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,8 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/EmailExportRecipients.php b/lib/Model/EmailExportRecipients.php index f092a178..a410b91a 100644 --- a/lib/Model/EmailExportRecipients.php +++ b/lib/Model/EmailExportRecipients.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -226,7 +226,7 @@ public function listInvalidProperties() $invalidProperties[] = "'recipientsType' can't be null"; } $allowedValues = $this->getRecipientsTypeAllowableValues(); - if (!in_array($this->container['recipientsType'], $allowedValues)) { + if (!is_null($this->container['recipientsType']) && !in_array($this->container['recipientsType'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'recipientsType', must be one of '%s'", implode("', '", $allowedValues) @@ -244,15 +244,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['recipientsType'] === null) { - return false; - } - $allowedValues = $this->getRecipientsTypeAllowableValues(); - if (!in_array($this->container['recipientsType'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -300,7 +292,7 @@ public function getRecipientsType() public function setRecipientsType($recipientsType) { $allowedValues = $this->getRecipientsTypeAllowableValues(); - if (!in_array($recipientsType, $allowedValues)) { + if (!in_array($recipientsType, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'recipientsType', must be one of '%s'", diff --git a/lib/Model/ErrorModel.php b/lib/Model/ErrorModel.php index 4c98fb51..d63e6f9f 100644 --- a/lib/Model/ErrorModel.php +++ b/lib/Model/ErrorModel.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -240,7 +240,7 @@ public function listInvalidProperties() $invalidProperties[] = "'code' can't be null"; } $allowedValues = $this->getCodeAllowableValues(); - if (!in_array($this->container['code'], $allowedValues)) { + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'code', must be one of '%s'", implode("', '", $allowedValues) @@ -261,18 +261,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['code'] === null) { - return false; - } - $allowedValues = $this->getCodeAllowableValues(); - if (!in_array($this->container['code'], $allowedValues)) { - return false; - } - if ($this->container['message'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -296,7 +285,7 @@ public function getCode() public function setCode($code) { $allowedValues = $this->getCodeAllowableValues(); - if (!in_array($code, $allowedValues)) { + if (!in_array($code, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'code', must be one of '%s'", diff --git a/lib/Model/GetAccount.php b/lib/Model/GetAccount.php index cb9dd7a2..3e0fea97 100644 --- a/lib/Model/GetAccount.php +++ b/lib/Model/GetAccount.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -263,29 +263,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - if ($this->container['firstName'] === null) { - return false; - } - if ($this->container['lastName'] === null) { - return false; - } - if ($this->container['companyName'] === null) { - return false; - } - if ($this->container['address'] === null) { - return false; - } - if ($this->container['plan'] === null) { - return false; - } - if ($this->container['relay'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetAccountMarketingAutomation.php b/lib/Model/GetAccountMarketingAutomation.php index a5721b23..b59305d8 100644 --- a/lib/Model/GetAccountMarketingAutomation.php +++ b/lib/Model/GetAccountMarketingAutomation.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -209,11 +209,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['enabled'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetAccountPlan.php b/lib/Model/GetAccountPlan.php index df25b787..dd3b6169 100644 --- a/lib/Model/GetAccountPlan.php +++ b/lib/Model/GetAccountPlan.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -257,7 +257,7 @@ public function listInvalidProperties() $invalidProperties[] = "'type' can't be null"; } $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'type', must be one of '%s'", implode("', '", $allowedValues) @@ -268,7 +268,7 @@ public function listInvalidProperties() $invalidProperties[] = "'creditsType' can't be null"; } $allowedValues = $this->getCreditsTypeAllowableValues(); - if (!in_array($this->container['creditsType'], $allowedValues)) { + if (!is_null($this->container['creditsType']) && !in_array($this->container['creditsType'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'creditsType', must be one of '%s'", implode("', '", $allowedValues) @@ -289,25 +289,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['type'] === null) { - return false; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { - return false; - } - if ($this->container['creditsType'] === null) { - return false; - } - $allowedValues = $this->getCreditsTypeAllowableValues(); - if (!in_array($this->container['creditsType'], $allowedValues)) { - return false; - } - if ($this->container['credits'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -331,7 +313,7 @@ public function getType() public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues)) { + if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'type', must be one of '%s'", @@ -364,7 +346,7 @@ public function getCreditsType() public function setCreditsType($creditsType) { $allowedValues = $this->getCreditsTypeAllowableValues(); - if (!in_array($creditsType, $allowedValues)) { + if (!in_array($creditsType, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'creditsType', must be one of '%s'", diff --git a/lib/Model/GetAccountRelay.php b/lib/Model/GetAccountRelay.php index 61ae084d..a49a56c4 100644 --- a/lib/Model/GetAccountRelay.php +++ b/lib/Model/GetAccountRelay.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -36,7 +36,7 @@ * GetAccountRelay Class Doc Comment * * @category Class - * @description Information about your SMTP account + * @description Information about your transactional email account * @package SendinBlue\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -213,14 +213,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['enabled'] === null) { - return false; - } - if ($this->container['data'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -237,7 +230,7 @@ public function getEnabled() /** * Sets enabled * - * @param bool $enabled Status of your SMTP Account (true=Enabled, false=Disabled) + * @param bool $enabled Status of your transactional email Account (true=Enabled, false=Disabled) * * @return $this */ diff --git a/lib/Model/GetAccountRelayData.php b/lib/Model/GetAccountRelayData.php index 07beaf0d..41cc0be5 100644 --- a/lib/Model/GetAccountRelayData.php +++ b/lib/Model/GetAccountRelayData.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -36,7 +36,7 @@ * GetAccountRelayData Class Doc Comment * * @category Class - * @description Data regarding the SMTP account + * @description Data regarding the transactional email account * @package SendinBlue\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -222,17 +222,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['userName'] === null) { - return false; - } - if ($this->container['relay'] === null) { - return false; - } - if ($this->container['port'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -249,7 +239,7 @@ public function getUserName() /** * Sets userName * - * @param string $userName Email to use as login on SMTP + * @param string $userName Email to use as login on transactional platform * * @return $this */ diff --git a/lib/Model/GetAggregatedReport.php b/lib/Model/GetAggregatedReport.php index 7bae8346..11c8cc01 100644 --- a/lib/Model/GetAggregatedReport.php +++ b/lib/Model/GetAggregatedReport.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -311,47 +311,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['range'] === null) { - return false; - } - if ($this->container['requests'] === null) { - return false; - } - if ($this->container['delivered'] === null) { - return false; - } - if ($this->container['hardBounces'] === null) { - return false; - } - if ($this->container['softBounces'] === null) { - return false; - } - if ($this->container['clicks'] === null) { - return false; - } - if ($this->container['uniqueClicks'] === null) { - return false; - } - if ($this->container['opens'] === null) { - return false; - } - if ($this->container['uniqueOpens'] === null) { - return false; - } - if ($this->container['spamReports'] === null) { - return false; - } - if ($this->container['blocked'] === null) { - return false; - } - if ($this->container['invalid'] === null) { - return false; - } - if ($this->container['unsubscribed'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetAttributes.php b/lib/Model/GetAttributes.php index 1cfc8453..ecb17e66 100644 --- a/lib/Model/GetAttributes.php +++ b/lib/Model/GetAttributes.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -203,11 +203,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['attributes'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetAttributesAttributes.php b/lib/Model/GetAttributesAttributes.php index 7cdea1c4..a87e68c7 100644 --- a/lib/Model/GetAttributesAttributes.php +++ b/lib/Model/GetAttributesAttributes.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -262,7 +262,7 @@ public function listInvalidProperties() $invalidProperties[] = "'category' can't be null"; } $allowedValues = $this->getCategoryAllowableValues(); - if (!in_array($this->container['category'], $allowedValues)) { + if (!is_null($this->container['category']) && !in_array($this->container['category'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'category', must be one of '%s'", implode("', '", $allowedValues) @@ -270,7 +270,7 @@ public function listInvalidProperties() } $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'type', must be one of '%s'", implode("', '", $allowedValues) @@ -288,22 +288,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['name'] === null) { - return false; - } - if ($this->container['category'] === null) { - return false; - } - $allowedValues = $this->getCategoryAllowableValues(); - if (!in_array($this->container['category'], $allowedValues)) { - return false; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -351,7 +336,7 @@ public function getCategory() public function setCategory($category) { $allowedValues = $this->getCategoryAllowableValues(); - if (!in_array($category, $allowedValues)) { + if (!in_array($category, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'category', must be one of '%s'", @@ -384,7 +369,7 @@ public function getType() public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($type) && !in_array($type, $allowedValues)) { + if (!is_null($type) && !in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'type', must be one of '%s'", diff --git a/lib/Model/GetAttributesEnumeration.php b/lib/Model/GetAttributesEnumeration.php index d6bcb40d..eb54e45c 100644 --- a/lib/Model/GetAttributesEnumeration.php +++ b/lib/Model/GetAttributesEnumeration.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['value'] === null) { - return false; - } - if ($this->container['label'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetCampaignOverview.php b/lib/Model/GetCampaignOverview.php index 4fb098cd..32c551c6 100644 --- a/lib/Model/GetCampaignOverview.php +++ b/lib/Model/GetCampaignOverview.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -309,7 +309,7 @@ public function listInvalidProperties() $invalidProperties[] = "'type' can't be null"; } $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'type', must be one of '%s'", implode("', '", $allowedValues) @@ -320,7 +320,7 @@ public function listInvalidProperties() $invalidProperties[] = "'status' can't be null"; } $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) @@ -338,28 +338,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - if ($this->container['type'] === null) { - return false; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { - return false; - } - if ($this->container['status'] === null) { - return false; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -455,7 +434,7 @@ public function getType() public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues)) { + if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'type', must be one of '%s'", @@ -488,7 +467,7 @@ public function getStatus() public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues)) { + if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", diff --git a/lib/Model/GetCampaignRecipients.php b/lib/Model/GetCampaignRecipients.php index 7197818d..1149ddf7 100644 --- a/lib/Model/GetCampaignRecipients.php +++ b/lib/Model/GetCampaignRecipients.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['lists'] === null) { - return false; - } - if ($this->container['exclusionLists'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetCampaignStats.php b/lib/Model/GetCampaignStats.php index 91b23dcb..e9cf5e0a 100644 --- a/lib/Model/GetCampaignStats.php +++ b/lib/Model/GetCampaignStats.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -296,38 +296,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['uniqueClicks'] === null) { - return false; - } - if ($this->container['clickers'] === null) { - return false; - } - if ($this->container['complaints'] === null) { - return false; - } - if ($this->container['delivered'] === null) { - return false; - } - if ($this->container['sent'] === null) { - return false; - } - if ($this->container['softBounces'] === null) { - return false; - } - if ($this->container['hardBounces'] === null) { - return false; - } - if ($this->container['uniqueViews'] === null) { - return false; - } - if ($this->container['unsubscriptions'] === null) { - return false; - } - if ($this->container['viewed'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetChildAccountCreationStatus.php b/lib/Model/GetChildAccountCreationStatus.php new file mode 100644 index 00000000..ae2f3568 --- /dev/null +++ b/lib/Model/GetChildAccountCreationStatus.php @@ -0,0 +1,304 @@ + 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'childAccountCreated' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'childAccountCreated' => 'childAccountCreated' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'childAccountCreated' => 'setChildAccountCreated' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'childAccountCreated' => 'getChildAccountCreated' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['childAccountCreated'] = isset($data['childAccountCreated']) ? $data['childAccountCreated'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['childAccountCreated'] === null) { + $invalidProperties[] = "'childAccountCreated' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets childAccountCreated + * + * @return bool + */ + public function getChildAccountCreated() + { + return $this->container['childAccountCreated']; + } + + /** + * Sets childAccountCreated + * + * @param bool $childAccountCreated Status of child account creation whether it is successfully created (exists) or not. + * + * @return $this + */ + public function setChildAccountCreated($childAccountCreated) + { + $this->container['childAccountCreated'] = $childAccountCreated; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetChildDomain.php b/lib/Model/GetChildDomain.php index 5b7db91a..76dfb884 100644 --- a/lib/Model/GetChildDomain.php +++ b/lib/Model/GetChildDomain.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['domain'] === null) { - return false; - } - if ($this->container['active'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetChildDomains.php b/lib/Model/GetChildDomains.php index dc0a126c..df8c5445 100644 --- a/lib/Model/GetChildDomains.php +++ b/lib/Model/GetChildDomains.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -199,11 +199,7 @@ public function listInvalidProperties() */ public function valid() { - if (!parent::valid()) { - return false; - } - - return true; + return count($this->listInvalidProperties()) === 0; } /** diff --git a/lib/Model/GetChildInfo.php b/lib/Model/GetChildInfo.php index 6991820a..97296b0b 100644 --- a/lib/Model/GetChildInfo.php +++ b/lib/Model/GetChildInfo.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -263,23 +263,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - if ($this->container['firstName'] === null) { - return false; - } - if ($this->container['lastName'] === null) { - return false; - } - if ($this->container['companyName'] === null) { - return false; - } - if ($this->container['password'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetChildInfoApiKeys.php b/lib/Model/GetChildInfoApiKeys.php index cf42ddeb..12a4d992 100644 --- a/lib/Model/GetChildInfoApiKeys.php +++ b/lib/Model/GetChildInfoApiKeys.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -210,11 +210,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['v2'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetChildInfoApiKeysV2.php b/lib/Model/GetChildInfoApiKeysV2.php index f4d2369e..d9ae913e 100644 --- a/lib/Model/GetChildInfoApiKeysV2.php +++ b/lib/Model/GetChildInfoApiKeysV2.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['name'] === null) { - return false; - } - if ($this->container['key'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetChildInfoApiKeysV3.php b/lib/Model/GetChildInfoApiKeysV3.php index b9d7c9da..5ddf6a24 100644 --- a/lib/Model/GetChildInfoApiKeysV3.php +++ b/lib/Model/GetChildInfoApiKeysV3.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['name'] === null) { - return false; - } - if ($this->container['key'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetChildInfoCredits.php b/lib/Model/GetChildInfoCredits.php index 3c043c05..1af7cbff 100644 --- a/lib/Model/GetChildInfoCredits.php +++ b/lib/Model/GetChildInfoCredits.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -207,8 +207,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetChildInfoStatistics.php b/lib/Model/GetChildInfoStatistics.php index 0b5dafe6..c5e80372 100644 --- a/lib/Model/GetChildInfoStatistics.php +++ b/lib/Model/GetChildInfoStatistics.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -213,8 +213,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetChildrenList.php b/lib/Model/GetChildrenList.php index 7a2fed21..95e5f0a4 100644 --- a/lib/Model/GetChildrenList.php +++ b/lib/Model/GetChildrenList.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -57,7 +57,8 @@ class GetChildrenList implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'children' => 'object[]' + 'children' => 'object[]', + 'count' => 'int' ]; /** @@ -66,7 +67,8 @@ class GetChildrenList implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'children' => null + 'children' => null, + 'count' => 'int64' ]; /** @@ -96,7 +98,8 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'children' => 'children' + 'children' => 'children', + 'count' => 'count' ]; /** @@ -105,7 +108,8 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'children' => 'setChildren' + 'children' => 'setChildren', + 'count' => 'setCount' ]; /** @@ -114,7 +118,8 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'children' => 'getChildren' + 'children' => 'getChildren', + 'count' => 'getCount' ]; /** @@ -178,6 +183,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['children'] = isset($data['children']) ? $data['children'] : null; + $this->container['count'] = isset($data['count']) ? $data['count'] : null; } /** @@ -189,6 +195,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } return $invalidProperties; } @@ -200,8 +209,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -228,6 +236,30 @@ public function setChildren($children) return $this; } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Number of child accounts + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/GetClient.php b/lib/Model/GetClient.php index a908c1a6..e6153079 100644 --- a/lib/Model/GetClient.php +++ b/lib/Model/GetClient.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -230,20 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - if ($this->container['firstName'] === null) { - return false; - } - if ($this->container['lastName'] === null) { - return false; - } - if ($this->container['companyName'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetContactCampaignStats.php b/lib/Model/GetContactCampaignStats.php index e917e7e7..df418c44 100644 --- a/lib/Model/GetContactCampaignStats.php +++ b/lib/Model/GetContactCampaignStats.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -243,8 +243,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetContactCampaignStatsClicked.php b/lib/Model/GetContactCampaignStatsClicked.php index 296e2a99..81fed708 100644 --- a/lib/Model/GetContactCampaignStatsClicked.php +++ b/lib/Model/GetContactCampaignStatsClicked.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['campaignId'] === null) { - return false; - } - if ($this->container['links'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetContactCampaignStatsOpened.php b/lib/Model/GetContactCampaignStatsOpened.php index 53cd6540..e6ad277d 100644 --- a/lib/Model/GetContactCampaignStatsOpened.php +++ b/lib/Model/GetContactCampaignStatsOpened.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -230,20 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['campaignId'] === null) { - return false; - } - if ($this->container['count'] === null) { - return false; - } - if ($this->container['eventTime'] === null) { - return false; - } - if ($this->container['ip'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetContactCampaignStatsTransacAttributes.php b/lib/Model/GetContactCampaignStatsTransacAttributes.php index 9d8d7368..3bdf6379 100644 --- a/lib/Model/GetContactCampaignStatsTransacAttributes.php +++ b/lib/Model/GetContactCampaignStatsTransacAttributes.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -221,17 +221,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['orderDate'] === null) { - return false; - } - if ($this->container['orderPrice'] === null) { - return false; - } - if ($this->container['orderId'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetContactCampaignStatsUnsubscriptions.php b/lib/Model/GetContactCampaignStatsUnsubscriptions.php index 87aef870..d4750b0d 100644 --- a/lib/Model/GetContactCampaignStatsUnsubscriptions.php +++ b/lib/Model/GetContactCampaignStatsUnsubscriptions.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['userUnsubscription'] === null) { - return false; - } - if ($this->container['adminUnsubscription'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetContactDetails.php b/lib/Model/GetContactDetails.php index 318fe79e..3831b794 100644 --- a/lib/Model/GetContactDetails.php +++ b/lib/Model/GetContactDetails.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -272,32 +272,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - if ($this->container['id'] === null) { - return false; - } - if ($this->container['emailBlacklisted'] === null) { - return false; - } - if ($this->container['smsBlacklisted'] === null) { - return false; - } - if ($this->container['createdAt'] === null) { - return false; - } - if ($this->container['modifiedAt'] === null) { - return false; - } - if ($this->container['listIds'] === null) { - return false; - } - if ($this->container['attributes'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetContacts.php b/lib/Model/GetContacts.php index 3c6c4e99..7e83dcaa 100644 --- a/lib/Model/GetContacts.php +++ b/lib/Model/GetContacts.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['contacts'] === null) { - return false; - } - if ($this->container['count'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetDeviceBrowserStats.php b/lib/Model/GetDeviceBrowserStats.php new file mode 100644 index 00000000..f81e45c0 --- /dev/null +++ b/lib/Model/GetDeviceBrowserStats.php @@ -0,0 +1,403 @@ + 'int', + 'uniqueClicks' => 'int', + 'viewed' => 'int', + 'uniqueViews' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'clickers' => 'int64', + 'uniqueClicks' => 'int64', + 'viewed' => 'int64', + 'uniqueViews' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'clickers' => 'clickers', + 'uniqueClicks' => 'uniqueClicks', + 'viewed' => 'viewed', + 'uniqueViews' => 'uniqueViews' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'clickers' => 'setClickers', + 'uniqueClicks' => 'setUniqueClicks', + 'viewed' => 'setViewed', + 'uniqueViews' => 'setUniqueViews' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'clickers' => 'getClickers', + 'uniqueClicks' => 'getUniqueClicks', + 'viewed' => 'getViewed', + 'uniqueViews' => 'getUniqueViews' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['clickers'] = isset($data['clickers']) ? $data['clickers'] : null; + $this->container['uniqueClicks'] = isset($data['uniqueClicks']) ? $data['uniqueClicks'] : null; + $this->container['viewed'] = isset($data['viewed']) ? $data['viewed'] : null; + $this->container['uniqueViews'] = isset($data['uniqueViews']) ? $data['uniqueViews'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['clickers'] === null) { + $invalidProperties[] = "'clickers' can't be null"; + } + if ($this->container['uniqueClicks'] === null) { + $invalidProperties[] = "'uniqueClicks' can't be null"; + } + if ($this->container['viewed'] === null) { + $invalidProperties[] = "'viewed' can't be null"; + } + if ($this->container['uniqueViews'] === null) { + $invalidProperties[] = "'uniqueViews' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets clickers + * + * @return int + */ + public function getClickers() + { + return $this->container['clickers']; + } + + /** + * Sets clickers + * + * @param int $clickers Number of total clicks for the campaign using the particular browser + * + * @return $this + */ + public function setClickers($clickers) + { + $this->container['clickers'] = $clickers; + + return $this; + } + + /** + * Gets uniqueClicks + * + * @return int + */ + public function getUniqueClicks() + { + return $this->container['uniqueClicks']; + } + + /** + * Sets uniqueClicks + * + * @param int $uniqueClicks Number of unique clicks for the campaign using the particular browser + * + * @return $this + */ + public function setUniqueClicks($uniqueClicks) + { + $this->container['uniqueClicks'] = $uniqueClicks; + + return $this; + } + + /** + * Gets viewed + * + * @return int + */ + public function getViewed() + { + return $this->container['viewed']; + } + + /** + * Sets viewed + * + * @param int $viewed Number of openings for the campaign using the particular browser + * + * @return $this + */ + public function setViewed($viewed) + { + $this->container['viewed'] = $viewed; + + return $this; + } + + /** + * Gets uniqueViews + * + * @return int + */ + public function getUniqueViews() + { + return $this->container['uniqueViews']; + } + + /** + * Sets uniqueViews + * + * @param int $uniqueViews Number of unique openings for the campaign using the particular browser + * + * @return $this + */ + public function setUniqueViews($uniqueViews) + { + $this->container['uniqueViews'] = $uniqueViews; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetEmailCampaign.php b/lib/Model/GetEmailCampaign.php index 8d2434f9..60a09e10 100644 --- a/lib/Model/GetEmailCampaign.php +++ b/lib/Model/GetEmailCampaign.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -411,7 +411,7 @@ public function listInvalidProperties() $invalidProperties[] = "'type' can't be null"; } $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'type', must be one of '%s'", implode("', '", $allowedValues) @@ -422,7 +422,7 @@ public function listInvalidProperties() $invalidProperties[] = "'status' can't be null"; } $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) @@ -476,64 +476,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - if ($this->container['type'] === null) { - return false; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { - return false; - } - if ($this->container['status'] === null) { - return false; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { - return false; - } - if ($this->container['testSent'] === null) { - return false; - } - if ($this->container['header'] === null) { - return false; - } - if ($this->container['footer'] === null) { - return false; - } - if ($this->container['sender'] === null) { - return false; - } - if ($this->container['replyTo'] === null) { - return false; - } - if ($this->container['toField'] === null) { - return false; - } - if ($this->container['htmlContent'] === null) { - return false; - } - if ($this->container['tag'] === null) { - return false; - } - if ($this->container['createdAt'] === null) { - return false; - } - if ($this->container['modifiedAt'] === null) { - return false; - } - if ($this->container['recipients'] === null) { - return false; - } - if ($this->container['statistics'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -629,7 +572,7 @@ public function getType() public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues)) { + if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'type', must be one of '%s'", @@ -662,7 +605,7 @@ public function getStatus() public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues)) { + if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", diff --git a/lib/Model/GetEmailCampaigns.php b/lib/Model/GetEmailCampaigns.php index ba26222b..794b5da5 100644 --- a/lib/Model/GetEmailCampaigns.php +++ b/lib/Model/GetEmailCampaigns.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -209,11 +209,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['count'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetEmailEventReport.php b/lib/Model/GetEmailEventReport.php index 4c2c1698..bd1789af 100644 --- a/lib/Model/GetEmailEventReport.php +++ b/lib/Model/GetEmailEventReport.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetEmailEventReportEvents.php b/lib/Model/GetEmailEventReportEvents.php index bebc48ab..940e3750 100644 --- a/lib/Model/GetEmailEventReportEvents.php +++ b/lib/Model/GetEmailEventReportEvents.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -291,7 +291,7 @@ public function listInvalidProperties() $invalidProperties[] = "'event' can't be null"; } $allowedValues = $this->getEventAllowableValues(); - if (!in_array($this->container['event'], $allowedValues)) { + if (!is_null($this->container['event']) && !in_array($this->container['event'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'event', must be one of '%s'", implode("', '", $allowedValues) @@ -309,24 +309,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - if ($this->container['date'] === null) { - return false; - } - if ($this->container['messageId'] === null) { - return false; - } - if ($this->container['event'] === null) { - return false; - } - $allowedValues = $this->getEventAllowableValues(); - if (!in_array($this->container['event'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -446,7 +429,7 @@ public function getEvent() public function setEvent($event) { $allowedValues = $this->getEventAllowableValues(); - if (!in_array($event, $allowedValues)) { + if (!in_array($event, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'event', must be one of '%s'", diff --git a/lib/Model/GetExtendedCampaignOverview.php b/lib/Model/GetExtendedCampaignOverview.php index 54ccb0c9..f4145770 100644 --- a/lib/Model/GetExtendedCampaignOverview.php +++ b/lib/Model/GetExtendedCampaignOverview.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -399,7 +399,7 @@ public function listInvalidProperties() $invalidProperties[] = "'type' can't be null"; } $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'type', must be one of '%s'", implode("', '", $allowedValues) @@ -410,7 +410,7 @@ public function listInvalidProperties() $invalidProperties[] = "'status' can't be null"; } $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) @@ -458,58 +458,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - if ($this->container['type'] === null) { - return false; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { - return false; - } - if ($this->container['status'] === null) { - return false; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { - return false; - } - if ($this->container['testSent'] === null) { - return false; - } - if ($this->container['header'] === null) { - return false; - } - if ($this->container['footer'] === null) { - return false; - } - if ($this->container['sender'] === null) { - return false; - } - if ($this->container['replyTo'] === null) { - return false; - } - if ($this->container['toField'] === null) { - return false; - } - if ($this->container['htmlContent'] === null) { - return false; - } - if ($this->container['tag'] === null) { - return false; - } - if ($this->container['createdAt'] === null) { - return false; - } - if ($this->container['modifiedAt'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -605,7 +554,7 @@ public function getType() public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues)) { + if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'type', must be one of '%s'", @@ -638,7 +587,7 @@ public function getStatus() public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues)) { + if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", diff --git a/lib/Model/GetExtendedCampaignOverviewSender.php b/lib/Model/GetExtendedCampaignOverviewSender.php index e74743c1..0bf63465 100644 --- a/lib/Model/GetExtendedCampaignOverviewSender.php +++ b/lib/Model/GetExtendedCampaignOverviewSender.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -58,7 +58,8 @@ class GetExtendedCampaignOverviewSender implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'name' => 'string', - 'email' => 'string' + 'email' => 'string', + 'id' => 'string' ]; /** @@ -68,7 +69,8 @@ class GetExtendedCampaignOverviewSender implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'name' => null, - 'email' => 'email' + 'email' => 'email', + 'id' => null ]; /** @@ -99,7 +101,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'email' => 'email' + 'email' => 'email', + 'id' => 'id' ]; /** @@ -109,7 +112,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'name' => 'setName', - 'email' => 'setEmail' + 'email' => 'setEmail', + 'id' => 'setId' ]; /** @@ -119,7 +123,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'name' => 'getName', - 'email' => 'getEmail' + 'email' => 'getEmail', + 'id' => 'getId' ]; /** @@ -184,6 +189,7 @@ public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; } /** @@ -206,8 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -258,6 +263,30 @@ public function setEmail($email) return $this; } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Sender id of the campaign + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/GetExtendedCampaignStats.php b/lib/Model/GetExtendedCampaignStats.php index 8d1d649e..2b39e2ab 100644 --- a/lib/Model/GetExtendedCampaignStats.php +++ b/lib/Model/GetExtendedCampaignStats.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -62,7 +62,9 @@ class GetExtendedCampaignStats implements ModelInterface, ArrayAccess 'mirrorClick' => 'int', 'remaining' => 'int', 'linksStats' => 'object', - 'statsByDomain' => '\SendinBlue\Client\Model\GetStatsByDomain' + 'statsByDomain' => '\SendinBlue\Client\Model\GetStatsByDomain', + 'statsByDevice' => '\SendinBlue\Client\Model\GetStatsByDevice', + 'statsByBrowser' => '\SendinBlue\Client\Model\GetStatsByBrowser' ]; /** @@ -76,7 +78,9 @@ class GetExtendedCampaignStats implements ModelInterface, ArrayAccess 'mirrorClick' => 'int64', 'remaining' => 'int64', 'linksStats' => null, - 'statsByDomain' => null + 'statsByDomain' => null, + 'statsByDevice' => null, + 'statsByBrowser' => null ]; /** @@ -111,7 +115,9 @@ public static function swaggerFormats() 'mirrorClick' => 'mirrorClick', 'remaining' => 'remaining', 'linksStats' => 'linksStats', - 'statsByDomain' => 'statsByDomain' + 'statsByDomain' => 'statsByDomain', + 'statsByDevice' => 'statsByDevice', + 'statsByBrowser' => 'statsByBrowser' ]; /** @@ -125,7 +131,9 @@ public static function swaggerFormats() 'mirrorClick' => 'setMirrorClick', 'remaining' => 'setRemaining', 'linksStats' => 'setLinksStats', - 'statsByDomain' => 'setStatsByDomain' + 'statsByDomain' => 'setStatsByDomain', + 'statsByDevice' => 'setStatsByDevice', + 'statsByBrowser' => 'setStatsByBrowser' ]; /** @@ -139,7 +147,9 @@ public static function swaggerFormats() 'mirrorClick' => 'getMirrorClick', 'remaining' => 'getRemaining', 'linksStats' => 'getLinksStats', - 'statsByDomain' => 'getStatsByDomain' + 'statsByDomain' => 'getStatsByDomain', + 'statsByDevice' => 'getStatsByDevice', + 'statsByBrowser' => 'getStatsByBrowser' ]; /** @@ -208,6 +218,8 @@ public function __construct(array $data = null) $this->container['remaining'] = isset($data['remaining']) ? $data['remaining'] : null; $this->container['linksStats'] = isset($data['linksStats']) ? $data['linksStats'] : null; $this->container['statsByDomain'] = isset($data['statsByDomain']) ? $data['statsByDomain'] : null; + $this->container['statsByDevice'] = isset($data['statsByDevice']) ? $data['statsByDevice'] : null; + $this->container['statsByBrowser'] = isset($data['statsByBrowser']) ? $data['statsByBrowser'] : null; } /** @@ -237,6 +249,12 @@ public function listInvalidProperties() if ($this->container['statsByDomain'] === null) { $invalidProperties[] = "'statsByDomain' can't be null"; } + if ($this->container['statsByDevice'] === null) { + $invalidProperties[] = "'statsByDevice' can't be null"; + } + if ($this->container['statsByBrowser'] === null) { + $invalidProperties[] = "'statsByBrowser' can't be null"; + } return $invalidProperties; } @@ -248,26 +266,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['globalStats'] === null) { - return false; - } - if ($this->container['campaignStats'] === null) { - return false; - } - if ($this->container['mirrorClick'] === null) { - return false; - } - if ($this->container['remaining'] === null) { - return false; - } - if ($this->container['linksStats'] === null) { - return false; - } - if ($this->container['statsByDomain'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -414,6 +413,54 @@ public function setStatsByDomain($statsByDomain) return $this; } + + /** + * Gets statsByDevice + * + * @return \SendinBlue\Client\Model\GetStatsByDevice + */ + public function getStatsByDevice() + { + return $this->container['statsByDevice']; + } + + /** + * Sets statsByDevice + * + * @param \SendinBlue\Client\Model\GetStatsByDevice $statsByDevice Statistics about the campaign on the basis of various devices + * + * @return $this + */ + public function setStatsByDevice($statsByDevice) + { + $this->container['statsByDevice'] = $statsByDevice; + + return $this; + } + + /** + * Gets statsByBrowser + * + * @return \SendinBlue\Client\Model\GetStatsByBrowser + */ + public function getStatsByBrowser() + { + return $this->container['statsByBrowser']; + } + + /** + * Sets statsByBrowser + * + * @param \SendinBlue\Client\Model\GetStatsByBrowser $statsByBrowser Statistics about the campaign on the basis of various browsers + * + * @return $this + */ + public function setStatsByBrowser($statsByBrowser) + { + $this->container['statsByBrowser'] = $statsByBrowser; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/GetExtendedClient.php b/lib/Model/GetExtendedClient.php index bb411250..13da49f1 100644 --- a/lib/Model/GetExtendedClient.php +++ b/lib/Model/GetExtendedClient.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -239,23 +239,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - if ($this->container['firstName'] === null) { - return false; - } - if ($this->container['lastName'] === null) { - return false; - } - if ($this->container['companyName'] === null) { - return false; - } - if ($this->container['address'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetExtendedClientAddress.php b/lib/Model/GetExtendedClientAddress.php index be071591..a122e05e 100644 --- a/lib/Model/GetExtendedClientAddress.php +++ b/lib/Model/GetExtendedClientAddress.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -231,20 +231,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['street'] === null) { - return false; - } - if ($this->container['city'] === null) { - return false; - } - if ($this->container['zipCode'] === null) { - return false; - } - if ($this->container['country'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetExtendedContactDetails.php b/lib/Model/GetExtendedContactDetails.php index 797e2e64..3bd46daf 100644 --- a/lib/Model/GetExtendedContactDetails.php +++ b/lib/Model/GetExtendedContactDetails.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -281,35 +281,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - if ($this->container['id'] === null) { - return false; - } - if ($this->container['emailBlacklisted'] === null) { - return false; - } - if ($this->container['smsBlacklisted'] === null) { - return false; - } - if ($this->container['createdAt'] === null) { - return false; - } - if ($this->container['modifiedAt'] === null) { - return false; - } - if ($this->container['listIds'] === null) { - return false; - } - if ($this->container['attributes'] === null) { - return false; - } - if ($this->container['statistics'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetExtendedContactDetailsStatistics.php b/lib/Model/GetExtendedContactDetailsStatistics.php index 19abe2c4..a0094655 100644 --- a/lib/Model/GetExtendedContactDetailsStatistics.php +++ b/lib/Model/GetExtendedContactDetailsStatistics.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -243,8 +243,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetExtendedContactDetailsStatisticsClicked.php b/lib/Model/GetExtendedContactDetailsStatisticsClicked.php index e328d3ff..1dcea6af 100644 --- a/lib/Model/GetExtendedContactDetailsStatisticsClicked.php +++ b/lib/Model/GetExtendedContactDetailsStatisticsClicked.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['campaignId'] === null) { - return false; - } - if ($this->container['links'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetExtendedContactDetailsStatisticsLinks.php b/lib/Model/GetExtendedContactDetailsStatisticsLinks.php index 32fc9e25..6d72201d 100644 --- a/lib/Model/GetExtendedContactDetailsStatisticsLinks.php +++ b/lib/Model/GetExtendedContactDetailsStatisticsLinks.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -230,20 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['count'] === null) { - return false; - } - if ($this->container['eventTime'] === null) { - return false; - } - if ($this->container['ip'] === null) { - return false; - } - if ($this->container['url'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetExtendedContactDetailsStatisticsMessagesSent.php b/lib/Model/GetExtendedContactDetailsStatisticsMessagesSent.php index 608fd98a..f52cc773 100644 --- a/lib/Model/GetExtendedContactDetailsStatisticsMessagesSent.php +++ b/lib/Model/GetExtendedContactDetailsStatisticsMessagesSent.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['campaignId'] === null) { - return false; - } - if ($this->container['eventTime'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetExtendedContactDetailsStatisticsOpened.php b/lib/Model/GetExtendedContactDetailsStatisticsOpened.php index eedb44da..564e4481 100644 --- a/lib/Model/GetExtendedContactDetailsStatisticsOpened.php +++ b/lib/Model/GetExtendedContactDetailsStatisticsOpened.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -230,20 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['campaignId'] === null) { - return false; - } - if ($this->container['count'] === null) { - return false; - } - if ($this->container['eventTime'] === null) { - return false; - } - if ($this->container['ip'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.php b/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.php index 7b4d1710..9d5ca263 100644 --- a/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.php +++ b/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptions.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -213,14 +213,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['userUnsubscription'] === null) { - return false; - } - if ($this->container['adminUnsubscription'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.php b/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.php index 604fdff2..a797433b 100644 --- a/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.php +++ b/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['eventTime'] === null) { - return false; - } - if ($this->container['ip'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.php b/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.php index 5bb6af18..0b555541 100644 --- a/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.php +++ b/lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -221,17 +221,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['campaignId'] === null) { - return false; - } - if ($this->container['eventTime'] === null) { - return false; - } - if ($this->container['ip'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetExtendedList.php b/lib/Model/GetExtendedList.php index 75861cb9..8f712bb5 100644 --- a/lib/Model/GetExtendedList.php +++ b/lib/Model/GetExtendedList.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -260,26 +260,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - if ($this->container['totalBlacklisted'] === null) { - return false; - } - if ($this->container['totalSubscribers'] === null) { - return false; - } - if ($this->container['folderId'] === null) { - return false; - } - if ($this->container['createdAt'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetExtendedListCampaignStats.php b/lib/Model/GetExtendedListCampaignStats.php index 90143a22..10874609 100644 --- a/lib/Model/GetExtendedListCampaignStats.php +++ b/lib/Model/GetExtendedListCampaignStats.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['campaignId'] === null) { - return false; - } - if ($this->container['stats'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetFolder.php b/lib/Model/GetFolder.php index bf3d2a8c..b568300e 100644 --- a/lib/Model/GetFolder.php +++ b/lib/Model/GetFolder.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -239,23 +239,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - if ($this->container['totalBlacklisted'] === null) { - return false; - } - if ($this->container['totalSubscribers'] === null) { - return false; - } - if ($this->container['uniqueSubscribers'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetFolderLists.php b/lib/Model/GetFolderLists.php index b8b6da27..084549ae 100644 --- a/lib/Model/GetFolderLists.php +++ b/lib/Model/GetFolderLists.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['lists'] === null) { - return false; - } - if ($this->container['count'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetFolders.php b/lib/Model/GetFolders.php index 095d19aa..47300d68 100644 --- a/lib/Model/GetFolders.php +++ b/lib/Model/GetFolders.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -206,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetIp.php b/lib/Model/GetIp.php index 027a39ef..78dd0840 100644 --- a/lib/Model/GetIp.php +++ b/lib/Model/GetIp.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -230,20 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['ip'] === null) { - return false; - } - if ($this->container['active'] === null) { - return false; - } - if ($this->container['domain'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetIpFromSender.php b/lib/Model/GetIpFromSender.php index 3c8e73cb..24be22fc 100644 --- a/lib/Model/GetIpFromSender.php +++ b/lib/Model/GetIpFromSender.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -230,20 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['ip'] === null) { - return false; - } - if ($this->container['domain'] === null) { - return false; - } - if ($this->container['weight'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetIps.php b/lib/Model/GetIps.php index eb660d20..7cd281b4 100644 --- a/lib/Model/GetIps.php +++ b/lib/Model/GetIps.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -203,11 +203,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['ips'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetIpsFromSender.php b/lib/Model/GetIpsFromSender.php index c3026ec5..e3f052a5 100644 --- a/lib/Model/GetIpsFromSender.php +++ b/lib/Model/GetIpsFromSender.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -203,11 +203,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['ips'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetList.php b/lib/Model/GetList.php index 74c5183f..e4983a21 100644 --- a/lib/Model/GetList.php +++ b/lib/Model/GetList.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -230,20 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - if ($this->container['totalBlacklisted'] === null) { - return false; - } - if ($this->container['totalSubscribers'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetLists.php b/lib/Model/GetLists.php index b0041937..f83b2bfc 100644 --- a/lib/Model/GetLists.php +++ b/lib/Model/GetLists.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['lists'] === null) { - return false; - } - if ($this->container['count'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetProcess.php b/lib/Model/GetProcess.php index 4e90a364..765ff374 100644 --- a/lib/Model/GetProcess.php +++ b/lib/Model/GetProcess.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -231,7 +231,7 @@ public function listInvalidProperties() $invalidProperties[] = "'status' can't be null"; } $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) @@ -252,21 +252,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['status'] === null) { - return false; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -314,7 +300,7 @@ public function getStatus() public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues)) { + if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", diff --git a/lib/Model/GetProcesses.php b/lib/Model/GetProcesses.php index 7f536394..e19cce90 100644 --- a/lib/Model/GetProcesses.php +++ b/lib/Model/GetProcesses.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -209,11 +209,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['count'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetReports.php b/lib/Model/GetReports.php index 05a6ebac..5b8daa5e 100644 --- a/lib/Model/GetReports.php +++ b/lib/Model/GetReports.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetReportsReports.php b/lib/Model/GetReportsReports.php index 46634998..a7a2f941 100644 --- a/lib/Model/GetReportsReports.php +++ b/lib/Model/GetReportsReports.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -311,47 +311,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['date'] === null) { - return false; - } - if ($this->container['requests'] === null) { - return false; - } - if ($this->container['delivered'] === null) { - return false; - } - if ($this->container['hardBounces'] === null) { - return false; - } - if ($this->container['softBounces'] === null) { - return false; - } - if ($this->container['clicks'] === null) { - return false; - } - if ($this->container['uniqueClicks'] === null) { - return false; - } - if ($this->container['opens'] === null) { - return false; - } - if ($this->container['uniqueOpens'] === null) { - return false; - } - if ($this->container['spamReports'] === null) { - return false; - } - if ($this->container['blocked'] === null) { - return false; - } - if ($this->container['invalid'] === null) { - return false; - } - if ($this->container['unsubscribed'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetSendersList.php b/lib/Model/GetSendersList.php index 7efcf132..f5fb8e38 100644 --- a/lib/Model/GetSendersList.php +++ b/lib/Model/GetSendersList.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetSendersListIps.php b/lib/Model/GetSendersListIps.php index 89bdbd6e..60a90316 100644 --- a/lib/Model/GetSendersListIps.php +++ b/lib/Model/GetSendersListIps.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -221,17 +221,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['ip'] === null) { - return false; - } - if ($this->container['domain'] === null) { - return false; - } - if ($this->container['weight'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetSendersListSenders.php b/lib/Model/GetSendersListSenders.php index 8fcd3a15..b6d8b861 100644 --- a/lib/Model/GetSendersListSenders.php +++ b/lib/Model/GetSendersListSenders.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -236,20 +236,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - if ($this->container['email'] === null) { - return false; - } - if ($this->container['active'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetSharedTemplateUrl.php b/lib/Model/GetSharedTemplateUrl.php new file mode 100644 index 00000000..5ac586e8 --- /dev/null +++ b/lib/Model/GetSharedTemplateUrl.php @@ -0,0 +1,304 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'sharedUrl' => 'url' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sharedUrl' => 'sharedUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sharedUrl' => 'setSharedUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sharedUrl' => 'getSharedUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sharedUrl'] = isset($data['sharedUrl']) ? $data['sharedUrl'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sharedUrl'] === null) { + $invalidProperties[] = "'sharedUrl' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets sharedUrl + * + * @return string + */ + public function getSharedUrl() + { + return $this->container['sharedUrl']; + } + + /** + * Sets sharedUrl + * + * @param string $sharedUrl A unique URL for the email campaign or transactional template. This URL can be shared with other Sendinblue users. + * + * @return $this + */ + public function setSharedUrl($sharedUrl) + { + $this->container['sharedUrl'] = $sharedUrl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetSmsCampaign.php b/lib/Model/GetSmsCampaign.php index 95c40014..3f19d1a0 100644 --- a/lib/Model/GetSmsCampaign.php +++ b/lib/Model/GetSmsCampaign.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -276,7 +276,7 @@ public function listInvalidProperties() $invalidProperties[] = "'status' can't be null"; } $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) @@ -315,42 +315,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - if ($this->container['status'] === null) { - return false; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { - return false; - } - if ($this->container['content'] === null) { - return false; - } - if ($this->container['scheduledAt'] === null) { - return false; - } - if ($this->container['sender'] === null) { - return false; - } - if ($this->container['createdAt'] === null) { - return false; - } - if ($this->container['modifiedAt'] === null) { - return false; - } - if ($this->container['recipients'] === null) { - return false; - } - if ($this->container['statistics'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -422,7 +387,7 @@ public function getStatus() public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues)) { + if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", diff --git a/lib/Model/GetSmsCampaignOverview.php b/lib/Model/GetSmsCampaignOverview.php index 308bd530..6976663f 100644 --- a/lib/Model/GetSmsCampaignOverview.php +++ b/lib/Model/GetSmsCampaignOverview.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -264,7 +264,7 @@ public function listInvalidProperties() $invalidProperties[] = "'status' can't be null"; } $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) @@ -297,36 +297,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - if ($this->container['status'] === null) { - return false; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { - return false; - } - if ($this->container['content'] === null) { - return false; - } - if ($this->container['scheduledAt'] === null) { - return false; - } - if ($this->container['sender'] === null) { - return false; - } - if ($this->container['createdAt'] === null) { - return false; - } - if ($this->container['modifiedAt'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -398,7 +369,7 @@ public function getStatus() public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues)) { + if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", diff --git a/lib/Model/GetSmsCampaignStats.php b/lib/Model/GetSmsCampaignStats.php index 3b8f81e7..c9688f1a 100644 --- a/lib/Model/GetSmsCampaignStats.php +++ b/lib/Model/GetSmsCampaignStats.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -257,29 +257,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['delivered'] === null) { - return false; - } - if ($this->container['sent'] === null) { - return false; - } - if ($this->container['processing'] === null) { - return false; - } - if ($this->container['softBounces'] === null) { - return false; - } - if ($this->container['hardBounces'] === null) { - return false; - } - if ($this->container['unsubscriptions'] === null) { - return false; - } - if ($this->container['answered'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetSmsCampaigns.php b/lib/Model/GetSmsCampaigns.php index 8e1fb955..b2c4ec13 100644 --- a/lib/Model/GetSmsCampaigns.php +++ b/lib/Model/GetSmsCampaigns.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -209,11 +209,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['count'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetSmsEventReport.php b/lib/Model/GetSmsEventReport.php index 4fc3fe47..cd0d115c 100644 --- a/lib/Model/GetSmsEventReport.php +++ b/lib/Model/GetSmsEventReport.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetSmsEventReportEvents.php b/lib/Model/GetSmsEventReportEvents.php index d939e565..35627f1d 100644 --- a/lib/Model/GetSmsEventReportEvents.php +++ b/lib/Model/GetSmsEventReportEvents.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -267,7 +267,7 @@ public function listInvalidProperties() $invalidProperties[] = "'event' can't be null"; } $allowedValues = $this->getEventAllowableValues(); - if (!in_array($this->container['event'], $allowedValues)) { + if (!is_null($this->container['event']) && !in_array($this->container['event'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'event', must be one of '%s'", implode("', '", $allowedValues) @@ -285,24 +285,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['phoneNumber'] === null) { - return false; - } - if ($this->container['date'] === null) { - return false; - } - if ($this->container['messageId'] === null) { - return false; - } - if ($this->container['event'] === null) { - return false; - } - $allowedValues = $this->getEventAllowableValues(); - if (!in_array($this->container['event'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -398,7 +381,7 @@ public function getEvent() public function setEvent($event) { $allowedValues = $this->getEventAllowableValues(); - if (!in_array($event, $allowedValues)) { + if (!in_array($event, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'event', must be one of '%s'", diff --git a/lib/Model/GetSmtpTemplateOverview.php b/lib/Model/GetSmtpTemplateOverview.php index fc119b0d..a38f11c2 100644 --- a/lib/Model/GetSmtpTemplateOverview.php +++ b/lib/Model/GetSmtpTemplateOverview.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -302,44 +302,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['id'] === null) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - if ($this->container['subject'] === null) { - return false; - } - if ($this->container['isActive'] === null) { - return false; - } - if ($this->container['testSent'] === null) { - return false; - } - if ($this->container['sender'] === null) { - return false; - } - if ($this->container['replyTo'] === null) { - return false; - } - if ($this->container['toField'] === null) { - return false; - } - if ($this->container['tag'] === null) { - return false; - } - if ($this->container['htmlContent'] === null) { - return false; - } - if ($this->container['createdAt'] === null) { - return false; - } - if ($this->container['modifiedAt'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetSmtpTemplateOverviewSender.php b/lib/Model/GetSmtpTemplateOverviewSender.php index 7ae6e3fa..ca75fcf2 100644 --- a/lib/Model/GetSmtpTemplateOverviewSender.php +++ b/lib/Model/GetSmtpTemplateOverviewSender.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -58,7 +58,8 @@ class GetSmtpTemplateOverviewSender implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'name' => 'string', - 'email' => 'string' + 'email' => 'string', + 'id' => 'string' ]; /** @@ -68,7 +69,8 @@ class GetSmtpTemplateOverviewSender implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'name' => null, - 'email' => 'email' + 'email' => 'email', + 'id' => null ]; /** @@ -99,7 +101,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'email' => 'email' + 'email' => 'email', + 'id' => 'id' ]; /** @@ -109,7 +112,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'name' => 'setName', - 'email' => 'setEmail' + 'email' => 'setEmail', + 'id' => 'setId' ]; /** @@ -119,7 +123,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'name' => 'getName', - 'email' => 'getEmail' + 'email' => 'getEmail', + 'id' => 'getId' ]; /** @@ -184,6 +189,7 @@ public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; } /** @@ -206,8 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -258,6 +263,30 @@ public function setEmail($email) return $this; } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id Sender id of the template + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/GetSmtpTemplates.php b/lib/Model/GetSmtpTemplates.php index 98d23249..76805c81 100644 --- a/lib/Model/GetSmtpTemplates.php +++ b/lib/Model/GetSmtpTemplates.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -206,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -224,7 +223,7 @@ public function getCount() /** * Sets count * - * @param int $count Count of smtp templates + * @param int $count Count of transactional email templates * * @return $this */ diff --git a/lib/Model/GetSsoToken.php b/lib/Model/GetSsoToken.php index fccdb855..cd159486 100644 --- a/lib/Model/GetSsoToken.php +++ b/lib/Model/GetSsoToken.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -203,11 +203,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['token'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetStatsByBrowser.php b/lib/Model/GetStatsByBrowser.php new file mode 100644 index 00000000..1fb4d1c6 --- /dev/null +++ b/lib/Model/GetStatsByBrowser.php @@ -0,0 +1,276 @@ +listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetStatsByDevice.php b/lib/Model/GetStatsByDevice.php new file mode 100644 index 00000000..da291a58 --- /dev/null +++ b/lib/Model/GetStatsByDevice.php @@ -0,0 +1,391 @@ + 'map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats]', + 'mobile' => 'map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats]', + 'tablet' => 'map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats]', + 'unknown' => 'map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'desktop' => null, + 'mobile' => null, + 'tablet' => null, + 'unknown' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'desktop' => 'desktop', + 'mobile' => 'mobile', + 'tablet' => 'tablet', + 'unknown' => 'unknown' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'desktop' => 'setDesktop', + 'mobile' => 'setMobile', + 'tablet' => 'setTablet', + 'unknown' => 'setUnknown' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'desktop' => 'getDesktop', + 'mobile' => 'getMobile', + 'tablet' => 'getTablet', + 'unknown' => 'getUnknown' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['desktop'] = isset($data['desktop']) ? $data['desktop'] : null; + $this->container['mobile'] = isset($data['mobile']) ? $data['mobile'] : null; + $this->container['tablet'] = isset($data['tablet']) ? $data['tablet'] : null; + $this->container['unknown'] = isset($data['unknown']) ? $data['unknown'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets desktop + * + * @return map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats] + */ + public function getDesktop() + { + return $this->container['desktop']; + } + + /** + * Sets desktop + * + * @param map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats] $desktop Statistics of the campaign on the basis of desktop devices + * + * @return $this + */ + public function setDesktop($desktop) + { + $this->container['desktop'] = $desktop; + + return $this; + } + + /** + * Gets mobile + * + * @return map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats] + */ + public function getMobile() + { + return $this->container['mobile']; + } + + /** + * Sets mobile + * + * @param map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats] $mobile Statistics of the campaign on the basis of mobile devices + * + * @return $this + */ + public function setMobile($mobile) + { + $this->container['mobile'] = $mobile; + + return $this; + } + + /** + * Gets tablet + * + * @return map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats] + */ + public function getTablet() + { + return $this->container['tablet']; + } + + /** + * Sets tablet + * + * @param map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats] $tablet Statistics of the campaign on the basis of tablet devices + * + * @return $this + */ + public function setTablet($tablet) + { + $this->container['tablet'] = $tablet; + + return $this; + } + + /** + * Gets unknown + * + * @return map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats] + */ + public function getUnknown() + { + return $this->container['unknown']; + } + + /** + * Sets unknown + * + * @param map[string,\SendinBlue\Client\Model\GetDeviceBrowserStats] $unknown Statistics of the campaign on the basis of unknown devices + * + * @return $this + */ + public function setUnknown($unknown) + { + $this->container['unknown'] = $unknown; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetStatsByDomain.php b/lib/Model/GetStatsByDomain.php index cedf4f07..15520a28 100644 --- a/lib/Model/GetStatsByDomain.php +++ b/lib/Model/GetStatsByDomain.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -199,11 +199,7 @@ public function listInvalidProperties() */ public function valid() { - if (!parent::valid()) { - return false; - } - - return true; + return count($this->listInvalidProperties()) === 0; } /** diff --git a/lib/Model/GetTransacAggregatedSmsReport.php b/lib/Model/GetTransacAggregatedSmsReport.php index 57bb5016..cc7bea3e 100644 --- a/lib/Model/GetTransacAggregatedSmsReport.php +++ b/lib/Model/GetTransacAggregatedSmsReport.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -284,38 +284,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['range'] === null) { - return false; - } - if ($this->container['requests'] === null) { - return false; - } - if ($this->container['delivered'] === null) { - return false; - } - if ($this->container['hardBounces'] === null) { - return false; - } - if ($this->container['softBounces'] === null) { - return false; - } - if ($this->container['blocked'] === null) { - return false; - } - if ($this->container['unsubscribed'] === null) { - return false; - } - if ($this->container['replied'] === null) { - return false; - } - if ($this->container['accepted'] === null) { - return false; - } - if ($this->container['rejected'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetTransacBlockedContacts.php b/lib/Model/GetTransacBlockedContacts.php new file mode 100644 index 00000000..f1505b9e --- /dev/null +++ b/lib/Model/GetTransacBlockedContacts.php @@ -0,0 +1,331 @@ + 'int', + 'contacts' => '\SendinBlue\Client\Model\GetTransacBlockedContactsContacts[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'count' => 'int64', + 'contacts' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'contacts' => 'contacts' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'contacts' => 'setContacts' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'contacts' => 'getContacts' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['count'] = isset($data['count']) ? $data['count'] : null; + $this->container['contacts'] = isset($data['contacts']) ? $data['contacts'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count Count of blocked or unsubscribed contact + * + * @return $this + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets contacts + * + * @return \SendinBlue\Client\Model\GetTransacBlockedContactsContacts[] + */ + public function getContacts() + { + return $this->container['contacts']; + } + + /** + * Sets contacts + * + * @param \SendinBlue\Client\Model\GetTransacBlockedContactsContacts[] $contacts contacts + * + * @return $this + */ + public function setContacts($contacts) + { + $this->container['contacts'] = $contacts; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetTransacBlockedContactsContacts.php b/lib/Model/GetTransacBlockedContactsContacts.php new file mode 100644 index 00000000..967bcb1c --- /dev/null +++ b/lib/Model/GetTransacBlockedContactsContacts.php @@ -0,0 +1,403 @@ + 'string', + 'senderEmail' => 'string', + 'reason' => '\SendinBlue\Client\Model\GetTransacBlockedContactsReason', + 'blockedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'senderEmail' => 'email', + 'reason' => null, + 'blockedAt' => 'date' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'senderEmail' => 'senderEmail', + 'reason' => 'reason', + 'blockedAt' => 'blockedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'senderEmail' => 'setSenderEmail', + 'reason' => 'setReason', + 'blockedAt' => 'setBlockedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'senderEmail' => 'getSenderEmail', + 'reason' => 'getReason', + 'blockedAt' => 'getBlockedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['senderEmail'] = isset($data['senderEmail']) ? $data['senderEmail'] : null; + $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; + $this->container['blockedAt'] = isset($data['blockedAt']) ? $data['blockedAt'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['senderEmail'] === null) { + $invalidProperties[] = "'senderEmail' can't be null"; + } + if ($this->container['reason'] === null) { + $invalidProperties[] = "'reason' can't be null"; + } + if ($this->container['blockedAt'] === null) { + $invalidProperties[] = "'blockedAt' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address of the blocked or unsubscribed contact + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets senderEmail + * + * @return string + */ + public function getSenderEmail() + { + return $this->container['senderEmail']; + } + + /** + * Sets senderEmail + * + * @param string $senderEmail Sender email address of the blocked or unsubscribed contact + * + * @return $this + */ + public function setSenderEmail($senderEmail) + { + $this->container['senderEmail'] = $senderEmail; + + return $this; + } + + /** + * Gets reason + * + * @return \SendinBlue\Client\Model\GetTransacBlockedContactsReason + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param \SendinBlue\Client\Model\GetTransacBlockedContactsReason $reason reason + * + * @return $this + */ + public function setReason($reason) + { + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets blockedAt + * + * @return \DateTime + */ + public function getBlockedAt() + { + return $this->container['blockedAt']; + } + + /** + * Sets blockedAt + * + * @param \DateTime $blockedAt Date when the contact was blocked or unsubscribed on + * + * @return $this + */ + public function setBlockedAt($blockedAt) + { + $this->container['blockedAt'] = $blockedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetTransacBlockedContactsReason.php b/lib/Model/GetTransacBlockedContactsReason.php new file mode 100644 index 00000000..fdf5fc9e --- /dev/null +++ b/lib/Model/GetTransacBlockedContactsReason.php @@ -0,0 +1,372 @@ + 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'code' => null, + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'code' => 'code', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const CODE_UNSUBSCRIBED_VIA_MA = 'unsubscribedViaMA'; + const CODE_UNSUBSCRIBED_VIA_EMAIL = 'unsubscribedViaEmail'; + const CODE_ADMIN_BLOCKED = 'adminBlocked'; + const CODE_UNSUBSCRIBED_VIA_API = 'unsubscribedViaApi'; + const CODE_HARD_BOUNCE = 'hardBounce'; + const CODE_CONTACT_FLAGGED_AS_SPAM = 'contactFlaggedAsSpam'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCodeAllowableValues() + { + return [ + self::CODE_UNSUBSCRIBED_VIA_MA, + self::CODE_UNSUBSCRIBED_VIA_EMAIL, + self::CODE_ADMIN_BLOCKED, + self::CODE_UNSUBSCRIBED_VIA_API, + self::CODE_HARD_BOUNCE, + self::CODE_CONTACT_FLAGGED_AS_SPAM, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code Reason code for blocking / unsubscribing (This code is safe for comparison) + * + * @return $this + */ + public function setCode($code) + { + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($code) && !in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message Reason for blocking / unsubscribing (This string is not safe for comparison) + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetTransacEmailContent.php b/lib/Model/GetTransacEmailContent.php new file mode 100644 index 00000000..6a30b45b --- /dev/null +++ b/lib/Model/GetTransacEmailContent.php @@ -0,0 +1,499 @@ + 'string', + 'subject' => 'string', + 'templateId' => 'int', + 'date' => '\DateTime', + 'events' => '\SendinBlue\Client\Model\GetTransacEmailContentEvents[]', + 'body' => 'string', + 'attachmentCount' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'subject' => null, + 'templateId' => 'int64', + 'date' => 'date-time', + 'events' => null, + 'body' => null, + 'attachmentCount' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'subject' => 'subject', + 'templateId' => 'templateId', + 'date' => 'date', + 'events' => 'events', + 'body' => 'body', + 'attachmentCount' => 'attachmentCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'subject' => 'setSubject', + 'templateId' => 'setTemplateId', + 'date' => 'setDate', + 'events' => 'setEvents', + 'body' => 'setBody', + 'attachmentCount' => 'setAttachmentCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'subject' => 'getSubject', + 'templateId' => 'getTemplateId', + 'date' => 'getDate', + 'events' => 'getEvents', + 'body' => 'getBody', + 'attachmentCount' => 'getAttachmentCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null; + $this->container['date'] = isset($data['date']) ? $data['date'] : null; + $this->container['events'] = isset($data['events']) ? $data['events'] : null; + $this->container['body'] = isset($data['body']) ? $data['body'] : null; + $this->container['attachmentCount'] = isset($data['attachmentCount']) ? $data['attachmentCount'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['subject'] === null) { + $invalidProperties[] = "'subject' can't be null"; + } + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['events'] === null) { + $invalidProperties[] = "'events' can't be null"; + } + if ($this->container['body'] === null) { + $invalidProperties[] = "'body' can't be null"; + } + if ($this->container['attachmentCount'] === null) { + $invalidProperties[] = "'attachmentCount' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address to which transactional email has been sent + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the sent email + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets templateId + * + * @return int + */ + public function getTemplateId() + { + return $this->container['templateId']; + } + + /** + * Sets templateId + * + * @param int $templateId Id of the template + * + * @return $this + */ + public function setTemplateId($templateId) + { + $this->container['templateId'] = $templateId; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime $date Date on which transactional email was sent + * + * @return $this + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets events + * + * @return \SendinBlue\Client\Model\GetTransacEmailContentEvents[] + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param \SendinBlue\Client\Model\GetTransacEmailContentEvents[] $events Series of events which occurred on the transactional email + * + * @return $this + */ + public function setEvents($events) + { + $this->container['events'] = $events; + + return $this; + } + + /** + * Gets body + * + * @return string + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * + * @param string $body Actual content of the transactional email that has been sent + * + * @return $this + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets attachmentCount + * + * @return int + */ + public function getAttachmentCount() + { + return $this->container['attachmentCount']; + } + + /** + * Sets attachmentCount + * + * @param int $attachmentCount Count of the attachments that were sent in the email + * + * @return $this + */ + public function setAttachmentCount($attachmentCount) + { + $this->container['attachmentCount'] = $attachmentCount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetTransacEmailContentEvents.php b/lib/Model/GetTransacEmailContentEvents.php new file mode 100644 index 00000000..15896a9f --- /dev/null +++ b/lib/Model/GetTransacEmailContentEvents.php @@ -0,0 +1,337 @@ + 'string', + 'time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'name' => null, + 'time' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'time' => 'time' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'time' => 'setTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'time' => 'getTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['time'] = isset($data['time']) ? $data['time'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['time'] === null) { + $invalidProperties[] = "'time' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the event that occurred on the sent email + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets time + * + * @return \DateTime + */ + public function getTime() + { + return $this->container['time']; + } + + /** + * Sets time + * + * @param \DateTime $time Time at which the event occurred + * + * @return $this + */ + public function setTime($time) + { + $this->container['time'] = $time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetTransacEmailsList.php b/lib/Model/GetTransacEmailsList.php new file mode 100644 index 00000000..486ff66f --- /dev/null +++ b/lib/Model/GetTransacEmailsList.php @@ -0,0 +1,301 @@ + '\SendinBlue\Client\Model\GetTransacEmailsListTransactionalEmails[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'transactionalEmails' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'transactionalEmails' => 'transactionalEmails' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transactionalEmails' => 'setTransactionalEmails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transactionalEmails' => 'getTransactionalEmails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['transactionalEmails'] = isset($data['transactionalEmails']) ? $data['transactionalEmails'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets transactionalEmails + * + * @return \SendinBlue\Client\Model\GetTransacEmailsListTransactionalEmails[] + */ + public function getTransactionalEmails() + { + return $this->container['transactionalEmails']; + } + + /** + * Sets transactionalEmails + * + * @param \SendinBlue\Client\Model\GetTransacEmailsListTransactionalEmails[] $transactionalEmails transactionalEmails + * + * @return $this + */ + public function setTransactionalEmails($transactionalEmails) + { + $this->container['transactionalEmails'] = $transactionalEmails; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetTransacEmailsListTransactionalEmails.php b/lib/Model/GetTransacEmailsListTransactionalEmails.php new file mode 100644 index 00000000..e27ef851 --- /dev/null +++ b/lib/Model/GetTransacEmailsListTransactionalEmails.php @@ -0,0 +1,466 @@ + 'string', + 'subject' => 'string', + 'templateId' => 'int', + 'messageId' => 'string', + 'uuid' => 'string', + 'date' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => 'email', + 'subject' => null, + 'templateId' => 'int64', + 'messageId' => null, + 'uuid' => null, + 'date' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'subject' => 'subject', + 'templateId' => 'templateId', + 'messageId' => 'messageId', + 'uuid' => 'uuid', + 'date' => 'date' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'subject' => 'setSubject', + 'templateId' => 'setTemplateId', + 'messageId' => 'setMessageId', + 'uuid' => 'setUuid', + 'date' => 'setDate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'subject' => 'getSubject', + 'templateId' => 'getTemplateId', + 'messageId' => 'getMessageId', + 'uuid' => 'getUuid', + 'date' => 'getDate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['templateId'] = isset($data['templateId']) ? $data['templateId'] : null; + $this->container['messageId'] = isset($data['messageId']) ? $data['messageId'] : null; + $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null; + $this->container['date'] = isset($data['date']) ? $data['date'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['subject'] === null) { + $invalidProperties[] = "'subject' can't be null"; + } + if ($this->container['messageId'] === null) { + $invalidProperties[] = "'messageId' can't be null"; + } + if ($this->container['uuid'] === null) { + $invalidProperties[] = "'uuid' can't be null"; + } + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address to which transactional email has been sent + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the sent email + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets templateId + * + * @return int + */ + public function getTemplateId() + { + return $this->container['templateId']; + } + + /** + * Sets templateId + * + * @param int $templateId Id of the template + * + * @return $this + */ + public function setTemplateId($templateId) + { + $this->container['templateId'] = $templateId; + + return $this; + } + + /** + * Gets messageId + * + * @return string + */ + public function getMessageId() + { + return $this->container['messageId']; + } + + /** + * Sets messageId + * + * @param string $messageId Message Id of the sent email + * + * @return $this + */ + public function setMessageId($messageId) + { + $this->container['messageId'] = $messageId; + + return $this; + } + + /** + * Gets uuid + * + * @return string + */ + public function getUuid() + { + return $this->container['uuid']; + } + + /** + * Sets uuid + * + * @param string $uuid Unique id of the email sent to a particular contact + * + * @return $this + */ + public function setUuid($uuid) + { + $this->container['uuid'] = $uuid; + + return $this; + } + + /** + * Gets date + * + * @return \DateTime + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param \DateTime $date Date on which transactional email was sent + * + * @return $this + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GetTransacSmsReport.php b/lib/Model/GetTransacSmsReport.php index 8de91a6f..24767e07 100644 --- a/lib/Model/GetTransacSmsReport.php +++ b/lib/Model/GetTransacSmsReport.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetTransacSmsReportReports.php b/lib/Model/GetTransacSmsReportReports.php index 232e1e84..8cf66000 100644 --- a/lib/Model/GetTransacSmsReportReports.php +++ b/lib/Model/GetTransacSmsReportReports.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -284,38 +284,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['date'] === null) { - return false; - } - if ($this->container['requests'] === null) { - return false; - } - if ($this->container['delivered'] === null) { - return false; - } - if ($this->container['hardBounces'] === null) { - return false; - } - if ($this->container['softBounces'] === null) { - return false; - } - if ($this->container['blocked'] === null) { - return false; - } - if ($this->container['unsubscribed'] === null) { - return false; - } - if ($this->container['replied'] === null) { - return false; - } - if ($this->container['accepted'] === null) { - return false; - } - if ($this->container['rejected'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/GetWebhook.php b/lib/Model/GetWebhook.php index be799198..fdccd4c4 100644 --- a/lib/Model/GetWebhook.php +++ b/lib/Model/GetWebhook.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -256,7 +256,7 @@ public function listInvalidProperties() $invalidProperties[] = "'type' can't be null"; } $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'type', must be one of '%s'", implode("', '", $allowedValues) @@ -280,33 +280,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['url'] === null) { - return false; - } - if ($this->container['id'] === null) { - return false; - } - if ($this->container['description'] === null) { - return false; - } - if ($this->container['events'] === null) { - return false; - } - if ($this->container['type'] === null) { - return false; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { - return false; - } - if ($this->container['createdAt'] === null) { - return false; - } - if ($this->container['modifiedAt'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -426,7 +400,7 @@ public function getType() public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues)) { + if (!in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'type', must be one of '%s'", diff --git a/lib/Model/GetWebhooks.php b/lib/Model/GetWebhooks.php index 302be51f..ffd15faa 100644 --- a/lib/Model/GetWebhooks.php +++ b/lib/Model/GetWebhooks.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -203,11 +203,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['webhooks'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/ManageIp.php b/lib/Model/ManageIp.php index 9fc28a7d..60b4616e 100644 --- a/lib/Model/ManageIp.php +++ b/lib/Model/ManageIp.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 79f6796d..d87ff711 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/lib/Model/PostContactInfo.php b/lib/Model/PostContactInfo.php index e0bd5e85..bd83c4bf 100644 --- a/lib/Model/PostContactInfo.php +++ b/lib/Model/PostContactInfo.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -203,11 +203,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['contacts'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/PostContactInfoContacts.php b/lib/Model/PostContactInfoContacts.php index b6c9a1c1..196b0b2a 100644 --- a/lib/Model/PostContactInfoContacts.php +++ b/lib/Model/PostContactInfoContacts.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,8 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/PostSendFailed.php b/lib/Model/PostSendFailed.php index b0b71f35..34c3f039 100644 --- a/lib/Model/PostSendFailed.php +++ b/lib/Model/PostSendFailed.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -230,14 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['code'] === null) { - return false; - } - if ($this->container['message'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/PostSendSmsTestFailed.php b/lib/Model/PostSendSmsTestFailed.php index 07ed3ccc..9c632ebe 100644 --- a/lib/Model/PostSendSmsTestFailed.php +++ b/lib/Model/PostSendSmsTestFailed.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -224,14 +224,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['code'] === null) { - return false; - } - if ($this->container['message'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/RemainingCreditModel.php b/lib/Model/RemainingCreditModel.php index 95cad1e7..64d3ce44 100644 --- a/lib/Model/RemainingCreditModel.php +++ b/lib/Model/RemainingCreditModel.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['child'] === null) { - return false; - } - if ($this->container['reseller'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/RemainingCreditModelChild.php b/lib/Model/RemainingCreditModelChild.php index 088bd9ad..e203b977 100644 --- a/lib/Model/RemainingCreditModelChild.php +++ b/lib/Model/RemainingCreditModelChild.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -213,14 +213,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['sms'] === null) { - return false; - } - if ($this->container['email'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/RemainingCreditModelReseller.php b/lib/Model/RemainingCreditModelReseller.php index c6398f90..bd258222 100644 --- a/lib/Model/RemainingCreditModelReseller.php +++ b/lib/Model/RemainingCreditModelReseller.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['sms'] === null) { - return false; - } - if ($this->container['email'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/RemoveContactFromList.php b/lib/Model/RemoveContactFromList.php index 017371b1..d8f46ec0 100644 --- a/lib/Model/RemoveContactFromList.php +++ b/lib/Model/RemoveContactFromList.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -206,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/RemoveCredits.php b/lib/Model/RemoveCredits.php index 9f9aaf92..58371942 100644 --- a/lib/Model/RemoveCredits.php +++ b/lib/Model/RemoveCredits.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -206,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/RequestContactExport.php b/lib/Model/RequestContactExport.php index 42d86ae5..627f2bc6 100644 --- a/lib/Model/RequestContactExport.php +++ b/lib/Model/RequestContactExport.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,7 @@ class RequestContactExport implements ModelInterface, ArrayAccess protected static $swaggerTypes = [ 'exportAttributes' => 'string[]', 'contactFilter' => 'object', + 'customContactFilter' => '\SendinBlue\Client\Model\RequestContactExportCustomContactFilter', 'notifyUrl' => 'string' ]; @@ -70,6 +71,7 @@ class RequestContactExport implements ModelInterface, ArrayAccess protected static $swaggerFormats = [ 'exportAttributes' => null, 'contactFilter' => null, + 'customContactFilter' => null, 'notifyUrl' => 'url' ]; @@ -102,6 +104,7 @@ public static function swaggerFormats() protected static $attributeMap = [ 'exportAttributes' => 'exportAttributes', 'contactFilter' => 'contactFilter', + 'customContactFilter' => 'customContactFilter', 'notifyUrl' => 'notifyUrl' ]; @@ -113,6 +116,7 @@ public static function swaggerFormats() protected static $setters = [ 'exportAttributes' => 'setExportAttributes', 'contactFilter' => 'setContactFilter', + 'customContactFilter' => 'setCustomContactFilter', 'notifyUrl' => 'setNotifyUrl' ]; @@ -124,6 +128,7 @@ public static function swaggerFormats() protected static $getters = [ 'exportAttributes' => 'getExportAttributes', 'contactFilter' => 'getContactFilter', + 'customContactFilter' => 'getCustomContactFilter', 'notifyUrl' => 'getNotifyUrl' ]; @@ -189,6 +194,7 @@ public function __construct(array $data = null) { $this->container['exportAttributes'] = isset($data['exportAttributes']) ? $data['exportAttributes'] : null; $this->container['contactFilter'] = isset($data['contactFilter']) ? $data['contactFilter'] : null; + $this->container['customContactFilter'] = isset($data['customContactFilter']) ? $data['customContactFilter'] : null; $this->container['notifyUrl'] = isset($data['notifyUrl']) ? $data['notifyUrl'] : null; } @@ -201,9 +207,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['contactFilter'] === null) { - $invalidProperties[] = "'contactFilter' can't be null"; - } return $invalidProperties; } @@ -215,11 +218,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['contactFilter'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -260,7 +259,7 @@ public function getContactFilter() /** * Sets contactFilter * - * @param object $contactFilter Set the filter for the contacts to be exported. For example, `{\"blacklisted\":true}` will export all the blacklisted contacts. + * @param object $contactFilter This attribute has been deprecated and will be removed by January 1st, 2021. Only one of the two filter options (contactFilter or customContactFilter) can be passed in the request. Set the filter for the contacts to be exported. For example, {'blacklisted':true} will export all the blacklisted contacts. * * @return $this */ @@ -271,6 +270,30 @@ public function setContactFilter($contactFilter) return $this; } + /** + * Gets customContactFilter + * + * @return \SendinBlue\Client\Model\RequestContactExportCustomContactFilter + */ + public function getCustomContactFilter() + { + return $this->container['customContactFilter']; + } + + /** + * Sets customContactFilter + * + * @param \SendinBlue\Client\Model\RequestContactExportCustomContactFilter $customContactFilter customContactFilter + * + * @return $this + */ + public function setCustomContactFilter($customContactFilter) + { + $this->container['customContactFilter'] = $customContactFilter; + + return $this; + } + /** * Gets notifyUrl * diff --git a/lib/Model/RequestContactExportCustomContactFilter.php b/lib/Model/RequestContactExportCustomContactFilter.php new file mode 100644 index 00000000..aaa2f5f2 --- /dev/null +++ b/lib/Model/RequestContactExportCustomContactFilter.php @@ -0,0 +1,564 @@ + 'string', + 'actionForEmailCampaigns' => 'string', + 'actionForSmsCampaigns' => 'string', + 'listId' => 'int', + 'emailCampaignId' => 'int', + 'smsCampaignId' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'actionForContacts' => null, + 'actionForEmailCampaigns' => null, + 'actionForSmsCampaigns' => null, + 'listId' => 'int64', + 'emailCampaignId' => 'int64', + 'smsCampaignId' => 'int64' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'actionForContacts' => 'actionForContacts', + 'actionForEmailCampaigns' => 'actionForEmailCampaigns', + 'actionForSmsCampaigns' => 'actionForSmsCampaigns', + 'listId' => 'listId', + 'emailCampaignId' => 'emailCampaignId', + 'smsCampaignId' => 'smsCampaignId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'actionForContacts' => 'setActionForContacts', + 'actionForEmailCampaigns' => 'setActionForEmailCampaigns', + 'actionForSmsCampaigns' => 'setActionForSmsCampaigns', + 'listId' => 'setListId', + 'emailCampaignId' => 'setEmailCampaignId', + 'smsCampaignId' => 'setSmsCampaignId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'actionForContacts' => 'getActionForContacts', + 'actionForEmailCampaigns' => 'getActionForEmailCampaigns', + 'actionForSmsCampaigns' => 'getActionForSmsCampaigns', + 'listId' => 'getListId', + 'emailCampaignId' => 'getEmailCampaignId', + 'smsCampaignId' => 'getSmsCampaignId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + const ACTION_FOR_CONTACTS_ALL_CONTACTS = 'allContacts'; + const ACTION_FOR_CONTACTS_SUBSCRIBED = 'subscribed'; + const ACTION_FOR_CONTACTS_UNSUBSCRIBED = 'unsubscribed'; + const ACTION_FOR_CONTACTS_UNSUBSCRIBED_PER_LIST = 'unsubscribedPerList'; + const ACTION_FOR_EMAIL_CAMPAIGNS_OPENERS = 'openers'; + const ACTION_FOR_EMAIL_CAMPAIGNS_NON_OPENERS = 'nonOpeners'; + const ACTION_FOR_EMAIL_CAMPAIGNS_CLICKERS = 'clickers'; + const ACTION_FOR_EMAIL_CAMPAIGNS_NON_CLICKERS = 'nonClickers'; + const ACTION_FOR_EMAIL_CAMPAIGNS_UNSUBSCRIBED = 'unsubscribed'; + const ACTION_FOR_EMAIL_CAMPAIGNS_HARD_BOUNCES = 'hardBounces'; + const ACTION_FOR_EMAIL_CAMPAIGNS_SOFT_BOUNCES = 'softBounces'; + const ACTION_FOR_SMS_CAMPAIGNS_HARD_BOUNCES = 'hardBounces'; + const ACTION_FOR_SMS_CAMPAIGNS_SOFT_BOUNCES = 'softBounces'; + const ACTION_FOR_SMS_CAMPAIGNS_UNSUBSCRIBED = 'unsubscribed'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getActionForContactsAllowableValues() + { + return [ + self::ACTION_FOR_CONTACTS_ALL_CONTACTS, + self::ACTION_FOR_CONTACTS_SUBSCRIBED, + self::ACTION_FOR_CONTACTS_UNSUBSCRIBED, + self::ACTION_FOR_CONTACTS_UNSUBSCRIBED_PER_LIST, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getActionForEmailCampaignsAllowableValues() + { + return [ + self::ACTION_FOR_EMAIL_CAMPAIGNS_OPENERS, + self::ACTION_FOR_EMAIL_CAMPAIGNS_NON_OPENERS, + self::ACTION_FOR_EMAIL_CAMPAIGNS_CLICKERS, + self::ACTION_FOR_EMAIL_CAMPAIGNS_NON_CLICKERS, + self::ACTION_FOR_EMAIL_CAMPAIGNS_UNSUBSCRIBED, + self::ACTION_FOR_EMAIL_CAMPAIGNS_HARD_BOUNCES, + self::ACTION_FOR_EMAIL_CAMPAIGNS_SOFT_BOUNCES, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getActionForSmsCampaignsAllowableValues() + { + return [ + self::ACTION_FOR_SMS_CAMPAIGNS_HARD_BOUNCES, + self::ACTION_FOR_SMS_CAMPAIGNS_SOFT_BOUNCES, + self::ACTION_FOR_SMS_CAMPAIGNS_UNSUBSCRIBED, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['actionForContacts'] = isset($data['actionForContacts']) ? $data['actionForContacts'] : null; + $this->container['actionForEmailCampaigns'] = isset($data['actionForEmailCampaigns']) ? $data['actionForEmailCampaigns'] : null; + $this->container['actionForSmsCampaigns'] = isset($data['actionForSmsCampaigns']) ? $data['actionForSmsCampaigns'] : null; + $this->container['listId'] = isset($data['listId']) ? $data['listId'] : null; + $this->container['emailCampaignId'] = isset($data['emailCampaignId']) ? $data['emailCampaignId'] : null; + $this->container['smsCampaignId'] = isset($data['smsCampaignId']) ? $data['smsCampaignId'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getActionForContactsAllowableValues(); + if (!is_null($this->container['actionForContacts']) && !in_array($this->container['actionForContacts'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'actionForContacts', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getActionForEmailCampaignsAllowableValues(); + if (!is_null($this->container['actionForEmailCampaigns']) && !in_array($this->container['actionForEmailCampaigns'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'actionForEmailCampaigns', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getActionForSmsCampaignsAllowableValues(); + if (!is_null($this->container['actionForSmsCampaigns']) && !in_array($this->container['actionForSmsCampaigns'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'actionForSmsCampaigns', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets actionForContacts + * + * @return string + */ + public function getActionForContacts() + { + return $this->container['actionForContacts']; + } + + /** + * Sets actionForContacts + * + * @param string $actionForContacts Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on contacts as per the list id. * allContacts - Fetch the list of all contacts for a particular list. * subscribed & unsubscribed - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * unsubscribedPerList - Fetch the list of contacts that are unsubscribed from a particular list only. + * + * @return $this + */ + public function setActionForContacts($actionForContacts) + { + $allowedValues = $this->getActionForContactsAllowableValues(); + if (!is_null($actionForContacts) && !in_array($actionForContacts, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'actionForContacts', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['actionForContacts'] = $actionForContacts; + + return $this; + } + + /** + * Gets actionForEmailCampaigns + * + * @return string + */ + public function getActionForEmailCampaigns() + { + return $this->container['actionForEmailCampaigns']; + } + + /** + * Sets actionForEmailCampaigns + * + * @param string $actionForEmailCampaigns Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on email campaigns. * openers & nonOpeners - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * clickers & nonClickers - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * unsubscribed - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * hardBounces & softBounces - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). + * + * @return $this + */ + public function setActionForEmailCampaigns($actionForEmailCampaigns) + { + $allowedValues = $this->getActionForEmailCampaignsAllowableValues(); + if (!is_null($actionForEmailCampaigns) && !in_array($actionForEmailCampaigns, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'actionForEmailCampaigns', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['actionForEmailCampaigns'] = $actionForEmailCampaigns; + + return $this; + } + + /** + * Gets actionForSmsCampaigns + * + * @return string + */ + public function getActionForSmsCampaigns() + { + return $this->container['actionForSmsCampaigns']; + } + + /** + * Sets actionForSmsCampaigns + * + * @param string $actionForSmsCampaigns Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed. This will export the contacts on the basis of provided action applied on sms campaigns. * unsubscribed - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * hardBounces & softBounces - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. + * + * @return $this + */ + public function setActionForSmsCampaigns($actionForSmsCampaigns) + { + $allowedValues = $this->getActionForSmsCampaignsAllowableValues(); + if (!is_null($actionForSmsCampaigns) && !in_array($actionForSmsCampaigns, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'actionForSmsCampaigns', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['actionForSmsCampaigns'] = $actionForSmsCampaigns; + + return $this; + } + + /** + * Gets listId + * + * @return int + */ + public function getListId() + { + return $this->container['listId']; + } + + /** + * Sets listId + * + * @param int $listId Mandatory if actionForContacts is passed, ignored otherwise. Id of the list for which the corresponding action shall be applied in the filter. + * + * @return $this + */ + public function setListId($listId) + { + $this->container['listId'] = $listId; + + return $this; + } + + /** + * Gets emailCampaignId + * + * @return int + */ + public function getEmailCampaignId() + { + return $this->container['emailCampaignId']; + } + + /** + * Sets emailCampaignId + * + * @param int $emailCampaignId Considered only if actionForEmailCampaigns is passed, ignored otherwise. Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed. The id of the email campaign for which the corresponding action shall be applied in the filter. + * + * @return $this + */ + public function setEmailCampaignId($emailCampaignId) + { + $this->container['emailCampaignId'] = $emailCampaignId; + + return $this; + } + + /** + * Gets smsCampaignId + * + * @return int + */ + public function getSmsCampaignId() + { + return $this->container['smsCampaignId']; + } + + /** + * Sets smsCampaignId + * + * @param int $smsCampaignId Considered only if actionForSmsCampaigns is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. + * + * @return $this + */ + public function setSmsCampaignId($smsCampaignId) + { + $this->container['smsCampaignId'] = $smsCampaignId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RequestContactImport.php b/lib/Model/RequestContactImport.php index b545b75e..089051f1 100644 --- a/lib/Model/RequestContactImport.php +++ b/lib/Model/RequestContactImport.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -248,8 +248,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/RequestContactImportNewList.php b/lib/Model/RequestContactImportNewList.php index ec1ebdae..7b75a557 100644 --- a/lib/Model/RequestContactImportNewList.php +++ b/lib/Model/RequestContactImportNewList.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -207,8 +207,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/RequestSMSRecipientExport.php b/lib/Model/RequestSMSRecipientExport.php index d8797cef..655fa259 100644 --- a/lib/Model/RequestSMSRecipientExport.php +++ b/lib/Model/RequestSMSRecipientExport.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -222,7 +222,7 @@ public function listInvalidProperties() $invalidProperties[] = "'recipientsType' can't be null"; } $allowedValues = $this->getRecipientsTypeAllowableValues(); - if (!in_array($this->container['recipientsType'], $allowedValues)) { + if (!is_null($this->container['recipientsType']) && !in_array($this->container['recipientsType'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'recipientsType', must be one of '%s'", implode("', '", $allowedValues) @@ -240,15 +240,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['recipientsType'] === null) { - return false; - } - $allowedValues = $this->getRecipientsTypeAllowableValues(); - if (!in_array($this->container['recipientsType'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -296,7 +288,7 @@ public function getRecipientsType() public function setRecipientsType($recipientsType) { $allowedValues = $this->getRecipientsTypeAllowableValues(); - if (!in_array($recipientsType, $allowedValues)) { + if (!in_array($recipientsType, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'recipientsType', must be one of '%s'", diff --git a/lib/Model/SendEmail.php b/lib/Model/SendEmail.php index 93f9ec3d..3ecd6be6 100644 --- a/lib/Model/SendEmail.php +++ b/lib/Model/SendEmail.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -251,11 +251,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['emailTo'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -392,7 +388,7 @@ public function getAttachment() /** * Sets attachment * - * @param \SendinBlue\Client\Model\SendEmailAttachment[] $attachment Pass the list of content (base64 encoded) and name of the attachment. For example, `[{\"content\":\"base64 encoded content 1\", \"name\":\"attcahment1\"}, {\"content\":\"base64 encoded content 2\", \"name\":\"attcahment2\"}]` + * @param \SendinBlue\Client\Model\SendEmailAttachment[] $attachment Pass the list of content (base64 encoded) and name of the attachment. For example, [{'content':'base64 encoded content 1', 'name':'attcahment1'}, {'content':'base64 encoded content 2', 'name':'attcahment2'}]. * * @return $this */ @@ -416,7 +412,7 @@ public function getHeaders() /** * Sets headers * - * @param object $headers Pass the set of headers that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, `{\"Content-Type\":\"text/html\", \"charset\":\"iso-8859-1\", \"sender.ip\":\"1.2.3.4\"}` + * @param object $headers Pass the set of headers that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, {'Content-Type':'text/html', 'charset':'iso-8859-1', 'sender.ip':'1.2.3.4'} * * @return $this */ @@ -440,7 +436,7 @@ public function getAttributes() /** * Sets attributes * - * @param object $attributes Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"} + * @param object $attributes Pass the set of attributes to customize the template. For example, {'FNAME':'Joe', 'LNAME':'Doe'} * * @return $this */ diff --git a/lib/Model/SendEmailAttachment.php b/lib/Model/SendEmailAttachment.php index a36e8ef2..15bbdf5a 100644 --- a/lib/Model/SendEmailAttachment.php +++ b/lib/Model/SendEmailAttachment.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -216,17 +216,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['content'] === null) { - return false; - } - if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['content'])) { - return false; - } - if ($this->container['name'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/SendReport.php b/lib/Model/SendReport.php index 73f77c29..e9949bef 100644 --- a/lib/Model/SendReport.php +++ b/lib/Model/SendReport.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -219,7 +219,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getLanguageAllowableValues(); - if (!in_array($this->container['language'], $allowedValues)) { + if (!is_null($this->container['language']) && !in_array($this->container['language'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'language', must be one of '%s'", implode("', '", $allowedValues) @@ -240,15 +240,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getLanguageAllowableValues(); - if (!in_array($this->container['language'], $allowedValues)) { - return false; - } - if ($this->container['email'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -272,7 +264,7 @@ public function getLanguage() public function setLanguage($language) { $allowedValues = $this->getLanguageAllowableValues(); - if (!is_null($language) && !in_array($language, $allowedValues)) { + if (!is_null($language) && !in_array($language, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'language', must be one of '%s'", diff --git a/lib/Model/SendReportEmail.php b/lib/Model/SendReportEmail.php index 0f42a2d9..e145810a 100644 --- a/lib/Model/SendReportEmail.php +++ b/lib/Model/SendReportEmail.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -242,7 +242,7 @@ public function listInvalidProperties() $invalidProperties[] = "'to' can't be null"; } $allowedValues = $this->getContentTypeAllowableValues(); - if (!in_array($this->container['contentType'], $allowedValues)) { + if (!is_null($this->container['contentType']) && !in_array($this->container['contentType'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'contentType', must be one of '%s'", implode("', '", $allowedValues) @@ -263,21 +263,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['subject'] === null) { - return false; - } - if ($this->container['to'] === null) { - return false; - } - $allowedValues = $this->getContentTypeAllowableValues(); - if (!in_array($this->container['contentType'], $allowedValues)) { - return false; - } - if ($this->container['body'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -349,7 +335,7 @@ public function getContentType() public function setContentType($contentType) { $allowedValues = $this->getContentTypeAllowableValues(); - if (!is_null($contentType) && !in_array($contentType, $allowedValues)) { + if (!is_null($contentType) && !in_array($contentType, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'contentType', must be one of '%s'", diff --git a/lib/Model/SendSms.php b/lib/Model/SendSms.php index f6c3e71f..c991b8aa 100644 --- a/lib/Model/SendSms.php +++ b/lib/Model/SendSms.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -230,14 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['reference'] === null) { - return false; - } - if ($this->container['messageId'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/SendSmtpEmail.php b/lib/Model/SendSmtpEmail.php index c9c6c9c3..81f00479 100644 --- a/lib/Model/SendSmtpEmail.php +++ b/lib/Model/SendSmtpEmail.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -275,11 +275,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['to'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -320,7 +316,7 @@ public function getTo() /** * Sets to * - * @param \SendinBlue\Client\Model\SendSmtpEmailTo[] $to List of email addresses and names (optional) of the recipients. For example, `[{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}]` + * @param \SendinBlue\Client\Model\SendSmtpEmailTo[] $to List of email addresses and names (optional) of the recipients. For example, [{'name':'Jimmy', 'email':'jimmy98@example.com'}, {'name':'Joe', 'email':'joe@example.com'}] * * @return $this */ @@ -488,7 +484,7 @@ public function getAttachment() /** * Sets attachment * - * @param \SendinBlue\Client\Model\SendSmtpEmailAttachment[] $attachment Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"My attachment 1\"}, {\"content\":\"base64 exmaple content\", \"name\":\"My attachment 2\"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps and odt ( If 'templateId' is passed and is in New Template Language format then only attachment url is accepted. If template is in Old template Language format, then 'attachment' is ignored ) + * @param \SendinBlue\Client\Model\SendSmtpEmailAttachment[] $attachment Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"My attachment 1\"}, {\"content\":\"base64 exmaple content\", \"name\":\"My attachment 2\"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg and wmv ( If 'templateId' is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then 'attachment' is ignored ) * * @return $this */ @@ -512,7 +508,7 @@ public function getHeaders() /** * Sets headers * - * @param object $headers Pass the set of headers that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, `{\"Content-Type\":\"text/html\", \"charset\":\"iso-8859-1\", \"sender.ip\":\"1.2.3.4\"}` + * @param object $headers Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, `{\"sender.ip\":\"1.2.3.4\", \"X-Mailin-custom\":\"some_custom_header\"}`. * * @return $this */ @@ -560,7 +556,7 @@ public function getParams() /** * Sets params * - * @param object $params Pass the set of attributes to customize the template. For example, `{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}`. It's considered only if template is in New Template Language format. + * @param object $params Pass the set of attributes to customize the template. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. It's considered only if template is in New Template Language format. Alternatively, you can pass the set of attributes to customize the template for each recipient. For this the email will be the key and its value will be a JSON containing attributes specific to each recipient. For example, `{'abc@example.com':{'name':'ABC', 'age':21}, 'xyz@example.com':{'name':'XYZ', 'age':25}}` * * @return $this */ diff --git a/lib/Model/SendSmtpEmailAttachment.php b/lib/Model/SendSmtpEmailAttachment.php index 48909d12..1bc49fdb 100644 --- a/lib/Model/SendSmtpEmailAttachment.php +++ b/lib/Model/SendSmtpEmailAttachment.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -216,11 +216,7 @@ public function listInvalidProperties() */ public function valid() { - - if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['content'])) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/SendSmtpEmailBcc.php b/lib/Model/SendSmtpEmailBcc.php index 50d5a205..98618377 100644 --- a/lib/Model/SendSmtpEmailBcc.php +++ b/lib/Model/SendSmtpEmailBcc.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -209,11 +209,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -254,7 +250,7 @@ public function getName() /** * Sets name * - * @param string $name Name of the recipient in bcc + * @param string $name Name of the recipient in bcc. Maximum allowed characters are 70. * * @return $this */ diff --git a/lib/Model/SendSmtpEmailCc.php b/lib/Model/SendSmtpEmailCc.php index c73cc01d..9104228c 100644 --- a/lib/Model/SendSmtpEmailCc.php +++ b/lib/Model/SendSmtpEmailCc.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -209,11 +209,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -254,7 +250,7 @@ public function getName() /** * Sets name * - * @param string $name Name of the recipient in cc + * @param string $name Name of the recipient in cc. Maximum allowed characters are 70. * * @return $this */ diff --git a/lib/Model/SendSmtpEmailReplyTo.php b/lib/Model/SendSmtpEmailReplyTo.php index ded04bc9..8bee4791 100644 --- a/lib/Model/SendSmtpEmailReplyTo.php +++ b/lib/Model/SendSmtpEmailReplyTo.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -36,7 +36,7 @@ * SendSmtpEmailReplyTo Class Doc Comment * * @category Class - * @description Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, `{\"email':'ann6533@example.com', 'name':'Ann'}` + * @description Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, {'email':'ann6533@example.com', 'name':'Ann'}. * @package SendinBlue\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -210,11 +210,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -255,7 +251,7 @@ public function getName() /** * Sets name * - * @param string $name Name in reply to + * @param string $name Name in reply to. Maximum allowed characters are 70. * * @return $this */ diff --git a/lib/Model/SendSmtpEmailSender.php b/lib/Model/SendSmtpEmailSender.php index ce50e46b..e146ea46 100644 --- a/lib/Model/SendSmtpEmailSender.php +++ b/lib/Model/SendSmtpEmailSender.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -36,7 +36,7 @@ * SendSmtpEmailSender Class Doc Comment * * @category Class - * @description Mandatory if 'templateId' is not passed. Pass name (optional) and email of sender from which emails will be sent. For example, `{\"name\":\"Mary from MyShop\", \"email\":\"no-reply@myshop.com\"}` + * @description Mandatory if 'templateId' is not passed. Pass name (optional) and email of sender from which emails will be sent. For example, {'name':'Mary from MyShop', 'email':'no-reply@myshop.com'} * @package SendinBlue\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -210,11 +210,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -231,7 +227,7 @@ public function getName() /** * Sets name * - * @param string $name Name of the sender from which the emails will be sent + * @param string $name Name of the sender from which the emails will be sent. Maximum allowed characters are 70. * * @return $this */ diff --git a/lib/Model/SendSmtpEmailTo.php b/lib/Model/SendSmtpEmailTo.php index eec8a18d..dd046a53 100644 --- a/lib/Model/SendSmtpEmailTo.php +++ b/lib/Model/SendSmtpEmailTo.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -209,11 +209,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['email'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -254,7 +250,7 @@ public function getName() /** * Sets name * - * @param string $name Name of the recipient + * @param string $name Name of the recipient. Maximum allowed characters are 70. * * @return $this */ diff --git a/lib/Model/SendTemplateEmail.php b/lib/Model/SendTemplateEmail.php index 7dac2431..8fa7c5ad 100644 --- a/lib/Model/SendTemplateEmail.php +++ b/lib/Model/SendTemplateEmail.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -203,11 +203,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['messageId'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/SendTestEmail.php b/lib/Model/SendTestEmail.php index 4131759a..126c77f7 100644 --- a/lib/Model/SendTestEmail.php +++ b/lib/Model/SendTestEmail.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/SendTestSms.php b/lib/Model/SendTestSms.php index f2576d33..b9e957b9 100644 --- a/lib/Model/SendTestSms.php +++ b/lib/Model/SendTestSms.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/SendTransacSms.php b/lib/Model/SendTransacSms.php index 44b9201a..01420c80 100644 --- a/lib/Model/SendTransacSms.php +++ b/lib/Model/SendTransacSms.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -237,7 +237,7 @@ public function listInvalidProperties() if ($this->container['sender'] === null) { $invalidProperties[] = "'sender' can't be null"; } - if ((strlen($this->container['sender']) > 11)) { + if ((mb_strlen($this->container['sender']) > 11)) { $invalidProperties[] = "invalid value for 'sender', the character length must be smaller than or equal to 11."; } @@ -248,7 +248,7 @@ public function listInvalidProperties() $invalidProperties[] = "'content' can't be null"; } $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'type', must be one of '%s'", implode("', '", $allowedValues) @@ -266,24 +266,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['sender'] === null) { - return false; - } - if (strlen($this->container['sender']) > 11) { - return false; - } - if ($this->container['recipient'] === null) { - return false; - } - if ($this->container['content'] === null) { - return false; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($this->container['type'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -306,7 +289,7 @@ public function getSender() */ public function setSender($sender) { - if ((strlen($sender) > 11)) { + if ((mb_strlen($sender) > 11)) { throw new \InvalidArgumentException('invalid length for $sender when calling SendTransacSms., must be smaller than or equal to 11.'); } @@ -383,7 +366,7 @@ public function getType() public function setType($type) { $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($type) && !in_array($type, $allowedValues)) { + if (!is_null($type) && !in_array($type, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'type', must be one of '%s'", diff --git a/lib/Model/UpdateAttribute.php b/lib/Model/UpdateAttribute.php index 7228a816..a26ef994 100644 --- a/lib/Model/UpdateAttribute.php +++ b/lib/Model/UpdateAttribute.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -206,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -248,7 +247,7 @@ public function getEnumeration() /** * Sets enumeration * - * @param \SendinBlue\Client\Model\UpdateAttributeEnumeration[] $enumeration List of the values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, `[{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]` + * @param \SendinBlue\Client\Model\UpdateAttributeEnumeration[] $enumeration List of the values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{'value':1, 'label':'male'}, {'value':2, 'label':'female'}] * * @return $this */ diff --git a/lib/Model/UpdateAttributeEnumeration.php b/lib/Model/UpdateAttributeEnumeration.php index 7c67fbc6..0023dad9 100644 --- a/lib/Model/UpdateAttributeEnumeration.php +++ b/lib/Model/UpdateAttributeEnumeration.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,14 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['value'] === null) { - return false; - } - if ($this->container['label'] === null) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/UpdateCampaignStatus.php b/lib/Model/UpdateCampaignStatus.php index 4dcac9a0..d4d01686 100644 --- a/lib/Model/UpdateCampaignStatus.php +++ b/lib/Model/UpdateCampaignStatus.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -218,7 +218,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) @@ -236,12 +236,7 @@ public function listInvalidProperties() */ public function valid() { - - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($this->container['status'], $allowedValues)) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -265,7 +260,7 @@ public function getStatus() public function setStatus($status) { $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($status) && !in_array($status, $allowedValues)) { + if (!is_null($status) && !in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'status', must be one of '%s'", diff --git a/lib/Model/UpdateChild.php b/lib/Model/UpdateChild.php index 2af84825..7ab3c778 100644 --- a/lib/Model/UpdateChild.php +++ b/lib/Model/UpdateChild.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -224,8 +224,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/UpdateChildAccountStatus.php b/lib/Model/UpdateChildAccountStatus.php index c5153ef3..6e4ed51b 100644 --- a/lib/Model/UpdateChildAccountStatus.php +++ b/lib/Model/UpdateChildAccountStatus.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,8 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -230,7 +229,7 @@ public function getTransactionalEmail() /** * Sets transactionalEmail * - * @param bool $transactionalEmail Status of Transactional Email (SMTP) Platform activation for your account (true=enabled, false=disabled) + * @param bool $transactionalEmail Status of Transactional Email Platform activation for your account (true=enabled, false=disabled) * * @return $this */ diff --git a/lib/Model/UpdateChildDomain.php b/lib/Model/UpdateChildDomain.php index 36d4faef..9e3f8b2a 100644 --- a/lib/Model/UpdateChildDomain.php +++ b/lib/Model/UpdateChildDomain.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -200,8 +200,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/UpdateContact.php b/lib/Model/UpdateContact.php index c59691d3..cf69fb73 100644 --- a/lib/Model/UpdateContact.php +++ b/lib/Model/UpdateContact.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -230,8 +230,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -248,7 +247,7 @@ public function getAttributes() /** * Sets attributes * - * @param object $attributes Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, `{\"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}` + * @param object $attributes Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, { 'EMAIL':'newemail@domain.com', 'FNAME':'Ellie', 'LNAME':'Roger'} `{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}`. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in \"SMS\" field should be passed with proper country code. For example {'SMS':'+91xxxxxxxxxx'} or {'SMS':'0091xxxxxxxxxx'} * * @return $this */ @@ -368,7 +367,7 @@ public function getSmtpBlacklistSender() /** * Sets smtpBlacklistSender * - * @param string[] $smtpBlacklistSender SMTP forbidden sender for contact. Use only for email Contact + * @param string[] $smtpBlacklistSender transactional email forbidden sender for contact. Use only for email Contact * * @return $this */ diff --git a/lib/Model/UpdateEmailCampaign.php b/lib/Model/UpdateEmailCampaign.php index d1683bb8..30edd3cf 100644 --- a/lib/Model/UpdateEmailCampaign.php +++ b/lib/Model/UpdateEmailCampaign.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -81,7 +81,10 @@ class UpdateEmailCampaign implements ModelInterface, ArrayAccess 'subjectB' => 'string', 'splitRule' => 'int', 'winnerCriteria' => 'string', - 'winnerDelay' => 'int' + 'winnerDelay' => 'int', + 'ipWarmupEnable' => 'bool', + 'initialQuota' => 'int', + 'increaseRate' => 'int' ]; /** @@ -114,7 +117,10 @@ class UpdateEmailCampaign implements ModelInterface, ArrayAccess 'subjectB' => null, 'splitRule' => 'int64', 'winnerCriteria' => null, - 'winnerDelay' => 'int64' + 'winnerDelay' => 'int64', + 'ipWarmupEnable' => null, + 'initialQuota' => 'int64', + 'increaseRate' => 'int64' ]; /** @@ -168,7 +174,10 @@ public static function swaggerFormats() 'subjectB' => 'subjectB', 'splitRule' => 'splitRule', 'winnerCriteria' => 'winnerCriteria', - 'winnerDelay' => 'winnerDelay' + 'winnerDelay' => 'winnerDelay', + 'ipWarmupEnable' => 'ipWarmupEnable', + 'initialQuota' => 'initialQuota', + 'increaseRate' => 'increaseRate' ]; /** @@ -201,7 +210,10 @@ public static function swaggerFormats() 'subjectB' => 'setSubjectB', 'splitRule' => 'setSplitRule', 'winnerCriteria' => 'setWinnerCriteria', - 'winnerDelay' => 'setWinnerDelay' + 'winnerDelay' => 'setWinnerDelay', + 'ipWarmupEnable' => 'setIpWarmupEnable', + 'initialQuota' => 'setInitialQuota', + 'increaseRate' => 'setIncreaseRate' ]; /** @@ -234,7 +246,10 @@ public static function swaggerFormats() 'subjectB' => 'getSubjectB', 'splitRule' => 'getSplitRule', 'winnerCriteria' => 'getWinnerCriteria', - 'winnerDelay' => 'getWinnerDelay' + 'winnerDelay' => 'getWinnerDelay', + 'ipWarmupEnable' => 'getIpWarmupEnable', + 'initialQuota' => 'getInitialQuota', + 'increaseRate' => 'getIncreaseRate' ]; /** @@ -337,6 +352,9 @@ public function __construct(array $data = null) $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null; $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null; $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null; + $this->container['ipWarmupEnable'] = isset($data['ipWarmupEnable']) ? $data['ipWarmupEnable'] : false; + $this->container['initialQuota'] = isset($data['initialQuota']) ? $data['initialQuota'] : null; + $this->container['increaseRate'] = isset($data['increaseRate']) ? $data['increaseRate'] : null; } /** @@ -357,7 +375,7 @@ public function listInvalidProperties() } $allowedValues = $this->getWinnerCriteriaAllowableValues(); - if (!in_array($this->container['winnerCriteria'], $allowedValues)) { + if (!is_null($this->container['winnerCriteria']) && !in_array($this->container['winnerCriteria'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'winnerCriteria', must be one of '%s'", implode("', '", $allowedValues) @@ -372,6 +390,14 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'winnerDelay', must be bigger than or equal to 1."; } + if (!is_null($this->container['increaseRate']) && ($this->container['increaseRate'] > 100)) { + $invalidProperties[] = "invalid value for 'increaseRate', must be smaller than or equal to 100."; + } + + if (!is_null($this->container['increaseRate']) && ($this->container['increaseRate'] < 0)) { + $invalidProperties[] = "invalid value for 'increaseRate', must be bigger than or equal to 0."; + } + return $invalidProperties; } @@ -383,24 +409,7 @@ public function listInvalidProperties() */ public function valid() { - - if ($this->container['splitRule'] > 50) { - return false; - } - if ($this->container['splitRule'] < 1) { - return false; - } - $allowedValues = $this->getWinnerCriteriaAllowableValues(); - if (!in_array($this->container['winnerCriteria'], $allowedValues)) { - return false; - } - if ($this->container['winnerDelay'] > 168) { - return false; - } - if ($this->container['winnerDelay'] < 1) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -609,7 +618,7 @@ public function getToField() /** * Sets toField * - * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add `{FNAME} {LNAME}`. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use `{{contact.FNAME}} {{contact.LNAME}}` for personalization + * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization * * @return $this */ @@ -825,7 +834,7 @@ public function getParams() /** * Sets params * - * @param object $params Pass the set of attributes to customize the type 'classic' campaign. For example, `{\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}`. The 'params' field will get updated, only if the campaign is in New Template Language, else ignored. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' + * @param object $params Pass the set of attributes to customize the type 'classic' campaign. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. The 'params' field will get updated, only if the campaign is in New Template Language, else ignored. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' * * @return $this */ @@ -984,7 +993,7 @@ public function getWinnerCriteria() public function setWinnerCriteria($winnerCriteria) { $allowedValues = $this->getWinnerCriteriaAllowableValues(); - if (!is_null($winnerCriteria) && !in_array($winnerCriteria, $allowedValues)) { + if (!is_null($winnerCriteria) && !in_array($winnerCriteria, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'winnerCriteria', must be one of '%s'", @@ -1028,6 +1037,86 @@ public function setWinnerDelay($winnerDelay) return $this; } + + /** + * Gets ipWarmupEnable + * + * @return bool + */ + public function getIpWarmupEnable() + { + return $this->container['ipWarmupEnable']; + } + + /** + * Sets ipWarmupEnable + * + * @param bool $ipWarmupEnable Available for dedicated ip clients. Set this to true if you wish to warm up your ip. + * + * @return $this + */ + public function setIpWarmupEnable($ipWarmupEnable) + { + $this->container['ipWarmupEnable'] = $ipWarmupEnable; + + return $this; + } + + /** + * Gets initialQuota + * + * @return int + */ + public function getInitialQuota() + { + return $this->container['initialQuota']; + } + + /** + * Sets initialQuota + * + * @param int $initialQuota Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. + * + * @return $this + */ + public function setInitialQuota($initialQuota) + { + $this->container['initialQuota'] = $initialQuota; + + return $this; + } + + /** + * Gets increaseRate + * + * @return int + */ + public function getIncreaseRate() + { + return $this->container['increaseRate']; + } + + /** + * Sets increaseRate + * + * @param int $increaseRate Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. + * + * @return $this + */ + public function setIncreaseRate($increaseRate) + { + + if (!is_null($increaseRate) && ($increaseRate > 100)) { + throw new \InvalidArgumentException('invalid value for $increaseRate when calling UpdateEmailCampaign., must be smaller than or equal to 100.'); + } + if (!is_null($increaseRate) && ($increaseRate < 0)) { + throw new \InvalidArgumentException('invalid value for $increaseRate when calling UpdateEmailCampaign., must be bigger than or equal to 0.'); + } + + $this->container['increaseRate'] = $increaseRate; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/UpdateEmailCampaignRecipients.php b/lib/Model/UpdateEmailCampaignRecipients.php index d9333399..07b0a4ac 100644 --- a/lib/Model/UpdateEmailCampaignRecipients.php +++ b/lib/Model/UpdateEmailCampaignRecipients.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -207,8 +207,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/UpdateEmailCampaignSender.php b/lib/Model/UpdateEmailCampaignSender.php index 6c40fd8c..7049b81f 100644 --- a/lib/Model/UpdateEmailCampaignSender.php +++ b/lib/Model/UpdateEmailCampaignSender.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -36,7 +36,7 @@ * UpdateEmailCampaignSender Class Doc Comment * * @category Class - * @description Sender details including email and/or name. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` + * @description Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` * @package SendinBlue\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -59,7 +59,8 @@ class UpdateEmailCampaignSender implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'name' => 'string', - 'email' => 'string' + 'email' => 'string', + 'id' => 'int' ]; /** @@ -69,7 +70,8 @@ class UpdateEmailCampaignSender implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'name' => null, - 'email' => 'email' + 'email' => 'email', + 'id' => 'int64' ]; /** @@ -100,7 +102,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'email' => 'email' + 'email' => 'email', + 'id' => 'id' ]; /** @@ -110,7 +113,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'name' => 'setName', - 'email' => 'setEmail' + 'email' => 'setEmail', + 'id' => 'setId' ]; /** @@ -120,7 +124,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'name' => 'getName', - 'email' => 'getEmail' + 'email' => 'getEmail', + 'id' => 'getId' ]; /** @@ -185,6 +190,7 @@ public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; } /** @@ -207,8 +213,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -259,6 +264,30 @@ public function setEmail($email) return $this; } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/UpdateList.php b/lib/Model/UpdateList.php index 1055fa9e..325f0a15 100644 --- a/lib/Model/UpdateList.php +++ b/lib/Model/UpdateList.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -206,8 +206,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/UpdateSender.php b/lib/Model/UpdateSender.php index 0a3b8550..38ffdeff 100644 --- a/lib/Model/UpdateSender.php +++ b/lib/Model/UpdateSender.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -212,8 +212,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/Model/UpdateSmsCampaign.php b/lib/Model/UpdateSmsCampaign.php index 4a8322ff..55ad73ec 100644 --- a/lib/Model/UpdateSmsCampaign.php +++ b/lib/Model/UpdateSmsCampaign.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -213,7 +213,7 @@ public function listInvalidProperties() { $invalidProperties = []; - if (!is_null($this->container['sender']) && (strlen($this->container['sender']) > 11)) { + if (!is_null($this->container['sender']) && (mb_strlen($this->container['sender']) > 11)) { $invalidProperties[] = "invalid value for 'sender', the character length must be smaller than or equal to 11."; } @@ -228,11 +228,7 @@ public function listInvalidProperties() */ public function valid() { - - if (strlen($this->container['sender']) > 11) { - return false; - } - return true; + return count($this->listInvalidProperties()) === 0; } @@ -279,7 +275,7 @@ public function getSender() */ public function setSender($sender) { - if (!is_null($sender) && (strlen($sender) > 11)) { + if (!is_null($sender) && (mb_strlen($sender) > 11)) { throw new \InvalidArgumentException('invalid length for $sender when calling UpdateSmsCampaign., must be smaller than or equal to 11.'); } diff --git a/lib/Model/UpdateSmtpTemplate.php b/lib/Model/UpdateSmtpTemplate.php index ebebe213..abe79d09 100644 --- a/lib/Model/UpdateSmtpTemplate.php +++ b/lib/Model/UpdateSmtpTemplate.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -254,8 +254,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -440,7 +439,7 @@ public function getToField() /** * Sets toField * - * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add `{FNAME} {LNAME}`. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use `{{contact.FNAME}} {{contact.LNAME}}` for personalization + * @param string $toField To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization * * @return $this */ diff --git a/lib/Model/UpdateSmtpTemplateSender.php b/lib/Model/UpdateSmtpTemplateSender.php index f675d27c..6b710984 100644 --- a/lib/Model/UpdateSmtpTemplateSender.php +++ b/lib/Model/UpdateSmtpTemplateSender.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -36,7 +36,7 @@ * UpdateSmtpTemplateSender Class Doc Comment * * @category Class - * @description Sender details including email and/or name. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` + * @description Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` * @package SendinBlue\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen @@ -59,7 +59,8 @@ class UpdateSmtpTemplateSender implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'name' => 'string', - 'email' => 'string' + 'email' => 'string', + 'id' => 'int' ]; /** @@ -69,7 +70,8 @@ class UpdateSmtpTemplateSender implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'name' => null, - 'email' => 'email' + 'email' => 'email', + 'id' => 'int64' ]; /** @@ -100,7 +102,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'email' => 'email' + 'email' => 'email', + 'id' => 'id' ]; /** @@ -110,7 +113,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'name' => 'setName', - 'email' => 'setEmail' + 'email' => 'setEmail', + 'id' => 'setId' ]; /** @@ -120,7 +124,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'name' => 'getName', - 'email' => 'getEmail' + 'email' => 'getEmail', + 'id' => 'getId' ]; /** @@ -185,6 +190,7 @@ public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; } /** @@ -207,8 +213,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } @@ -259,6 +264,30 @@ public function setEmail($email) return $this; } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/UpdateWebhook.php b/lib/Model/UpdateWebhook.php index 9e2012ea..f6adcbef 100644 --- a/lib/Model/UpdateWebhook.php +++ b/lib/Model/UpdateWebhook.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -181,6 +181,8 @@ public function getModelName() const EVENTS_UNIQUE_OPENED = 'uniqueOpened'; const EVENTS_UNSUBSCRIBED = 'unsubscribed'; const EVENTS_LIST_ADDITION = 'listAddition'; + const EVENTS_CONTACT_UPDATED = 'contactUpdated'; + const EVENTS_CONTACT_DELETED = 'contactDeleted'; @@ -205,6 +207,8 @@ public function getEventsAllowableValues() self::EVENTS_UNIQUE_OPENED, self::EVENTS_UNSUBSCRIBED, self::EVENTS_LIST_ADDITION, + self::EVENTS_CONTACT_UPDATED, + self::EVENTS_CONTACT_DELETED, ]; } @@ -249,8 +253,7 @@ public function listInvalidProperties() */ public function valid() { - - return true; + return count($this->listInvalidProperties()) === 0; } diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 3068625b..8af09f3a 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -13,12 +13,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -59,6 +59,11 @@ public static function sanitizeForSerialization($data, $type = null, $format = n $data[$property] = self::sanitizeForSerialization($value); } return $data; + } elseif ($data instanceof \stdClass) { + foreach ($data as $property => $value) { + $data->$property = self::sanitizeForSerialization($value); + } + return $data; } elseif (is_object($data)) { $values = []; $formats = $data::swaggerFormats(); @@ -68,7 +73,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n if ($value !== null && !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) && method_exists($swaggerType, 'getAllowableEnumValues') - && !in_array($value, $swaggerType::getAllowableEnumValues())) { + && !in_array($value, $swaggerType::getAllowableEnumValues(), true)) { $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); } @@ -271,7 +276,7 @@ public static function deserialize($data, $class, $httpHeaders = null) // determine file name if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . self::sanitizeFilename($match[1]); + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); } else { $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); } @@ -284,7 +289,7 @@ public static function deserialize($data, $class, $httpHeaders = null) return new \SplFileObject($filename, 'r'); } elseif (method_exists($class, 'getAllowableEnumValues')) { - if (!in_array($data, $class::getAllowableEnumValues())) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { $imploded = implode("', '", $class::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); } diff --git a/test/Api/AccountApiTest.php b/test/Api/AccountApiTest.php index bb4b3902..c89e2959 100644 --- a/test/Api/AccountApiTest.php +++ b/test/Api/AccountApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/test/Api/AttributesApiTest.php b/test/Api/AttributesApiTest.php index 3a825592..71259cd7 100644 --- a/test/Api/AttributesApiTest.php +++ b/test/Api/AttributesApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/test/Api/ContactsApiTest.php b/test/Api/ContactsApiTest.php index e8fdd23b..51c6c51e 100644 --- a/test/Api/ContactsApiTest.php +++ b/test/Api/ContactsApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/test/Api/EmailCampaignsApiTest.php b/test/Api/EmailCampaignsApiTest.php index 93ff3f3c..1140bf65 100644 --- a/test/Api/EmailCampaignsApiTest.php +++ b/test/Api/EmailCampaignsApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -101,6 +101,16 @@ public function testEmailExportRecipients() { } + /** + * Test case for getAbTestCampaignResult + * + * Get A/B test email campaign result. + * + */ + public function testGetAbTestCampaignResult() + { + } + /** * Test case for getEmailCampaign * @@ -121,10 +131,20 @@ public function testGetEmailCampaigns() { } + /** + * Test case for getSharedTemplateUrl + * + * Get a shared template url. + * + */ + public function testGetSharedTemplateUrl() + { + } + /** * Test case for sendEmailCampaignNow * - * Send an email campaign id of the campaign immediately. + * Send an email campaign immediately, based on campaignId. * */ public function testSendEmailCampaignNow() diff --git a/test/Api/FoldersApiTest.php b/test/Api/FoldersApiTest.php index 2bd58e7f..5debe774 100644 --- a/test/Api/FoldersApiTest.php +++ b/test/Api/FoldersApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/test/Api/ListsApiTest.php b/test/Api/ListsApiTest.php index b2c67082..46d3787e 100644 --- a/test/Api/ListsApiTest.php +++ b/test/Api/ListsApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/test/Api/ProcessApiTest.php b/test/Api/ProcessApiTest.php index 6cf4d73b..160e35cd 100644 --- a/test/Api/ProcessApiTest.php +++ b/test/Api/ProcessApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/test/Api/ResellerApiTest.php b/test/Api/ResellerApiTest.php index 1ba829e1..0a96d113 100644 --- a/test/Api/ResellerApiTest.php +++ b/test/Api/ResellerApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -141,6 +141,16 @@ public function testDissociateIpFromChild() { } + /** + * Test case for getChildAccountCreationStatus + * + * Returns the status of reseller's child account creation, whether it is successfully created (exists) or not based on the childAuthKey supplied. + * + */ + public function testGetChildAccountCreationStatus() + { + } + /** * Test case for getChildDomains * diff --git a/test/Api/SMSCampaignsApiTest.php b/test/Api/SMSCampaignsApiTest.php index 3301b72c..53afea0d 100644 --- a/test/Api/SMSCampaignsApiTest.php +++ b/test/Api/SMSCampaignsApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/test/Api/SMTPApiTest.php b/test/Api/SMTPApiTest.php index 6d4d35c7..535c133d 100644 --- a/test/Api/SMTPApiTest.php +++ b/test/Api/SMTPApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** @@ -74,7 +74,7 @@ public static function tearDownAfterClass() /** * Test case for createSmtpTemplate * - * Create an smtp template. + * Create a transactional email template. * */ public function testCreateSmtpTemplate() @@ -94,7 +94,7 @@ public function testDeleteHardbounces() /** * Test case for deleteSmtpTemplate * - * Delete an inactive smtp template. + * Delete an inactive transactional email template. * */ public function testDeleteSmtpTemplate() @@ -104,7 +104,7 @@ public function testDeleteSmtpTemplate() /** * Test case for getAggregatedSmtpReport * - * Get your SMTP activity aggregated over a period of time. + * Get your transactional email activity aggregated over a period of time. * */ public function testGetAggregatedSmtpReport() @@ -114,7 +114,7 @@ public function testGetAggregatedSmtpReport() /** * Test case for getEmailEventReport * - * Get all your SMTP activity (unaggregated events). + * Get all your transactional email activity (unaggregated events). * */ public function testGetEmailEventReport() @@ -124,7 +124,7 @@ public function testGetEmailEventReport() /** * Test case for getSmtpReport * - * Get your SMTP activity aggregated per day. + * Get your transactional email activity aggregated per day. * */ public function testGetSmtpReport() @@ -144,13 +144,43 @@ public function testGetSmtpTemplate() /** * Test case for getSmtpTemplates * - * Get the list of SMTP templates. + * Get the list of transactional email templates. * */ public function testGetSmtpTemplates() { } + /** + * Test case for getTransacBlockedContacts + * + * Get the list of blocked or unsubscribed transactional contacts. + * + */ + public function testGetTransacBlockedContacts() + { + } + + /** + * Test case for getTransacEmailContent + * + * Get the personalized content of a sent transactional email. + * + */ + public function testGetTransacEmailContent() + { + } + + /** + * Test case for getTransacEmailsList + * + * Get the list of transactional emails on the basis of allowed filters. + * + */ + public function testGetTransacEmailsList() + { + } + /** * Test case for sendTemplate * @@ -181,10 +211,30 @@ public function testSendTransacEmail() { } + /** + * Test case for smtpBlockedContactsEmailDelete + * + * Unblock or resubscribe a transactional contact. + * + */ + public function testSmtpBlockedContactsEmailDelete() + { + } + + /** + * Test case for smtpLogMessageIdDelete + * + * Delete an SMTP transactional log. + * + */ + public function testSmtpLogMessageIdDelete() + { + } + /** * Test case for updateSmtpTemplate * - * Updates an smtp templates. + * Updates a transactional email templates. * */ public function testUpdateSmtpTemplate() diff --git a/test/Api/SendersApiTest.php b/test/Api/SendersApiTest.php index a8ce6b33..c783a420 100644 --- a/test/Api/SendersApiTest.php +++ b/test/Api/SendersApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/test/Api/TransactionalSMSApiTest.php b/test/Api/TransactionalSMSApiTest.php index 6f81b5e4..6b737210 100644 --- a/test/Api/TransactionalSMSApiTest.php +++ b/test/Api/TransactionalSMSApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/test/Api/WebhooksApiTest.php b/test/Api/WebhooksApiTest.php index 4de5bbd9..9a641395 100644 --- a/test/Api/WebhooksApiTest.php +++ b/test/Api/WebhooksApiTest.php @@ -12,12 +12,12 @@ /** * SendinBlue API * - * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | + * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | * * OpenAPI spec version: 3.0.0 * Contact: contact@sendinblue.com * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.3.1 + * Swagger Codegen version: 2.4.12 */ /** diff --git a/test/Model/AbTestCampaignResultTest.php b/test/Model/AbTestCampaignResultTest.php new file mode 100644 index 00000000..0d0aa487 --- /dev/null +++ b/test/Model/AbTestCampaignResultTest.php @@ -0,0 +1,120 @@ +