Skip to content

Commit cb6351e

Browse files
authored
Merge pull request #15 from sendinblue/feature_valid-swagger-spec-2.0
Swagger specification 2.0 validation fixes
2 parents 3006950 + 87f49df commit cb6351e

34 files changed

+170
-841
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ Class | Method | HTTP request | Description
265265
- [GetIpsFromSender](docs/Model/GetIpsFromSender.md)
266266
- [GetList](docs/Model/GetList.md)
267267
- [GetLists](docs/Model/GetLists.md)
268-
- [GetListsFolder](docs/Model/GetListsFolder.md)
269-
- [GetListsLists](docs/Model/GetListsLists.md)
270268
- [GetProcess](docs/Model/GetProcess.md)
271269
- [GetProcesses](docs/Model/GetProcesses.md)
272270
- [GetReports](docs/Model/GetReports.md)

docs/Model/GetAccountPlan.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
**type** | **string** | Displays the plan type of the user |
77
**creditsType** | **string** | This is the type of the credit, \"User Limit\" or \"Send Limit\" are two possible types of credit of a user. \"User Limit\" implies the total number of subscribers you can add to your account, and \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. |
8-
**credits** | **int** | Remaining credits of the user. This can either be \"User Limit\" or \"Send Limit\" depending on the plan. |
8+
**credits** | **float** | Remaining credits of the user. This can either be \"User Limit\" or \"Send Limit\" depending on the plan. |
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/GetCampaignStats.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-
**listId** | **int** | List Id of email campaign (only in case of get email campaign(s)) |
6+
**listId** | **int** | List Id of email campaign (only in case of get email campaign(s)) | [optional]
77
**uniqueClicks** | **int** | Number of unique clicks for the campaign |
88
**clickers** | **int** | Number of clicks for the campaign |
99
**complaints** | **int** | Number of complaints (Spam reports) for the campaign |

docs/Model/GetContactCampaignStatsOpened.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
**count** | **int** | Number of openings of the campaign |
8-
**eventTime** | [**\DateTime**](\DateTime.md) | Date of the event |
8+
**eventTime** | **string** | Date of the event |
99
**ip** | **string** | IP from which the user has opened the campaign |
1010

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

docs/Model/GetEmailCampaign.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Name | Type | Description | Notes
1616
**replyTo** | **string** | Email defined as the \"Reply to\" of the campaign |
1717
**toField** | **string** | Customisation of the \"to\" field of the campaign |
1818
**htmlContent** | **string** | HTML content of the campaign |
19-
**shareLink** | **string** | Link to share the campaign on social medias |
19+
**shareLink** | **string** | Link to share the campaign on social medias | [optional]
2020
**tag** | **string** | Tag of the campaign |
2121
**createdAt** | **string** | Creation date of the campaign (YYYY-MM-DD HH:mm:ss) |
2222
**modifiedAt** | **string** | Date of last modification of the campaign (YYYY-MM-DD HH:mm:ss) |

docs/Model/GetExtendedCampaignOverview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Name | Type | Description | Notes
1616
**replyTo** | **string** | Email defined as the \"Reply to\" of the campaign |
1717
**toField** | **string** | Customisation of the \"to\" field of the campaign |
1818
**htmlContent** | **string** | HTML content of the campaign |
19-
**shareLink** | **string** | Link to share the campaign on social medias |
19+
**shareLink** | **string** | Link to share the campaign on social medias | [optional]
2020
**tag** | **string** | Tag of the campaign |
2121
**createdAt** | **string** | Creation date of the campaign (YYYY-MM-DD HH:mm:ss) |
2222
**modifiedAt** | **string** | Date of last modification of the campaign (YYYY-MM-DD HH:mm:ss) |

docs/Model/GetExtendedContactDetailsStatisticsLinks.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
**count** | **int** | Number of clicks on this link for the campaign |
7-
**eventTime** | [**\DateTime**](\DateTime.md) | Date of the event |
7+
**eventTime** | **string** | Date of the event |
88
**ip** | **string** | IP from which the user has clicked on the link |
99
**url** | **string** | URL of the clicked link |
1010

