From 570c803f939276a578e039e409ff0a35bf145395 Mon Sep 17 00:00:00 2001 From: ekta-slt Date: Thu, 18 Apr 2019 11:51:03 +0530 Subject: [PATCH] Mixed changes with new APIs --- README.md | 10 + composer.lock | 99 +- docs/Api/ResellerApi.md | 295 ++++ docs/Api/SMSCampaignsApi.md | 6 +- docs/Api/SMTPApi.md | 24 +- docs/Api/TransactionalSMSApi.md | 24 +- docs/Model/AddChildDomain.md | 10 + docs/Model/DeleteHardbounces.md | 4 +- docs/Model/GetCampaignOverview.md | 2 +- docs/Model/GetChildDomain.md | 11 + docs/Model/GetChildDomains.md | 9 + docs/Model/GetEmailCampaign.md | 9 +- docs/Model/GetExtendedCampaignOverview.md | 9 +- docs/Model/GetSsoToken.md | 10 + docs/Model/UpdateChildDomain.md | 10 + lib/Api/ResellerApi.php | 1933 ++++++++++++++++++--- lib/Api/SMSCampaignsApi.php | 32 +- lib/Api/SMTPApi.php | 60 +- lib/Api/TransactionalSMSApi.php | 60 +- lib/Model/AddChildDomain.php | 302 ++++ lib/Model/DeleteHardbounces.php | 16 +- lib/Model/GetAttributesAttributes.php | 2 + lib/Model/GetChildDomain.php | 344 ++++ lib/Model/GetChildDomains.php | 280 +++ lib/Model/GetSsoToken.php | 308 ++++ lib/Model/UpdateChildDomain.php | 302 ++++ test/Api/ResellerApiTest.php | 50 + test/Model/AddChildDomainTest.php | 86 + test/Model/GetChildDomainTest.php | 93 + test/Model/GetChildDomainsTest.php | 79 + test/Model/GetSsoTokenTest.php | 86 + test/Model/UpdateChildDomainTest.php | 86 + 32 files changed, 4229 insertions(+), 422 deletions(-) create mode 100644 docs/Model/AddChildDomain.md create mode 100644 docs/Model/GetChildDomain.md create mode 100644 docs/Model/GetChildDomains.md create mode 100644 docs/Model/GetSsoToken.md create mode 100644 docs/Model/UpdateChildDomain.md create mode 100644 lib/Model/AddChildDomain.php create mode 100644 lib/Model/GetChildDomain.php create mode 100644 lib/Model/GetChildDomains.php create mode 100644 lib/Model/GetSsoToken.php create mode 100644 lib/Model/UpdateChildDomain.php create mode 100644 test/Model/AddChildDomainTest.php create mode 100644 test/Model/GetChildDomainTest.php create mode 100644 test/Model/GetChildDomainsTest.php create mode 100644 test/Model/GetSsoTokenTest.php create mode 100644 test/Model/UpdateChildDomainTest.php diff --git a/README.md b/README.md index 00fdaef1..96b60987 100644 --- a/README.md +++ b/README.md @@ -139,12 +139,17 @@ Class | Method | HTTP request | Description *ProcessApi* | [**getProcesses**](docs/Api/ProcessApi.md#getprocesses) | **GET** /processes | Return all the processes for your account *ResellerApi* | [**addCredits**](docs/Api/ResellerApi.md#addcredits) | **POST** /reseller/children/{childAuthKey}/credits/add | Add Email and/or SMS credits to a specific child account *ResellerApi* | [**associateIpToChild**](docs/Api/ResellerApi.md#associateiptochild) | **POST** /reseller/children/{childAuthKey}/ips/associate | Associate a dedicated IP to the child +*ResellerApi* | [**createChildDomain**](docs/Api/ResellerApi.md#createchilddomain) | **POST** /reseller/children/{childAuthKey}/domains | Creates a domain for a child account *ResellerApi* | [**createResellerChild**](docs/Api/ResellerApi.md#createresellerchild) | **POST** /reseller/children | Creates a reseller child +*ResellerApi* | [**deleteChildDomain**](docs/Api/ResellerApi.md#deletechilddomain) | **DELETE** /reseller/children/{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* | [**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 +*ResellerApi* | [**getSsoToken**](docs/Api/ResellerApi.md#getssotoken) | **GET** /reseller/children/{childAuthKey}/auth | Generates a session token which will remain valid for a short period of time only. *ResellerApi* | [**removeCredits**](docs/Api/ResellerApi.md#removecredits) | **POST** /reseller/children/{childAuthKey}/credits/remove | Remove Email and/or SMS credits from a specific child account +*ResellerApi* | [**updateChildDomain**](docs/Api/ResellerApi.md#updatechilddomain) | **PUT** /reseller/children/{childAuthKey}/domains/{domainName} | Updates the sender domain of reseller's child based on the childAuthKey and domainName passed *ResellerApi* | [**updateResellerChild**](docs/Api/ResellerApi.md#updateresellerchild) | **PUT** /reseller/children/{childAuthKey} | Updates infos of reseller's child based on the childAuthKey supplied *SMSCampaignsApi* | [**createSmsCampaign**](docs/Api/SMSCampaignsApi.md#createsmscampaign) | **POST** /smsCampaigns | Creates an SMS campaign *SMSCampaignsApi* | [**deleteSmsCampaign**](docs/Api/SMSCampaignsApi.md#deletesmscampaign) | **DELETE** /smsCampaigns/{campaignId} | Delete the SMS campaign @@ -187,6 +192,7 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AddChildDomain](docs/Model/AddChildDomain.md) - [AddContactToList](docs/Model/AddContactToList.md) - [AddCredits](docs/Model/AddCredits.md) - [CreateAttribute](docs/Model/CreateAttribute.md) @@ -225,6 +231,8 @@ Class | Method | HTTP request | Description - [GetCampaignOverview](docs/Model/GetCampaignOverview.md) - [GetCampaignRecipients](docs/Model/GetCampaignRecipients.md) - [GetCampaignStats](docs/Model/GetCampaignStats.md) + - [GetChildDomain](docs/Model/GetChildDomain.md) + - [GetChildDomains](docs/Model/GetChildDomains.md) - [GetChildInfoApiKeys](docs/Model/GetChildInfoApiKeys.md) - [GetChildInfoApiKeysV2](docs/Model/GetChildInfoApiKeysV2.md) - [GetChildInfoApiKeysV3](docs/Model/GetChildInfoApiKeysV3.md) @@ -278,6 +286,7 @@ Class | Method | HTTP request | Description - [GetSmtpTemplateOverview](docs/Model/GetSmtpTemplateOverview.md) - [GetSmtpTemplateOverviewSender](docs/Model/GetSmtpTemplateOverviewSender.md) - [GetSmtpTemplates](docs/Model/GetSmtpTemplates.md) + - [GetSsoToken](docs/Model/GetSsoToken.md) - [GetStatsByDomain](docs/Model/GetStatsByDomain.md) - [GetTransacAggregatedSmsReport](docs/Model/GetTransacAggregatedSmsReport.md) - [GetTransacSmsReport](docs/Model/GetTransacSmsReport.md) @@ -318,6 +327,7 @@ Class | Method | HTTP request | Description - [UpdateAttributeEnumeration](docs/Model/UpdateAttributeEnumeration.md) - [UpdateCampaignStatus](docs/Model/UpdateCampaignStatus.md) - [UpdateChild](docs/Model/UpdateChild.md) + - [UpdateChildDomain](docs/Model/UpdateChildDomain.md) - [UpdateContact](docs/Model/UpdateContact.md) - [UpdateEmailCampaign](docs/Model/UpdateEmailCampaign.md) - [UpdateEmailCampaignRecipients](docs/Model/UpdateEmailCampaignRecipients.md) diff --git a/composer.lock b/composer.lock index b32b444c..eba6b48d 100644 --- a/composer.lock +++ b/composer.lock @@ -976,6 +976,7 @@ "mock", "xunit" ], + "abandoned": true, "time": "2015-10-02T06:51:40+00:00" }, { @@ -1477,16 +1478,16 @@ }, { "name": "symfony/console", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be" + "reference": "15a9104356436cb26e08adab97706654799d31d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/069bf3f0e8f871a2169a06e43d9f3f03f355e9be", - "reference": "069bf3f0e8f871a2169a06e43d9f3f03f355e9be", + "url": "https://api.github.com/repos/symfony/console/zipball/15a9104356436cb26e08adab97706654799d31d8", + "reference": "15a9104356436cb26e08adab97706654799d31d8", "shasum": "" }, "require": { @@ -1545,20 +1546,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-01-25T10:42:12+00:00" + "time": "2019-04-08T09:29:13+00:00" }, { "name": "symfony/debug", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8" + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8", - "reference": "667a26c4dd6bc75c67f06bc9bcd015bdecc7cbb8", + "url": "https://api.github.com/repos/symfony/debug/zipball/681afbb26488903c5ac15e63734f1d8ac430c9b9", + "reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9", "shasum": "" }, "require": { @@ -1601,20 +1602,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2019-01-25T10:19:25+00:00" + "time": "2019-04-11T09:48:14+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "ed5be1663fa66623b3a7004d5d51a14c4045399b" + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ed5be1663fa66623b3a7004d5d51a14c4045399b", - "reference": "ed5be1663fa66623b3a7004d5d51a14c4045399b", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a088aafcefb4eef2520a290ed82e4374092a6dff", + "reference": "a088aafcefb4eef2520a290ed82e4374092a6dff", "shasum": "" }, "require": { @@ -1664,20 +1665,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:27:11+00:00" + "time": "2019-04-02T08:51:52+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b52454ec66fe5082b7a66a491339d1f1da9a5a0d" + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b52454ec66fe5082b7a66a491339d1f1da9a5a0d", - "reference": "b52454ec66fe5082b7a66a491339d1f1da9a5a0d", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/acf99758b1df8e9295e6b85aa69f294565c9fedb", + "reference": "acf99758b1df8e9295e6b85aa69f294565c9fedb", "shasum": "" }, "require": { @@ -1714,20 +1715,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:27:11+00:00" + "time": "2019-02-04T21:34:32+00:00" }, { "name": "symfony/finder", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "7c0c627220308928e958a87c293108e5891cde1d" + "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/7c0c627220308928e958a87c293108e5891cde1d", - "reference": "7c0c627220308928e958a87c293108e5891cde1d", + "url": "https://api.github.com/repos/symfony/finder/zipball/61af5ce0b34b942d414fe8f1b11950d0e9a90e98", + "reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98", "shasum": "" }, "require": { @@ -1763,20 +1764,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:43:35+00:00" + "time": "2019-04-02T19:54:57+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + "reference": "82ebae02209c21113908c229e9883c419720738a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", + "reference": "82ebae02209c21113908c229e9883c419720738a", "shasum": "" }, "require": { @@ -1788,7 +1789,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -1810,7 +1811,7 @@ }, { "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "email": "backendtea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", @@ -1821,20 +1822,20 @@ "polyfill", "portable" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609", + "reference": "fe5e94c604826c35a32fa832f35bd036b6799609", "shasum": "" }, "require": { @@ -1846,7 +1847,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -1880,20 +1881,20 @@ "portable", "shim" ], - "time": "2018-09-21T13:07:52+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/process", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e" + "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/009f8dda80930e89e8344a4e310b08f9ff07dd2e", - "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e", + "url": "https://api.github.com/repos/symfony/process/zipball/a9c4dfbf653023b668c282e4e02609d131f4057a", + "reference": "a9c4dfbf653023b668c282e4e02609d131f4057a", "shasum": "" }, "require": { @@ -1929,11 +1930,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-01-16T13:27:11+00:00" + "time": "2019-04-08T16:15:54+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -1982,16 +1983,16 @@ }, { "name": "symfony/yaml", - "version": "v3.4.22", + "version": "v3.4.26", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d" + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ba11776e9e6c15ad5759a07bffb15899bac75c2d", - "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", "shasum": "" }, "require": { @@ -2037,7 +2038,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-01-16T10:59:17+00:00" + "time": "2019-03-25T07:48:46+00:00" }, { "name": "webmozart/assert", diff --git a/docs/Api/ResellerApi.md b/docs/Api/ResellerApi.md index 8884a8f2..3539b217 100644 --- a/docs/Api/ResellerApi.md +++ b/docs/Api/ResellerApi.md @@ -6,12 +6,17 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**addCredits**](ResellerApi.md#addCredits) | **POST** /reseller/children/{childAuthKey}/credits/add | Add Email and/or SMS credits to a specific child account [**associateIpToChild**](ResellerApi.md#associateIpToChild) | **POST** /reseller/children/{childAuthKey}/ips/associate | Associate a dedicated IP to the child +[**createChildDomain**](ResellerApi.md#createChildDomain) | **POST** /reseller/children/{childAuthKey}/domains | Creates a domain for a child account [**createResellerChild**](ResellerApi.md#createResellerChild) | **POST** /reseller/children | Creates a reseller child +[**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 +[**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 +[**getSsoToken**](ResellerApi.md#getSsoToken) | **GET** /reseller/children/{childAuthKey}/auth | Generates a session token which will remain valid for a short period of time only. [**removeCredits**](ResellerApi.md#removeCredits) | **POST** /reseller/children/{childAuthKey}/credits/remove | Remove Email and/or SMS credits from a specific child account +[**updateChildDomain**](ResellerApi.md#updateChildDomain) | **PUT** /reseller/children/{childAuthKey}/domains/{domainName} | Updates the sender domain of reseller's child based on the childAuthKey and domainName passed [**updateResellerChild**](ResellerApi.md#updateResellerChild) | **PUT** /reseller/children/{childAuthKey} | Updates infos of reseller's child based on the childAuthKey supplied @@ -132,6 +137,64 @@ 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) +# **createChildDomain** +> createChildDomain($childAuthKey, $addChildDomain) + +Creates a domain for a child account + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = 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 +$addChildDomain = new \SendinBlue\Client\Model\AddChildDomain(); // \SendinBlue\Client\Model\AddChildDomain | Sender domain to add for a specific child account + +try { + $apiInstance->createChildDomain($childAuthKey, $addChildDomain); +} catch (Exception $e) { + echo 'Exception when calling ResellerApi->createChildDomain: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +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 | + +### Return type + +void (empty response body) + +### Authorization + +[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **createResellerChild** > \SendinBlue\Client\Model\CreateReseller createResellerChild($resellerChild) @@ -189,6 +252,64 @@ 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) +# **deleteChildDomain** +> deleteChildDomain($childAuthKey, $domainName) + +Deletes the sender domain of the reseller child based on the childAuthKey and domainName passed + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = 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 +$domainName = "domainName_example"; // string | Pass the existing domain that needs to be deleted + +try { + $apiInstance->deleteChildDomain($childAuthKey, $domainName); +} catch (Exception $e) { + echo 'Exception when calling ResellerApi->deleteChildDomain: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **childAuthKey** | **string**| auth key of reseller's child | + **domainName** | **string**| Pass the existing domain that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **deleteResellerChild** > deleteResellerChild($childAuthKey) @@ -303,6 +424,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) +# **getChildDomains** +> \SendinBlue\Client\Model\GetChildDomains getChildDomains($childAuthKey) + +Gets all the sender domains of a specific child account + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = 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->getChildDomains($childAuthKey); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ResellerApi->getChildDomains: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **childAuthKey** | **string**| auth key of reseller's child | + +### Return type + +[**\SendinBlue\Client\Model\GetChildDomains**](../Model/GetChildDomains.md) + +### Authorization + +[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **getChildInfo** > \SendinBlue\Client\Model\GetChildInfo getChildInfo($childAuthKey) @@ -413,6 +591,63 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **getSsoToken** +> \SendinBlue\Client\Model\GetSsoToken getSsoToken($childAuthKey) + +Generates a session token which will remain valid for a short period of time only. + +### 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->getSsoToken($childAuthKey); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ResellerApi->getSsoToken: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **childAuthKey** | **string**| auth key of reseller's child | + +### Return type + +[**\SendinBlue\Client\Model\GetSsoToken**](../Model/GetSsoToken.md) + +### Authorization + +[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **removeCredits** > \SendinBlue\Client\Model\RemainingCreditModel removeCredits($childAuthKey, $removeCredits) @@ -472,6 +707,66 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **updateChildDomain** +> updateChildDomain($childAuthKey, $domainName, $updateChildDomain) + +Updates the sender domain of reseller's child based on the childAuthKey and domainName passed + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = 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 +$domainName = "domainName_example"; // string | Pass the existing domain that needs to be updated +$updateChildDomain = new \SendinBlue\Client\Model\UpdateChildDomain(); // \SendinBlue\Client\Model\UpdateChildDomain | value to update for sender domain + +try { + $apiInstance->updateChildDomain($childAuthKey, $domainName, $updateChildDomain); +} catch (Exception $e) { + echo 'Exception when calling ResellerApi->updateChildDomain: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **childAuthKey** | **string**| auth key of reseller's child | + **domainName** | **string**| Pass the existing domain that needs to be updated | + **updateChildDomain** | [**\SendinBlue\Client\Model\UpdateChildDomain**](../Model/UpdateChildDomain.md)| value to update for sender domain | + +### Return type + +void (empty response body) + +### Authorization + +[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **updateResellerChild** > updateResellerChild($childAuthKey, $resellerChild) diff --git a/docs/Api/SMSCampaignsApi.md b/docs/Api/SMSCampaignsApi.md index e1530c09..bdecb6f1 100644 --- a/docs/Api/SMSCampaignsApi.md +++ b/docs/Api/SMSCampaignsApi.md @@ -130,7 +130,7 @@ 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) # **getSmsCampaign** -> \SendinBlue\Client\Model\GetSmsCampaign getSmsCampaign($campaignId, $getSmsCampaign) +> \SendinBlue\Client\Model\GetSmsCampaign getSmsCampaign($campaignId) Get an SMS campaign @@ -155,10 +155,9 @@ $apiInstance = new SendinBlue\Client\Api\SMSCampaignsApi( $config ); $campaignId = 789; // int | id of the SMS campaign -$getSmsCampaign = new \SendinBlue\Client\Model\GetSmsCampaign(); // \SendinBlue\Client\Model\GetSmsCampaign | Values to update an SMS Campaign try { - $result = $apiInstance->getSmsCampaign($campaignId, $getSmsCampaign); + $result = $apiInstance->getSmsCampaign($campaignId); print_r($result); } catch (Exception $e) { echo 'Exception when calling SMSCampaignsApi->getSmsCampaign: ', $e->getMessage(), PHP_EOL; @@ -171,7 +170,6 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **campaignId** | **int**| id of the SMS campaign | - **getSmsCampaign** | [**\SendinBlue\Client\Model\GetSmsCampaign**](../Model/GetSmsCampaign.md)| Values to update an SMS Campaign | ### Return type diff --git a/docs/Api/SMTPApi.md b/docs/Api/SMTPApi.md index 49a2de66..72bf07f9 100644 --- a/docs/Api/SMTPApi.md +++ b/docs/Api/SMTPApi.md @@ -214,8 +214,8 @@ $apiInstance = new SendinBlue\Client\Api\SMTPApi( new GuzzleHttp\Client(), $config ); -$startDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate -$endDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate +$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate +$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate $days = 56; // int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' $tag = "tag_example"; // string | Tag of the emails @@ -232,8 +232,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **startDate** | **\DateTime**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] - **endDate** | **\DateTime**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] + **startDate** | **string**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] + **endDate** | **string**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] **days** | **int**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] **tag** | **string**| Tag of the emails | [optional] @@ -279,8 +279,8 @@ $apiInstance = new SendinBlue\Client\Api\SMTPApi( ); $limit = 50; // int | Number limitation for the result returned $offset = 0; // int | Beginning point in the list to retrieve from. -$startDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate -$endDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate +$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate +$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate $days = 56; // int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' $email = "email_example"; // string | Filter the report for a specific email addresses $event = "event_example"; // string | Filter the report for a specific event type @@ -303,8 +303,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **int**| Number limitation for the result returned | [optional] [default to 50] **offset** | **int**| Beginning point in the list to retrieve from. | [optional] [default to 0] - **startDate** | **\DateTime**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] - **endDate** | **\DateTime**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] + **startDate** | **string**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] + **endDate** | **string**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] **days** | **int**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] **email** | **string**| Filter the report for a specific email addresses | [optional] **event** | **string**| Filter the report for a specific event type | [optional] @@ -354,8 +354,8 @@ $apiInstance = new SendinBlue\Client\Api\SMTPApi( ); $limit = 50; // int | Number of documents returned per page $offset = 0; // int | Index of the first document on the page -$startDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) -$endDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) +$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) +$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) $days = 56; // int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' $tag = "tag_example"; // string | Tag of the emails @@ -374,8 +374,8 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **int**| Number of documents returned per page | [optional] [default to 50] **offset** | **int**| Index of the first document on the page | [optional] [default to 0] - **startDate** | **\DateTime**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) | [optional] - **endDate** | **\DateTime**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) | [optional] + **startDate** | **string**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) | [optional] + **endDate** | **string**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) | [optional] **days** | **int**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] **tag** | **string**| Tag of the emails | [optional] diff --git a/docs/Api/TransactionalSMSApi.md b/docs/Api/TransactionalSMSApi.md index b9aed6f3..bb0917e6 100644 --- a/docs/Api/TransactionalSMSApi.md +++ b/docs/Api/TransactionalSMSApi.md @@ -36,8 +36,8 @@ $apiInstance = new SendinBlue\Client\Api\TransactionalSMSApi( $config ); $limit = 50; // int | Number of documents per page -$startDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report -$endDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report +$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report +$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report $offset = 0; // int | Index of the first document of the page $days = 56; // int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' $phoneNumber = "phoneNumber_example"; // string | Filter the report for a specific phone number @@ -58,8 +58,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **int**| Number of documents per page | [optional] [default to 50] - **startDate** | **\DateTime**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional] - **endDate** | **\DateTime**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional] + **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional] + **endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional] **offset** | **int**| Index of the first document of the page | [optional] [default to 0] **days** | **int**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] **phoneNumber** | **string**| Filter the report for a specific phone number | [optional] @@ -106,8 +106,8 @@ $apiInstance = new SendinBlue\Client\Api\TransactionalSMSApi( new GuzzleHttp\Client(), $config ); -$startDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report -$endDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report +$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report +$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report $days = 56; // int | Number of days in the past including today (positive integer). Not compatible with startDate and endDate $tag = "tag_example"; // string | Filter on a tag @@ -124,8 +124,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **startDate** | **\DateTime**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional] - **endDate** | **\DateTime**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional] + **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional] + **endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional] **days** | **int**| Number of days in the past including today (positive integer). Not compatible with startDate and endDate | [optional] **tag** | **string**| Filter on a tag | [optional] @@ -169,8 +169,8 @@ $apiInstance = new SendinBlue\Client\Api\TransactionalSMSApi( new GuzzleHttp\Client(), $config ); -$startDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report -$endDate = new \DateTime("2013-10-20"); // \DateTime | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report +$startDate = "startDate_example"; // string | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report +$endDate = "endDate_example"; // string | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report $days = 56; // int | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' $tag = "tag_example"; // string | Filter on a tag @@ -187,8 +187,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **startDate** | **\DateTime**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional] - **endDate** | **\DateTime**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional] + **startDate** | **string**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional] + **endDate** | **string**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional] **days** | **int**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] **tag** | **string**| Filter on a tag | [optional] diff --git a/docs/Model/AddChildDomain.md b/docs/Model/AddChildDomain.md new file mode 100644 index 00000000..25d5a309 --- /dev/null +++ b/docs/Model/AddChildDomain.md @@ -0,0 +1,10 @@ +# AddChildDomain + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domain** | **string** | Sender domain to add for a specific child account | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/DeleteHardbounces.md b/docs/Model/DeleteHardbounces.md index af31c91f..e7262992 100644 --- a/docs/Model/DeleteHardbounces.md +++ b/docs/Model/DeleteHardbounces.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**startDate** | [**\DateTime**] | Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate | [optional] -**endDate** | [**\DateTime**] | Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate | [optional] +**startDate** | **string** | Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate | [optional] +**endDate** | **string** | Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate | [optional] **contactEmail** | **string** | Target a specific email address | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GetCampaignOverview.md b/docs/Model/GetCampaignOverview.md index 86428d29..da7f3a54 100644 --- a/docs/Model/GetCampaignOverview.md +++ b/docs/Model/GetCampaignOverview.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **subject** | **string** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional] **type** | **string** | Type of campaign | **status** | **string** | Status of the campaign | -**scheduledAt** | [**\DateTime**](\DateTime.md) | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] +**scheduledAt** | [**\DateTime**] | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] **abTesting** | **bool** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional] **subjectA** | **string** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] **subjectB** | **string** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] diff --git a/docs/Model/GetChildDomain.md b/docs/Model/GetChildDomain.md new file mode 100644 index 00000000..3e2c78a4 --- /dev/null +++ b/docs/Model/GetChildDomain.md @@ -0,0 +1,11 @@ +# GetChildDomain + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domain** | **string** | Sender domain | +**active** | **bool** | indicates whether a domain is verified 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/GetChildDomains.md b/docs/Model/GetChildDomains.md new file mode 100644 index 00000000..1021351c --- /dev/null +++ b/docs/Model/GetChildDomains.md @@ -0,0 +1,9 @@ +# GetChildDomains + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/GetEmailCampaign.md b/docs/Model/GetEmailCampaign.md index 505c6285..4350fd71 100644 --- a/docs/Model/GetEmailCampaign.md +++ b/docs/Model/GetEmailCampaign.md @@ -5,10 +5,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | ID of the campaign | **name** | **string** | Name of the campaign | -**subject** | **string** | Subject of the campaign | +**subject** | **string** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional] **type** | **string** | Type of campaign | **status** | **string** | Status of the campaign | **scheduledAt** | [**\DateTime**] | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] +**abTesting** | **bool** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional] +**subjectA** | **string** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] +**subjectB** | **string** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] +**splitRule** | **int** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional] +**winnerCriteria** | **string** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional] +**winnerDelay** | **int** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional] +**sendAtBestTime** | **bool** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional] **testSent** | **bool** | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) | **header** | **string** | Header of the campaign | **footer** | **string** | Footer of the campaign | diff --git a/docs/Model/GetExtendedCampaignOverview.md b/docs/Model/GetExtendedCampaignOverview.md index 8e9df9d8..218190f9 100644 --- a/docs/Model/GetExtendedCampaignOverview.md +++ b/docs/Model/GetExtendedCampaignOverview.md @@ -5,10 +5,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | ID of the campaign | **name** | **string** | Name of the campaign | -**subject** | **string** | Subject of the campaign | +**subject** | **string** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional] **type** | **string** | Type of campaign | **status** | **string** | Status of the campaign | **scheduledAt** | [**\DateTime**] | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] +**abTesting** | **bool** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional] +**subjectA** | **string** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] +**subjectB** | **string** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] +**splitRule** | **int** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional] +**winnerCriteria** | **string** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional] +**winnerDelay** | **int** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional] +**sendAtBestTime** | **bool** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional] **testSent** | **bool** | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) | **header** | **string** | Header of the campaign | **footer** | **string** | Footer of the campaign | diff --git a/docs/Model/GetSsoToken.md b/docs/Model/GetSsoToken.md new file mode 100644 index 00000000..8f7ad814 --- /dev/null +++ b/docs/Model/GetSsoToken.md @@ -0,0 +1,10 @@ +# GetSsoToken + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **string** | Session token. It will remain valid for a short period of time only. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/UpdateChildDomain.md b/docs/Model/UpdateChildDomain.md new file mode 100644 index 00000000..a22b5d2f --- /dev/null +++ b/docs/Model/UpdateChildDomain.md @@ -0,0 +1,10 @@ +# UpdateChildDomain + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**domain** | **string** | Value for the sender domain that will replace the existing domain | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/lib/Api/ResellerApi.php b/lib/Api/ResellerApi.php index 640adfc3..08c78b0b 100644 --- a/lib/Api/ResellerApi.php +++ b/lib/Api/ResellerApi.php @@ -657,38 +657,1390 @@ protected function associateIpToChildRequest($childAuthKey, $ip) ); } + /** + * Operation createChildDomain + * + * 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) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function createChildDomain($childAuthKey, $addChildDomain) + { + $this->createChildDomainWithHttpInfo($childAuthKey, $addChildDomain); + } + + /** + * Operation createChildDomainWithHttpInfo + * + * 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) + * + * @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 createChildDomainWithHttpInfo($childAuthKey, $addChildDomain) + { + $returnType = ''; + $request = $this->createChildDomainRequest($childAuthKey, $addChildDomain); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\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 createChildDomainAsync + * + * 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) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createChildDomainAsync($childAuthKey, $addChildDomain) + { + return $this->createChildDomainAsyncWithHttpInfo($childAuthKey, $addChildDomain) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createChildDomainAsyncWithHttpInfo + * + * 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) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createChildDomainAsyncWithHttpInfo($childAuthKey, $addChildDomain) + { + $returnType = ''; + $request = $this->createChildDomainRequest($childAuthKey, $addChildDomain); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createChildDomain' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\AddChildDomain $addChildDomain Sender domain to add for a specific child account (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createChildDomainRequest($childAuthKey, $addChildDomain) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling createChildDomain' + ); + } + // verify the required parameter 'addChildDomain' is set + if ($addChildDomain === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $addChildDomain when calling createChildDomain' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/domains'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($addChildDomain)) { + $_tempBody = $addChildDomain; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($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 createResellerChild * - * Creates a reseller child + * Creates a reseller child + * + * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \SendinBlue\Client\Model\CreateReseller + */ + public function createResellerChild($resellerChild = null) + { + list($response) = $this->createResellerChildWithHttpInfo($resellerChild); + return $response; + } + + /** + * Operation createResellerChildWithHttpInfo + * + * Creates a reseller child + * + * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \SendinBlue\Client\Model\CreateReseller, HTTP status code, HTTP response headers (array of strings) + */ + public function createResellerChildWithHttpInfo($resellerChild = null) + { + $returnType = '\SendinBlue\Client\Model\CreateReseller'; + $request = $this->createResellerChildRequest($resellerChild); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\CreateReseller', + $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; + } + throw $e; + } + } + + /** + * Operation createResellerChildAsync + * + * Creates a reseller child + * + * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createResellerChildAsync($resellerChild = null) + { + return $this->createResellerChildAsyncWithHttpInfo($resellerChild) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createResellerChildAsyncWithHttpInfo + * + * Creates a reseller child + * + * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createResellerChildAsyncWithHttpInfo($resellerChild = null) + { + $returnType = '\SendinBlue\Client\Model\CreateReseller'; + $request = $this->createResellerChildRequest($resellerChild); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createResellerChild' + * + * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createResellerChildRequest($resellerChild = null) + { + + $resourcePath = '/reseller/children'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($resellerChild)) { + $_tempBody = $resellerChild; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($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 deleteChildDomain + * + * Deletes the sender domain of the reseller child based on the childAuthKey and domainName passed + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be deleted (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteChildDomain($childAuthKey, $domainName) + { + $this->deleteChildDomainWithHttpInfo($childAuthKey, $domainName); + } + + /** + * Operation deleteChildDomainWithHttpInfo + * + * Deletes the sender domain of the reseller child based on the childAuthKey and domainName passed + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be deleted (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 deleteChildDomainWithHttpInfo($childAuthKey, $domainName) + { + $returnType = ''; + $request = $this->deleteChildDomainRequest($childAuthKey, $domainName); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 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 deleteChildDomainAsync + * + * Deletes the sender domain of the reseller child based on the childAuthKey and domainName passed + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be deleted (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteChildDomainAsync($childAuthKey, $domainName) + { + return $this->deleteChildDomainAsyncWithHttpInfo($childAuthKey, $domainName) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteChildDomainAsyncWithHttpInfo + * + * Deletes the sender domain of the reseller child based on the childAuthKey and domainName passed + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be deleted (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteChildDomainAsyncWithHttpInfo($childAuthKey, $domainName) + { + $returnType = ''; + $request = $this->deleteChildDomainRequest($childAuthKey, $domainName); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteChildDomain' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param string $domainName Pass the existing domain that needs to be deleted (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteChildDomainRequest($childAuthKey, $domainName) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling deleteChildDomain' + ); + } + // verify the required parameter 'domainName' is set + if ($domainName === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $domainName when calling deleteChildDomain' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/domains/{domainName}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + // path params + if ($domainName !== null) { + $resourcePath = str_replace( + '{' . 'domainName' . '}', + ObjectSerializer::toPathValue($domainName), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($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 deleteResellerChild + * + * Deletes a single reseller child 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 void + */ + public function deleteResellerChild($childAuthKey) + { + $this->deleteResellerChildWithHttpInfo($childAuthKey); + } + + /** + * Operation deleteResellerChildWithHttpInfo + * + * Deletes a single reseller child 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 null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteResellerChildWithHttpInfo($childAuthKey) + { + $returnType = ''; + $request = $this->deleteResellerChildRequest($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() + ); + } + + 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 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 deleteResellerChildAsync + * + * Deletes a single reseller child based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteResellerChildAsync($childAuthKey) + { + return $this->deleteResellerChildAsyncWithHttpInfo($childAuthKey) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteResellerChildAsyncWithHttpInfo + * + * Deletes a single reseller child based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteResellerChildAsyncWithHttpInfo($childAuthKey) + { + $returnType = ''; + $request = $this->deleteResellerChildRequest($childAuthKey); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteResellerChild' + * + * @param string $childAuthKey auth key of reseller's child (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteResellerChildRequest($childAuthKey) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling deleteResellerChild' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}'; + $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; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($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 dissociateIpFromChild + * + * Dissociate a dedicated IP to the child + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function dissociateIpFromChild($childAuthKey, $ip) + { + $this->dissociateIpFromChildWithHttpInfo($childAuthKey, $ip); + } + + /** + * Operation dissociateIpFromChildWithHttpInfo + * + * Dissociate a dedicated IP to the child + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (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 dissociateIpFromChildWithHttpInfo($childAuthKey, $ip) + { + $returnType = ''; + $request = $this->dissociateIpFromChildRequest($childAuthKey, $ip); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\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 dissociateIpFromChildAsync + * + * Dissociate a dedicated IP to the child + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function dissociateIpFromChildAsync($childAuthKey, $ip) + { + return $this->dissociateIpFromChildAsyncWithHttpInfo($childAuthKey, $ip) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation dissociateIpFromChildAsyncWithHttpInfo + * + * Dissociate a dedicated IP to the child + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function dissociateIpFromChildAsyncWithHttpInfo($childAuthKey, $ip) + { + $returnType = ''; + $request = $this->dissociateIpFromChildRequest($childAuthKey, $ip); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'dissociateIpFromChild' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function dissociateIpFromChildRequest($childAuthKey, $ip) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling dissociateIpFromChild' + ); + } + // verify the required parameter 'ip' is set + if ($ip === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $ip when calling dissociateIpFromChild' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/ips/dissociate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($ip)) { + $_tempBody = $ip; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($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 getChildDomains + * + * Gets all the sender domains of a specific child account * - * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * @param string $childAuthKey auth key of reseller's child (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SendinBlue\Client\Model\CreateReseller + * @return \SendinBlue\Client\Model\GetChildDomains */ - public function createResellerChild($resellerChild = null) + public function getChildDomains($childAuthKey) { - list($response) = $this->createResellerChildWithHttpInfo($resellerChild); + list($response) = $this->getChildDomainsWithHttpInfo($childAuthKey); return $response; } /** - * Operation createResellerChildWithHttpInfo + * Operation getChildDomainsWithHttpInfo * - * Creates a reseller child + * Gets all the sender domains of a specific child account * - * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * @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\CreateReseller, HTTP status code, HTTP response headers (array of strings) + * @return array of \SendinBlue\Client\Model\GetChildDomains, HTTP status code, HTTP response headers (array of strings) */ - public function createResellerChildWithHttpInfo($resellerChild = null) + public function getChildDomainsWithHttpInfo($childAuthKey) { - $returnType = '\SendinBlue\Client\Model\CreateReseller'; - $request = $this->createResellerChildRequest($resellerChild); + $returnType = '\SendinBlue\Client\Model\GetChildDomains'; + $request = $this->getChildDomainsRequest($childAuthKey); try { $options = $this->createHttpClientOption(); @@ -736,10 +2088,10 @@ public function createResellerChildWithHttpInfo($resellerChild = null) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SendinBlue\Client\Model\CreateReseller', + '\SendinBlue\Client\Model\GetChildDomains', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -760,24 +2112,32 @@ public function createResellerChildWithHttpInfo($resellerChild = null) ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation createResellerChildAsync + * Operation getChildDomainsAsync * - * Creates a reseller child + * Gets all the sender domains of a specific child account * - * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * @param string $childAuthKey auth key of reseller's child (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createResellerChildAsync($resellerChild = null) + public function getChildDomainsAsync($childAuthKey) { - return $this->createResellerChildAsyncWithHttpInfo($resellerChild) + return $this->getChildDomainsAsyncWithHttpInfo($childAuthKey) ->then( function ($response) { return $response[0]; @@ -786,19 +2146,19 @@ function ($response) { } /** - * Operation createResellerChildAsyncWithHttpInfo + * Operation getChildDomainsAsyncWithHttpInfo * - * Creates a reseller child + * Gets all the sender domains of a specific child account * - * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * @param string $childAuthKey auth key of reseller's child (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createResellerChildAsyncWithHttpInfo($resellerChild = null) + public function getChildDomainsAsyncWithHttpInfo($childAuthKey) { - $returnType = '\SendinBlue\Client\Model\CreateReseller'; - $request = $this->createResellerChildRequest($resellerChild); + $returnType = '\SendinBlue\Client\Model\GetChildDomains'; + $request = $this->getChildDomainsRequest($childAuthKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -838,17 +2198,23 @@ function ($exception) { } /** - * Create request for operation 'createResellerChild' + * Create request for operation 'getChildDomains' * - * @param \SendinBlue\Client\Model\CreateChild $resellerChild reseller child to add (optional) + * @param string $childAuthKey auth key of reseller's child (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createResellerChildRequest($resellerChild = null) + protected function getChildDomainsRequest($childAuthKey) { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling getChildDomains' + ); + } - $resourcePath = '/reseller/children'; + $resourcePath = '/reseller/children/{childAuthKey}/domains'; $formParams = []; $queryParams = []; $headerParams = []; @@ -856,12 +2222,17 @@ protected function createResellerChildRequest($resellerChild = null) $multipart = false; + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($resellerChild)) { - $_tempBody = $resellerChild; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -927,7 +2298,7 @@ protected function createResellerChildRequest($resellerChild = null) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -935,36 +2306,37 @@ protected function createResellerChildRequest($resellerChild = null) } /** - * Operation deleteResellerChild + * Operation getChildInfo * - * Deletes a single reseller child based on the childAuthKey supplied + * Gets the info about a specific child account * * @param string $childAuthKey auth key of reseller's child (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \SendinBlue\Client\Model\GetChildInfo */ - public function deleteResellerChild($childAuthKey) + public function getChildInfo($childAuthKey) { - $this->deleteResellerChildWithHttpInfo($childAuthKey); + list($response) = $this->getChildInfoWithHttpInfo($childAuthKey); + return $response; } /** - * Operation deleteResellerChildWithHttpInfo + * Operation getChildInfoWithHttpInfo * - * Deletes a single reseller child based on the childAuthKey supplied + * Gets the info about a specific child account * * @param string $childAuthKey auth key of reseller's child (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\GetChildInfo, HTTP status code, HTTP response headers (array of strings) */ - public function deleteResellerChildWithHttpInfo($childAuthKey) + public function getChildInfoWithHttpInfo($childAuthKey) { - $returnType = ''; - $request = $this->deleteResellerChildRequest($childAuthKey); + $returnType = '\SendinBlue\Client\Model\GetChildInfo'; + $request = $this->getChildInfoRequest($childAuthKey); try { $options = $this->createHttpClientOption(); @@ -994,10 +2366,32 @@ public function deleteResellerChildWithHttpInfo($childAuthKey) ); } - 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 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\GetChildInfo', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1028,18 +2422,18 @@ public function deleteResellerChildWithHttpInfo($childAuthKey) } /** - * Operation deleteResellerChildAsync + * Operation getChildInfoAsync * - * Deletes a single reseller child based on the childAuthKey supplied + * Gets the info about a specific child account * * @param string $childAuthKey auth key of reseller's child (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteResellerChildAsync($childAuthKey) + public function getChildInfoAsync($childAuthKey) { - return $this->deleteResellerChildAsyncWithHttpInfo($childAuthKey) + return $this->getChildInfoAsyncWithHttpInfo($childAuthKey) ->then( function ($response) { return $response[0]; @@ -1048,25 +2442,39 @@ function ($response) { } /** - * Operation deleteResellerChildAsyncWithHttpInfo + * Operation getChildInfoAsyncWithHttpInfo * - * Deletes a single reseller child based on the childAuthKey supplied + * Gets the info about a specific child account * * @param string $childAuthKey auth key of reseller's child (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteResellerChildAsyncWithHttpInfo($childAuthKey) + public function getChildInfoAsyncWithHttpInfo($childAuthKey) { - $returnType = ''; - $request = $this->deleteResellerChildRequest($childAuthKey); + $returnType = '\SendinBlue\Client\Model\GetChildInfo'; + $request = $this->getChildInfoRequest($childAuthKey); 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(); @@ -1086,19 +2494,19 @@ function ($exception) { } /** - * Create request for operation 'deleteResellerChild' + * Create request for operation 'getChildInfo' * * @param string $childAuthKey auth key of reseller's child (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteResellerChildRequest($childAuthKey) + protected function getChildInfoRequest($childAuthKey) { // verify the required parameter 'childAuthKey' is set if ($childAuthKey === null) { throw new \InvalidArgumentException( - 'Missing the required parameter $childAuthKey when calling deleteResellerChild' + 'Missing the required parameter $childAuthKey when calling getChildInfo' ); } @@ -1186,7 +2594,7 @@ protected function deleteResellerChildRequest($childAuthKey) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1194,38 +2602,35 @@ protected function deleteResellerChildRequest($childAuthKey) } /** - * Operation dissociateIpFromChild + * Operation getResellerChilds * - * Dissociate a dedicated IP to the child + * Gets the list of all reseller's children accounts * - * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \SendinBlue\Client\Model\GetChildrenList */ - public function dissociateIpFromChild($childAuthKey, $ip) + public function getResellerChilds() { - $this->dissociateIpFromChildWithHttpInfo($childAuthKey, $ip); + list($response) = $this->getResellerChildsWithHttpInfo(); + return $response; } /** - * Operation dissociateIpFromChildWithHttpInfo + * Operation getResellerChildsWithHttpInfo * - * Dissociate a dedicated IP to the child + * Gets the list of all reseller's children accounts * - * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (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\GetChildrenList, HTTP status code, HTTP response headers (array of strings) */ - public function dissociateIpFromChildWithHttpInfo($childAuthKey, $ip) + public function getResellerChildsWithHttpInfo() { - $returnType = ''; - $request = $this->dissociateIpFromChildRequest($childAuthKey, $ip); + $returnType = '\SendinBlue\Client\Model\GetChildrenList'; + $request = $this->getResellerChildsRequest(); try { $options = $this->createHttpClientOption(); @@ -1255,19 +2660,33 @@ public function dissociateIpFromChildWithHttpInfo($childAuthKey, $ip) ); } - 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: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SendinBlue\Client\Model\ErrorModel', + '\SendinBlue\Client\Model\GetChildrenList', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 404: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', @@ -1281,19 +2700,17 @@ public function dissociateIpFromChildWithHttpInfo($childAuthKey, $ip) } /** - * Operation dissociateIpFromChildAsync + * Operation getResellerChildsAsync * - * Dissociate a dedicated IP to the child + * Gets the list of all reseller's children accounts * - * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function dissociateIpFromChildAsync($childAuthKey, $ip) + public function getResellerChildsAsync() { - return $this->dissociateIpFromChildAsyncWithHttpInfo($childAuthKey, $ip) + return $this->getResellerChildsAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -1302,26 +2719,38 @@ function ($response) { } /** - * Operation dissociateIpFromChildAsyncWithHttpInfo + * Operation getResellerChildsAsyncWithHttpInfo * - * Dissociate a dedicated IP to the child + * Gets the list of all reseller's children accounts * - * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function dissociateIpFromChildAsyncWithHttpInfo($childAuthKey, $ip) + public function getResellerChildsAsyncWithHttpInfo() { - $returnType = ''; - $request = $this->dissociateIpFromChildRequest($childAuthKey, $ip); + $returnType = '\SendinBlue\Client\Model\GetChildrenList'; + $request = $this->getResellerChildsRequest(); + + 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 $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -1341,30 +2770,16 @@ function ($exception) { } /** - * Create request for operation 'dissociateIpFromChild' + * Create request for operation 'getResellerChilds' * - * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\ManageIp $ip IP to dissociate (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function dissociateIpFromChildRequest($childAuthKey, $ip) + protected function getResellerChildsRequest() { - // verify the required parameter 'childAuthKey' is set - if ($childAuthKey === null) { - throw new \InvalidArgumentException( - 'Missing the required parameter $childAuthKey when calling dissociateIpFromChild' - ); - } - // verify the required parameter 'ip' is set - if ($ip === null) { - throw new \InvalidArgumentException( - 'Missing the required parameter $ip when calling dissociateIpFromChild' - ); - } - $resourcePath = '/reseller/children/{childAuthKey}/ips/dissociate'; + $resourcePath = '/reseller/children'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1372,20 +2787,9 @@ protected function dissociateIpFromChildRequest($childAuthKey, $ip) $multipart = false; - // path params - if ($childAuthKey !== null) { - $resourcePath = str_replace( - '{' . 'childAuthKey' . '}', - ObjectSerializer::toPathValue($childAuthKey), - $resourcePath - ); - } // body params $_tempBody = null; - if (isset($ip)) { - $_tempBody = $ip; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1451,7 +2855,7 @@ protected function dissociateIpFromChildRequest($childAuthKey, $ip) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1459,37 +2863,37 @@ protected function dissociateIpFromChildRequest($childAuthKey, $ip) } /** - * Operation getChildInfo + * Operation getSsoToken * - * Gets the info about a specific child account + * Generates a session token which will remain valid for a short period of time only. * * @param string $childAuthKey auth key of reseller's child (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SendinBlue\Client\Model\GetChildInfo + * @return \SendinBlue\Client\Model\GetSsoToken */ - public function getChildInfo($childAuthKey) + public function getSsoToken($childAuthKey) { - list($response) = $this->getChildInfoWithHttpInfo($childAuthKey); + list($response) = $this->getSsoTokenWithHttpInfo($childAuthKey); return $response; } /** - * Operation getChildInfoWithHttpInfo + * Operation getSsoTokenWithHttpInfo * - * Gets the info about a specific child account + * Generates a session token which will remain valid for a short period of time only. * * @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\GetChildInfo, HTTP status code, HTTP response headers (array of strings) + * @return array of \SendinBlue\Client\Model\GetSsoToken, HTTP status code, HTTP response headers (array of strings) */ - public function getChildInfoWithHttpInfo($childAuthKey) + public function getSsoTokenWithHttpInfo($childAuthKey) { - $returnType = '\SendinBlue\Client\Model\GetChildInfo'; - $request = $this->getChildInfoRequest($childAuthKey); + $returnType = '\SendinBlue\Client\Model\GetSsoToken'; + $request = $this->getSsoTokenRequest($childAuthKey); try { $options = $this->createHttpClientOption(); @@ -1540,7 +2944,7 @@ public function getChildInfoWithHttpInfo($childAuthKey) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SendinBlue\Client\Model\GetChildInfo', + '\SendinBlue\Client\Model\GetSsoToken', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1575,18 +2979,18 @@ public function getChildInfoWithHttpInfo($childAuthKey) } /** - * Operation getChildInfoAsync + * Operation getSsoTokenAsync * - * Gets the info about a specific child account + * Generates a session token which will remain valid for a short period of time only. * * @param string $childAuthKey auth key of reseller's child (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChildInfoAsync($childAuthKey) + public function getSsoTokenAsync($childAuthKey) { - return $this->getChildInfoAsyncWithHttpInfo($childAuthKey) + return $this->getSsoTokenAsyncWithHttpInfo($childAuthKey) ->then( function ($response) { return $response[0]; @@ -1595,19 +2999,19 @@ function ($response) { } /** - * Operation getChildInfoAsyncWithHttpInfo + * Operation getSsoTokenAsyncWithHttpInfo * - * Gets the info about a specific child account + * Generates a session token which will remain valid for a short period of time only. * * @param string $childAuthKey auth key of reseller's child (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getChildInfoAsyncWithHttpInfo($childAuthKey) + public function getSsoTokenAsyncWithHttpInfo($childAuthKey) { - $returnType = '\SendinBlue\Client\Model\GetChildInfo'; - $request = $this->getChildInfoRequest($childAuthKey); + $returnType = '\SendinBlue\Client\Model\GetSsoToken'; + $request = $this->getSsoTokenRequest($childAuthKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1647,23 +3051,23 @@ function ($exception) { } /** - * Create request for operation 'getChildInfo' + * Create request for operation 'getSsoToken' * * @param string $childAuthKey auth key of reseller's child (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getChildInfoRequest($childAuthKey) + protected function getSsoTokenRequest($childAuthKey) { // verify the required parameter 'childAuthKey' is set if ($childAuthKey === null) { throw new \InvalidArgumentException( - 'Missing the required parameter $childAuthKey when calling getChildInfo' + 'Missing the required parameter $childAuthKey when calling getSsoToken' ); } - $resourcePath = '/reseller/children/{childAuthKey}'; + $resourcePath = '/reseller/children/{childAuthKey}/auth'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1755,35 +3159,39 @@ protected function getChildInfoRequest($childAuthKey) } /** - * Operation getResellerChilds + * Operation removeCredits * - * Gets the list of all reseller's children accounts + * Remove Email and/or SMS credits from a specific child account * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SendinBlue\Client\Model\GetChildrenList + * @return \SendinBlue\Client\Model\RemainingCreditModel */ - public function getResellerChilds() + public function removeCredits($childAuthKey, $removeCredits) { - list($response) = $this->getResellerChildsWithHttpInfo(); + list($response) = $this->removeCreditsWithHttpInfo($childAuthKey, $removeCredits); return $response; } /** - * Operation getResellerChildsWithHttpInfo + * Operation removeCreditsWithHttpInfo * - * Gets the list of all reseller's children accounts + * Remove Email and/or SMS credits from a specific child account * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) * * @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) + * @return array of \SendinBlue\Client\Model\RemainingCreditModel, HTTP status code, HTTP response headers (array of strings) */ - public function getResellerChildsWithHttpInfo() + public function removeCreditsWithHttpInfo($childAuthKey, $removeCredits) { - $returnType = '\SendinBlue\Client\Model\GetChildrenList'; - $request = $this->getResellerChildsRequest(); + $returnType = '\SendinBlue\Client\Model\RemainingCreditModel'; + $request = $this->removeCreditsRequest($childAuthKey, $removeCredits); try { $options = $this->createHttpClientOption(); @@ -1834,7 +3242,15 @@ public function getResellerChildsWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SendinBlue\Client\Model\GetChildrenList', + '\SendinBlue\Client\Model\RemainingCreditModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1847,23 +3263,33 @@ public function getResellerChildsWithHttpInfo() ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\SendinBlue\Client\Model\ErrorModel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation getResellerChildsAsync + * Operation removeCreditsAsync * - * Gets the list of all reseller's children accounts + * Remove Email and/or SMS credits from a specific child account * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getResellerChildsAsync() + public function removeCreditsAsync($childAuthKey, $removeCredits) { - return $this->getResellerChildsAsyncWithHttpInfo() + return $this->removeCreditsAsyncWithHttpInfo($childAuthKey, $removeCredits) ->then( function ($response) { return $response[0]; @@ -1872,18 +3298,20 @@ function ($response) { } /** - * Operation getResellerChildsAsyncWithHttpInfo + * Operation removeCreditsAsyncWithHttpInfo * - * Gets the list of all reseller's children accounts + * Remove Email and/or SMS credits from a specific child account * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getResellerChildsAsyncWithHttpInfo() + public function removeCreditsAsyncWithHttpInfo($childAuthKey, $removeCredits) { - $returnType = '\SendinBlue\Client\Model\GetChildrenList'; - $request = $this->getResellerChildsRequest(); + $returnType = '\SendinBlue\Client\Model\RemainingCreditModel'; + $request = $this->removeCreditsRequest($childAuthKey, $removeCredits); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1923,16 +3351,30 @@ function ($exception) { } /** - * Create request for operation 'getResellerChilds' + * Create request for operation 'removeCredits' * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getResellerChildsRequest() + protected function removeCreditsRequest($childAuthKey, $removeCredits) { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling removeCredits' + ); + } + // verify the required parameter 'removeCredits' is set + if ($removeCredits === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $removeCredits when calling removeCredits' + ); + } - $resourcePath = '/reseller/children'; + $resourcePath = '/reseller/children/{childAuthKey}/credits/remove'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1940,9 +3382,20 @@ protected function getResellerChildsRequest() $multipart = false; + // path params + if ($childAuthKey !== null) { + $resourcePath = str_replace( + '{' . 'childAuthKey' . '}', + ObjectSerializer::toPathValue($childAuthKey), + $resourcePath + ); + } // body params $_tempBody = null; + if (isset($removeCredits)) { + $_tempBody = $removeCredits; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2008,7 +3461,7 @@ protected function getResellerChildsRequest() $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2016,39 +3469,40 @@ protected function getResellerChildsRequest() } /** - * Operation removeCredits + * Operation updateChildDomain * - * Remove Email and/or SMS credits from a specific child account + * Updates the sender domain of reseller's child based on the childAuthKey and domainName passed * * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) + * @param string $domainName Pass the existing domain that needs to be updated (required) + * @param \SendinBlue\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SendinBlue\Client\Model\RemainingCreditModel + * @return void */ - public function removeCredits($childAuthKey, $removeCredits) + public function updateChildDomain($childAuthKey, $domainName, $updateChildDomain) { - list($response) = $this->removeCreditsWithHttpInfo($childAuthKey, $removeCredits); - return $response; + $this->updateChildDomainWithHttpInfo($childAuthKey, $domainName, $updateChildDomain); } /** - * Operation removeCreditsWithHttpInfo + * Operation updateChildDomainWithHttpInfo * - * Remove Email and/or SMS credits from a specific child account + * Updates the sender domain of reseller's child based on the childAuthKey and domainName passed * * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) + * @param string $domainName Pass the existing domain that needs to be updated (required) + * @param \SendinBlue\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SendinBlue\Client\Model\RemainingCreditModel, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function removeCreditsWithHttpInfo($childAuthKey, $removeCredits) + public function updateChildDomainWithHttpInfo($childAuthKey, $domainName, $updateChildDomain) { - $returnType = '\SendinBlue\Client\Model\RemainingCreditModel'; - $request = $this->removeCreditsRequest($childAuthKey, $removeCredits); + $returnType = ''; + $request = $this->updateChildDomainRequest($childAuthKey, $domainName, $updateChildDomain); try { $options = $this->createHttpClientOption(); @@ -2078,32 +3532,10 @@ public function removeCreditsWithHttpInfo($childAuthKey, $removeCredits) ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\SendinBlue\Client\Model\RemainingCreditModel', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2134,19 +3566,20 @@ public function removeCreditsWithHttpInfo($childAuthKey, $removeCredits) } /** - * Operation removeCreditsAsync + * Operation updateChildDomainAsync * - * Remove Email and/or SMS credits from a specific child account + * Updates the sender domain of reseller's child based on the childAuthKey and domainName passed * * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) + * @param string $domainName Pass the existing domain that needs to be updated (required) + * @param \SendinBlue\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function removeCreditsAsync($childAuthKey, $removeCredits) + public function updateChildDomainAsync($childAuthKey, $domainName, $updateChildDomain) { - return $this->removeCreditsAsyncWithHttpInfo($childAuthKey, $removeCredits) + return $this->updateChildDomainAsyncWithHttpInfo($childAuthKey, $domainName, $updateChildDomain) ->then( function ($response) { return $response[0]; @@ -2155,40 +3588,27 @@ function ($response) { } /** - * Operation removeCreditsAsyncWithHttpInfo + * Operation updateChildDomainAsyncWithHttpInfo * - * Remove Email and/or SMS credits from a specific child account + * Updates the sender domain of reseller's child based on the childAuthKey and domainName passed * * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) + * @param string $domainName Pass the existing domain that needs to be updated (required) + * @param \SendinBlue\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function removeCreditsAsyncWithHttpInfo($childAuthKey, $removeCredits) + public function updateChildDomainAsyncWithHttpInfo($childAuthKey, $domainName, $updateChildDomain) { - $returnType = '\SendinBlue\Client\Model\RemainingCreditModel'; - $request = $this->removeCreditsRequest($childAuthKey, $removeCredits); + $returnType = ''; + $request = $this->updateChildDomainRequest($childAuthKey, $domainName, $updateChildDomain); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -2208,30 +3628,37 @@ function ($exception) { } /** - * Create request for operation 'removeCredits' + * Create request for operation 'updateChildDomain' * * @param string $childAuthKey auth key of reseller's child (required) - * @param \SendinBlue\Client\Model\RemoveCredits $removeCredits Values to post to remove email or SMS credits from a specific child account (required) + * @param string $domainName Pass the existing domain that needs to be updated (required) + * @param \SendinBlue\Client\Model\UpdateChildDomain $updateChildDomain value to update for sender domain (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function removeCreditsRequest($childAuthKey, $removeCredits) + protected function updateChildDomainRequest($childAuthKey, $domainName, $updateChildDomain) { // verify the required parameter 'childAuthKey' is set if ($childAuthKey === null) { throw new \InvalidArgumentException( - 'Missing the required parameter $childAuthKey when calling removeCredits' + 'Missing the required parameter $childAuthKey when calling updateChildDomain' ); } - // verify the required parameter 'removeCredits' is set - if ($removeCredits === null) { + // verify the required parameter 'domainName' is set + if ($domainName === null) { throw new \InvalidArgumentException( - 'Missing the required parameter $removeCredits when calling removeCredits' + 'Missing the required parameter $domainName when calling updateChildDomain' + ); + } + // verify the required parameter 'updateChildDomain' is set + if ($updateChildDomain === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateChildDomain when calling updateChildDomain' ); } - $resourcePath = '/reseller/children/{childAuthKey}/credits/remove'; + $resourcePath = '/reseller/children/{childAuthKey}/domains/{domainName}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2247,11 +3674,19 @@ protected function removeCreditsRequest($childAuthKey, $removeCredits) $resourcePath ); } + // path params + if ($domainName !== null) { + $resourcePath = str_replace( + '{' . 'domainName' . '}', + ObjectSerializer::toPathValue($domainName), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($removeCredits)) { - $_tempBody = $removeCredits; + if (isset($updateChildDomain)) { + $_tempBody = $updateChildDomain; } if ($multipart) { @@ -2318,7 +3753,7 @@ protected function removeCreditsRequest($childAuthKey, $removeCredits) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody diff --git a/lib/Api/SMSCampaignsApi.php b/lib/Api/SMSCampaignsApi.php index f67df12d..31345a88 100644 --- a/lib/Api/SMSCampaignsApi.php +++ b/lib/Api/SMSCampaignsApi.php @@ -614,15 +614,14 @@ protected function deleteSmsCampaignRequest($campaignId) * Get an SMS campaign * * @param int $campaignId id of the SMS campaign (required) - * @param \SendinBlue\Client\Model\GetSmsCampaign $getSmsCampaign Values to update an SMS Campaign (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \SendinBlue\Client\Model\GetSmsCampaign */ - public function getSmsCampaign($campaignId, $getSmsCampaign) + public function getSmsCampaign($campaignId) { - list($response) = $this->getSmsCampaignWithHttpInfo($campaignId, $getSmsCampaign); + list($response) = $this->getSmsCampaignWithHttpInfo($campaignId); return $response; } @@ -632,16 +631,15 @@ public function getSmsCampaign($campaignId, $getSmsCampaign) * Get an SMS campaign * * @param int $campaignId id of the SMS campaign (required) - * @param \SendinBlue\Client\Model\GetSmsCampaign $getSmsCampaign Values to update an SMS Campaign (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \SendinBlue\Client\Model\GetSmsCampaign, HTTP status code, HTTP response headers (array of strings) */ - public function getSmsCampaignWithHttpInfo($campaignId, $getSmsCampaign) + public function getSmsCampaignWithHttpInfo($campaignId) { $returnType = '\SendinBlue\Client\Model\GetSmsCampaign'; - $request = $this->getSmsCampaignRequest($campaignId, $getSmsCampaign); + $request = $this->getSmsCampaignRequest($campaignId); try { $options = $this->createHttpClientOption(); @@ -724,14 +722,13 @@ public function getSmsCampaignWithHttpInfo($campaignId, $getSmsCampaign) * Get an SMS campaign * * @param int $campaignId id of the SMS campaign (required) - * @param \SendinBlue\Client\Model\GetSmsCampaign $getSmsCampaign Values to update an SMS Campaign (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSmsCampaignAsync($campaignId, $getSmsCampaign) + public function getSmsCampaignAsync($campaignId) { - return $this->getSmsCampaignAsyncWithHttpInfo($campaignId, $getSmsCampaign) + return $this->getSmsCampaignAsyncWithHttpInfo($campaignId) ->then( function ($response) { return $response[0]; @@ -745,15 +742,14 @@ function ($response) { * Get an SMS campaign * * @param int $campaignId id of the SMS campaign (required) - * @param \SendinBlue\Client\Model\GetSmsCampaign $getSmsCampaign Values to update an SMS Campaign (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSmsCampaignAsyncWithHttpInfo($campaignId, $getSmsCampaign) + public function getSmsCampaignAsyncWithHttpInfo($campaignId) { $returnType = '\SendinBlue\Client\Model\GetSmsCampaign'; - $request = $this->getSmsCampaignRequest($campaignId, $getSmsCampaign); + $request = $this->getSmsCampaignRequest($campaignId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -796,12 +792,11 @@ function ($exception) { * Create request for operation 'getSmsCampaign' * * @param int $campaignId id of the SMS campaign (required) - * @param \SendinBlue\Client\Model\GetSmsCampaign $getSmsCampaign Values to update an SMS Campaign (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getSmsCampaignRequest($campaignId, $getSmsCampaign) + protected function getSmsCampaignRequest($campaignId) { // verify the required parameter 'campaignId' is set if ($campaignId === null) { @@ -809,12 +804,6 @@ protected function getSmsCampaignRequest($campaignId, $getSmsCampaign) 'Missing the required parameter $campaignId when calling getSmsCampaign' ); } - // verify the required parameter 'getSmsCampaign' is set - if ($getSmsCampaign === null) { - throw new \InvalidArgumentException( - 'Missing the required parameter $getSmsCampaign when calling getSmsCampaign' - ); - } $resourcePath = '/smsCampaigns/{campaignId}'; $formParams = []; @@ -835,9 +824,6 @@ protected function getSmsCampaignRequest($campaignId, $getSmsCampaign) // body params $_tempBody = null; - if (isset($getSmsCampaign)) { - $_tempBody = $getSmsCampaign; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( diff --git a/lib/Api/SMTPApi.php b/lib/Api/SMTPApi.php index 9bb285d4..6789ffbb 100644 --- a/lib/Api/SMTPApi.php +++ b/lib/Api/SMTPApi.php @@ -845,8 +845,8 @@ protected function deleteSmtpTemplateRequest($templateId) * * Get your SMTP activity aggregated over a period of time * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Tag of the emails (optional) * @@ -865,8 +865,8 @@ public function getAggregatedSmtpReport($startDate = null, $endDate = null, $day * * Get your SMTP activity aggregated over a period of time * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Tag of the emails (optional) * @@ -951,8 +951,8 @@ public function getAggregatedSmtpReportWithHttpInfo($startDate = null, $endDate * * Get your SMTP activity aggregated over a period of time * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Tag of the emails (optional) * @@ -974,8 +974,8 @@ function ($response) { * * Get your SMTP activity aggregated over a period of time * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Tag of the emails (optional) * @@ -1027,8 +1027,8 @@ function ($exception) { /** * Create request for operation 'getAggregatedSmtpReport' * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Tag of the emails (optional) * @@ -1144,8 +1144,8 @@ protected function getAggregatedSmtpReportRequest($startDate = null, $endDate = * * @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) - * @param \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $email Filter the report for a specific email addresses (optional) * @param string $event Filter the report for a specific event type (optional) @@ -1170,8 +1170,8 @@ public function getEmailEventReport($limit = '50', $offset = '0', $startDate = n * * @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) - * @param \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $email Filter the report for a specific email addresses (optional) * @param string $event Filter the report for a specific event type (optional) @@ -1262,8 +1262,8 @@ public function getEmailEventReportWithHttpInfo($limit = '50', $offset = '0', $s * * @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) - * @param \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $email Filter the report for a specific email addresses (optional) * @param string $event Filter the report for a specific event type (optional) @@ -1291,8 +1291,8 @@ function ($response) { * * @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) - * @param \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $email Filter the report for a specific email addresses (optional) * @param string $event Filter the report for a specific event type (optional) @@ -1350,8 +1350,8 @@ function ($exception) { * * @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) - * @param \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $email Filter the report for a specific email addresses (optional) * @param string $event Filter the report for a specific event type (optional) @@ -1499,8 +1499,8 @@ protected function getEmailEventReportRequest($limit = '50', $offset = '0', $sta * * @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 \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Tag of the emails (optional) * @@ -1521,8 +1521,8 @@ public function getSmtpReport($limit = '50', $offset = '0', $startDate = null, $ * * @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 \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Tag of the emails (optional) * @@ -1609,8 +1609,8 @@ public function getSmtpReportWithHttpInfo($limit = '50', $offset = '0', $startDa * * @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 \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Tag of the emails (optional) * @@ -1634,8 +1634,8 @@ function ($response) { * * @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 \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Tag of the emails (optional) * @@ -1689,8 +1689,8 @@ function ($exception) { * * @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 \DateTime $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) + * @param string $startDate Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) (optional) + * @param string $endDate Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Tag of the emails (optional) * diff --git a/lib/Api/TransactionalSMSApi.php b/lib/Api/TransactionalSMSApi.php index fef49a79..3391fdfb 100644 --- a/lib/Api/TransactionalSMSApi.php +++ b/lib/Api/TransactionalSMSApi.php @@ -88,8 +88,8 @@ public function getConfig() * Get all the SMS activity (unaggregated events) * * @param int $limit Number of documents per page (optional, default to 50) - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $offset Index of the first document of the page (optional, default to 0) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $phoneNumber Filter the report for a specific phone number (optional) @@ -112,8 +112,8 @@ public function getSmsEvents($limit = '50', $startDate = null, $endDate = null, * Get all the SMS activity (unaggregated events) * * @param int $limit Number of documents per page (optional, default to 50) - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $offset Index of the first document of the page (optional, default to 0) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $phoneNumber Filter the report for a specific phone number (optional) @@ -202,8 +202,8 @@ public function getSmsEventsWithHttpInfo($limit = '50', $startDate = null, $endD * Get all the SMS activity (unaggregated events) * * @param int $limit Number of documents per page (optional, default to 50) - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $offset Index of the first document of the page (optional, default to 0) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $phoneNumber Filter the report for a specific phone number (optional) @@ -229,8 +229,8 @@ function ($response) { * Get all the SMS activity (unaggregated events) * * @param int $limit Number of documents per page (optional, default to 50) - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $offset Index of the first document of the page (optional, default to 0) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $phoneNumber Filter the report for a specific phone number (optional) @@ -286,8 +286,8 @@ function ($exception) { * Create request for operation 'getSmsEvents' * * @param int $limit Number of documents per page (optional, default to 50) - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $offset Index of the first document of the page (optional, default to 0) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $phoneNumber Filter the report for a specific phone number (optional) @@ -424,8 +424,8 @@ protected function getSmsEventsRequest($limit = '50', $startDate = null, $endDat * * Get your SMS activity aggregated over a period of time * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) * @param string $tag Filter on a tag (optional) * @@ -444,8 +444,8 @@ public function getTransacAggregatedSmsReport($startDate = null, $endDate = null * * Get your SMS activity aggregated over a period of time * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) * @param string $tag Filter on a tag (optional) * @@ -530,8 +530,8 @@ public function getTransacAggregatedSmsReportWithHttpInfo($startDate = null, $en * * Get your SMS activity aggregated over a period of time * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) * @param string $tag Filter on a tag (optional) * @@ -553,8 +553,8 @@ function ($response) { * * Get your SMS activity aggregated over a period of time * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) * @param string $tag Filter on a tag (optional) * @@ -606,8 +606,8 @@ function ($exception) { /** * Create request for operation 'getTransacAggregatedSmsReport' * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with startDate and endDate (optional) * @param string $tag Filter on a tag (optional) * @@ -721,8 +721,8 @@ protected function getTransacAggregatedSmsReportRequest($startDate = null, $endD * * Get your SMS activity aggregated per day * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Filter on a tag (optional) * @@ -741,8 +741,8 @@ public function getTransacSmsReport($startDate = null, $endDate = null, $days = * * Get your SMS activity aggregated per day * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Filter on a tag (optional) * @@ -827,8 +827,8 @@ public function getTransacSmsReportWithHttpInfo($startDate = null, $endDate = nu * * Get your SMS activity aggregated per day * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Filter on a tag (optional) * @@ -850,8 +850,8 @@ function ($response) { * * Get your SMS activity aggregated per day * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Filter on a tag (optional) * @@ -903,8 +903,8 @@ function ($exception) { /** * Create request for operation 'getTransacSmsReport' * - * @param \DateTime $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) - * @param \DateTime $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) + * @param string $startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report (optional) + * @param string $endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report (optional) * @param int $days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' (optional) * @param string $tag Filter on a tag (optional) * diff --git a/lib/Model/AddChildDomain.php b/lib/Model/AddChildDomain.php new file mode 100644 index 00000000..3c24c860 --- /dev/null +++ b/lib/Model/AddChildDomain.php @@ -0,0 +1,302 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'domain' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'domain' => 'domain' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'domain' => 'setDomain' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'domain' => 'getDomain' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain Sender domain to add for a specific child account + * + * @return $this + */ + public function setDomain($domain) + { + $this->container['domain'] = $domain; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + 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/DeleteHardbounces.php b/lib/Model/DeleteHardbounces.php index fdde0955..5b87d5ef 100644 --- a/lib/Model/DeleteHardbounces.php +++ b/lib/Model/DeleteHardbounces.php @@ -57,8 +57,8 @@ class DeleteHardbounces implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'startDate' => '\DateTime', - 'endDate' => '\DateTime', + 'startDate' => 'string', + 'endDate' => 'string', 'contactEmail' => 'string' ]; @@ -68,8 +68,8 @@ class DeleteHardbounces implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'startDate' => 'date', - 'endDate' => 'date', + 'startDate' => null, + 'endDate' => null, 'contactEmail' => 'email' ]; @@ -220,7 +220,7 @@ public function valid() /** * Gets startDate * - * @return \DateTime + * @return string */ public function getStartDate() { @@ -230,7 +230,7 @@ public function getStartDate() /** * Sets startDate * - * @param \DateTime $startDate Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate + * @param string $startDate Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate * * @return $this */ @@ -244,7 +244,7 @@ public function setStartDate($startDate) /** * Gets endDate * - * @return \DateTime + * @return string */ public function getEndDate() { @@ -254,7 +254,7 @@ public function getEndDate() /** * Sets endDate * - * @param \DateTime $endDate Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate + * @param string $endDate Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate * * @return $this */ diff --git a/lib/Model/GetAttributesAttributes.php b/lib/Model/GetAttributesAttributes.php index aa334c67..7cdea1c4 100644 --- a/lib/Model/GetAttributesAttributes.php +++ b/lib/Model/GetAttributesAttributes.php @@ -187,6 +187,7 @@ public function getModelName() const TYPE_DATE = 'date'; const TYPE_FLOAT = 'float'; const TYPE_ID = 'id'; + const TYPE_BOOLEAN = 'boolean'; @@ -218,6 +219,7 @@ public function getTypeAllowableValues() self::TYPE_DATE, self::TYPE_FLOAT, self::TYPE_ID, + self::TYPE_BOOLEAN, ]; } diff --git a/lib/Model/GetChildDomain.php b/lib/Model/GetChildDomain.php new file mode 100644 index 00000000..5b7db91a --- /dev/null +++ b/lib/Model/GetChildDomain.php @@ -0,0 +1,344 @@ + 'string', + 'active' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'domain' => null, + 'active' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'domain' => 'domain', + 'active' => 'active' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'domain' => 'setDomain', + 'active' => 'setActive' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'domain' => 'getDomain', + 'active' => 'getActive' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null; + $this->container['active'] = isset($data['active']) ? $data['active'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['domain'] === null) { + $invalidProperties[] = "'domain' can't be null"; + } + if ($this->container['active'] === null) { + $invalidProperties[] = "'active' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['domain'] === null) { + return false; + } + if ($this->container['active'] === null) { + return false; + } + return true; + } + + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain Sender domain + * + * @return $this + */ + public function setDomain($domain) + { + $this->container['domain'] = $domain; + + return $this; + } + + /** + * Gets active + * + * @return bool + */ + public function getActive() + { + return $this->container['active']; + } + + /** + * Sets active + * + * @param bool $active indicates whether a domain is verified or not + * + * @return $this + */ + public function setActive($active) + { + $this->container['active'] = $active; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + 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/GetChildDomains.php b/lib/Model/GetChildDomains.php new file mode 100644 index 00000000..dc0a126c --- /dev/null +++ b/lib/Model/GetChildDomains.php @@ -0,0 +1,280 @@ +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/GetSsoToken.php b/lib/Model/GetSsoToken.php new file mode 100644 index 00000000..fccdb855 --- /dev/null +++ b/lib/Model/GetSsoToken.php @@ -0,0 +1,308 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'token' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'token' => 'token' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'token' => 'setToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'token' => 'getToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['token'] = isset($data['token']) ? $data['token'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['token'] === null) { + $invalidProperties[] = "'token' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + if ($this->container['token'] === null) { + return false; + } + return true; + } + + + /** + * Gets token + * + * @return string + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param string $token Session token. It will remain valid for a short period of time only. + * + * @return $this + */ + public function setToken($token) + { + $this->container['token'] = $token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + 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/UpdateChildDomain.php b/lib/Model/UpdateChildDomain.php new file mode 100644 index 00000000..36d4faef --- /dev/null +++ b/lib/Model/UpdateChildDomain.php @@ -0,0 +1,302 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'domain' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'domain' => 'domain' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'domain' => 'setDomain' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'domain' => 'getDomain' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['domain'] = isset($data['domain']) ? $data['domain'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + + return true; + } + + + /** + * Gets domain + * + * @return string + */ + public function getDomain() + { + return $this->container['domain']; + } + + /** + * Sets domain + * + * @param string $domain Value for the sender domain that will replace the existing domain + * + * @return $this + */ + public function setDomain($domain) + { + $this->container['domain'] = $domain; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + 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/test/Api/ResellerApiTest.php b/test/Api/ResellerApiTest.php index 29428996..8e899b20 100644 --- a/test/Api/ResellerApiTest.php +++ b/test/Api/ResellerApiTest.php @@ -91,6 +91,16 @@ public function testAssociateIpToChild() { } + /** + * Test case for createChildDomain + * + * Creates a domain for a child account. + * + */ + public function testCreateChildDomain() + { + } + /** * Test case for createResellerChild * @@ -101,6 +111,16 @@ public function testCreateResellerChild() { } + /** + * Test case for deleteChildDomain + * + * Deletes the sender domain of the reseller child based on the childAuthKey and domainName passed. + * + */ + public function testDeleteChildDomain() + { + } + /** * Test case for deleteResellerChild * @@ -121,6 +141,16 @@ public function testDissociateIpFromChild() { } + /** + * Test case for getChildDomains + * + * Gets all the sender domains of a specific child account. + * + */ + public function testGetChildDomains() + { + } + /** * Test case for getChildInfo * @@ -141,6 +171,16 @@ public function testGetResellerChilds() { } + /** + * Test case for getSsoToken + * + * Generates a session token which will remain valid for a short period of time only.. + * + */ + public function testGetSsoToken() + { + } + /** * Test case for removeCredits * @@ -151,6 +191,16 @@ public function testRemoveCredits() { } + /** + * Test case for updateChildDomain + * + * Updates the sender domain of reseller's child based on the childAuthKey and domainName passed. + * + */ + public function testUpdateChildDomain() + { + } + /** * Test case for updateResellerChild * diff --git a/test/Model/AddChildDomainTest.php b/test/Model/AddChildDomainTest.php new file mode 100644 index 00000000..82b10c3f --- /dev/null +++ b/test/Model/AddChildDomainTest.php @@ -0,0 +1,86 @@ +