Skip to content

Commit

Permalink
Merge pull request #15 from sendinblue/feature_valid-swagger-spec-2.0
Browse files Browse the repository at this point in the history
Swagger specification 2.0 validation fixes
  • Loading branch information
ekta-slit authored Sep 19, 2017
2 parents 3006950 + 87f49df commit cb6351e
Show file tree
Hide file tree
Showing 34 changed files with 170 additions and 841 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,6 @@ Class | Method | HTTP request | Description
- [GetIpsFromSender](docs/Model/GetIpsFromSender.md)
- [GetList](docs/Model/GetList.md)
- [GetLists](docs/Model/GetLists.md)
- [GetListsFolder](docs/Model/GetListsFolder.md)
- [GetListsLists](docs/Model/GetListsLists.md)
- [GetProcess](docs/Model/GetProcess.md)
- [GetProcesses](docs/Model/GetProcesses.md)
- [GetReports](docs/Model/GetReports.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/Model/GetAccountPlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **string** | Displays the plan type of the user |
**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. |
**credits** | **int** | Remaining credits of the user. This can either be \"User Limit\" or \"Send Limit\" depending on the plan. |
**credits** | **float** | Remaining credits of the user. This can either be \"User Limit\" or \"Send Limit\" depending on the plan. |

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

Expand Down
2 changes: 1 addition & 1 deletion docs/Model/GetCampaignStats.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**listId** | **int** | List Id of email campaign (only in case of get email campaign(s)) |
**listId** | **int** | List Id of email campaign (only in case of get email campaign(s)) | [optional]
**uniqueClicks** | **int** | Number of unique clicks for the campaign |
**clickers** | **int** | Number of clicks for the campaign |
**complaints** | **int** | Number of complaints (Spam reports) for the campaign |
Expand Down
2 changes: 1 addition & 1 deletion docs/Model/GetContactCampaignStatsOpened.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**campaignId** | **int** | ID of the campaign which generated the event |
**count** | **int** | Number of openings of the campaign |
**eventTime** | [**\DateTime**](\DateTime.md) | Date of the event |
**eventTime** | **string** | Date of the event |
**ip** | **string** | IP from which the user has opened the campaign |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/Model/GetEmailCampaign.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Name | Type | Description | Notes
**replyTo** | **string** | Email defined as the \"Reply to\" of the campaign |
**toField** | **string** | Customisation of the \"to\" field of the campaign |
**htmlContent** | **string** | HTML content of the campaign |
**shareLink** | **string** | Link to share the campaign on social medias |
**shareLink** | **string** | Link to share the campaign on social medias | [optional]
**tag** | **string** | Tag of the campaign |
**createdAt** | **string** | Creation date of the campaign (YYYY-MM-DD HH:mm:ss) |
**modifiedAt** | **string** | Date of last modification of the campaign (YYYY-MM-DD HH:mm:ss) |
Expand Down
2 changes: 1 addition & 1 deletion docs/Model/GetExtendedCampaignOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Name | Type | Description | Notes
**replyTo** | **string** | Email defined as the \"Reply to\" of the campaign |
**toField** | **string** | Customisation of the \"to\" field of the campaign |
**htmlContent** | **string** | HTML content of the campaign |
**shareLink** | **string** | Link to share the campaign on social medias |
**shareLink** | **string** | Link to share the campaign on social medias | [optional]
**tag** | **string** | Tag of the campaign |
**createdAt** | **string** | Creation date of the campaign (YYYY-MM-DD HH:mm:ss) |
**modifiedAt** | **string** | Date of last modification of the campaign (YYYY-MM-DD HH:mm:ss) |
Expand Down
2 changes: 1 addition & 1 deletion docs/Model/GetExtendedContactDetailsStatisticsLinks.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**count** | **int** | Number of clicks on this link for the campaign |
**eventTime** | [**\DateTime**](\DateTime.md) | Date of the event |
**eventTime** | **string** | Date of the event |
**ip** | **string** | IP from which the user has clicked on the link |
**url** | **string** | URL of the clicked link |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**campaignId** | **int** | ID of the campaign which generated the event |
**eventTime** | [**\DateTime**](\DateTime.md) | Date of the event |
**eventTime** | **string** | Date of the event |

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

Expand Down
2 changes: 1 addition & 1 deletion docs/Model/GetExtendedContactDetailsStatisticsOpened.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**campaignId** | **int** | ID of the campaign which generated the event |
**count** | **int** | Number of openings for the campaign |
**eventTime** | [**\DateTime**](\DateTime.md) | Date of the event |
**eventTime** | **string** | Date of the event |
**ip** | **string** | IP from which the user has opened the email |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**eventTime** | [**\DateTime**](\DateTime.md) | Date of the event |
**eventTime** | **string** | Date of the event |
**ip** | **string** | IP from which the user has been unsubscribed |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**campaignId** | **int** | ID of the campaign which generated the event |
**eventTime** | [**\DateTime**](\DateTime.md) | Date of the event |
**eventTime** | **string** | Date of the event |
**ip** | **string** | IP from which the user has unsubscribed |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/Model/GetExtendedList.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Name | Type | Description | Notes
**totalBlacklisted** | **int** | Number of blacklisted contacts in the list |
**totalSubscribers** | **int** | Number of contacts in the list |
**folderId** | **int** | ID of the folder |
**createdAt** | **string** | Creation Date of the list (YYYY-MM-DD) |
**createdAt** | **string** | Creation Date of the list (YYYY-MM-DD HH:mm:ss) |
**campaignStats** | [**\SendinBlue\Client\Model\GetExtendedListCampaignStats[]**](GetExtendedListCampaignStats.md) | | [optional]
**dynamicList** | **bool** | Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) | [optional]

