diff --git a/docs/Model/GetEmailCampaign.md b/docs/Model/GetEmailCampaign.md index a81342ef..109b6c8e 100644 --- a/docs/Model/GetEmailCampaign.md +++ b/docs/Model/GetEmailCampaign.md @@ -3,8 +3,37 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**recipients** | [**\SendinBlue\Client\Model\GetSmsCampaignRecipients**](GetSmsCampaignRecipients.md) | | -**statistics** | [**\SendinBlue\Client\Model\GetSmsCampaignRecipients**](GetSmsCampaignRecipients.md) | | +**id** | **int** | ID of the campaign | +**name** | **string** | Name of the campaign | +**subject** | **string** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional] +**type** | **string** | Type of campaign | +**status** | **string** | Status of the campaign | +**scheduledAt** | **string** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] +**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 | +**sender** | [**\SendinBlue\Client\Model\GetExtendedCampaignOverviewSender**](GetExtendedCampaignOverviewSender.md) | | +**replyTo** | **string** | Email defined as the \"Reply to\" of the campaign | +**toField** | **string** | Customisation of the \"to\" field of the campaign | [optional] +**htmlContent** | **string** | HTML content of the campaign | +**shareLink** | **string** | Link to share the campaign on social medias | [optional] +**tag** | **string** | Tag of the campaign | [optional] +**createdAt** | **string** | Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | +**modifiedAt** | **string** | UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | +**inlineImageActivation** | **bool** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional] +**mirrorActive** | **bool** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional] +**recurring** | **bool** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional] +**sentDate** | **string** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional] +**returnBounce** | **int** | Total number of non-delivered campaigns for a particular campaign id. | [optional] +**recipients** | **object** | | +**statistics** | **object** | | [[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/GetExtendedCampaignOverview.md b/docs/Model/GetExtendedCampaignOverview.md index ff621682..52253c7a 100644 --- a/docs/Model/GetExtendedCampaignOverview.md +++ b/docs/Model/GetExtendedCampaignOverview.md @@ -1,8 +1,20 @@ # GetExtendedCampaignOverview - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**id** | **int** | ID of the campaign | +**name** | **string** | Name of the campaign | +**subject** | **string** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional] +**type** | **string** | Type of campaign | +**status** | **string** | Status of the campaign | +**scheduledAt** | **string** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] +**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 | @@ -19,7 +31,4 @@ Name | Type | Description | Notes **recurring** | **bool** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional] **sentDate** | **string** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional] **returnBounce** | **int** | Total number of non-delivered campaigns for a particular campaign id. | [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) - - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) \ No newline at end of file diff --git a/docs/Model/GetExtendedContactDetails.md b/docs/Model/GetExtendedContactDetails.md index 2e8b0da5..b063650e 100644 --- a/docs/Model/GetExtendedContactDetails.md +++ b/docs/Model/GetExtendedContactDetails.md @@ -1,10 +1,16 @@ # GetExtendedContactDetails - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**email** | **string** | Email address of the contact for which you requested the details | +**id** | **int** | ID of the contact for which you requested the details | +**emailBlacklisted** | **bool** | Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) | +**smsBlacklisted** | **bool** | Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) | +**createdAt** | **string** | Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) | +**modifiedAt** | **string** | Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) | +**listIds** | **int[]** | | +**listUnsubscribed** | **int[]** | | [optional] +**attributes** | **object** | Set of attributes of the contact | **statistics** | [**\SendinBlue\Client\Model\GetExtendedContactDetailsStatistics**](GetExtendedContactDetailsStatistics.md) | | -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) \ No newline at end of file diff --git a/docs/Model/GetSmsCampaign.md b/docs/Model/GetSmsCampaign.md index aaab6780..099d917c 100644 --- a/docs/Model/GetSmsCampaign.md +++ b/docs/Model/GetSmsCampaign.md @@ -1,11 +1,16 @@ # GetSmsCampaign - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**recipients** | [**\SendinBlue\Client\Model\GetSmsCampaignRecipients**](GetSmsCampaignRecipients.md) | | -**statistics** | [**\SendinBlue\Client\Model\GetSmsCampaignRecipients**](GetSmsCampaignRecipients.md) | | - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) - +**id** | **int** | ID of the SMS Campaign | +**name** | **string** | Name of the SMS Campaign | +**status** | **string** | Status of the SMS Campaign | +**content** | **string** | Content of the SMS Campaign | +**scheduledAt** | **string** | UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format | [optional] +**sender** | **string** | Sender of the SMS Campaign | +**createdAt** | **string** | Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | +**modifiedAt** | **string** | UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | +**recipients** | **object** | | +**statistics** | **object** | | +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) \ No newline at end of file diff --git a/lib/Configuration.php b/lib/Configuration.php index 9d99b3ea..c84dccbc 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -38,7 +38,7 @@ * @link https://github.com/swagger-api/swagger-codegen */ -$GLOBALS['version'] = '8.3.0'; +$GLOBALS['version'] = '8.3.1'; class Configuration { diff --git a/lib/Model/GetEmailCampaign.php b/lib/Model/GetEmailCampaign.php index d84afb2f..201b9b95 100644 --- a/lib/Model/GetEmailCampaign.php +++ b/lib/Model/GetEmailCampaign.php @@ -9,7 +9,6 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ - /** * SendinBlue API * @@ -28,6 +27,8 @@ */ namespace SendinBlue\Client\Model; + +use \ArrayAccess; use \SendinBlue\Client\ObjectSerializer; /** @@ -38,7 +39,7 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class GetEmailCampaign extends GetExtendedCampaignOverview +class GetEmailCampaign implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; @@ -48,15 +49,43 @@ class GetEmailCampaign extends GetExtendedCampaignOverview * @var string */ protected static $swaggerModelName = 'getEmailCampaign'; - /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ protected static $swaggerTypes = [ - 'recipients' => '\SendinBlue\Client\Model\GetSmsCampaignRecipients', - 'statistics' => '\SendinBlue\Client\Model\GetSmsCampaignRecipients' + 'id' => 'int', + 'name' => 'string', + 'subject' => 'string', + 'type' => 'string', + 'status' => 'string', + 'scheduledAt' => 'string', + 'abTesting' => 'bool', + 'subjectA' => 'string', + 'subjectB' => 'string', + 'splitRule' => 'int', + 'winnerCriteria' => 'string', + 'winnerDelay' => 'int', + 'sendAtBestTime' => 'bool', + 'testSent' => 'bool', + 'header' => 'string', + 'footer' => 'string', + 'sender' => '\SendinBlue\Client\Model\GetExtendedCampaignOverviewSender', + 'replyTo' => 'string', + 'toField' => 'string', + 'htmlContent' => 'string', + 'shareLink' => 'string', + 'tag' => 'string', + 'createdAt' => 'string', + 'modifiedAt' => 'string', + 'inlineImageActivation' => 'bool', + 'mirrorActive' => 'bool', + 'recurring' => 'bool', + 'sentDate' => 'string', + 'returnBounce' => 'int', + 'recipients' => 'object', + 'statistics' => 'object' ]; /** @@ -65,10 +94,38 @@ class GetEmailCampaign extends GetExtendedCampaignOverview * @var string[] */ protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'subject' => null, + 'type' => null, + 'status' => null, + 'scheduledAt' => null, + 'abTesting' => null, + 'subjectA' => null, + 'subjectB' => null, + 'splitRule' => null, + 'winnerCriteria' => null, + 'winnerDelay' => null, + 'sendAtBestTime' => null, + 'testSent' => null, + 'header' => null, + 'footer' => null, + 'sender' => null, + 'replyTo' => 'email', + 'toField' => null, + 'htmlContent' => null, + 'shareLink' => 'url', + 'tag' => null, + 'createdAt' => null, + 'modifiedAt' => null, + 'inlineImageActivation' => null, + 'mirrorActive' => null, + 'recurring' => null, + 'sentDate' => null, + 'returnBounce' => 'int64', 'recipients' => null, 'statistics' => null ]; - /** * Array of property to type mappings. Used for (de)serialization * @@ -76,7 +133,7 @@ class GetEmailCampaign extends GetExtendedCampaignOverview */ public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); + return self::$swaggerTypes; } /** @@ -86,7 +143,7 @@ public static function swaggerTypes() */ public static function swaggerFormats() { - return self::$swaggerFormats + parent::swaggerFormats(); + return self::$swaggerFormats; } /** @@ -96,30 +153,114 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'subject' => 'subject', + 'type' => 'type', + 'status' => 'status', + 'scheduledAt' => 'scheduledAt', + 'abTesting' => 'abTesting', + 'subjectA' => 'subjectA', + 'subjectB' => 'subjectB', + 'splitRule' => 'splitRule', + 'winnerCriteria' => 'winnerCriteria', + 'winnerDelay' => 'winnerDelay', + 'sendAtBestTime' => 'sendAtBestTime', + 'testSent' => 'testSent', + 'header' => 'header', + 'footer' => 'footer', + 'sender' => 'sender', + 'replyTo' => 'replyTo', + 'toField' => 'toField', + 'htmlContent' => 'htmlContent', + 'shareLink' => 'shareLink', + 'tag' => 'tag', + 'createdAt' => 'createdAt', + 'modifiedAt' => 'modifiedAt', + 'inlineImageActivation' => 'inlineImageActivation', + 'mirrorActive' => 'mirrorActive', + 'recurring' => 'recurring', + 'sentDate' => 'sentDate', + 'returnBounce' => 'returnBounce', 'recipients' => 'recipients', 'statistics' => 'statistics' ]; - /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'subject' => 'setSubject', + 'type' => 'setType', + 'status' => 'setStatus', + 'scheduledAt' => 'setScheduledAt', + 'abTesting' => 'setAbTesting', + 'subjectA' => 'setSubjectA', + 'subjectB' => 'setSubjectB', + 'splitRule' => 'setSplitRule', + 'winnerCriteria' => 'setWinnerCriteria', + 'winnerDelay' => 'setWinnerDelay', + 'sendAtBestTime' => 'setSendAtBestTime', + 'testSent' => 'setTestSent', + 'header' => 'setHeader', + 'footer' => 'setFooter', + 'sender' => 'setSender', + 'replyTo' => 'setReplyTo', + 'toField' => 'setToField', + 'htmlContent' => 'setHtmlContent', + 'shareLink' => 'setShareLink', + 'tag' => 'setTag', + 'createdAt' => 'setCreatedAt', + 'modifiedAt' => 'setModifiedAt', + 'inlineImageActivation' => 'setInlineImageActivation', + 'mirrorActive' => 'setMirrorActive', + 'recurring' => 'setRecurring', + 'sentDate' => 'setSentDate', + 'returnBounce' => 'setReturnBounce', 'recipients' => 'setRecipients', 'statistics' => 'setStatistics' ]; - /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'subject' => 'getSubject', + 'type' => 'getType', + 'status' => 'getStatus', + 'scheduledAt' => 'getScheduledAt', + 'abTesting' => 'getAbTesting', + 'subjectA' => 'getSubjectA', + 'subjectB' => 'getSubjectB', + 'splitRule' => 'getSplitRule', + 'winnerCriteria' => 'getWinnerCriteria', + 'winnerDelay' => 'getWinnerDelay', + 'sendAtBestTime' => 'getSendAtBestTime', + 'testSent' => 'getTestSent', + 'header' => 'getHeader', + 'footer' => 'getFooter', + 'sender' => 'getSender', + 'replyTo' => 'getReplyTo', + 'toField' => 'getToField', + 'htmlContent' => 'getHtmlContent', + 'shareLink' => 'getShareLink', + 'tag' => 'getTag', + 'createdAt' => 'getCreatedAt', + 'modifiedAt' => 'getModifiedAt', + 'inlineImageActivation' => 'getInlineImageActivation', + 'mirrorActive' => 'getMirrorActive', + 'recurring' => 'getRecurring', + 'sentDate' => 'getSentDate', + 'returnBounce' => 'getReturnBounce', 'recipients' => 'getRecipients', 'statistics' => 'getStatistics' ]; - /** * Array of attributes where the key is the local name, * and the value is the original name @@ -128,7 +269,7 @@ public static function swaggerFormats() */ public static function attributeMap() { - return parent::attributeMap() + self::$attributeMap; + return self::$attributeMap; } /** @@ -138,7 +279,7 @@ public static function attributeMap() */ public static function setters() { - return parent::setters() + self::$setters; + return self::$setters; } /** @@ -148,7 +289,7 @@ public static function setters() */ public static function getters() { - return parent::getters() + self::$getters; + return self::$getters; } /** @@ -161,10 +302,54 @@ public function getModelName() return self::$swaggerModelName; } - + const TYPE_CLASSIC = 'classic'; + const TYPE_TRIGGER = 'trigger'; + const STATUS_DRAFT = 'draft'; + const STATUS_SENT = 'sent'; + const STATUS_ARCHIVE = 'archive'; + const STATUS_QUEUED = 'queued'; + const STATUS_SUSPENDED = 'suspended'; + const STATUS_IN_PROCESS = 'in_process'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CLASSIC, + self::TYPE_TRIGGER, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_DRAFT, + self::STATUS_SENT, + self::STATUS_ARCHIVE, + self::STATUS_QUEUED, + self::STATUS_SUSPENDED, + self::STATUS_IN_PROCESS, + ]; + } - + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; /** * Constructor @@ -174,12 +359,38 @@ public function getModelName() */ public function __construct(array $data = null) { - parent::__construct($data); - + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null; + $this->container['abTesting'] = isset($data['abTesting']) ? $data['abTesting'] : null; + $this->container['subjectA'] = isset($data['subjectA']) ? $data['subjectA'] : null; + $this->container['subjectB'] = isset($data['subjectB']) ? $data['subjectB'] : null; + $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null; + $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null; + $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null; + $this->container['sendAtBestTime'] = isset($data['sendAtBestTime']) ? $data['sendAtBestTime'] : null; + $this->container['testSent'] = isset($data['testSent']) ? $data['testSent'] : null; + $this->container['header'] = isset($data['header']) ? $data['header'] : null; + $this->container['footer'] = isset($data['footer']) ? $data['footer'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['replyTo'] = isset($data['replyTo']) ? $data['replyTo'] : null; + $this->container['toField'] = isset($data['toField']) ? $data['toField'] : null; + $this->container['htmlContent'] = isset($data['htmlContent']) ? $data['htmlContent'] : null; + $this->container['shareLink'] = isset($data['shareLink']) ? $data['shareLink'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; + $this->container['inlineImageActivation'] = isset($data['inlineImageActivation']) ? $data['inlineImageActivation'] : null; + $this->container['mirrorActive'] = isset($data['mirrorActive']) ? $data['mirrorActive'] : null; + $this->container['recurring'] = isset($data['recurring']) ? $data['recurring'] : null; + $this->container['sentDate'] = isset($data['sentDate']) ? $data['sentDate'] : null; + $this->container['returnBounce'] = isset($data['returnBounce']) ? $data['returnBounce'] : null; $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null; $this->container['statistics'] = isset($data['statistics']) ? $data['statistics'] : null; } - /** * Show all the invalid properties with reasons. * @@ -187,8 +398,60 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['testSent'] === null) { + $invalidProperties[] = "'testSent' can't be null"; + } + if ($this->container['header'] === null) { + $invalidProperties[] = "'header' can't be null"; + } + if ($this->container['footer'] === null) { + $invalidProperties[] = "'footer' can't be null"; + } + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; + } + if ($this->container['replyTo'] === null) { + $invalidProperties[] = "'replyTo' can't be null"; + } + if ($this->container['htmlContent'] === null) { + $invalidProperties[] = "'htmlContent' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['modifiedAt'] === null) { + $invalidProperties[] = "'modifiedAt' can't be null"; + } if ($this->container['recipients'] === null) { $invalidProperties[] = "'recipients' can't be null"; } @@ -197,7 +460,6 @@ public function listInvalidProperties() } return $invalidProperties; } - /** * Validate all the properties in the model * return true if all passed @@ -211,121 +473,823 @@ public function valid() /** - * Gets recipients + * Gets id * - * @return \SendinBlue\Client\Model\GetSmsCampaignRecipients + * @return int */ - public function getRecipients() + public function getId() { - return $this->container['recipients']; + return $this->container['id']; } /** - * Sets recipients + * Sets id * - * @param \SendinBlue\Client\Model\GetSmsCampaignRecipients $recipients recipients + * @param int $id ID of the campaign * * @return $this */ - public function setRecipients($recipients) + public function setId($id) { - $this->container['recipients'] = $recipients; + $this->container['id'] = $id; return $this; } /** - * Gets statistics + * Gets name * - * @return \SendinBlue\Client\Model\GetSmsCampaignRecipients + * @return string */ - public function getStatistics() + public function getName() { - return $this->container['statistics']; + return $this->container['name']; } /** - * Sets statistics + * Sets name * - * @param \SendinBlue\Client\Model\GetSmsCampaignRecipients $statistics statistics + * @param string $name Name of the campaign * * @return $this */ - public function setStatistics($statistics) + public function setName($name) { - $this->container['statistics'] = $statistics; + $this->container['name'] = $name; return $this; } + /** - * Returns true if offset exists. False otherwise. + * Gets subject * - * @param integer $offset Offset + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject * - * @return boolean + * @param string $subject Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` + * + * @return $this */ - public function offsetExists($offset) + public function setSubject($subject) { - return isset($this->container[$offset]); + $this->container['subject'] = $subject; + + return $this; } /** - * Gets offset. + * Gets type * - * @param integer $offset Offset + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type * - * @return mixed + * @param string $type Type of campaign + * + * @return $this */ - public function offsetGet($offset) + public function setType($type) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; } /** - * Sets value based on offset. + * Gets status * - * @param integer $offset Offset - * @param mixed $value Value to be set + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status * - * @return void + * @param string $status Status of the campaign + * + * @return $this */ - public function offsetSet($offset, $value) + public function setStatus($status) { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); } + $this->container['status'] = $status; + + return $this; } /** - * Unsets offset. + * Gets scheduledAt * - * @param integer $offset Offset + * @return string + */ + public function getScheduledAt() + { + return $this->container['scheduledAt']; + } + + /** + * Sets scheduledAt * - * @return void + * @param string $scheduledAt UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this */ - public function offsetUnset($offset) + public function setScheduledAt($scheduledAt) { - unset($this->container[$offset]); + $this->container['scheduledAt'] = $scheduledAt; + + return $this; } /** - * Gets the string presentation of the object + * Gets abTesting + * + * @return bool + */ + public function getAbTesting() + { + return $this->container['abTesting']; + } + + /** + * Sets abTesting + * + * @param bool $abTesting Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. + * + * @return $this + */ + public function setAbTesting($abTesting) + { + $this->container['abTesting'] = $abTesting; + + return $this; + } + + /** + * Gets subjectA * * @return string */ - public function __toString() + public function getSubjectA() { - if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } + return $this->container['subjectA']; + } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + /** + * Sets subjectA + * + * @param string $subjectA Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSubjectA($subjectA) + { + $this->container['subjectA'] = $subjectA; + + return $this; + } + + /** + * Gets subjectB + * + * @return string + */ + public function getSubjectB() + { + return $this->container['subjectB']; + } + + /** + * Sets subjectB + * + * @param string $subjectB Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSubjectB($subjectB) + { + $this->container['subjectB'] = $subjectB; + + return $this; + } + + /** + * Gets splitRule + * + * @return int + */ + public function getSplitRule() + { + return $this->container['splitRule']; + } + + /** + * Sets splitRule + * + * @param int $splitRule The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSplitRule($splitRule) + { + $this->container['splitRule'] = $splitRule; + + return $this; + } + + /** + * Gets winnerCriteria + * + * @return string + */ + public function getWinnerCriteria() + { + return $this->container['winnerCriteria']; + } + + /** + * Sets winnerCriteria + * + * @param string $winnerCriteria Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setWinnerCriteria($winnerCriteria) + { + $this->container['winnerCriteria'] = $winnerCriteria; + + return $this; + } + + /** + * Gets winnerDelay + * + * @return int + */ + public function getWinnerDelay() + { + return $this->container['winnerDelay']; + } + + /** + * Sets winnerDelay + * + * @param int $winnerDelay 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` + * + * @return $this + */ + public function setWinnerDelay($winnerDelay) + { + $this->container['winnerDelay'] = $winnerDelay; + + return $this; + } + + /** + * Gets sendAtBestTime + * + * @return bool + */ + public function getSendAtBestTime() + { + return $this->container['sendAtBestTime']; + } + + /** + * Sets sendAtBestTime + * + * @param bool $sendAtBestTime It is true if you have chosen to send your campaign at best time, otherwise it is false + * + * @return $this + */ + public function setSendAtBestTime($sendAtBestTime) + { + $this->container['sendAtBestTime'] = $sendAtBestTime; + + return $this; + } + + /** + * Gets testSent + * + * @return bool + */ + public function getTestSent() + { + return $this->container['testSent']; } -} + /** + * Sets testSent + * + * @param bool $testSent Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) + * + * @return $this + */ + public function setTestSent($testSent) + { + $this->container['testSent'] = $testSent; + return $this; + } + + /** + * Gets header + * + * @return string + */ + public function getHeader() + { + return $this->container['header']; + } + + /** + * Sets header + * + * @param string $header Header of the campaign + * + * @return $this + */ + public function setHeader($header) + { + $this->container['header'] = $header; + + return $this; + } + + /** + * Gets footer + * + * @return string + */ + public function getFooter() + { + return $this->container['footer']; + } + + /** + * Sets footer + * + * @param string $footer Footer of the campaign + * + * @return $this + */ + public function setFooter($footer) + { + $this->container['footer'] = $footer; + + return $this; + } + + /** + * Gets sender + * + * @return \SendinBlue\Client\Model\GetExtendedCampaignOverviewSender + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param \SendinBlue\Client\Model\GetExtendedCampaignOverviewSender $sender sender + * + * @return $this + */ + public function setSender($sender) + { + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets replyTo + * + * @return string + */ + public function getReplyTo() + { + return $this->container['replyTo']; + } + + /** + * Sets replyTo + * + * @param string $replyTo Email defined as the \"Reply to\" of the campaign + * + * @return $this + */ + public function setReplyTo($replyTo) + { + $this->container['replyTo'] = $replyTo; + + return $this; + } + + /** + * Gets toField + * + * @return string + */ + public function getToField() + { + return $this->container['toField']; + } + + /** + * Sets toField + * + * @param string $toField Customisation of the \"to\" field of the campaign + * + * @return $this + */ + public function setToField($toField) + { + $this->container['toField'] = $toField; + + return $this; + } + + /** + * Gets htmlContent + * + * @return string + */ + public function getHtmlContent() + { + return $this->container['htmlContent']; + } + + /** + * Sets htmlContent + * + * @param string $htmlContent HTML content of the campaign + * + * @return $this + */ + public function setHtmlContent($htmlContent) + { + $this->container['htmlContent'] = $htmlContent; + + return $this; + } + + /** + * Gets shareLink + * + * @return string + */ + public function getShareLink() + { + return $this->container['shareLink']; + } + + /** + * Sets shareLink + * + * @param string $shareLink Link to share the campaign on social medias + * + * @return $this + */ + public function setShareLink($shareLink) + { + $this->container['shareLink'] = $shareLink; + + return $this; + } + + /** + * Gets tag + * + * @return string + */ + public function getTag() + { + return $this->container['tag']; + } + + /** + * Sets tag + * + * @param string $tag Tag of the campaign + * + * @return $this + */ + public function setTag($tag) + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets createdAt + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param string $createdAt Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets modifiedAt + * + * @return string + */ + public function getModifiedAt() + { + return $this->container['modifiedAt']; + } + + /** + * Sets modifiedAt + * + * @param string $modifiedAt UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setModifiedAt($modifiedAt) + { + $this->container['modifiedAt'] = $modifiedAt; + + return $this; + } + + /** + * Gets inlineImageActivation + * + * @return bool + */ + public function getInlineImageActivation() + { + return $this->container['inlineImageActivation']; + } + + /** + * Sets inlineImageActivation + * + * @param bool $inlineImageActivation Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. + * + * @return $this + */ + public function setInlineImageActivation($inlineImageActivation) + { + $this->container['inlineImageActivation'] = $inlineImageActivation; + + return $this; + } + + /** + * Gets mirrorActive + * + * @return bool + */ + public function getMirrorActive() + { + return $this->container['mirrorActive']; + } + + /** + * Sets mirrorActive + * + * @param bool $mirrorActive Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign + * + * @return $this + */ + public function setMirrorActive($mirrorActive) + { + $this->container['mirrorActive'] = $mirrorActive; + + return $this; + } + + /** + * Gets recurring + * + * @return bool + */ + public function getRecurring() + { + return $this->container['recurring']; + } + + /** + * Sets recurring + * + * @param bool $recurring FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times + * + * @return $this + */ + public function setRecurring($recurring) + { + $this->container['recurring'] = $recurring; + + return $this; + } + + /** + * Gets sentDate + * + * @return string + */ + public function getSentDate() + { + return $this->container['sentDate']; + } + + /** + * Sets sentDate + * + * @param string $sentDate Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' + * + * @return $this + */ + public function setSentDate($sentDate) + { + $this->container['sentDate'] = $sentDate; + + return $this; + } + + /** + * Gets returnBounce + * + * @return int + */ + public function getReturnBounce() + { + return $this->container['returnBounce']; + } + + /** + * Sets returnBounce + * + * @param int $returnBounce Total number of non-delivered campaigns for a particular campaign id. + * + * @return $this + */ + public function setReturnBounce($returnBounce) + { + $this->container['returnBounce'] = $returnBounce; + + return $this; + } + + /** + * Gets recipients + * + * @return object + */ + public function getRecipients() + { + return $this->container['recipients']; + } + /** + * Sets recipients + * + * @param object $recipients recipients + * + * @return $this + */ + public function setRecipients($recipients) + { + $this->container['recipients'] = $recipients; + return $this; + } + /** + * Gets statistics + * + * @return object + */ + public function getStatistics() + { + return $this->container['statistics']; + } + /** + * Sets statistics + * + * @param object $statistics statistics + * + * @return $this + */ + public function setStatistics($statistics) + { + $this->container['statistics'] = $statistics; + 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)); + } +} \ No newline at end of file diff --git a/lib/Model/GetExtendedCampaignOverview.php b/lib/Model/GetExtendedCampaignOverview.php index ec459a8b..aa168312 100644 --- a/lib/Model/GetExtendedCampaignOverview.php +++ b/lib/Model/GetExtendedCampaignOverview.php @@ -9,7 +9,6 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ - /** * SendinBlue API * @@ -28,6 +27,8 @@ */ namespace SendinBlue\Client\Model; + +use \ArrayAccess; use \SendinBlue\Client\ObjectSerializer; /** @@ -38,7 +39,7 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class GetExtendedCampaignOverview extends GetCampaignOverview +class GetExtendedCampaignOverview implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; @@ -48,13 +49,25 @@ class GetExtendedCampaignOverview extends GetCampaignOverview * @var string */ protected static $swaggerModelName = 'getExtendedCampaignOverview'; - /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ protected static $swaggerTypes = [ + 'id' => 'int', + 'name' => 'string', + 'subject' => 'string', + 'type' => 'string', + 'status' => 'string', + 'scheduledAt' => 'string', + 'abTesting' => 'bool', + 'subjectA' => 'string', + 'subjectB' => 'string', + 'splitRule' => 'int', + 'winnerCriteria' => 'string', + 'winnerDelay' => 'int', + 'sendAtBestTime' => 'bool', 'testSent' => 'bool', 'header' => 'string', 'footer' => 'string', @@ -72,13 +85,25 @@ class GetExtendedCampaignOverview extends GetCampaignOverview 'sentDate' => 'string', 'returnBounce' => 'int' ]; - /** * Array of property to format mappings. Used for (de)serialization * * @var string[] */ protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'subject' => null, + 'type' => null, + 'status' => null, + 'scheduledAt' => null, + 'abTesting' => null, + 'subjectA' => null, + 'subjectB' => null, + 'splitRule' => null, + 'winnerCriteria' => null, + 'winnerDelay' => null, + 'sendAtBestTime' => null, 'testSent' => null, 'header' => null, 'footer' => null, @@ -96,7 +121,6 @@ class GetExtendedCampaignOverview extends GetCampaignOverview 'sentDate' => null, 'returnBounce' => 'int64' ]; - /** * Array of property to type mappings. Used for (de)serialization * @@ -104,7 +128,7 @@ class GetExtendedCampaignOverview extends GetCampaignOverview */ public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); + return self::$swaggerTypes; } /** @@ -114,7 +138,7 @@ public static function swaggerTypes() */ public static function swaggerFormats() { - return self::$swaggerFormats + parent::swaggerFormats(); + return self::$swaggerFormats; } /** @@ -124,6 +148,19 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'subject' => 'subject', + 'type' => 'type', + 'status' => 'status', + 'scheduledAt' => 'scheduledAt', + 'abTesting' => 'abTesting', + 'subjectA' => 'subjectA', + 'subjectB' => 'subjectB', + 'splitRule' => 'splitRule', + 'winnerCriteria' => 'winnerCriteria', + 'winnerDelay' => 'winnerDelay', + 'sendAtBestTime' => 'sendAtBestTime', 'testSent' => 'testSent', 'header' => 'header', 'footer' => 'footer', @@ -141,13 +178,25 @@ public static function swaggerFormats() 'sentDate' => 'sentDate', 'returnBounce' => 'returnBounce' ]; - /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'subject' => 'setSubject', + 'type' => 'setType', + 'status' => 'setStatus', + 'scheduledAt' => 'setScheduledAt', + 'abTesting' => 'setAbTesting', + 'subjectA' => 'setSubjectA', + 'subjectB' => 'setSubjectB', + 'splitRule' => 'setSplitRule', + 'winnerCriteria' => 'setWinnerCriteria', + 'winnerDelay' => 'setWinnerDelay', + 'sendAtBestTime' => 'setSendAtBestTime', 'testSent' => 'setTestSent', 'header' => 'setHeader', 'footer' => 'setFooter', @@ -165,13 +214,25 @@ public static function swaggerFormats() 'sentDate' => 'setSentDate', 'returnBounce' => 'setReturnBounce' ]; - /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'subject' => 'getSubject', + 'type' => 'getType', + 'status' => 'getStatus', + 'scheduledAt' => 'getScheduledAt', + 'abTesting' => 'getAbTesting', + 'subjectA' => 'getSubjectA', + 'subjectB' => 'getSubjectB', + 'splitRule' => 'getSplitRule', + 'winnerCriteria' => 'getWinnerCriteria', + 'winnerDelay' => 'getWinnerDelay', + 'sendAtBestTime' => 'getSendAtBestTime', 'testSent' => 'getTestSent', 'header' => 'getHeader', 'footer' => 'getFooter', @@ -189,7 +250,6 @@ public static function swaggerFormats() 'sentDate' => 'getSentDate', 'returnBounce' => 'getReturnBounce' ]; - /** * Array of attributes where the key is the local name, * and the value is the original name @@ -198,7 +258,7 @@ public static function swaggerFormats() */ public static function attributeMap() { - return parent::attributeMap() + self::$attributeMap; + return self::$attributeMap; } /** @@ -208,7 +268,7 @@ public static function attributeMap() */ public static function setters() { - return parent::setters() + self::$setters; + return self::$setters; } /** @@ -218,7 +278,7 @@ public static function setters() */ public static function getters() { - return parent::getters() + self::$getters; + return self::$getters; } /** @@ -231,10 +291,54 @@ public function getModelName() return self::$swaggerModelName; } - + const TYPE_CLASSIC = 'classic'; + const TYPE_TRIGGER = 'trigger'; + const STATUS_DRAFT = 'draft'; + const STATUS_SENT = 'sent'; + const STATUS_ARCHIVE = 'archive'; + const STATUS_QUEUED = 'queued'; + const STATUS_SUSPENDED = 'suspended'; + const STATUS_IN_PROCESS = 'in_process'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_CLASSIC, + self::TYPE_TRIGGER, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_DRAFT, + self::STATUS_SENT, + self::STATUS_ARCHIVE, + self::STATUS_QUEUED, + self::STATUS_SUSPENDED, + self::STATUS_IN_PROCESS, + ]; + } - + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; /** * Constructor @@ -244,8 +348,19 @@ public function getModelName() */ public function __construct(array $data = null) { - parent::__construct($data); - + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null; + $this->container['abTesting'] = isset($data['abTesting']) ? $data['abTesting'] : null; + $this->container['subjectA'] = isset($data['subjectA']) ? $data['subjectA'] : null; + $this->container['subjectB'] = isset($data['subjectB']) ? $data['subjectB'] : null; + $this->container['splitRule'] = isset($data['splitRule']) ? $data['splitRule'] : null; + $this->container['winnerCriteria'] = isset($data['winnerCriteria']) ? $data['winnerCriteria'] : null; + $this->container['winnerDelay'] = isset($data['winnerDelay']) ? $data['winnerDelay'] : null; + $this->container['sendAtBestTime'] = isset($data['sendAtBestTime']) ? $data['sendAtBestTime'] : null; $this->container['testSent'] = isset($data['testSent']) ? $data['testSent'] : null; $this->container['header'] = isset($data['header']) ? $data['header'] : null; $this->container['footer'] = isset($data['footer']) ? $data['footer'] : null; @@ -263,7 +378,6 @@ public function __construct(array $data = null) $this->container['sentDate'] = isset($data['sentDate']) ? $data['sentDate'] : null; $this->container['returnBounce'] = isset($data['returnBounce']) ? $data['returnBounce'] : null; } - /** * Show all the invalid properties with reasons. * @@ -271,7 +385,35 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } if ($this->container['testSent'] === null) { $invalidProperties[] = "'testSent' can't be null"; @@ -299,7 +441,6 @@ public function listInvalidProperties() } return $invalidProperties; } - /** * Validate all the properties in the model * return true if all passed @@ -312,6 +453,336 @@ public function valid() } + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the campaign + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the campaign + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets subject + * + * @return string + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string $subject Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` + * + * @return $this + */ + public function setSubject($subject) + { + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of campaign + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Status of the campaign + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets scheduledAt + * + * @return string + */ + public function getScheduledAt() + { + return $this->container['scheduledAt']; + } + + /** + * Sets scheduledAt + * + * @param string $scheduledAt UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setScheduledAt($scheduledAt) + { + $this->container['scheduledAt'] = $scheduledAt; + + return $this; + } + + /** + * Gets abTesting + * + * @return bool + */ + public function getAbTesting() + { + return $this->container['abTesting']; + } + + /** + * Sets abTesting + * + * @param bool $abTesting Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. + * + * @return $this + */ + public function setAbTesting($abTesting) + { + $this->container['abTesting'] = $abTesting; + + return $this; + } + + /** + * Gets subjectA + * + * @return string + */ + public function getSubjectA() + { + return $this->container['subjectA']; + } + + /** + * Sets subjectA + * + * @param string $subjectA Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSubjectA($subjectA) + { + $this->container['subjectA'] = $subjectA; + + return $this; + } + + /** + * Gets subjectB + * + * @return string + */ + public function getSubjectB() + { + return $this->container['subjectB']; + } + + /** + * Sets subjectB + * + * @param string $subjectB Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSubjectB($subjectB) + { + $this->container['subjectB'] = $subjectB; + + return $this; + } + + /** + * Gets splitRule + * + * @return int + */ + public function getSplitRule() + { + return $this->container['splitRule']; + } + + /** + * Sets splitRule + * + * @param int $splitRule The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setSplitRule($splitRule) + { + $this->container['splitRule'] = $splitRule; + + return $this; + } + + /** + * Gets winnerCriteria + * + * @return string + */ + public function getWinnerCriteria() + { + return $this->container['winnerCriteria']; + } + + /** + * Sets winnerCriteria + * + * @param string $winnerCriteria Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` + * + * @return $this + */ + public function setWinnerCriteria($winnerCriteria) + { + $this->container['winnerCriteria'] = $winnerCriteria; + + return $this; + } + + /** + * Gets winnerDelay + * + * @return int + */ + public function getWinnerDelay() + { + return $this->container['winnerDelay']; + } + + /** + * Sets winnerDelay + * + * @param int $winnerDelay 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` + * + * @return $this + */ + public function setWinnerDelay($winnerDelay) + { + $this->container['winnerDelay'] = $winnerDelay; + + return $this; + } + + /** + * Gets sendAtBestTime + * + * @return bool + */ + public function getSendAtBestTime() + { + return $this->container['sendAtBestTime']; + } + + /** + * Sets sendAtBestTime + * + * @param bool $sendAtBestTime It is true if you have chosen to send your campaign at best time, otherwise it is false + * + * @return $this + */ + public function setSendAtBestTime($sendAtBestTime) + { + $this->container['sendAtBestTime'] = $sendAtBestTime; + + return $this; + } + /** * Gets testSent * @@ -321,7 +792,6 @@ public function getTestSent() { return $this->container['testSent']; } - /** * Sets testSent * @@ -332,10 +802,8 @@ public function getTestSent() public function setTestSent($testSent) { $this->container['testSent'] = $testSent; - return $this; } - /** * Gets header * @@ -345,7 +813,6 @@ public function getHeader() { return $this->container['header']; } - /** * Sets header * @@ -356,10 +823,8 @@ public function getHeader() public function setHeader($header) { $this->container['header'] = $header; - return $this; } - /** * Gets footer * @@ -369,7 +834,6 @@ public function getFooter() { return $this->container['footer']; } - /** * Sets footer * @@ -380,10 +844,8 @@ public function getFooter() public function setFooter($footer) { $this->container['footer'] = $footer; - return $this; } - /** * Gets sender * @@ -393,7 +855,6 @@ public function getSender() { return $this->container['sender']; } - /** * Sets sender * @@ -404,10 +865,8 @@ public function getSender() public function setSender($sender) { $this->container['sender'] = $sender; - return $this; } - /** * Gets replyTo * @@ -417,7 +876,6 @@ public function getReplyTo() { return $this->container['replyTo']; } - /** * Sets replyTo * @@ -428,10 +886,8 @@ public function getReplyTo() public function setReplyTo($replyTo) { $this->container['replyTo'] = $replyTo; - return $this; } - /** * Gets toField * @@ -441,7 +897,6 @@ public function getToField() { return $this->container['toField']; } - /** * Sets toField * @@ -452,10 +907,8 @@ public function getToField() public function setToField($toField) { $this->container['toField'] = $toField; - return $this; } - /** * Gets htmlContent * @@ -465,7 +918,6 @@ public function getHtmlContent() { return $this->container['htmlContent']; } - /** * Sets htmlContent * @@ -476,10 +928,8 @@ public function getHtmlContent() public function setHtmlContent($htmlContent) { $this->container['htmlContent'] = $htmlContent; - return $this; } - /** * Gets shareLink * @@ -489,7 +939,6 @@ public function getShareLink() { return $this->container['shareLink']; } - /** * Sets shareLink * @@ -500,10 +949,8 @@ public function getShareLink() public function setShareLink($shareLink) { $this->container['shareLink'] = $shareLink; - return $this; } - /** * Gets tag * @@ -513,7 +960,6 @@ public function getTag() { return $this->container['tag']; } - /** * Sets tag * @@ -524,10 +970,8 @@ public function getTag() public function setTag($tag) { $this->container['tag'] = $tag; - return $this; } - /** * Gets createdAt * @@ -537,7 +981,6 @@ public function getCreatedAt() { return $this->container['createdAt']; } - /** * Sets createdAt * @@ -548,10 +991,8 @@ public function getCreatedAt() public function setCreatedAt($createdAt) { $this->container['createdAt'] = $createdAt; - return $this; } - /** * Gets modifiedAt * @@ -561,7 +1002,6 @@ public function getModifiedAt() { return $this->container['modifiedAt']; } - /** * Sets modifiedAt * @@ -572,10 +1012,8 @@ public function getModifiedAt() public function setModifiedAt($modifiedAt) { $this->container['modifiedAt'] = $modifiedAt; - return $this; } - /** * Gets inlineImageActivation * @@ -585,7 +1023,6 @@ public function getInlineImageActivation() { return $this->container['inlineImageActivation']; } - /** * Sets inlineImageActivation * @@ -596,10 +1033,8 @@ public function getInlineImageActivation() public function setInlineImageActivation($inlineImageActivation) { $this->container['inlineImageActivation'] = $inlineImageActivation; - return $this; } - /** * Gets mirrorActive * @@ -609,7 +1044,6 @@ public function getMirrorActive() { return $this->container['mirrorActive']; } - /** * Sets mirrorActive * @@ -620,10 +1054,8 @@ public function getMirrorActive() public function setMirrorActive($mirrorActive) { $this->container['mirrorActive'] = $mirrorActive; - return $this; } - /** * Gets recurring * @@ -633,7 +1065,6 @@ public function getRecurring() { return $this->container['recurring']; } - /** * Sets recurring * @@ -644,10 +1075,8 @@ public function getRecurring() public function setRecurring($recurring) { $this->container['recurring'] = $recurring; - return $this; } - /** * Gets sentDate * @@ -657,7 +1086,6 @@ public function getSentDate() { return $this->container['sentDate']; } - /** * Sets sentDate * @@ -668,10 +1096,8 @@ public function getSentDate() public function setSentDate($sentDate) { $this->container['sentDate'] = $sentDate; - return $this; } - /** * Gets returnBounce * @@ -681,7 +1107,6 @@ public function getReturnBounce() { return $this->container['returnBounce']; } - /** * Sets returnBounce * @@ -692,7 +1117,6 @@ public function getReturnBounce() public function setReturnBounce($returnBounce) { $this->container['returnBounce'] = $returnBounce; - return $this; } /** @@ -706,7 +1130,6 @@ public function offsetExists($offset) { return isset($this->container[$offset]); } - /** * Gets offset. * @@ -718,7 +1141,6 @@ public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } - /** * Sets value based on offset. * @@ -735,7 +1157,6 @@ public function offsetSet($offset, $value) $this->container[$offset] = $value; } } - /** * Unsets offset. * @@ -747,7 +1168,6 @@ public function offsetUnset($offset) { unset($this->container[$offset]); } - /** * Gets the string presentation of the object * @@ -761,9 +1181,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } -} - - +} \ No newline at end of file diff --git a/lib/Model/GetExtendedContactDetails.php b/lib/Model/GetExtendedContactDetails.php index 02a63288..a007f660 100644 --- a/lib/Model/GetExtendedContactDetails.php +++ b/lib/Model/GetExtendedContactDetails.php @@ -9,7 +9,6 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ - /** * SendinBlue API * @@ -28,6 +27,8 @@ */ namespace SendinBlue\Client\Model; + +use \ArrayAccess; use \SendinBlue\Client\ObjectSerializer; /** @@ -38,7 +39,7 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class GetExtendedContactDetails extends GetContactDetails +class GetExtendedContactDetails implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; @@ -48,13 +49,21 @@ class GetExtendedContactDetails extends GetContactDetails * @var string */ protected static $swaggerModelName = 'getExtendedContactDetails'; - /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ protected static $swaggerTypes = [ + 'email' => 'string', + 'id' => 'int', + 'emailBlacklisted' => 'bool', + 'smsBlacklisted' => 'bool', + 'createdAt' => 'string', + 'modifiedAt' => 'string', + 'listIds' => 'int[]', + 'listUnsubscribed' => 'int[]', + 'attributes' => 'object', 'statistics' => '\SendinBlue\Client\Model\GetExtendedContactDetailsStatistics' ]; @@ -64,6 +73,15 @@ class GetExtendedContactDetails extends GetContactDetails * @var string[] */ protected static $swaggerFormats = [ + 'email' => 'email', + 'id' => 'int64', + 'emailBlacklisted' => null, + 'smsBlacklisted' => null, + 'createdAt' => null, + 'modifiedAt' => null, + 'listIds' => 'int64', + 'listUnsubscribed' => 'int64', + 'attributes' => null, 'statistics' => null ]; @@ -74,7 +92,7 @@ class GetExtendedContactDetails extends GetContactDetails */ public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); + return self::$swaggerTypes; } /** @@ -84,7 +102,7 @@ public static function swaggerTypes() */ public static function swaggerFormats() { - return self::$swaggerFormats + parent::swaggerFormats(); + return self::$swaggerFormats; } /** @@ -94,6 +112,15 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ + 'email' => 'email', + 'id' => 'id', + 'emailBlacklisted' => 'emailBlacklisted', + 'smsBlacklisted' => 'smsBlacklisted', + 'createdAt' => 'createdAt', + 'modifiedAt' => 'modifiedAt', + 'listIds' => 'listIds', + 'listUnsubscribed' => 'listUnsubscribed', + 'attributes' => 'attributes', 'statistics' => 'statistics' ]; @@ -103,6 +130,15 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ + 'email' => 'setEmail', + 'id' => 'setId', + 'emailBlacklisted' => 'setEmailBlacklisted', + 'smsBlacklisted' => 'setSmsBlacklisted', + 'createdAt' => 'setCreatedAt', + 'modifiedAt' => 'setModifiedAt', + 'listIds' => 'setListIds', + 'listUnsubscribed' => 'setListUnsubscribed', + 'attributes' => 'setAttributes', 'statistics' => 'setStatistics' ]; @@ -112,6 +148,15 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ + 'email' => 'getEmail', + 'id' => 'getId', + 'emailBlacklisted' => 'getEmailBlacklisted', + 'smsBlacklisted' => 'getSmsBlacklisted', + 'createdAt' => 'getCreatedAt', + 'modifiedAt' => 'getModifiedAt', + 'listIds' => 'getListIds', + 'listUnsubscribed' => 'getListUnsubscribed', + 'attributes' => 'getAttributes', 'statistics' => 'getStatistics' ]; @@ -123,7 +168,7 @@ public static function swaggerFormats() */ public static function attributeMap() { - return parent::attributeMap() + self::$attributeMap; + return self::$attributeMap; } /** @@ -133,7 +178,7 @@ public static function attributeMap() */ public static function setters() { - return parent::setters() + self::$setters; + return self::$setters; } /** @@ -143,7 +188,7 @@ public static function setters() */ public static function getters() { - return parent::getters() + self::$getters; + return self::$getters; } /** @@ -155,12 +200,17 @@ public function getModelName() { return self::$swaggerModelName; } - - + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + /** * Constructor * @@ -169,8 +219,15 @@ public function getModelName() */ public function __construct(array $data = null) { - parent::__construct($data); - + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['emailBlacklisted'] = isset($data['emailBlacklisted']) ? $data['emailBlacklisted'] : null; + $this->container['smsBlacklisted'] = isset($data['smsBlacklisted']) ? $data['smsBlacklisted'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; + $this->container['listIds'] = isset($data['listIds']) ? $data['listIds'] : null; + $this->container['listUnsubscribed'] = isset($data['listUnsubscribed']) ? $data['listUnsubscribed'] : null; + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; $this->container['statistics'] = isset($data['statistics']) ? $data['statistics'] : null; } @@ -181,14 +238,37 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); + $invalidProperties = []; + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['emailBlacklisted'] === null) { + $invalidProperties[] = "'emailBlacklisted' can't be null"; + } + if ($this->container['smsBlacklisted'] === null) { + $invalidProperties[] = "'smsBlacklisted' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['modifiedAt'] === null) { + $invalidProperties[] = "'modifiedAt' can't be null"; + } + if ($this->container['listIds'] === null) { + $invalidProperties[] = "'listIds' can't be null"; + } + if ($this->container['attributes'] === null) { + $invalidProperties[] = "'attributes' can't be null"; + } if ($this->container['statistics'] === null) { $invalidProperties[] = "'statistics' can't be null"; } return $invalidProperties; } - /** * Validate all the properties in the model * return true if all passed @@ -201,6 +281,222 @@ public function valid() } + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email Email address of the contact for which you requested the details + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the contact for which you requested the details + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets emailBlacklisted + * + * @return bool + */ + public function getEmailBlacklisted() + { + return $this->container['emailBlacklisted']; + } + + /** + * Sets emailBlacklisted + * + * @param bool $emailBlacklisted Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) + * + * @return $this + */ + public function setEmailBlacklisted($emailBlacklisted) + { + $this->container['emailBlacklisted'] = $emailBlacklisted; + + return $this; + } + + /** + * Gets smsBlacklisted + * + * @return bool + */ + public function getSmsBlacklisted() + { + return $this->container['smsBlacklisted']; + } + + /** + * Sets smsBlacklisted + * + * @param bool $smsBlacklisted Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) + * + * @return $this + */ + public function setSmsBlacklisted($smsBlacklisted) + { + $this->container['smsBlacklisted'] = $smsBlacklisted; + + return $this; + } + + /** + * Gets createdAt + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param string $createdAt Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets modifiedAt + * + * @return string + */ + public function getModifiedAt() + { + return $this->container['modifiedAt']; + } + + /** + * Sets modifiedAt + * + * @param string $modifiedAt Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setModifiedAt($modifiedAt) + { + $this->container['modifiedAt'] = $modifiedAt; + + return $this; + } + + /** + * Gets listIds + * + * @return int[] + */ + public function getListIds() + { + return $this->container['listIds']; + } + + /** + * Sets listIds + * + * @param int[] $listIds listIds + * + * @return $this + */ + public function setListIds($listIds) + { + $this->container['listIds'] = $listIds; + + return $this; + } + + /** + * Gets listUnsubscribed + * + * @return int[] + */ + public function getListUnsubscribed() + { + return $this->container['listUnsubscribed']; + } + + /** + * Sets listUnsubscribed + * + * @param int[] $listUnsubscribed listUnsubscribed + * + * @return $this + */ + public function setListUnsubscribed($listUnsubscribed) + { + $this->container['listUnsubscribed'] = $listUnsubscribed; + + return $this; + } + + /** + * Gets attributes + * + * @return object + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param object $attributes Set of attributes of the contact + * + * @return $this + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + /** * Gets statistics * @@ -210,7 +506,6 @@ public function getStatistics() { return $this->container['statistics']; } - /** * Sets statistics * @@ -221,7 +516,6 @@ public function getStatistics() public function setStatistics($statistics) { $this->container['statistics'] = $statistics; - return $this; } /** @@ -235,7 +529,6 @@ public function offsetExists($offset) { return isset($this->container[$offset]); } - /** * Gets offset. * @@ -247,7 +540,6 @@ public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } - /** * Sets value based on offset. * @@ -264,7 +556,6 @@ public function offsetSet($offset, $value) $this->container[$offset] = $value; } } - /** * Unsets offset. * @@ -276,7 +567,6 @@ public function offsetUnset($offset) { unset($this->container[$offset]); } - /** * Gets the string presentation of the object * @@ -290,9 +580,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } -} - - +} \ No newline at end of file diff --git a/lib/Model/GetSmsCampaign.php b/lib/Model/GetSmsCampaign.php index b96dd230..fd68d201 100644 --- a/lib/Model/GetSmsCampaign.php +++ b/lib/Model/GetSmsCampaign.php @@ -9,7 +9,6 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ - /** * SendinBlue API * @@ -28,6 +27,8 @@ */ namespace SendinBlue\Client\Model; + +use \ArrayAccess; use \SendinBlue\Client\ObjectSerializer; /** @@ -38,7 +39,7 @@ * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class GetSmsCampaign extends GetSmsCampaignOverview +class GetSmsCampaign implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; @@ -48,27 +49,40 @@ class GetSmsCampaign extends GetSmsCampaignOverview * @var string */ protected static $swaggerModelName = 'getSmsCampaign'; - /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ protected static $swaggerTypes = [ - 'recipients' => '\SendinBlue\Client\Model\GetSmsCampaignRecipients', - 'statistics' => '\SendinBlue\Client\Model\GetSmsCampaignRecipients' + 'id' => 'int', + 'name' => 'string', + 'status' => 'string', + 'content' => 'string', + 'scheduledAt' => 'string', + 'sender' => 'string', + 'createdAt' => 'string', + 'modifiedAt' => 'string', + 'recipients' => 'object', + 'statistics' => 'object' ]; /** - * Array of property to format mappings. Used for (de)serialization - * + @@ -75,14 +65,6 @@ class GetSmsCampaign implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ + 'id' => 'int64', + 'name' => null, + 'status' => null, + 'content' => null, + 'scheduledAt' => null, + 'sender' => null, + 'createdAt' => null, + 'modifiedAt' => null, 'recipients' => null, 'statistics' => null ]; - /** * Array of property to type mappings. Used for (de)serialization * @@ -76,7 +90,7 @@ class GetSmsCampaign extends GetSmsCampaignOverview */ public static function swaggerTypes() { - return self::$swaggerTypes + parent::swaggerTypes(); + return self::$swaggerTypes; } /** @@ -86,7 +100,7 @@ public static function swaggerTypes() */ public static function swaggerFormats() { - return self::$swaggerFormats + parent::swaggerFormats(); + return self::$swaggerFormats; } /** @@ -96,30 +110,51 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'status' => 'status', + 'content' => 'content', + 'scheduledAt' => 'scheduledAt', + 'sender' => 'sender', + 'createdAt' => 'createdAt', + 'modifiedAt' => 'modifiedAt', 'recipients' => 'recipients', 'statistics' => 'statistics' ]; - /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'status' => 'setStatus', + 'content' => 'setContent', + 'scheduledAt' => 'setScheduledAt', + 'sender' => 'setSender', + 'createdAt' => 'setCreatedAt', + 'modifiedAt' => 'setModifiedAt', 'recipients' => 'setRecipients', 'statistics' => 'setStatistics' ]; - /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'status' => 'getStatus', + 'content' => 'getContent', + 'scheduledAt' => 'getScheduledAt', + 'sender' => 'getSender', + 'createdAt' => 'getCreatedAt', + 'modifiedAt' => 'getModifiedAt', 'recipients' => 'getRecipients', 'statistics' => 'getStatistics' ]; - /** * Array of attributes where the key is the local name, * and the value is the original name @@ -128,7 +163,7 @@ public static function swaggerFormats() */ public static function attributeMap() { - return parent::attributeMap() + self::$attributeMap; + return self::$attributeMap; } /** @@ -138,7 +173,7 @@ public static function attributeMap() */ public static function setters() { - return parent::setters() + self::$setters; + return self::$setters; } /** @@ -148,7 +183,7 @@ public static function setters() */ public static function getters() { - return parent::getters() + self::$getters; + return self::$getters; } /** @@ -161,11 +196,40 @@ public function getModelName() return self::$swaggerModelName; } - + const STATUS_DRAFT = 'draft'; + const STATUS_SENT = 'sent'; + const STATUS_ARCHIVE = 'archive'; + const STATUS_QUEUED = 'queued'; + const STATUS_SUSPENDED = 'suspended'; + const STATUS_IN_PROCESS = 'inProcess'; - + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_DRAFT, + self::STATUS_SENT, + self::STATUS_ARCHIVE, + self::STATUS_QUEUED, + self::STATUS_SUSPENDED, + self::STATUS_IN_PROCESS, + ]; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + /** * Constructor * @@ -174,12 +238,17 @@ public function getModelName() */ public function __construct(array $data = null) { - parent::__construct($data); - + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['content'] = isset($data['content']) ? $data['content'] : null; + $this->container['scheduledAt'] = isset($data['scheduledAt']) ? $data['scheduledAt'] : null; + $this->container['sender'] = isset($data['sender']) ? $data['sender'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; $this->container['recipients'] = isset($data['recipients']) ? $data['recipients'] : null; $this->container['statistics'] = isset($data['statistics']) ? $data['statistics'] : null; } - /** * Show all the invalid properties with reasons. * @@ -187,8 +256,37 @@ public function __construct(array $data = null) */ public function listInvalidProperties() { - $invalidProperties = parent::listInvalidProperties(); + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + if ($this->container['content'] === null) { + $invalidProperties[] = "'content' can't be null"; + } + if ($this->container['sender'] === null) { + $invalidProperties[] = "'sender' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['modifiedAt'] === null) { + $invalidProperties[] = "'modifiedAt' can't be null"; + } if ($this->container['recipients'] === null) { $invalidProperties[] = "'recipients' can't be null"; } @@ -197,7 +295,6 @@ public function listInvalidProperties() } return $invalidProperties; } - /** * Validate all the properties in the model * return true if all passed @@ -210,51 +307,247 @@ public function valid() } + /** + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id ID of the SMS Campaign + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name Name of the SMS Campaign + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status Status of the SMS Campaign + * + * @return $this + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'status', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets content + * + * @return string + */ + public function getContent() + { + return $this->container['content']; + } + + /** + * Sets content + * + * @param string $content Content of the SMS Campaign + * + * @return $this + */ + public function setContent($content) + { + $this->container['content'] = $content; + + return $this; + } + + /** + * Gets scheduledAt + * + * @return string + */ + public function getScheduledAt() + { + return $this->container['scheduledAt']; + } + + /** + * Sets scheduledAt + * + * @param string $scheduledAt UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format + * + * @return $this + */ + public function setScheduledAt($scheduledAt) + { + $this->container['scheduledAt'] = $scheduledAt; + + return $this; + } + + /** + * Gets sender + * + * @return string + */ + public function getSender() + { + return $this->container['sender']; + } + + /** + * Sets sender + * + * @param string $sender Sender of the SMS Campaign + * + * @return $this + */ + public function setSender($sender) + { + $this->container['sender'] = $sender; + + return $this; + } + + /** + * Gets createdAt + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param string $createdAt Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets modifiedAt + * + * @return string + */ + public function getModifiedAt() + { + return $this->container['modifiedAt']; + } + + /** + * Sets modifiedAt + * + * @param string $modifiedAt UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + * + * @return $this + */ + public function setModifiedAt($modifiedAt) + { + $this->container['modifiedAt'] = $modifiedAt; + + return $this; + } + /** * Gets recipients * - * @return \SendinBlue\Client\Model\GetSmsCampaignRecipients + * @return object */ public function getRecipients() { return $this->container['recipients']; } - /** * Sets recipients * - * @param \SendinBlue\Client\Model\GetSmsCampaignRecipients $recipients recipients + * @param object $recipients recipients * * @return $this */ public function setRecipients($recipients) { $this->container['recipients'] = $recipients; - return $this; } - /** * Gets statistics * - * @return \SendinBlue\Client\Model\GetSmsCampaignRecipients + * @return object */ public function getStatistics() { return $this->container['statistics']; } - /** * Sets statistics * - * @param \SendinBlue\Client\Model\GetSmsCampaignRecipients $statistics statistics + * @param object $statistics statistics * * @return $this */ public function setStatistics($statistics) { $this->container['statistics'] = $statistics; - return $this; } /** @@ -268,7 +561,6 @@ public function offsetExists($offset) { return isset($this->container[$offset]); } - /** * Gets offset. * @@ -280,7 +572,6 @@ public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } - /** * Sets value based on offset. * @@ -297,7 +588,6 @@ public function offsetSet($offset, $value) $this->container[$offset] = $value; } } - /** * Unsets offset. * @@ -309,7 +599,6 @@ public function offsetUnset($offset) { unset($this->container[$offset]); } - /** * Gets the string presentation of the object * @@ -323,9 +612,6 @@ public function __toString() JSON_PRETTY_PRINT ); } - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } -} - - +} \ No newline at end of file