docs/Model/GetExtendedContactDetailsStatisticsMessagesSent.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
**campaignId** | **int** | ID of the campaign which generated the event |
7-
**eventTime** | [**\DateTime**](\DateTime.md) | Date of the event |
7+
**eventTime** | **string** | Date of the event |
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/GetExtendedContactDetailsStatisticsOpened.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
**count** | **int** | Number of openings for the campaign |
8-
**eventTime** | [**\DateTime**](\DateTime.md) | Date of the event |
8+
**eventTime** | **string** | Date of the event |
99
**ip** | **string** | IP from which the user has opened the email |
1010

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

docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.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-
**eventTime** | [**\DateTime**](\DateTime.md) | Date of the event |
6+
**eventTime** | **string** | Date of the event |
77
**ip** | **string** | IP from which the user has been unsubscribed |
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)

docs/Model/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.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
**campaignId** | **int** | ID of the campaign which generated the event |
7-
**eventTime** | [**\DateTime**](\DateTime.md) | Date of the event |
7+
**eventTime** | **string** | Date of the event |
88
**ip** | **string** | IP from which the user has unsubscribed |
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)

docs/Model/GetExtendedList.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
88
**totalBlacklisted** | **int** | Number of blacklisted contacts in the list |
99
**totalSubscribers** | **int** | Number of contacts in the list |
1010
**folderId** | **int** | ID of the folder |
11-
**createdAt** | **string** | Creation Date of the list (YYYY-MM-DD) |
11+
**createdAt** | **string** | Creation Date of the list (YYYY-MM-DD HH:mm:ss) |
1212
**campaignStats** | [**\SendinBlue\Client\Model\GetExtendedListCampaignStats[]**](GetExtendedListCampaignStats.md) | | [optional]
1313
**dynamicList** | **bool** | Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) | [optional]
1414

docs/Model/GetLists.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6+
**lists** | **object[]** | Listing of all the lists available in your account |
67
**count** | **int** | Number of lists in your account |
7-
**lists** | [**\SendinBlue\Client\Model\GetListsLists[]**](GetListsLists.md) | Listing of all the lists available in your account |
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/GetListsFolder.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/Model/GetListsLists.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/Model/GetWebhook.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Name | Type | Description | Notes
88
**description** | **string** | Description of the webhook |
99
**events** | **string[]** | |
1010
**type** | **string** | Type of webhook (marketing or transac) |
11-
**createdAt** | **string** | Creation date of the webhook (YYYY-MM-DD) |
12-
**modifiedAt** | **string** | Last modification date of the webhook (YYYY-MM-DD) |
11+
**createdAt** | **string** | Creation date of the webhook (YYYY-MM-DD HH:mm:ss) |
12+
**modifiedAt** | **string** | Last modification date of the webhook (YYYY-MM-DD HH:mm:ss) |
1313

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

lib/Model/GetAccountPlan.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class GetAccountPlan implements ArrayAccess
5656
protected static $swaggerTypes = [
5757
'type' => 'string',
5858
'creditsType' => 'string',
59-
'credits' => 'int'
59+
'credits' => 'float'
6060
];
6161

