diff --git a/LICENSE.md b/LICENSE.md index f441ef17..152cf7f5 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 SendinBlue +Copyright (c) 2018 SendinBlue Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +THE SOFTWARE. diff --git a/README.md b/README.md index b6e4417d..d6b0d91f 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ Class | Method | HTTP request | Description *ContactsApi* | [**getList**](docs/Api/ContactsApi.md#getlist) | **GET** /contacts/lists/{listId} | Get the details of a list *ContactsApi* | [**getLists**](docs/Api/ContactsApi.md#getlists) | **GET** /contacts/lists | Get all the lists *ContactsApi* | [**importContacts**](docs/Api/ContactsApi.md#importcontacts) | **POST** /contacts/import | Import contacts -*ContactsApi* | [**removeContactToList**](docs/Api/ContactsApi.md#removecontacttolist) | **POST** /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list +*ContactsApi* | [**removeContactFromList**](docs/Api/ContactsApi.md#removecontactfromlist) | **POST** /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list *ContactsApi* | [**requestContactExport**](docs/Api/ContactsApi.md#requestcontactexport) | **POST** /contacts/export | Export contacts *ContactsApi* | [**updateAttribute**](docs/Api/ContactsApi.md#updateattribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Updates contact attribute *ContactsApi* | [**updateContact**](docs/Api/ContactsApi.md#updatecontact) | **PUT** /contacts/{email} | Updates a contact @@ -138,7 +138,7 @@ Class | Method | HTTP request | Description *ListsApi* | [**getFolderLists**](docs/Api/ListsApi.md#getfolderlists) | **GET** /contacts/folders/{folderId}/lists | Get the lists in a folder *ListsApi* | [**getList**](docs/Api/ListsApi.md#getlist) | **GET** /contacts/lists/{listId} | Get the details of a list *ListsApi* | [**getLists**](docs/Api/ListsApi.md#getlists) | **GET** /contacts/lists | Get all the lists -*ListsApi* | [**removeContactToList**](docs/Api/ListsApi.md#removecontacttolist) | **POST** /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list +*ListsApi* | [**removeContactFromList**](docs/Api/ListsApi.md#removecontactfromlist) | **POST** /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list *ListsApi* | [**updateList**](docs/Api/ListsApi.md#updatelist) | **PUT** /contacts/lists/{listId} | Update a list *ProcessApi* | [**getProcess**](docs/Api/ProcessApi.md#getprocess) | **GET** /processes/{processId} | Return the informations for a process *ProcessApi* | [**getProcesses**](docs/Api/ProcessApi.md#getprocesses) | **GET** /processes | Return all the processes for your account @@ -192,8 +192,8 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [AddContactToList](docs/Model/AddContactToList.md) - [AddCredits](docs/Model/AddCredits.md) - - [AddRemoveContactToList](docs/Model/AddRemoveContactToList.md) - [CreateAttribute](docs/Model/CreateAttribute.md) - [CreateAttributeEnumeration](docs/Model/CreateAttributeEnumeration.md) - [CreateChild](docs/Model/CreateChild.md) @@ -295,6 +295,7 @@ Class | Method | HTTP request | Description - [RemainingCreditModel](docs/Model/RemainingCreditModel.md) - [RemainingCreditModelChild](docs/Model/RemainingCreditModelChild.md) - [RemainingCreditModelReseller](docs/Model/RemainingCreditModelReseller.md) + - [RemoveContactFromList](docs/Model/RemoveContactFromList.md) - [RemoveCredits](docs/Model/RemoveCredits.md) - [RequestContactExport](docs/Model/RequestContactExport.md) - [RequestContactImport](docs/Model/RequestContactImport.md) diff --git a/composer.json b/composer.json index 59013acb..f054c841 100755 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "4.0.x-dev" } } } diff --git a/docs/Api/ContactsApi.md b/docs/Api/ContactsApi.md index e17e1b13..991b5aa3 100644 --- a/docs/Api/ContactsApi.md +++ b/docs/Api/ContactsApi.md @@ -23,7 +23,7 @@ Method | HTTP request | Description [**getList**](ContactsApi.md#getList) | **GET** /contacts/lists/{listId} | Get the details of a list [**getLists**](ContactsApi.md#getLists) | **GET** /contacts/lists | Get all the lists [**importContacts**](ContactsApi.md#importContacts) | **POST** /contacts/import | Import contacts -[**removeContactToList**](ContactsApi.md#removeContactToList) | **POST** /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list +[**removeContactFromList**](ContactsApi.md#removeContactFromList) | **POST** /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list [**requestContactExport**](ContactsApi.md#requestContactExport) | **POST** /contacts/export | Export contacts [**updateAttribute**](ContactsApi.md#updateAttribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Updates contact attribute [**updateContact**](ContactsApi.md#updateContact) | **PUT** /contacts/{email} | Updates a contact @@ -48,7 +48,7 @@ SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', $api_instance = new SendinBlue\Client\Api\ContactsApi(); $listId = 789; // int | Id of the list -$contactEmails = new \SendinBlue\Client\Model\AddRemoveContactToList(); // \SendinBlue\Client\Model\AddRemoveContactToList | Emails addresses of the contacts +$contactEmails = new \SendinBlue\Client\Model\AddContactToList(); // \SendinBlue\Client\Model\AddContactToList | Emails addresses of the contacts try { $result = $api_instance->addContactToList($listId, $contactEmails); @@ -64,7 +64,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **int**| Id of the list | - **contactEmails** | [**\SendinBlue\Client\Model\AddRemoveContactToList**](../Model/AddRemoveContactToList.md)| Emails addresses of the contacts | + **contactEmails** | [**\SendinBlue\Client\Model\AddContactToList**](../Model/AddContactToList.md)| Emails addresses of the contacts | ### Return type @@ -963,8 +963,8 @@ 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) -# **removeContactToList** -> \SendinBlue\Client\Model\PostContactInfo removeContactToList($listId, $contactEmails) +# **removeContactFromList** +> \SendinBlue\Client\Model\PostContactInfo removeContactFromList($listId, $contactEmails) Remove existing contacts from a list @@ -980,13 +980,13 @@ SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', $api_instance = new SendinBlue\Client\Api\ContactsApi(); $listId = 789; // int | Id of the list -$contactEmails = new \SendinBlue\Client\Model\AddRemoveContactToList(); // \SendinBlue\Client\Model\AddRemoveContactToList | Emails adresses of the contact +$contactEmails = new \SendinBlue\Client\Model\RemoveContactFromList(); // \SendinBlue\Client\Model\RemoveContactFromList | Emails adresses of the contact try { - $result = $api_instance->removeContactToList($listId, $contactEmails); + $result = $api_instance->removeContactFromList($listId, $contactEmails); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ContactsApi->removeContactToList: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ContactsApi->removeContactFromList: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -996,7 +996,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **int**| Id of the list | - **contactEmails** | [**\SendinBlue\Client\Model\AddRemoveContactToList**](../Model/AddRemoveContactToList.md)| Emails adresses of the contact | + **contactEmails** | [**\SendinBlue\Client\Model\RemoveContactFromList**](../Model/RemoveContactFromList.md)| Emails adresses of the contact | ### Return type diff --git a/docs/Api/ListsApi.md b/docs/Api/ListsApi.md index 6ce5fcb9..32ff7c2c 100644 --- a/docs/Api/ListsApi.md +++ b/docs/Api/ListsApi.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**getFolderLists**](ListsApi.md#getFolderLists) | **GET** /contacts/folders/{folderId}/lists | Get the lists in a folder [**getList**](ListsApi.md#getList) | **GET** /contacts/lists/{listId} | Get the details of a list [**getLists**](ListsApi.md#getLists) | **GET** /contacts/lists | Get all the lists -[**removeContactToList**](ListsApi.md#removeContactToList) | **POST** /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list +[**removeContactFromList**](ListsApi.md#removeContactFromList) | **POST** /contacts/lists/{listId}/contacts/remove | Remove existing contacts from a list [**updateList**](ListsApi.md#updateList) | **PUT** /contacts/lists/{listId} | Update a list @@ -32,7 +32,7 @@ SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', $api_instance = new SendinBlue\Client\Api\ListsApi(); $listId = 789; // int | Id of the list -$contactEmails = new \SendinBlue\Client\Model\AddRemoveContactToList(); // \SendinBlue\Client\Model\AddRemoveContactToList | Emails addresses of the contacts +$contactEmails = new \SendinBlue\Client\Model\AddContactToList(); // \SendinBlue\Client\Model\AddContactToList | Emails addresses of the contacts try { $result = $api_instance->addContactToList($listId, $contactEmails); @@ -48,7 +48,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **int**| Id of the list | - **contactEmails** | [**\SendinBlue\Client\Model\AddRemoveContactToList**](../Model/AddRemoveContactToList.md)| Emails addresses of the contacts | + **contactEmails** | [**\SendinBlue\Client\Model\AddContactToList**](../Model/AddContactToList.md)| Emails addresses of the contacts | ### Return type @@ -364,8 +364,8 @@ 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) -# **removeContactToList** -> \SendinBlue\Client\Model\PostContactInfo removeContactToList($listId, $contactEmails) +# **removeContactFromList** +> \SendinBlue\Client\Model\PostContactInfo removeContactFromList($listId, $contactEmails) Remove existing contacts from a list @@ -381,13 +381,13 @@ SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', $api_instance = new SendinBlue\Client\Api\ListsApi(); $listId = 789; // int | Id of the list -$contactEmails = new \SendinBlue\Client\Model\AddRemoveContactToList(); // \SendinBlue\Client\Model\AddRemoveContactToList | Emails adresses of the contact +$contactEmails = new \SendinBlue\Client\Model\RemoveContactFromList(); // \SendinBlue\Client\Model\RemoveContactFromList | Emails adresses of the contact try { - $result = $api_instance->removeContactToList($listId, $contactEmails); + $result = $api_instance->removeContactFromList($listId, $contactEmails); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ListsApi->removeContactToList: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ListsApi->removeContactFromList: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -397,7 +397,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **listId** | **int**| Id of the list | - **contactEmails** | [**\SendinBlue\Client\Model\AddRemoveContactToList**](../Model/AddRemoveContactToList.md)| Emails adresses of the contact | + **contactEmails** | [**\SendinBlue\Client\Model\RemoveContactFromList**](../Model/RemoveContactFromList.md)| Emails adresses of the contact | ### Return type diff --git a/docs/Model/AddRemoveContactToList.md b/docs/Model/AddContactToList.md similarity index 73% rename from docs/Model/AddRemoveContactToList.md rename to docs/Model/AddContactToList.md index c099ace1..170e194c 100644 --- a/docs/Model/AddRemoveContactToList.md +++ b/docs/Model/AddContactToList.md @@ -1,9 +1,9 @@ -# AddRemoveContactToList +# AddContactToList ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**emails** | **string[]** | Emails to add or remove from a list | [optional] +**emails** | **string[]** | Emails to add to a list | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateEmailCampaign.md b/docs/Model/CreateEmailCampaign.md index 6df5ef14..a0b9398c 100644 --- a/docs/Model/CreateEmailCampaign.md +++ b/docs/Model/CreateEmailCampaign.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **scheduledAt** | **\DateTime** | Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] **subject** | **string** | Subject of the campaign | **replyTo** | **string** | Email on which the campaign recipients will be able to reply to | [optional] -**toField** | **string** | To personalize the «To» Field, e.g. if you want to include the first name and last name of your recipient, use [FNAME] [LNAME]. These attributes must already exist in your contact database | [optional] +**toField** | **string** | To personalize the «To» Field, e.g. if you want to include the first name and last name of your recipient, use {FNAME} {LNAME}. These attributes must already exist in your contact database | [optional] **recipients** | [**\SendinBlue\Client\Model\CreateEmailCampaignRecipients**](CreateEmailCampaignRecipients.md) | | [optional] **attachmentUrl** | **string** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional] **inlineImageActivation** | **bool** | Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts | [optional] [default to false] diff --git a/docs/Model/CreateSmtpTemplate.md b/docs/Model/CreateSmtpTemplate.md index c36504c6..a016af89 100644 --- a/docs/Model/CreateSmtpTemplate.md +++ b/docs/Model/CreateSmtpTemplate.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **htmlUrl** | **string** | Url which contents the body of the email message. REQUIRED if htmlContent is empty | [optional] **subject** | **string** | Subject of the template | **replyTo** | **string** | Email on which campaign recipients will be able to reply to | [optional] -**toField** | **string** | This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [FNAME] [LNAME]. To use the contact attributes here, these must already exist in SendinBlue account | [optional] +**toField** | **string** | This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. To use the contact attributes here, these must already exist in SendinBlue account | [optional] **attachmentUrl** | **string** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional] **isActive** | **bool** | Status of template. isActive = true means template is active and isActive = false means template is inactive | [optional] diff --git a/docs/Model/RemoveContactFromList.md b/docs/Model/RemoveContactFromList.md new file mode 100644 index 00000000..d780d063 --- /dev/null +++ b/docs/Model/RemoveContactFromList.md @@ -0,0 +1,11 @@ +# RemoveContactFromList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emails** | **string[]** | Required if 'all' is false. Emails to remove from a list | [optional] +**all** | **bool** | Required if 'emails' is empty. Remove all existing contacts from a list | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/lib/Api/ContactsApi.php b/lib/Api/ContactsApi.php index 85f22e95..98081c39 100644 --- a/lib/Api/ContactsApi.php +++ b/lib/Api/ContactsApi.php @@ -93,7 +93,7 @@ public function setApiClient(\SendinBlue\Client\ApiClient $apiClient) * Add existing contacts to a list * * @param int $listId Id of the list (required) - * @param \SendinBlue\Client\Model\AddRemoveContactToList $contactEmails Emails addresses of the contacts (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) * @throws \SendinBlue\Client\ApiException on non-2xx response * @return \SendinBlue\Client\Model\PostContactInfo */ @@ -109,7 +109,7 @@ public function addContactToList($listId, $contactEmails) * Add existing contacts to a list * * @param int $listId Id of the list (required) - * @param \SendinBlue\Client\Model\AddRemoveContactToList $contactEmails Emails addresses of the contacts (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) * @throws \SendinBlue\Client\ApiException on non-2xx response * @return array of \SendinBlue\Client\Model\PostContactInfo, HTTP status code, HTTP response headers (array of strings) */ @@ -1919,40 +1919,40 @@ public function importContactsWithHttpInfo($requestContactImport) } /** - * Operation removeContactToList + * Operation removeContactFromList * * Remove existing contacts from a list * * @param int $listId Id of the list (required) - * @param \SendinBlue\Client\Model\AddRemoveContactToList $contactEmails Emails adresses of the contact (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) * @throws \SendinBlue\Client\ApiException on non-2xx response * @return \SendinBlue\Client\Model\PostContactInfo */ - public function removeContactToList($listId, $contactEmails) + public function removeContactFromList($listId, $contactEmails) { - list($response) = $this->removeContactToListWithHttpInfo($listId, $contactEmails); + list($response) = $this->removeContactFromListWithHttpInfo($listId, $contactEmails); return $response; } /** - * Operation removeContactToListWithHttpInfo + * Operation removeContactFromListWithHttpInfo * * Remove existing contacts from a list * * @param int $listId Id of the list (required) - * @param \SendinBlue\Client\Model\AddRemoveContactToList $contactEmails Emails adresses of the contact (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) * @throws \SendinBlue\Client\ApiException on non-2xx response * @return array of \SendinBlue\Client\Model\PostContactInfo, HTTP status code, HTTP response headers (array of strings) */ - public function removeContactToListWithHttpInfo($listId, $contactEmails) + public function removeContactFromListWithHttpInfo($listId, $contactEmails) { // verify the required parameter 'listId' is set if ($listId === null) { - throw new \InvalidArgumentException('Missing the required parameter $listId when calling removeContactToList'); + throw new \InvalidArgumentException('Missing the required parameter $listId when calling removeContactFromList'); } // verify the required parameter 'contactEmails' is set if ($contactEmails === null) { - throw new \InvalidArgumentException('Missing the required parameter $contactEmails when calling removeContactToList'); + throw new \InvalidArgumentException('Missing the required parameter $contactEmails when calling removeContactFromList'); } // parse inputs $resourcePath = "/contacts/lists/{listId}/contacts/remove"; diff --git a/lib/Api/ListsApi.php b/lib/Api/ListsApi.php index dc4b2f96..5e2a6699 100644 --- a/lib/Api/ListsApi.php +++ b/lib/Api/ListsApi.php @@ -93,7 +93,7 @@ public function setApiClient(\SendinBlue\Client\ApiClient $apiClient) * Add existing contacts to a list * * @param int $listId Id of the list (required) - * @param \SendinBlue\Client\Model\AddRemoveContactToList $contactEmails Emails addresses of the contacts (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) * @throws \SendinBlue\Client\ApiException on non-2xx response * @return \SendinBlue\Client\Model\PostContactInfo */ @@ -109,7 +109,7 @@ public function addContactToList($listId, $contactEmails) * Add existing contacts to a list * * @param int $listId Id of the list (required) - * @param \SendinBlue\Client\Model\AddRemoveContactToList $contactEmails Emails addresses of the contacts (required) + * @param \SendinBlue\Client\Model\AddContactToList $contactEmails Emails addresses of the contacts (required) * @throws \SendinBlue\Client\ApiException on non-2xx response * @return array of \SendinBlue\Client\Model\PostContactInfo, HTTP status code, HTTP response headers (array of strings) */ @@ -789,40 +789,40 @@ public function getListsWithHttpInfo($limit = '10', $offset = '0') } /** - * Operation removeContactToList + * Operation removeContactFromList * * Remove existing contacts from a list * * @param int $listId Id of the list (required) - * @param \SendinBlue\Client\Model\AddRemoveContactToList $contactEmails Emails adresses of the contact (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) * @throws \SendinBlue\Client\ApiException on non-2xx response * @return \SendinBlue\Client\Model\PostContactInfo */ - public function removeContactToList($listId, $contactEmails) + public function removeContactFromList($listId, $contactEmails) { - list($response) = $this->removeContactToListWithHttpInfo($listId, $contactEmails); + list($response) = $this->removeContactFromListWithHttpInfo($listId, $contactEmails); return $response; } /** - * Operation removeContactToListWithHttpInfo + * Operation removeContactFromListWithHttpInfo * * Remove existing contacts from a list * * @param int $listId Id of the list (required) - * @param \SendinBlue\Client\Model\AddRemoveContactToList $contactEmails Emails adresses of the contact (required) + * @param \SendinBlue\Client\Model\RemoveContactFromList $contactEmails Emails adresses of the contact (required) * @throws \SendinBlue\Client\ApiException on non-2xx response * @return array of \SendinBlue\Client\Model\PostContactInfo, HTTP status code, HTTP response headers (array of strings) */ - public function removeContactToListWithHttpInfo($listId, $contactEmails) + public function removeContactFromListWithHttpInfo($listId, $contactEmails) { // verify the required parameter 'listId' is set if ($listId === null) { - throw new \InvalidArgumentException('Missing the required parameter $listId when calling removeContactToList'); + throw new \InvalidArgumentException('Missing the required parameter $listId when calling removeContactFromList'); } // verify the required parameter 'contactEmails' is set if ($contactEmails === null) { - throw new \InvalidArgumentException('Missing the required parameter $contactEmails when calling removeContactToList'); + throw new \InvalidArgumentException('Missing the required parameter $contactEmails when calling removeContactFromList'); } // parse inputs $resourcePath = "/contacts/lists/{listId}/contacts/remove"; diff --git a/lib/Model/AddRemoveContactToList.php b/lib/Model/AddContactToList.php similarity index 95% rename from lib/Model/AddRemoveContactToList.php rename to lib/Model/AddContactToList.php index 31a82908..8bd1617d 100644 --- a/lib/Model/AddRemoveContactToList.php +++ b/lib/Model/AddContactToList.php @@ -1,6 +1,6 @@ container['tag'] === null) { - $invalid_properties[] = "'tag' can't be null"; - } - if ($this->container['from'] === null) { - $invalid_properties[] = "'from' can't be null"; - } return $invalid_properties; } @@ -284,12 +278,6 @@ public function valid() if (!in_array($this->container['event'], $allowed_values)) { return false; } - if ($this->container['tag'] === null) { - return false; - } - if ($this->container['from'] === null) { - return false; - } return true; } diff --git a/lib/Model/RemoveContactFromList.php b/lib/Model/RemoveContactFromList.php new file mode 100644 index 00000000..52cb8b79 --- /dev/null +++ b/lib/Model/RemoveContactFromList.php @@ -0,0 +1,269 @@ + 'string[]', + 'all' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * @var string[] + */ + protected static $swaggerFormats = [ + 'emails' => 'email', + 'all' => null + ]; + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = [ + 'emails' => 'emails', + 'all' => 'all' + ]; + + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = [ + 'emails' => 'setEmails', + 'all' => 'setAll' + ]; + + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = [ + 'emails' => 'getEmails', + 'all' => 'getAll' + ]; + + public static function attributeMap() + { + return self::$attributeMap; + } + + public static function setters() + { + return self::$setters; + } + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->container['emails'] = isset($data['emails']) ? $data['emails'] : null; + $this->container['all'] = isset($data['all']) ? $data['all'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = []; + + return $invalid_properties; + } + + /** + * 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 emails + * @return string[] + */ + public function getEmails() + { + return $this->container['emails']; + } + + /** + * Sets emails + * @param string[] $emails Required if 'all' is false. Emails to remove from a list + * @return $this + */ + public function setEmails($emails) + { + $this->container['emails'] = $emails; + + return $this; + } + + /** + * Gets all + * @return bool + */ + public function getAll() + { + return $this->container['all']; + } + + /** + * Sets all + * @param bool $all Required if 'emails' is empty. Remove all existing contacts from a list + * @return $this + */ + public function setAll($all) + { + $this->container['all'] = $all; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + 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(\SendinBlue\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); + } + + return json_encode(\SendinBlue\Client\ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UpdateEmailCampaign.php b/lib/Model/UpdateEmailCampaign.php index d3d8db60..ff8eeff5 100644 --- a/lib/Model/UpdateEmailCampaign.php +++ b/lib/Model/UpdateEmailCampaign.php @@ -435,7 +435,7 @@ public function getToField() /** * Sets toField - * @param string $toField This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [FNAME] [LNAME]. To use the contact attributes here, these must already exist in SendinBlue account + * @param string $toField This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. To use the contact attributes here, these must already exist in SendinBlue account * @return $this */ public function setToField($toField) diff --git a/lib/Model/UpdateSmtpTemplate.php b/lib/Model/UpdateSmtpTemplate.php index a7202d17..8083b242 100644 --- a/lib/Model/UpdateSmtpTemplate.php +++ b/lib/Model/UpdateSmtpTemplate.php @@ -372,7 +372,7 @@ public function getToField() /** * Sets toField - * @param string $toField To personalize the «To» Field, e.g. if you want to include the first name and last name of your recipient, add [FNAME] [LNAME]. These attributes must already exist in contacts database + * @param string $toField To personalize the «To» Field, e.g. if you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These attributes must already exist in contacts database * @return $this */ public function setToField($toField) diff --git a/test/Api/ContactsApiTest.php b/test/Api/ContactsApiTest.php index 7b6912dc..111f29ff 100644 --- a/test/Api/ContactsApiTest.php +++ b/test/Api/ContactsApiTest.php @@ -263,12 +263,12 @@ public function testImportContacts() } /** - * Test case for removeContactToList + * Test case for removeContactFromList * * Remove existing contacts from a list. * */ - public function testRemoveContactToList() + public function testRemoveContactFromList() { } diff --git a/test/Api/ListsApiTest.php b/test/Api/ListsApiTest.php index 713a021f..bc8059c0 100644 --- a/test/Api/ListsApiTest.php +++ b/test/Api/ListsApiTest.php @@ -143,12 +143,12 @@ public function testGetLists() } /** - * Test case for removeContactToList + * Test case for removeContactFromList * * Remove existing contacts from a list. * */ - public function testRemoveContactToList() + public function testRemoveContactFromList() { } diff --git a/test/Model/AddRemoveContactToListTest.php b/test/Model/AddContactToListTest.php similarity index 88% rename from test/Model/AddRemoveContactToListTest.php rename to test/Model/AddContactToListTest.php index aa46087b..61127def 100644 --- a/test/Model/AddRemoveContactToListTest.php +++ b/test/Model/AddContactToListTest.php @@ -1,6 +1,6 @@