From 71d3d07114a20dbd18d7c13dd6067c08b511c830 Mon Sep 17 00:00:00 2001 From: ekta-slt Date: Mon, 27 May 2019 14:50:06 +0530 Subject: [PATCH] New reseller route updated --- README.md | 4 +- docs/Api/ContactsApi.md | 4 +- docs/Api/ResellerApi.md | 65 +++- docs/Model/UpdateChildAccountStatus.md | 12 + lib/Api/ContactsApi.php | 10 +- lib/Api/ResellerApi.php | 281 ++++++++++++++- lib/Model/UpdateChildAccountStatus.php | 362 ++++++++++++++++++++ test/Api/ResellerApiTest.php | 12 +- test/Model/UpdateChildAccountStatusTest.php | 100 ++++++ 9 files changed, 835 insertions(+), 15 deletions(-) create mode 100644 docs/Model/UpdateChildAccountStatus.md create mode 100644 lib/Model/UpdateChildAccountStatus.php create mode 100644 test/Model/UpdateChildAccountStatusTest.php diff --git a/README.md b/README.md index 96b60987..820939fd 100644 --- a/README.md +++ b/README.md @@ -147,8 +147,9 @@ Class | Method | HTTP request | Description *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* | [**getSsoToken**](docs/Api/ResellerApi.md#getssotoken) | **GET** /reseller/children/{childAuthKey}/auth | Get session token to access Sendinblue (SSO) *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* | [**updateChildAccountStatus**](docs/Api/ResellerApi.md#updatechildaccountstatus) | **PUT** /reseller/children/{childAuthKey}/accountStatus | Updates infos of reseller's child account status based on the childAuthKey supplied *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 @@ -327,6 +328,7 @@ Class | Method | HTTP request | Description - [UpdateAttributeEnumeration](docs/Model/UpdateAttributeEnumeration.md) - [UpdateCampaignStatus](docs/Model/UpdateCampaignStatus.md) - [UpdateChild](docs/Model/UpdateChild.md) + - [UpdateChildAccountStatus](docs/Model/UpdateChildAccountStatus.md) - [UpdateChildDomain](docs/Model/UpdateChildDomain.md) - [UpdateContact](docs/Model/UpdateContact.md) - [UpdateEmailCampaign](docs/Model/UpdateEmailCampaign.md) diff --git a/docs/Api/ContactsApi.md b/docs/Api/ContactsApi.md index 9ccfa684..227fecab 100644 --- a/docs/Api/ContactsApi.md +++ b/docs/Api/ContactsApi.md @@ -626,7 +626,7 @@ $apiInstance = new SendinBlue\Client\Api\ContactsApi( new GuzzleHttp\Client(), $config ); -$email = "email_example"; // string | Email (urlencoded) of the contact +$email = "email_example"; // string | Email (urlencoded) of the contact OR its SMS attribute value try { $result = $apiInstance->getContactInfo($email); @@ -641,7 +641,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **email** | **string**| Email (urlencoded) of the contact | + **email** | **string**| Email (urlencoded) of the contact OR its SMS attribute value | ### Return type diff --git a/docs/Api/ResellerApi.md b/docs/Api/ResellerApi.md index 3539b217..43167fb8 100644 --- a/docs/Api/ResellerApi.md +++ b/docs/Api/ResellerApi.md @@ -14,8 +14,9 @@ Method | HTTP request | Description [**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. +[**getSsoToken**](ResellerApi.md#getSsoToken) | **GET** /reseller/children/{childAuthKey}/auth | Get session token to access Sendinblue (SSO) [**removeCredits**](ResellerApi.md#removeCredits) | **POST** /reseller/children/{childAuthKey}/credits/remove | Remove Email and/or SMS credits from a specific child account +[**updateChildAccountStatus**](ResellerApi.md#updateChildAccountStatus) | **PUT** /reseller/children/{childAuthKey}/accountStatus | Updates infos of reseller's child account status based on the childAuthKey supplied [**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 @@ -594,7 +595,9 @@ This endpoint does not need any parameter. # **getSsoToken** > \SendinBlue\Client\Model\GetSsoToken getSsoToken($childAuthKey) -Generates a session token which will remain valid for a short period of time only. +Get session token to access Sendinblue (SSO) + +It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] ### Example ```php @@ -707,6 +710,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) +# **updateChildAccountStatus** +> updateChildAccountStatus($childAuthKey, $updateChildAccountStatus) + +Updates infos of reseller's child account status based on the childAuthKey supplied + +### Example +```php +setApiKey('api-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer'); +// Configure API key authorization: partner-key +$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer'); + +$apiInstance = new SendinBlue\Client\Api\ResellerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$childAuthKey = "childAuthKey_example"; // string | auth key of reseller's child +$updateChildAccountStatus = new \SendinBlue\Client\Model\UpdateChildAccountStatus(); // \SendinBlue\Client\Model\UpdateChildAccountStatus | values to update in child account status + +try { + $apiInstance->updateChildAccountStatus($childAuthKey, $updateChildAccountStatus); +} catch (Exception $e) { + echo 'Exception when calling ResellerApi->updateChildAccountStatus: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **childAuthKey** | **string**| auth key of reseller's child | + **updateChildAccountStatus** | [**\SendinBlue\Client\Model\UpdateChildAccountStatus**](../Model/UpdateChildAccountStatus.md)| values to update in child account status | + +### Return type + +void (empty response body) + +### Authorization + +[api-key](../../README.md#api-key), [partner-key](../../README.md#partner-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + # **updateChildDomain** > updateChildDomain($childAuthKey, $domainName, $updateChildDomain) diff --git a/docs/Model/UpdateChildAccountStatus.md b/docs/Model/UpdateChildAccountStatus.md new file mode 100644 index 00000000..e7f6c2de --- /dev/null +++ b/docs/Model/UpdateChildAccountStatus.md @@ -0,0 +1,12 @@ +# UpdateChildAccountStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transactionalEmail** | **bool** | Status of Transactional Email (SMTP) Platform activation for your account (true=enabled, false=disabled) | [optional] +**transactionalSms** | **bool** | Status of Transactional SMS Platform activation for your account (true=enabled, false=disabled) | [optional] +**marketingAutomation** | **bool** | Status of Marketing Automation Platform activation for your account (true=enabled, false=disabled) | [optional] + +[[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/ContactsApi.php b/lib/Api/ContactsApi.php index 7b6edffa..f8cadee3 100644 --- a/lib/Api/ContactsApi.php +++ b/lib/Api/ContactsApi.php @@ -2782,7 +2782,7 @@ protected function getAttributesRequest() * * Retrieves contact informations * - * @param string $email Email (urlencoded) of the contact (required) + * @param string $email Email (urlencoded) of the contact OR its SMS attribute value (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2799,7 +2799,7 @@ public function getContactInfo($email) * * Retrieves contact informations * - * @param string $email Email (urlencoded) of the contact (required) + * @param string $email Email (urlencoded) of the contact OR its SMS attribute value (required) * * @throws \SendinBlue\Client\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2890,7 +2890,7 @@ public function getContactInfoWithHttpInfo($email) * * Retrieves contact informations * - * @param string $email Email (urlencoded) of the contact (required) + * @param string $email Email (urlencoded) of the contact OR its SMS attribute value (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2910,7 +2910,7 @@ function ($response) { * * Retrieves contact informations * - * @param string $email Email (urlencoded) of the contact (required) + * @param string $email Email (urlencoded) of the contact OR its SMS attribute value (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface @@ -2960,7 +2960,7 @@ function ($exception) { /** * Create request for operation 'getContactInfo' * - * @param string $email Email (urlencoded) of the contact (required) + * @param string $email Email (urlencoded) of the contact OR its SMS attribute value (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request diff --git a/lib/Api/ResellerApi.php b/lib/Api/ResellerApi.php index 08c78b0b..cf7cf832 100644 --- a/lib/Api/ResellerApi.php +++ b/lib/Api/ResellerApi.php @@ -2865,7 +2865,7 @@ protected function getResellerChildsRequest() /** * Operation getSsoToken * - * Generates a session token which will remain valid for a short period of time only. + * Get session token to access Sendinblue (SSO) * * @param string $childAuthKey auth key of reseller's child (required) * @@ -2882,7 +2882,7 @@ public function getSsoToken($childAuthKey) /** * Operation getSsoTokenWithHttpInfo * - * Generates a session token which will remain valid for a short period of time only. + * Get session token to access Sendinblue (SSO) * * @param string $childAuthKey auth key of reseller's child (required) * @@ -2981,7 +2981,7 @@ public function getSsoTokenWithHttpInfo($childAuthKey) /** * Operation getSsoTokenAsync * - * Generates a session token which will remain valid for a short period of time only. + * Get session token to access Sendinblue (SSO) * * @param string $childAuthKey auth key of reseller's child (required) * @@ -3001,7 +3001,7 @@ function ($response) { /** * Operation getSsoTokenAsyncWithHttpInfo * - * Generates a session token which will remain valid for a short period of time only. + * Get session token to access Sendinblue (SSO) * * @param string $childAuthKey auth key of reseller's child (required) * @@ -3468,6 +3468,279 @@ protected function removeCreditsRequest($childAuthKey, $removeCredits) ); } + /** + * Operation updateChildAccountStatus + * + * Updates infos of reseller's child account status based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required) + * + * @throws \SendinBlue\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function updateChildAccountStatus($childAuthKey, $updateChildAccountStatus) + { + $this->updateChildAccountStatusWithHttpInfo($childAuthKey, $updateChildAccountStatus); + } + + /** + * Operation updateChildAccountStatusWithHttpInfo + * + * Updates infos of reseller's child account status based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (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 updateChildAccountStatusWithHttpInfo($childAuthKey, $updateChildAccountStatus) + { + $returnType = ''; + $request = $this->updateChildAccountStatusRequest($childAuthKey, $updateChildAccountStatus); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 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 updateChildAccountStatusAsync + * + * Updates infos of reseller's child account status based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateChildAccountStatusAsync($childAuthKey, $updateChildAccountStatus) + { + return $this->updateChildAccountStatusAsyncWithHttpInfo($childAuthKey, $updateChildAccountStatus) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateChildAccountStatusAsyncWithHttpInfo + * + * Updates infos of reseller's child account status based on the childAuthKey supplied + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateChildAccountStatusAsyncWithHttpInfo($childAuthKey, $updateChildAccountStatus) + { + $returnType = ''; + $request = $this->updateChildAccountStatusRequest($childAuthKey, $updateChildAccountStatus); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateChildAccountStatus' + * + * @param string $childAuthKey auth key of reseller's child (required) + * @param \SendinBlue\Client\Model\UpdateChildAccountStatus $updateChildAccountStatus values to update in child account status (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function updateChildAccountStatusRequest($childAuthKey, $updateChildAccountStatus) + { + // verify the required parameter 'childAuthKey' is set + if ($childAuthKey === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $childAuthKey when calling updateChildAccountStatus' + ); + } + // verify the required parameter 'updateChildAccountStatus' is set + if ($updateChildAccountStatus === null) { + throw new \InvalidArgumentException( + 'Missing the required parameter $updateChildAccountStatus when calling updateChildAccountStatus' + ); + } + + $resourcePath = '/reseller/children/{childAuthKey}/accountStatus'; + $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($updateChildAccountStatus)) { + $_tempBody = $updateChildAccountStatus; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \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( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation updateChildDomain * diff --git a/lib/Model/UpdateChildAccountStatus.php b/lib/Model/UpdateChildAccountStatus.php new file mode 100644 index 00000000..c5153ef3 --- /dev/null +++ b/lib/Model/UpdateChildAccountStatus.php @@ -0,0 +1,362 @@ + 'bool', + 'transactionalSms' => 'bool', + 'marketingAutomation' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'transactionalEmail' => null, + 'transactionalSms' => null, + 'marketingAutomation' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'transactionalEmail' => 'transactionalEmail', + 'transactionalSms' => 'transactionalSms', + 'marketingAutomation' => 'marketingAutomation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transactionalEmail' => 'setTransactionalEmail', + 'transactionalSms' => 'setTransactionalSms', + 'marketingAutomation' => 'setMarketingAutomation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transactionalEmail' => 'getTransactionalEmail', + 'transactionalSms' => 'getTransactionalSms', + 'marketingAutomation' => 'getMarketingAutomation' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['transactionalEmail'] = isset($data['transactionalEmail']) ? $data['transactionalEmail'] : null; + $this->container['transactionalSms'] = isset($data['transactionalSms']) ? $data['transactionalSms'] : null; + $this->container['marketingAutomation'] = isset($data['marketingAutomation']) ? $data['marketingAutomation'] : null; + } + + /** + * 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 transactionalEmail + * + * @return bool + */ + public function getTransactionalEmail() + { + return $this->container['transactionalEmail']; + } + + /** + * Sets transactionalEmail + * + * @param bool $transactionalEmail Status of Transactional Email (SMTP) Platform activation for your account (true=enabled, false=disabled) + * + * @return $this + */ + public function setTransactionalEmail($transactionalEmail) + { + $this->container['transactionalEmail'] = $transactionalEmail; + + return $this; + } + + /** + * Gets transactionalSms + * + * @return bool + */ + public function getTransactionalSms() + { + return $this->container['transactionalSms']; + } + + /** + * Sets transactionalSms + * + * @param bool $transactionalSms Status of Transactional SMS Platform activation for your account (true=enabled, false=disabled) + * + * @return $this + */ + public function setTransactionalSms($transactionalSms) + { + $this->container['transactionalSms'] = $transactionalSms; + + return $this; + } + + /** + * Gets marketingAutomation + * + * @return bool + */ + public function getMarketingAutomation() + { + return $this->container['marketingAutomation']; + } + + /** + * Sets marketingAutomation + * + * @param bool $marketingAutomation Status of Marketing Automation Platform activation for your account (true=enabled, false=disabled) + * + * @return $this + */ + public function setMarketingAutomation($marketingAutomation) + { + $this->container['marketingAutomation'] = $marketingAutomation; + + return $this; + } + /** + * 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 8e899b20..1ba829e1 100644 --- a/test/Api/ResellerApiTest.php +++ b/test/Api/ResellerApiTest.php @@ -174,7 +174,7 @@ public function testGetResellerChilds() /** * Test case for getSsoToken * - * Generates a session token which will remain valid for a short period of time only.. + * Get session token to access Sendinblue (SSO). * */ public function testGetSsoToken() @@ -191,6 +191,16 @@ public function testRemoveCredits() { } + /** + * Test case for updateChildAccountStatus + * + * Updates infos of reseller's child account status based on the childAuthKey supplied. + * + */ + public function testUpdateChildAccountStatus() + { + } + /** * Test case for updateChildDomain * diff --git a/test/Model/UpdateChildAccountStatusTest.php b/test/Model/UpdateChildAccountStatusTest.php new file mode 100644 index 00000000..875f8594 --- /dev/null +++ b/test/Model/UpdateChildAccountStatusTest.php @@ -0,0 +1,100 @@ +