6262
/**
@@ -66,7 +66,7 @@ class GetAccountPlan implements ArrayAccess
6666
protected static $swaggerFormats = [
6767
'type' => null,
6868
'creditsType' => null,
69-
'credits' => 'int32'
69+
'credits' => 'float'
7070
];
7171

7272
public static function swaggerTypes()
@@ -312,7 +312,7 @@ public function setCreditsType($creditsType)
312312

313313
/**
314314
* Gets credits
315-
* @return int
315+
* @return float
316316
*/
317317
public function getCredits()
318318
{
@@ -321,7 +321,7 @@ public function getCredits()
321321

322322
/**
323323
* Sets credits
324-
* @param int $credits Remaining credits of the user. This can either be \"User Limit\" or \"Send Limit\" depending on the plan.
324+
* @param float $credits Remaining credits of the user. This can either be \"User Limit\" or \"Send Limit\" depending on the plan.
325325
* @return $this
326326
*/
327327
public function setCredits($credits)

lib/Model/GetCampaignStats.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@ public function listInvalidProperties()
210210
{
211211
$invalid_properties = [];
212212

213-
if ($this->container['listId'] === null) {
214-
$invalid_properties[] = "'listId' can't be null";
215-
}
216213
if ($this->container['uniqueClicks'] === null) {
217214
$invalid_properties[] = "'uniqueClicks' can't be null";
218215
}
@@ -258,9 +255,6 @@ public function listInvalidProperties()
258255
public function valid()
259256
{
260257

261-
if ($this->container['listId'] === null) {
262-
return false;
263-
}
264258
if ($this->container['uniqueClicks'] === null) {
265259
return false;
266260
}

lib/Model/GetContactCampaignStatsOpened.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class GetContactCampaignStatsOpened implements ArrayAccess
5656
protected static $swaggerTypes = [
5757
'campaignId' => 'int',
5858
'count' => 'int',
59-
'eventTime' => '\DateTime',
59+
'eventTime' => 'string',
6060
'ip' => 'string'
6161
];
6262

@@ -67,7 +67,7 @@ class GetContactCampaignStatsOpened implements ArrayAccess
6767
protected static $swaggerFormats = [
6868
'campaignId' => 'int32',
6969
'count' => 'int32',
70-
'eventTime' => 'date-time',
70+
'eventTime' => null,
7171
'ip' => null
7272
];
7373

@@ -171,6 +171,10 @@ public function listInvalidProperties()
171171
if ($this->container['eventTime'] === null) {
172172
$invalid_properties[] = "'eventTime' can't be null";
173173
}
174+
if (!preg_match("/^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/", $this->container['eventTime'])) {
175+
$invalid_properties[] = "invalid value for 'eventTime', must be conform to the pattern /^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/.";
176+
}
177+
174178
if ($this->container['ip'] === null) {
175179
$invalid_properties[] = "'ip' can't be null";
176180
}
@@ -195,6 +199,9 @@ public function valid()
195199
if ($this->container['eventTime'] === null) {
196200
return false;
197201
}
202+
if (!preg_match("/^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/", $this->container['eventTime'])) {
203+
return false;
204+
}
198205
if ($this->container['ip'] === null) {
199206
return false;
200207
}
@@ -246,7 +253,7 @@ public function setCount($count)
246253

247254
/**
248255
* Gets eventTime
249-
* @return \DateTime
256+
* @return string
250257
*/
251258
public function getEventTime()
252259
{
@@ -255,11 +262,16 @@ public function getEventTime()
255262

256263
/**
257264
* Sets eventTime
258-
* @param \DateTime $eventTime Date of the event
265+
* @param string $eventTime Date of the event
259266
* @return $this
260267
*/
261268
public function setEventTime($eventTime)
262269
{
270+
271+
if ((!preg_match("/^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/", $eventTime))) {
272+
throw new \InvalidArgumentException("invalid value for $eventTime when calling GetContactCampaignStatsOpened., must conform to the pattern /^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/.");
273+
}
274+
263275
$this->container['eventTime'] = $eventTime;
264276

265277
return $this;

lib/Model/GetEmailCampaign.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class GetEmailCampaign implements ArrayAccess
9292
'footer' => null,
9393
'sender' => null,
9494
'replyTo' => 'email',
95-
'toField' => 'email',
95+
'toField' => null,
9696
'htmlContent' => null,
9797
'shareLink' => 'url',
9898
'tag' => null,
@@ -347,9 +347,6 @@ public function listInvalidProperties()
347347
if ($this->container['htmlContent'] === null) {
348348
$invalid_properties[] = "'htmlContent' can't be null";
349349
}
350-
if ($this->container['shareLink'] === null) {
351-
$invalid_properties[] = "'shareLink' can't be null";
352-
}
353350
if ($this->container['tag'] === null) {
354351
$invalid_properties[] = "'tag' can't be null";
355352
}
@@ -423,9 +420,6 @@ public function valid()
423420
if ($this->container['htmlContent'] === null) {
424421
return false;
425422
}
426-
if ($this->container['shareLink'] === null) {
427-
return false;
428-
}
429423
if ($this->container['tag'] === null) {
430424
return false;
431425
}

lib/Model/GetExtendedCampaignOverview.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class GetExtendedCampaignOverview implements ArrayAccess
9292
'footer' => null,
9393
'sender' => null,
9494
'replyTo' => 'email',
95-
'toField' => 'email',
95+
'toField' => null,
9696
'htmlContent' => null,
9797
'shareLink' => 'url',
9898
'tag' => null,
@@ -347,9 +347,6 @@ public function listInvalidProperties()
347347
if ($this->container['htmlContent'] === null) {
348348
$invalid_properties[] = "'htmlContent' can't be null";
349349
}
350-
if ($this->container['shareLink'] === null) {
351-
$invalid_properties[] = "'shareLink' can't be null";
352-
}
353350
if ($this->container['tag'] === null) {
354351
$invalid_properties[] = "'tag' can't be null";
355352
}
@@ -423,9 +420,6 @@ public function valid()
423420
if ($this->container['htmlContent'] === null) {
424421
return false;
425422
}
426-
if ($this->container['shareLink'] === null) {
427-
return false;
428-
}
429423
if ($this->container['tag'] === null) {
430424
return false;
431425
}

lib/Model/GetExtendedContactDetailsStatisticsLinks.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class GetExtendedContactDetailsStatisticsLinks implements ArrayAccess
5555
*/
5656
protected static $swaggerTypes = [
5757
'count' => 'int',
58-
'eventTime' => '\DateTime',
58+
'eventTime' => 'string',
5959
'ip' => 'string',
6060
'url' => 'string'
6161
];
@@ -66,7 +66,7 @@ class GetExtendedContactDetailsStatisticsLinks implements ArrayAccess
6666
*/
6767
protected static $swaggerFormats = [
6868
'count' => 'int32',
69-
'eventTime' => 'date-time',
69+
'eventTime' => null,
7070
'ip' => null,
7171
'url' => null
7272
];
@@ -168,6 +168,10 @@ public function listInvalidProperties()
168168
if ($this->container['eventTime'] === null) {
169169
$invalid_properties[] = "'eventTime' can't be null";
170170
}
171+
if (!preg_match("/^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/", $this->container['eventTime'])) {
172+
$invalid_properties[] = "invalid value for 'eventTime', must be conform to the pattern /^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/.";
173+
}
174+
171175
if ($this->container['ip'] === null) {
172176
$invalid_properties[] = "'ip' can't be null";
173177
}
@@ -192,6 +196,9 @@ public function valid()
192196
if ($this->container['eventTime'] === null) {
193197
return false;
194198
}
199+
if (!preg_match("/^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/", $this->container['eventTime'])) {
200+
return false;
201+
}
195202
if ($this->container['ip'] === null) {
196203
return false;
197204
}
@@ -225,7 +232,7 @@ public function setCount($count)
225232

226233
/**
227234
* Gets eventTime
228-
* @return \DateTime
235+
* @return string
229236
*/
230237
public function getEventTime()
231238
{
@@ -234,11 +241,16 @@ public function getEventTime()
234241

235242
/**
236243
* Sets eventTime
237-
* @param \DateTime $eventTime Date of the event
244+
* @param string $eventTime Date of the event
238245
* @return $this
239246
*/
240247
public function setEventTime($eventTime)
241248
{
249+
250+
if ((!preg_match("/^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/", $eventTime))) {
251+
throw new \InvalidArgumentException("invalid value for $eventTime when calling GetExtendedContactDetailsStatisticsLinks., must conform to the pattern /^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/.");
252+
}
253+
242254
$this->container['eventTime'] = $eventTime;
243255

244256
return $this;

0 commit comments

Comments
 (0)