Skip to content

Commit 8c93479

Browse files
authored
Merge pull request #21 from sendinblue/feature_spec-updates
Mixed spec updates
2 parents c4689d5 + 6896ea6 commit 8c93479

File tree

12 files changed

+221
-28
lines changed

12 files changed

+221
-28
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,19 @@ Class | Method | HTTP request | Description
149149
*ResellerApi* | [**getResellerChilds**](docs/Api/ResellerApi.md#getresellerchilds) | **GET** /reseller/children | Gets the list of all reseller's children accounts
150150
*ResellerApi* | [**removeCredits**](docs/Api/ResellerApi.md#removecredits) | **POST** /reseller/children/{childId}/credits/remove | Remove Email and/or SMS credits from a specific child account
151151
*ResellerApi* | [**updateResellerChild**](docs/Api/ResellerApi.md#updateresellerchild) | **PUT** /reseller/children/{childId} | Updates infos of reseller's child based on the childId supplied
152-
*SMSCampaignsApi* | [**createSMSCampaign**](docs/Api/SMSCampaignsApi.md#createsmscampaign) | **POST** /smsCampaigns | Creates a SMS campaign
152+
*SMSCampaignsApi* | [**createSMSCampaign**](docs/Api/SMSCampaignsApi.md#createsmscampaign) | **POST** /smsCampaigns | Creates an SMS campaign
153153
*SMSCampaignsApi* | [**deleteSMSCampaigns**](docs/Api/SMSCampaignsApi.md#deletesmscampaigns) | **DELETE** /smsCampaigns/{campaignId} | Delete the SMS campaign
154154
*SMSCampaignsApi* | [**getSMSCampaigns**](docs/Api/SMSCampaignsApi.md#getsmscampaigns) | **GET** /smsCampaigns | Returns the informations for all your created SMS campaigns
155-
*SMSCampaignsApi* | [**getSmsCampaign**](docs/Api/SMSCampaignsApi.md#getsmscampaign) | **GET** /smsCampaigns/{campaignId} | Get a SMS campaign
155+
*SMSCampaignsApi* | [**getSmsCampaign**](docs/Api/SMSCampaignsApi.md#getsmscampaign) | **GET** /smsCampaigns/{campaignId} | Get an SMS campaign
156156
*SMSCampaignsApi* | [**requestSMSRecipientExport**](docs/Api/SMSCampaignsApi.md#requestsmsrecipientexport) | **POST** /smsCampaigns/{campaignId}/exportRecipients | Exports the recipients of the specified campaign.
157157
*SMSCampaignsApi* | [**sendSMSCampaignNow**](docs/Api/SMSCampaignsApi.md#sendsmscampaignnow) | **POST** /smsCampaigns/{campaignId}/sendNow | Send your SMS campaign immediately
158158
*SMSCampaignsApi* | [**sendSMSReport**](docs/Api/SMSCampaignsApi.md#sendsmsreport) | **POST** /smsCampaigns/{campaignId}/sendReport | Send report of SMS campaigns
159159
*SMSCampaignsApi* | [**sendTestSms**](docs/Api/SMSCampaignsApi.md#sendtestsms) | **POST** /smsCampaigns/{campaignId}/sendTest | Send an SMS
160160
*SMSCampaignsApi* | [**updateSMSCampaignStatus**](docs/Api/SMSCampaignsApi.md#updatesmscampaignstatus) | **PUT** /smsCampaigns/{campaignId}/status | Update the campaign status
161-
*SMSCampaignsApi* | [**updateSmsCampaign**](docs/Api/SMSCampaignsApi.md#updatesmscampaign) | **PUT** /smsCampaigns/{campaignId} | Updates a SMS campaign
161+
*SMSCampaignsApi* | [**updateSmsCampaign**](docs/Api/SMSCampaignsApi.md#updatesmscampaign) | **PUT** /smsCampaigns/{campaignId} | Updates an SMS campaign
162162
*SMTPApi* | [**createSmtpTemplate**](docs/Api/SMTPApi.md#createsmtptemplate) | **POST** /smtp/templates | Create an smtp template
163163
*SMTPApi* | [**deleteHardbounces**](docs/Api/SMTPApi.md#deletehardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces
164+
*SMTPApi* | [**deleteSmtpTemplate**](docs/Api/SMTPApi.md#deletesmtptemplate) | **DELETE** /smtp/templates/{templateId} | Delete an inactive smtp template
164165
*SMTPApi* | [**getAggregatedSmtpReport**](docs/Api/SMTPApi.md#getaggregatedsmtpreport) | **GET** /smtp/statistics/aggregatedReport | Get your SMTP activity aggregated over a period of time
165166
*SMTPApi* | [**getEmailEventReport**](docs/Api/SMTPApi.md#getemaileventreport) | **GET** /smtp/statistics/events | Get all your SMTP activity (unaggregated events)
166167
*SMTPApi* | [**getSmtpReport**](docs/Api/SMTPApi.md#getsmtpreport) | **GET** /smtp/statistics/reports | Get your SMTP activity aggregated per day

docs/Api/ContactsApi.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ Name | Type | Description | Notes
554554
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
555555

556556
# **getContacts**
557-
> \SendinBlue\Client\Model\GetContacts getContacts($limit, $offset)
557+
> \SendinBlue\Client\Model\GetContacts getContacts($limit, $offset, $modifiedSince)
558558
559559
Get all the contacts
560560

@@ -571,9 +571,10 @@ SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key',
571571
$api_instance = new SendinBlue\Client\Api\ContactsApi();
572572
$limit = 50; // int | Number of documents per page
573573
$offset = 0; // int | Index of the first document of the page
574+
$modifiedSince = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ)
574575

575576
try {
576-
$result = $api_instance->getContacts($limit, $offset);
577+
$result = $api_instance->getContacts($limit, $offset, $modifiedSince);
577578
print_r($result);
578579
} catch (Exception $e) {
579580
echo 'Exception when calling ContactsApi->getContacts: ', $e->getMessage(), PHP_EOL;
@@ -587,6 +588,7 @@ Name | Type | Description | Notes
587588
------------- | ------------- | ------------- | -------------
588589
**limit** | **int**| Number of documents per page | [optional] [default to 50]
589590
**offset** | **int**| Index of the first document of the page | [optional] [default to 0]
591+
**modifiedSince** | **\DateTime**| Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional]
590592

591593
### Return type
592594

docs/Api/SMSCampaignsApi.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ All URIs are relative to *https://api.sendinblue.com/v3*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7-
[**createSMSCampaign**](SMSCampaignsApi.md#createSMSCampaign) | **POST** /smsCampaigns | Creates a SMS campaign
7+
[**createSMSCampaign**](SMSCampaignsApi.md#createSMSCampaign) | **POST** /smsCampaigns | Creates an SMS campaign
88
[**deleteSMSCampaigns**](SMSCampaignsApi.md#deleteSMSCampaigns) | **DELETE** /smsCampaigns/{campaignId} | Delete the SMS campaign
99
[**getSMSCampaigns**](SMSCampaignsApi.md#getSMSCampaigns) | **GET** /smsCampaigns | Returns the informations for all your created SMS campaigns
10-
[**getSmsCampaign**](SMSCampaignsApi.md#getSmsCampaign) | **GET** /smsCampaigns/{campaignId} | Get a SMS campaign
10+
[**getSmsCampaign**](SMSCampaignsApi.md#getSmsCampaign) | **GET** /smsCampaigns/{campaignId} | Get an SMS campaign
1111
[**requestSMSRecipientExport**](SMSCampaignsApi.md#requestSMSRecipientExport) | **POST** /smsCampaigns/{campaignId}/exportRecipients | Exports the recipients of the specified campaign.
1212
[**sendSMSCampaignNow**](SMSCampaignsApi.md#sendSMSCampaignNow) | **POST** /smsCampaigns/{campaignId}/sendNow | Send your SMS campaign immediately
1313
[**sendSMSReport**](SMSCampaignsApi.md#sendSMSReport) | **POST** /smsCampaigns/{campaignId}/sendReport | Send report of SMS campaigns
1414
[**sendTestSms**](SMSCampaignsApi.md#sendTestSms) | **POST** /smsCampaigns/{campaignId}/sendTest | Send an SMS
1515
[**updateSMSCampaignStatus**](SMSCampaignsApi.md#updateSMSCampaignStatus) | **PUT** /smsCampaigns/{campaignId}/status | Update the campaign status
16-
[**updateSmsCampaign**](SMSCampaignsApi.md#updateSmsCampaign) | **PUT** /smsCampaigns/{campaignId} | Updates a SMS campaign
16+
[**updateSmsCampaign**](SMSCampaignsApi.md#updateSmsCampaign) | **PUT** /smsCampaigns/{campaignId} | Updates an SMS campaign
1717

1818

1919
# **createSMSCampaign**
2020
> \SendinBlue\Client\Model\CreateModel createSMSCampaign($createSmsCampaign)
2121
22-
Creates a SMS campaign
22+
Creates an SMS campaign
2323

2424
### Example
2525
```php
@@ -166,7 +166,7 @@ Name | Type | Description | Notes
166166
# **getSmsCampaign**
167167
> \SendinBlue\Client\Model\GetSmsCampaign getSmsCampaign($campaignId, $getSmsCampaign)
168168
169-
Get a SMS campaign
169+
Get an SMS campaign
170170

171171
### Example
172172
```php
@@ -464,7 +464,7 @@ void (empty response body)
464464
# **updateSmsCampaign**
465465
> updateSmsCampaign($campaignId, $updateSmsCampaign)
466466
467-
Updates a SMS campaign
467+
Updates an SMS campaign
468468

469469
### Example
470470
```php

docs/Api/SMTPApi.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**createSmtpTemplate**](SMTPApi.md#createSmtpTemplate) | **POST** /smtp/templates | Create an smtp template
88
[**deleteHardbounces**](SMTPApi.md#deleteHardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces
9+
[**deleteSmtpTemplate**](SMTPApi.md#deleteSmtpTemplate) | **DELETE** /smtp/templates/{templateId} | Delete an inactive smtp template
910
[**getAggregatedSmtpReport**](SMTPApi.md#getAggregatedSmtpReport) | **GET** /smtp/statistics/aggregatedReport | Get your SMTP activity aggregated over a period of time
1011
[**getEmailEventReport**](SMTPApi.md#getEmailEventReport) | **GET** /smtp/statistics/events | Get all your SMTP activity (unaggregated events)
1112
[**getSmtpReport**](SMTPApi.md#getSmtpReport) | **GET** /smtp/statistics/reports | Get your SMTP activity aggregated per day
@@ -114,6 +115,53 @@ void (empty response body)
114115

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

118+
# **deleteSmtpTemplate**
119+
> deleteSmtpTemplate($templateId)
120+
121+
Delete an inactive smtp template
122+
123+
### Example
124+
```php
125+
<?php
126+
require_once(__DIR__ . '/vendor/autoload.php');
127+
128+
// Configure API key authorization: api-key
129+
SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', 'YOUR_API_KEY');
130+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
131+
// SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
132+
133+
$api_instance = new SendinBlue\Client\Api\SMTPApi();
134+
$templateId = 789; // int | id of the template
135+
136+
try {
137+
$api_instance->deleteSmtpTemplate($templateId);
138+
} catch (Exception $e) {
139+
echo 'Exception when calling SMTPApi->deleteSmtpTemplate: ', $e->getMessage(), PHP_EOL;
140+
}
141+
?>
142+
```
143+
144+
### Parameters
145+
146+
Name | Type | Description | Notes
147+
------------- | ------------- | ------------- | -------------
148+
**templateId** | **int**| id of the template |
149+
150+
### Return type
151+
152+
void (empty response body)
153+
154+
### Authorization
155+
156+
[api-key](../../README.md#api-key)
157+
158+
### HTTP request headers
159+
160+
- **Content-Type**: application/json
161+
- **Accept**: application/json
162+
163+
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
164+
117165
# **getAggregatedSmtpReport**
118166
> \SendinBlue\Client\Model\GetAggregatedReport getAggregatedSmtpReport($startDate, $endDate, $days, $tag)
119167

docs/Model/CreateContact.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
88
**emailBlacklisted** | **bool** | Blacklist the contact for emails (emailBlacklisted &#x3D; true) | [optional]
99
**smsBlacklisted** | **bool** | Blacklist the contact for SMS (smsBlacklisted &#x3D; true) | [optional]
1010
**listIds** | **int[]** | Ids of the lists to add the contact to | [optional]
11+
**updateEnabled** | **bool** | Facilitate to update existing contact in same request (updateEnabled &#x3D; true) | [optional] [default to false]
1112

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

lib/Api/ContactsApi.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,12 +1088,13 @@ public function getContactStatsWithHttpInfo($email)
10881088
*
10891089
* @param int $limit Number of documents per page (optional, default to 50)
10901090
* @param int $offset Index of the first document of the page (optional, default to 0)
1091+
* @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) (optional)
10911092
* @throws \SendinBlue\Client\ApiException on non-2xx response
10921093
* @return \SendinBlue\Client\Model\GetContacts
10931094
*/
1094-
public function getContacts($limit = '50', $offset = '0')
1095+
public function getContacts($limit = '50', $offset = '0', $modifiedSince = null)
10951096
{
1096-
list($response) = $this->getContactsWithHttpInfo($limit, $offset);
1097+
list($response) = $this->getContactsWithHttpInfo($limit, $offset, $modifiedSince);
10971098
return $response;
10981099
}
10991100

@@ -1104,10 +1105,11 @@ public function getContacts($limit = '50', $offset = '0')
11041105
*
11051106
* @param int $limit Number of documents per page (optional, default to 50)
11061107
* @param int $offset Index of the first document of the page (optional, default to 0)
1108+
* @param \DateTime $modifiedSince Filter (urlencoded) the contacts modified after a given date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) (optional)
11071109
* @throws \SendinBlue\Client\ApiException on non-2xx response
11081110
* @return array of \SendinBlue\Client\Model\GetContacts, HTTP status code, HTTP response headers (array of strings)
11091111
*/
1110-
public function getContactsWithHttpInfo($limit = '50', $offset = '0')
1112+
public function getContactsWithHttpInfo($limit = '50', $offset = '0', $modifiedSince = null)
11111113
{
11121114
if (!is_null($limit) && ($limit > 1000)) {
11131115
throw new \InvalidArgumentException('invalid value for "$limit" when calling ContactsApi.getContacts, must be smaller than or equal to 1000.');
@@ -1133,6 +1135,10 @@ public function getContactsWithHttpInfo($limit = '50', $offset = '0')
11331135
if ($offset !== null) {
11341136
$queryParams['offset'] = $this->apiClient->getSerializer()->toQueryValue($offset);
11351137
}
1138+
// query params
1139+
if ($modifiedSince !== null) {
1140+
$queryParams['modifiedSince'] = $this->apiClient->getSerializer()->toQueryValue($modifiedSince);
1141+
}
11361142

11371143
// for model (json/xml)
11381144
if (isset($_tempBody)) {

lib/Api/SMSCampaignsApi.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function setApiClient(\SendinBlue\Client\ApiClient $apiClient)
9090
/**
9191
* Operation createSMSCampaign
9292
*
93-
* Creates a SMS campaign
93+
* Creates an SMS campaign
9494
*
9595
* @param \SendinBlue\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
9696
* @throws \SendinBlue\Client\ApiException on non-2xx response
@@ -105,7 +105,7 @@ public function createSMSCampaign($createSmsCampaign)
105105
/**
106106
* Operation createSMSCampaignWithHttpInfo
107107
*
108-
* Creates a SMS campaign
108+
* Creates an SMS campaign
109109
*
110110
* @param \SendinBlue\Client\Model\CreateSmsCampaign $createSmsCampaign Values to create an SMS Campaign (required)
111111
* @throws \SendinBlue\Client\ApiException on non-2xx response
@@ -368,7 +368,7 @@ public function getSMSCampaignsWithHttpInfo($status = null, $limit = '500', $off
368368
/**
369369
* Operation getSmsCampaign
370370
*
371-
* Get a SMS campaign
371+
* Get an SMS campaign
372372
*
373373
* @param int $campaignId id of the SMS campaign (required)
374374
* @param \SendinBlue\Client\Model\GetSmsCampaign $getSmsCampaign Values to update an SMS Campaign (required)
@@ -384,7 +384,7 @@ public function getSmsCampaign($campaignId, $getSmsCampaign)
384384
/**
385385
* Operation getSmsCampaignWithHttpInfo
386386
*
387-
* Get a SMS campaign
387+
* Get an SMS campaign
388388
*
389389
* @param int $campaignId id of the SMS campaign (required)
390390
* @param \SendinBlue\Client\Model\GetSmsCampaign $getSmsCampaign Values to update an SMS Campaign (required)
@@ -977,7 +977,7 @@ public function updateSMSCampaignStatusWithHttpInfo($campaignId, $status)
977977
/**
978978
* Operation updateSmsCampaign
979979
*
980-
* Updates a SMS campaign
980+
* Updates an SMS campaign
981981
*
982982
* @param int $campaignId id of the SMS campaign (required)
983983
* @param \SendinBlue\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)
@@ -993,7 +993,7 @@ public function updateSmsCampaign($campaignId, $updateSmsCampaign)
993993
/**
994994
* Operation updateSmsCampaignWithHttpInfo
995995
*
996-
* Updates a SMS campaign
996+
* Updates an SMS campaign
997997
*
998998
* @param int $campaignId id of the SMS campaign (required)
999999
* @param \SendinBlue\Client\Model\UpdateSmsCampaign $updateSmsCampaign Values to update an SMS Campaign (required)

lib/Api/SMTPApi.php

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,97 @@ public function deleteHardbouncesWithHttpInfo($deleteHardbounces = null)
255255
}
256256
}
257257

258+
/**
259+
* Operation deleteSmtpTemplate
260+
*
261+
* Delete an inactive smtp template
262+
*
263+
* @param int $templateId id of the template (required)
264+
* @throws \SendinBlue\Client\ApiException on non-2xx response
265+
* @return void
266+
*/
267+
public function deleteSmtpTemplate($templateId)
268+
{
269+
list($response) = $this->deleteSmtpTemplateWithHttpInfo($templateId);
270+
return $response;
271+
}
272+
273+
/**
274+
* Operation deleteSmtpTemplateWithHttpInfo
275+
*
276+
* Delete an inactive smtp template
277+
*
278+
* @param int $templateId id of the template (required)
279+
* @throws \SendinBlue\Client\ApiException on non-2xx response
280+
* @return array of null, HTTP status code, HTTP response headers (array of strings)
281+
*/
282+
public function deleteSmtpTemplateWithHttpInfo($templateId)
283+
{
284+
// verify the required parameter 'templateId' is set
285+
if ($templateId === null) {
286+
throw new \InvalidArgumentException('Missing the required parameter $templateId when calling deleteSmtpTemplate');
287+
}
288+
// parse inputs
289+
$resourcePath = "/smtp/templates/{templateId}";
290+
$httpBody = '';
291+
$queryParams = [];
292+
$headerParams = [];
293+
$formParams = [];
294+
$_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);
295+
if (!is_null($_header_accept)) {
296+
$headerParams['Accept'] = $_header_accept;
297+
}
298+
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);
299+
300+
// path params
301+
if ($templateId !== null) {
302+
$resourcePath = str_replace(
303+
"{" . "templateId" . "}",
304+
$this->apiClient->getSerializer()->toPathValue($templateId),
305+
$resourcePath
306+
);
307+
}
308+
309+
// for model (json/xml)
310+
if (isset($_tempBody)) {
311+
$httpBody = $_tempBody; // $_tempBody is the method argument, if present
312+
} elseif (count($formParams) > 0) {
313+
$httpBody = $formParams; // for HTTP post (form)
314+
}
315+
// this endpoint requires API key authentication
316+
$apiKey = $this->apiClient->getApiKeyWithPrefix('api-key');
317+
if (strlen($apiKey) !== 0) {
318+
$headerParams['api-key'] = $apiKey;
319+
}
320+
// make the API Call
321+
try {
322+
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
323+
$resourcePath,
324+
'DELETE',
325+
$queryParams,
326+
$httpBody,
327+
$headerParams,
328+
null,
329+
'/smtp/templates/{templateId}'
330+
);
331+
332+
return [null, $statusCode, $httpHeader];
333+
} catch (ApiException $e) {
334+
switch ($e->getCode()) {
335+
case 400:
336+
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
337+
$e->setResponseObject($data);
338+
break;
339+
case 404:
340+
$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\SendinBlue\Client\Model\ErrorModel', $e->getResponseHeaders());
341+
$e->setResponseObject($data);
342+
break;
343+
}
344+
345+
throw $e;
346+
}
347+
}
348+
258349
/**
259350
* Operation getAggregatedSmtpReport
260351
*

0 commit comments

Comments
 (0)