Skip to content

Commit 6954f4c

Browse files
authored
Merge pull request #130 from sendinblue/feature_AP-947
Php wrapper updates
2 parents d57869f + 822eb72 commit 6954f4c

13 files changed

+24
-217
lines changed

docs/Model/CreateSmsCampaign.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**name** | **string** | Name of the campaign |
7-
**sender** | **string** | Name of the sender. The number of characters is limited to 11 |
7+
**sender** | **string** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** |
88
**content** | **string** | Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS |
99
**recipients** | [**\SendinBlue\Client\Model\CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional]
1010
**scheduledAt** | [**\DateTime**] | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]

docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**eventTime** | [**\DateTime**] | UTC date-time of the event |
7-
**ip** | **string** | IP from which the user has been unsubscribed |
7+
**ip** | **string** | IP from which the user has been unsubscribed | [optional]
88

99
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
1010

docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**campaignId** | **int** | ID of the campaign which generated the event |
77
**eventTime** | [**\DateTime**] | UTC date-time of the event |
8-
**ip** | **string** | IP from which the user has unsubscribed |
8+
**ip** | **string** | IP from which the user has unsubscribed | [optional]
99

1010
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
1111

docs/Model/SendReportEmail.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**subject** | **string** | Subject of the email message |
76
**to** | **string[]** | Email addresses of the recipients |
8-
**contentType** | **string** | Type of the message body | [optional] [default to 'html']
9-
**bcc** | **string[]** | Email addresses of the recipients in bcc | [optional]
10-
**cc** | **string[]** | Email addresses of the recipients in cc | [optional]
11-
**body** | **string** | Body of the email message |
7+
**body** | **string** | Custom text message to be presented in the report email. |
128

139
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
1410

docs/Model/SendTransacSms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**sender** | **string** | Name of the sender. Only alphanumeric characters. No more than 11 characters |
6+
**sender** | **string** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** |
77
**recipient** | **string** | Mobile number to send SMS with the country code |
88
**content** | **string** | Content of the message. If more than 160 characters long, will be sent as multiple text messages |
99
**type** | **string** | Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. | [optional] [default to 'transactional']

docs/Model/UpdateSmsCampaign.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**name** | **string** | Name of the campaign | [optional]
7-
**sender** | **string** | Name of the sender. The number of characters is limited to 11 | [optional]
7+
**sender** | **string** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** | [optional]
88
**content** | **string** | Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS | [optional]
99
**recipients** | [**\SendinBlue\Client\Model\CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional]
1010
**scheduledAt** | [**\DateTime**] | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]