Expand Down
2 changes: 1 addition & 1 deletion docs/Model/GetLists.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**lists** | **object[]** | Listing of all the lists available in your account |
**count** | **int** | Number of lists in your account |
**lists** | [**\SendinBlue\Client\Model\GetListsLists[]**](GetListsLists.md) | Listing of all the lists available in your account |

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

Expand Down
11 changes: 0 additions & 11 deletions docs/Model/GetListsFolder.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/Model/GetListsLists.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/Model/GetWebhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Name | Type | Description | Notes
**description** | **string** | Description of the webhook |
**events** | **string[]** | |
**type** | **string** | Type of webhook (marketing or transac) |
**createdAt** | **string** | Creation date of the webhook (YYYY-MM-DD) |
**modifiedAt** | **string** | Last modification date of the webhook (YYYY-MM-DD) |
**createdAt** | **string** | Creation date of the webhook (YYYY-MM-DD HH:mm:ss) |
**modifiedAt** | **string** | Last modification date of the webhook (YYYY-MM-DD HH:mm:ss) |

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

Expand Down
8 changes: 4 additions & 4 deletions lib/Model/GetAccountPlan.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class GetAccountPlan implements ArrayAccess
protected static $swaggerTypes = [
'type' => 'string',
'creditsType' => 'string',
'credits' => 'int'
'credits' => 'float'
];