lib/Model/CreateSmsCampaign.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ public function listInvalidProperties()
219219
if ($this->container['sender'] === null) {
220220
$invalidProperties[] = "'sender' can't be null";
221221
}
222-
if ((mb_strlen($this->container['sender']) > 11)) {
223-
$invalidProperties[] = "invalid value for 'sender', the character length must be smaller than or equal to 11.";
222+
if ((mb_strlen($this->container['sender']) > 15)) {
223+
$invalidProperties[] = "invalid value for 'sender', the character length must be smaller than or equal to 15.";
224224
}
225225

226226
if ($this->container['content'] === null) {
@@ -278,14 +278,14 @@ public function getSender()
278278
/**
279279
* Sets sender
280280
*
281-
* @param string $sender Name of the sender. The number of characters is limited to 11
281+
* @param string $sender Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters**
282282
*
283283
* @return $this
284284
*/
285285
public function setSender($sender)
286286
{
287-
if ((mb_strlen($sender) > 11)) {
288-
throw new \InvalidArgumentException('invalid length for $sender when calling CreateSmsCampaign., must be smaller than or equal to 11.');
287+
if ((mb_strlen($sender) > 15)) {
288+
throw new \InvalidArgumentException('invalid length for $sender when calling CreateSmsCampaign., must be smaller than or equal to 15.');
289289
}
290290

291291
$this->container['sender'] = $sender;

lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,6 @@ public function listInvalidProperties()
198198
if ($this->container['eventTime'] === null) {
199199
$invalidProperties[] = "'eventTime' can't be null";
200200
}
201-
if ($this->container['ip'] === null) {
202-
$invalidProperties[] = "'ip' can't be null";
203-
}
204201
return $invalidProperties;
205202
}
206203

lib/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,6 @@ public function listInvalidProperties()
207207
if ($this->container['eventTime'] === null) {
208208
$invalidProperties[] = "'eventTime' can't be null";
209209
}
210-
if ($this->container['ip'] === null) {
211-
$invalidProperties[] = "'ip' can't be null";
212-
}
213210
return $invalidProperties;
214211
}
215212

lib/Model/SendReportEmail.php

Lines changed: 2 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* SendReportEmail Class Doc Comment
3737
*
3838
* @category Class
39-
* @description Email sending credentials including subject, body, to, cc etc.
39+
* @description Custom attributes for the report email.
4040
* @package SendinBlue\Client
4141
* @author Swagger Codegen team
4242
* @link https://github.com/swagger-api/swagger-codegen
@@ -58,11 +58,7 @@ class SendReportEmail implements ModelInterface, ArrayAccess
5858
* @var string[]
5959
*/
6060
protected static $swaggerTypes = [
61-
'subject' => 'string',
6261
'to' => 'string[]',
63-
'contentType' => 'string',
64-
'bcc' => 'string[]',
65-
'cc' => 'string[]',
6662
'body' => 'string'
6763
];
6864

@@ -72,11 +68,7 @@ class SendReportEmail implements ModelInterface, ArrayAccess
7268
* @var string[]
7369
*/
7470
protected static $swaggerFormats = [
75-
'subject' => null,
7671
'to' => 'email',
77-
'contentType' => null,
78-
'bcc' => 'email',
79-
'cc' => 'email',
8072
'body' => null
8173
];
8274

@@ -107,11 +99,7 @@ public static function swaggerFormats()
10799
* @var string[]
108100
*/
109101
protected static $attributeMap = [
110-
'subject' => 'subject',
111102
'to' => 'to',
112-
'contentType' => 'contentType',
113-
'bcc' => 'bcc',
114-
'cc' => 'cc',
115103
'body' => 'body'
116104
];
117105

@@ -121,11 +109,7 @@ public static function swaggerFormats()
121109
* @var string[]
122110
*/
123111
protected static $setters = [
124-
'subject' => 'setSubject',
125112
'to' => 'setTo',
126-
'contentType' => 'setContentType',
127-
'bcc' => 'setBcc',
128-
'cc' => 'setCc',
129113
'body' => 'setBody'
130114
];
131115

@@ -135,11 +119,7 @@ public static function swaggerFormats()
135119
* @var string[]
136120
*/
137121
protected static $getters = [
138-
'subject' => 'getSubject',
139122
'to' => 'getTo',
140-
'contentType' => 'getContentType',
141-
'bcc' => 'getBcc',
142-
'cc' => 'getCc',
143123
'body' => 'getBody'
144124
];
145125

@@ -184,24 +164,9 @@ public function getModelName()
184164
return self::$swaggerModelName;
185165
}
186166

187-
const CONTENT_TYPE_TEXT = 'text';
188-
const CONTENT_TYPE_HTML = 'html';
189167

190168

191169

192-
/**
193-
* Gets allowable values of the enum
194-
*
195-
* @return string[]
196-
*/
197-
public function getContentTypeAllowableValues()
198-
{
199-
return [
200-
self::CONTENT_TYPE_TEXT,
201-
self::CONTENT_TYPE_HTML,
202-
];
203-
}
204-
205170

206171
/**
207172
* Associative array for storing property values
@@ -218,11 +183,7 @@ public function getContentTypeAllowableValues()
218183
*/
219184
public function __construct(array $data = null)
220185
{
221-
$this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
222186
$this->container['to'] = isset($data['to']) ? $data['to'] : null;
223-
$this->container['contentType'] = isset($data['contentType']) ? $data['contentType'] : 'html';
224-
$this->container['bcc'] = isset($data['bcc']) ? $data['bcc'] : null;
225-
$this->container['cc'] = isset($data['cc']) ? $data['cc'] : null;
226187
$this->container['body'] = isset($data['body']) ? $data['body'] : null;
227188
}
228189

@@ -235,20 +196,9 @@ public function listInvalidProperties()
235196
{
236197
$invalidProperties = [];
237198

238-
if ($this->container['subject'] === null) {
239-
$invalidProperties[] = "'subject' can't be null";
240-
}
241199
if ($this->container['to'] === null) {
242200
$invalidProperties[] = "'to' can't be null";
243201
}
244-
$allowedValues = $this->getContentTypeAllowableValues();
245-
if (!is_null($this->container['contentType']) && !in_array($this->container['contentType'], $allowedValues, true)) {
246-
$invalidProperties[] = sprintf(
247-
"invalid value for 'contentType', must be one of '%s'",
248-
implode("', '", $allowedValues)
249-
);
250-
}
251-
252202
if ($this->container['body'] === null) {
253203
$invalidProperties[] = "'body' can't be null";
254204
}
@@ -267,30 +217,6 @@ public function valid()
267217
}
268218

269219

270-
/**
271-
* Gets subject
272-
*
273-
* @return string
274-
*/
275-
public function getSubject()
276-
{
277-
return $this->container['subject'];
278-
}
279-
280-
/**
281-
* Sets subject
282-
*
283-
* @param string $subject Subject of the email message
284-
*
285-
* @return $this
286-
*/
287-
public function setSubject($subject)
288-
{
289-
$this->container['subject'] = $subject;
290-
291-
return $this;
292-
}
293-
294220
/**
295221
* Gets to
296222
*
@@ -315,87 +241,6 @@ public function setTo($to)
315241
return $this;
316242
}
317243

318-
/**
319-
* Gets contentType
320-
*
321-
* @return string
322-
*/
323-
public function getContentType()
324-
{
325-
return $this->container['contentType'];
326-
}
327-
328-
/**
329-
* Sets contentType
330-
*
331-
* @param string $contentType Type of the message body
332-
*
333-
* @return $this
334-
*/
335-
public function setContentType($contentType)
336-
{
337-
$allowedValues = $this->getContentTypeAllowableValues();
338-
if (!is_null($contentType) && !in_array($contentType, $allowedValues, true)) {
339-
throw new \InvalidArgumentException(
340-
sprintf(
341-
"Invalid value for 'contentType', must be one of '%s'",
342-
implode("', '", $allowedValues)
343-
)
344-
);
345-
}
346-
$this->container['contentType'] = $contentType;
347-
348-
return $this;
349-
}
350-
351-
/**
352-
* Gets bcc
353-
*
354-
* @return string[]
355-
*/
356-
public function getBcc()
357-
{
358-
return $this->container['bcc'];
359-
}
360-
361-
/**
362-
* Sets bcc
363-
*
364-
* @param string[] $bcc Email addresses of the recipients in bcc
365-
*
366-
* @return $this
367-
*/
368-
public function setBcc($bcc)
369-
{
370-
$this->container['bcc'] = $bcc;
371-
372-
return $this;
373-
}
374-
375-
/**
376-
* Gets cc
377-
*
378-
* @return string[]
379-
*/
380-
public function getCc()
381-
{
382-
return $this->container['cc'];
383-
}
384-
385-
/**
386-
* Sets cc
387-
*
388-
* @param string[] $cc Email addresses of the recipients in cc
389-
*
390-
* @return $this
391-
*/
392-
public function setCc($cc)
393-
{
394-
$this->container['cc'] = $cc;
395-
396-
return $this;
397-
}
398-
399244
/**
400245
* Gets body
401246
*
@@ -409,7 +254,7 @@ public function getBody()
409254
/**
410255
* Sets body
411256
*
412-
* @param string $body Body of the email message
257+
* @param string $body Custom text message to be presented in the report email.
413258
*
414259
* @return $this
415260
*/

0 commit comments

Comments
 (0)