/**
Expand All @@ -66,7 +66,7 @@ class GetAccountPlan implements ArrayAccess
protected static $swaggerFormats = [
'type' => null,
'creditsType' => null,
'credits' => 'int32'
'credits' => 'float'
];

public static function swaggerTypes()
Expand Down Expand Up @@ -312,7 +312,7 @@ public function setCreditsType($creditsType)

/**
* Gets credits
* @return int
* @return float
*/
public function getCredits()
{
Expand All @@ -321,7 +321,7 @@ public function getCredits()

/**
* Sets credits
* @param int $credits Remaining credits of the user. This can either be \"User Limit\" or \"Send Limit\" depending on the plan.
* @param float $credits Remaining credits of the user. This can either be \"User Limit\" or \"Send Limit\" depending on the plan.
* @return $this
*/
public function setCredits($credits)
Expand Down
6 changes: 0 additions & 6 deletions lib/Model/GetCampaignStats.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,6 @@ public function listInvalidProperties()
{
$invalid_properties = [];

if ($this->container['listId'] === null) {
$invalid_properties[] = "'listId' can't be null";
}
if ($this->container['uniqueClicks'] === null) {
$invalid_properties[] = "'uniqueClicks' can't be null";
}
Expand Down Expand Up @@ -258,9 +255,6 @@ public function listInvalidProperties()
public function valid()
{

if ($this->container['listId'] === null) {
return false;
}
if ($this->container['uniqueClicks'] === null) {
return false;
}
Expand Down
20 changes: 16 additions & 4 deletions lib/Model/GetContactCampaignStatsOpened.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class GetContactCampaignStatsOpened implements ArrayAccess
protected static $swaggerTypes = [
'campaignId' => 'int',
'count' => 'int',
'eventTime' => '\DateTime',
'eventTime' => 'string',
'ip' => 'string'
];

Expand All @@ -67,7 +67,7 @@ class GetContactCampaignStatsOpened implements ArrayAccess
protected static $swaggerFormats = [
'campaignId' => 'int32',
'count' => 'int32',
'eventTime' => 'date-time',
'eventTime' => null,
'ip' => null
];

Expand Down Expand Up @@ -171,6 +171,10 @@ public function listInvalidProperties()
if ($this->container['eventTime'] === null) {
$invalid_properties[] = "'eventTime' can't be null";
}
if (!preg_match("/^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/", $this->container['eventTime'])) {
$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)?$/.";
}

if ($this->container['ip'] === null) {
$invalid_properties[] = "'ip' can't be null";
}
Expand All @@ -195,6 +199,9 @@ public function valid()
if ($this->container['eventTime'] === null) {
return false;
}
if (!preg_match("/^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/", $this->container['eventTime'])) {
return false;
}
if ($this->container['ip'] === null) {
return false;
}
Expand Down Expand Up @@ -246,7 +253,7 @@ public function setCount($count)

/**
* Gets eventTime
* @return \DateTime
* @return string
*/
public function getEventTime()
{
Expand All @@ -255,11 +262,16 @@ public function getEventTime()

/**
* Sets eventTime
* @param \DateTime $eventTime Date of the event
* @param string $eventTime Date of the event
* @return $this
*/
public function setEventTime($eventTime)
{

if ((!preg_match("/^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/", $eventTime))) {
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)?$/.");
}

$this->container['eventTime'] = $eventTime;

return $this;
Expand Down
8 changes: 1 addition & 7 deletions lib/Model/GetEmailCampaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class GetEmailCampaign implements ArrayAccess
'footer' => null,
'sender' => null,
'replyTo' => 'email',
'toField' => 'email',
'toField' => null,
'htmlContent' => null,
'shareLink' => 'url',
'tag' => null,
Expand Down Expand Up @@ -347,9 +347,6 @@ public function listInvalidProperties()
if ($this->container['htmlContent'] === null) {
$invalid_properties[] = "'htmlContent' can't be null";
}
if ($this->container['shareLink'] === null) {
$invalid_properties[] = "'shareLink' can't be null";
}
if ($this->container['tag'] === null) {
$invalid_properties[] = "'tag' can't be null";
}
Expand Down Expand Up @@ -423,9 +420,6 @@ public function valid()
if ($this->container['htmlContent'] === null) {
return false;
}
if ($this->container['shareLink'] === null) {
return false;
}
if ($this->container['tag'] === null) {
return false;
}
Expand Down
8 changes: 1 addition & 7 deletions lib/Model/GetExtendedCampaignOverview.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class GetExtendedCampaignOverview implements ArrayAccess
'footer' => null,
'sender' => null,
'replyTo' => 'email',
'toField' => 'email',
'toField' => null,
'htmlContent' => null,
'shareLink' => 'url',
'tag' => null,
Expand Down Expand Up @@ -347,9 +347,6 @@ public function listInvalidProperties()
if ($this->container['htmlContent'] === null) {
$invalid_properties[] = "'htmlContent' can't be null";
}
if ($this->container['shareLink'] === null) {
$invalid_properties[] = "'shareLink' can't be null";
}
if ($this->container['tag'] === null) {
$invalid_properties[] = "'tag' can't be null";
}
Expand Down Expand Up @@ -423,9 +420,6 @@ public function valid()
if ($this->container['htmlContent'] === null) {
return false;
}
if ($this->container['shareLink'] === null) {
return false;
}
if ($this->container['tag'] === null) {
return false;
}
Expand Down
20 changes: 16 additions & 4 deletions lib/Model/GetExtendedContactDetailsStatisticsLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class GetExtendedContactDetailsStatisticsLinks implements ArrayAccess
*/
protected static $swaggerTypes = [
'count' => 'int',
'eventTime' => '\DateTime',
'eventTime' => 'string',
'ip' => 'string',
'url' => 'string'
];
Expand All @@ -66,7 +66,7 @@ class GetExtendedContactDetailsStatisticsLinks implements ArrayAccess
*/
protected static $swaggerFormats = [
'count' => 'int32',
'eventTime' => 'date-time',
'eventTime' => null,
'ip' => null,
'url' => null
];
Expand Down Expand Up @@ -168,6 +168,10 @@ public function listInvalidProperties()
if ($this->container['eventTime'] === null) {
$invalid_properties[] = "'eventTime' can't be null";
}
if (!preg_match("/^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/", $this->container['eventTime'])) {
$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)?$/.";
}

if ($this->container['ip'] === null) {
$invalid_properties[] = "'ip' can't be null";
}
Expand All @@ -192,6 +196,9 @@ public function valid()
if ($this->container['eventTime'] === null) {
return false;
}
if (!preg_match("/^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/", $this->container['eventTime'])) {
return false;
}
if ($this->container['ip'] === null) {
return false;
}
Expand Down Expand Up @@ -225,7 +232,7 @@ public function setCount($count)

/**
* Gets eventTime
* @return \DateTime
* @return string
*/
public function getEventTime()
{
Expand All @@ -234,11 +241,16 @@ public function getEventTime()

/**
* Sets eventTime
* @param \DateTime $eventTime Date of the event
* @param string $eventTime Date of the event
* @return $this
*/
public function setEventTime($eventTime)
{

if ((!preg_match("/^([1-9]\\d{3}-\\d{2}-\\d{2} [0-2]\\d:[0-5]\\d:[0-5]\\d)?$/", $eventTime))) {
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)?$/.");
}

$this->container['eventTime'] = $eventTime;

return $this;
Expand Down
Loading

0 comments on commit cb6351e

Please sign in to comment.