Skip to content

Commit dc89982

Browse files
Merge pull request #9 from sendinblue/feature_updated_swagger_sync
swagger sync: delete route added for templates
2 parents a844a83 + 2f50ed0 commit dc89982

12 files changed

+168
-30
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,19 @@ Class | Method | HTTP request | Description
143143
*SibApiV3Sdk::ResellerApi* | [**get_reseller_childs**](docs/ResellerApi.md#get_reseller_childs) | **GET** /reseller/children | Gets the list of all reseller's children accounts
144144
*SibApiV3Sdk::ResellerApi* | [**remove_credits**](docs/ResellerApi.md#remove_credits) | **POST** /reseller/children/{childId}/credits/remove | Remove Email and/or SMS credits from a specific child account
145145
*SibApiV3Sdk::ResellerApi* | [**update_reseller_child**](docs/ResellerApi.md#update_reseller_child) | **PUT** /reseller/children/{childId} | Updates infos of reseller's child based on the childId supplied
146-
*SibApiV3Sdk::SMSCampaignsApi* | [**create_sms_campaign**](docs/SMSCampaignsApi.md#create_sms_campaign) | **POST** /smsCampaigns | Creates a SMS campaign
146+
*SibApiV3Sdk::SMSCampaignsApi* | [**create_sms_campaign**](docs/SMSCampaignsApi.md#create_sms_campaign) | **POST** /smsCampaigns | Creates an SMS campaign
147147
*SibApiV3Sdk::SMSCampaignsApi* | [**delete_sms_campaigns**](docs/SMSCampaignsApi.md#delete_sms_campaigns) | **DELETE** /smsCampaigns/{campaignId} | Delete the SMS campaign
148-
*SibApiV3Sdk::SMSCampaignsApi* | [**get_sms_campaign**](docs/SMSCampaignsApi.md#get_sms_campaign) | **GET** /smsCampaigns/{campaignId} | Get a SMS campaign
148+
*SibApiV3Sdk::SMSCampaignsApi* | [**get_sms_campaign**](docs/SMSCampaignsApi.md#get_sms_campaign) | **GET** /smsCampaigns/{campaignId} | Get an SMS campaign
149149
*SibApiV3Sdk::SMSCampaignsApi* | [**get_sms_campaigns**](docs/SMSCampaignsApi.md#get_sms_campaigns) | **GET** /smsCampaigns | Returns the informations for all your created SMS campaigns
150150
*SibApiV3Sdk::SMSCampaignsApi* | [**request_sms_recipient_export**](docs/SMSCampaignsApi.md#request_sms_recipient_export) | **POST** /smsCampaigns/{campaignId}/exportRecipients | Exports the recipients of the specified campaign.
151151
*SibApiV3Sdk::SMSCampaignsApi* | [**send_sms_campaign_now**](docs/SMSCampaignsApi.md#send_sms_campaign_now) | **POST** /smsCampaigns/{campaignId}/sendNow | Send your SMS campaign immediately
152152
*SibApiV3Sdk::SMSCampaignsApi* | [**send_sms_report**](docs/SMSCampaignsApi.md#send_sms_report) | **POST** /smsCampaigns/{campaignId}/sendReport | Send report of SMS campaigns
153153
*SibApiV3Sdk::SMSCampaignsApi* | [**send_test_sms**](docs/SMSCampaignsApi.md#send_test_sms) | **POST** /smsCampaigns/{campaignId}/sendTest | Send an SMS
154-
*SibApiV3Sdk::SMSCampaignsApi* | [**update_sms_campaign**](docs/SMSCampaignsApi.md#update_sms_campaign) | **PUT** /smsCampaigns/{campaignId} | Updates a SMS campaign
154+
*SibApiV3Sdk::SMSCampaignsApi* | [**update_sms_campaign**](docs/SMSCampaignsApi.md#update_sms_campaign) | **PUT** /smsCampaigns/{campaignId} | Updates an SMS campaign
155155
*SibApiV3Sdk::SMSCampaignsApi* | [**update_sms_campaign_status**](docs/SMSCampaignsApi.md#update_sms_campaign_status) | **PUT** /smsCampaigns/{campaignId}/status | Update the campaign status
156156
*SibApiV3Sdk::SMTPApi* | [**create_smtp_template**](docs/SMTPApi.md#create_smtp_template) | **POST** /smtp/templates | Create an smtp template
157157
*SibApiV3Sdk::SMTPApi* | [**delete_hardbounces**](docs/SMTPApi.md#delete_hardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces
158+
*SibApiV3Sdk::SMTPApi* | [**delete_smtp_template**](docs/SMTPApi.md#delete_smtp_template) | **DELETE** /smtp/templates/{templateId} | Delete an inactive smtp template
158159
*SibApiV3Sdk::SMTPApi* | [**get_aggregated_smtp_report**](docs/SMTPApi.md#get_aggregated_smtp_report) | **GET** /smtp/statistics/aggregatedReport | Get your SMTP activity aggregated over a period of time
159160
*SibApiV3Sdk::SMTPApi* | [**get_email_event_report**](docs/SMTPApi.md#get_email_event_report) | **GET** /smtp/statistics/events | Get all your SMTP activity (unaggregated events)
160161
*SibApiV3Sdk::SMTPApi* | [**get_smtp_report**](docs/SMTPApi.md#get_smtp_report) | **GET** /smtp/statistics/reports | Get your SMTP activity aggregated per day

docs/CreateContact.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ Name | Type | Description | Notes
88
**email_blacklisted** | **BOOLEAN** | Blacklist the contact for emails (emailBlacklisted = true) | [optional]
99
**sms_blacklisted** | **BOOLEAN** | Blacklist the contact for SMS (smsBlacklisted = true) | [optional]
1010
**list_ids** | **Array<Integer>** | Ids of the lists to add the contact to | [optional]
11+
**update_enabled** | **BOOLEAN** | Facilitate to update existing contact in same request (updateEnabled = true) | [optional] [default to false]
1112

1213

docs/SMSCampaignsApi.md

Lines changed: 9 additions & 9 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-
[**create_sms_campaign**](SMSCampaignsApi.md#create_sms_campaign) | **POST** /smsCampaigns | Creates a SMS campaign
7+
[**create_sms_campaign**](SMSCampaignsApi.md#create_sms_campaign) | **POST** /smsCampaigns | Creates an SMS campaign
88
[**delete_sms_campaigns**](SMSCampaignsApi.md#delete_sms_campaigns) | **DELETE** /smsCampaigns/{campaignId} | Delete the SMS campaign
9-
[**get_sms_campaign**](SMSCampaignsApi.md#get_sms_campaign) | **GET** /smsCampaigns/{campaignId} | Get a SMS campaign
9+
[**get_sms_campaign**](SMSCampaignsApi.md#get_sms_campaign) | **GET** /smsCampaigns/{campaignId} | Get an SMS campaign
1010
[**get_sms_campaigns**](SMSCampaignsApi.md#get_sms_campaigns) | **GET** /smsCampaigns | Returns the informations for all your created SMS campaigns
1111
[**request_sms_recipient_export**](SMSCampaignsApi.md#request_sms_recipient_export) | **POST** /smsCampaigns/{campaignId}/exportRecipients | Exports the recipients of the specified campaign.
1212
[**send_sms_campaign_now**](SMSCampaignsApi.md#send_sms_campaign_now) | **POST** /smsCampaigns/{campaignId}/sendNow | Send your SMS campaign immediately
1313
[**send_sms_report**](SMSCampaignsApi.md#send_sms_report) | **POST** /smsCampaigns/{campaignId}/sendReport | Send report of SMS campaigns
1414
[**send_test_sms**](SMSCampaignsApi.md#send_test_sms) | **POST** /smsCampaigns/{campaignId}/sendTest | Send an SMS
15-
[**update_sms_campaign**](SMSCampaignsApi.md#update_sms_campaign) | **PUT** /smsCampaigns/{campaignId} | Updates a SMS campaign
15+
[**update_sms_campaign**](SMSCampaignsApi.md#update_sms_campaign) | **PUT** /smsCampaigns/{campaignId} | Updates an SMS campaign
1616
[**update_sms_campaign_status**](SMSCampaignsApi.md#update_sms_campaign_status) | **PUT** /smsCampaigns/{campaignId}/status | Update the campaign status
1717

1818

1919
# **create_sms_campaign**
2020
> CreateModel create_sms_campaign(create_sms_campaign)
2121
22-
Creates a SMS campaign
22+
Creates an SMS campaign
2323

2424
### Example
2525
```ruby
@@ -39,7 +39,7 @@ create_sms_campaign = SibApiV3Sdk::CreateSmsCampaign.new # CreateSmsCampaign | V
3939

4040

4141
begin
42-
#Creates a SMS campaign
42+
#Creates an SMS campaign
4343
result = api_instance.create_sms_campaign(create_sms_campaign)
4444
p result
4545
rescue SibApiV3Sdk::ApiError => e
@@ -122,7 +122,7 @@ nil (empty response body)
122122
# **get_sms_campaign**
123123
> GetSmsCampaign get_sms_campaign(campaign_id, get_sms_campaign)
124124
125-
Get a SMS campaign
125+
Get an SMS campaign
126126

127127
### Example
128128
```ruby
@@ -144,7 +144,7 @@ get_sms_campaign = SibApiV3Sdk::GetSmsCampaign.new # GetSmsCampaign | Values to
144144

145145

146146
begin
147-
#Get a SMS campaign
147+
#Get an SMS campaign
148148
result = api_instance.get_sms_campaign(campaign_id, get_sms_campaign)
149149
p result
150150
rescue SibApiV3Sdk::ApiError => e
@@ -453,7 +453,7 @@ nil (empty response body)
453453
# **update_sms_campaign**
454454
> update_sms_campaign(campaign_id, update_sms_campaign)
455455
456-
Updates a SMS campaign
456+
Updates an SMS campaign
457457

458458
### Example
459459
```ruby
@@ -475,7 +475,7 @@ update_sms_campaign = SibApiV3Sdk::UpdateSmsCampaign.new # UpdateSmsCampaign | V
475475

476476

477477
begin
478-
#Updates a SMS campaign
478+
#Updates an SMS campaign
479479
api_instance.update_sms_campaign(campaign_id, update_sms_campaign)
480480
rescue SibApiV3Sdk::ApiError => e
481481
puts "Exception when calling SMSCampaignsApi->update_sms_campaign: #{e}"

docs/SMTPApi.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**create_smtp_template**](SMTPApi.md#create_smtp_template) | **POST** /smtp/templates | Create an smtp template
88
[**delete_hardbounces**](SMTPApi.md#delete_hardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces
9+
[**delete_smtp_template**](SMTPApi.md#delete_smtp_template) | **DELETE** /smtp/templates/{templateId} | Delete an inactive smtp template
910
[**get_aggregated_smtp_report**](SMTPApi.md#get_aggregated_smtp_report) | **GET** /smtp/statistics/aggregatedReport | Get your SMTP activity aggregated over a period of time
1011
[**get_email_event_report**](SMTPApi.md#get_email_event_report) | **GET** /smtp/statistics/events | Get all your SMTP activity (unaggregated events)
1112
[**get_smtp_report**](SMTPApi.md#get_smtp_report) | **GET** /smtp/statistics/reports | Get your SMTP activity aggregated per day
@@ -123,6 +124,57 @@ nil (empty response body)
123124

124125

125126

127+
# **delete_smtp_template**
128+
> delete_smtp_template(template_id)
129+
130+
Delete an inactive smtp template
131+
132+
### Example
133+
```ruby
134+
# load the gem
135+
require 'sib-api-v3-sdk'
136+
# setup authorization
137+
SibApiV3Sdk.configure do |config|
138+
# Configure API key authorization: api-key
139+
config.api_key['api-key'] = 'YOUR API KEY'
140+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
141+
#config.api_key_prefix['api-key'] = 'Bearer'
142+
end
143+
144+
api_instance = SibApiV3Sdk::SMTPApi.new
145+
146+
template_id = 789 # Integer | id of the template
147+
148+
149+
begin
150+
#Delete an inactive smtp template
151+
api_instance.delete_smtp_template(template_id)
152+
rescue SibApiV3Sdk::ApiError => e
153+
puts "Exception when calling SMTPApi->delete_smtp_template: #{e}"
154+
end
155+
```
156+
157+
### Parameters
158+
159+
Name | Type | Description | Notes
160+
------------- | ------------- | ------------- | -------------
161+
**template_id** | **Integer**| id of the template |
162+
163+
### Return type
164+
165+
nil (empty response body)
166+
167+
### Authorization
168+
169+
[api-key](../README.md#api-key)
170+
171+
### HTTP request headers
172+
173+
- **Content-Type**: application/json
174+
- **Accept**: application/json
175+
176+
177+
126178
# **get_aggregated_smtp_report**
127179
> GetAggregatedReport get_aggregated_smtp_report(opts)
128180

lib/sib-api-v3-sdk/api/email_campaigns_api.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ def get_email_campaigns_with_http_info(opts = {})
269269
if @api_client.config.client_side_validation && opts[:'type'] && !['classic', 'trigger'].include?(opts[:'type'])
270270
fail ArgumentError, 'invalid value for "type", must be one of classic, trigger'
271271
end
272-
if @api_client.config.client_side_validation && opts[:'status'] && !['suspended', 'archive', 'darchive', 'sent', 'queued', 'replicate', 'draft', 'inProcess'].include?(opts[:'status'])
273-
fail ArgumentError, 'invalid value for "status", must be one of suspended, archive, darchive, sent, queued, replicate, draft, inProcess'
272+
if @api_client.config.client_side_validation && opts[:'status'] && !['suspended', 'archive', 'sent', 'queued', 'draft', 'inProcess'].include?(opts[:'status'])
273+
fail ArgumentError, 'invalid value for "status", must be one of suspended, archive, sent, queued, draft, inProcess'
274274
end
275275
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
276276
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EmailCampaignsApi.get_email_campaigns, must be smaller than or equal to 1000.'

lib/sib-api-v3-sdk/api/sms_campaigns_api.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def initialize(api_client = ApiClient.default)
2020
@api_client = api_client
2121
end
2222

23-
# Creates a SMS campaign
23+
# Creates an SMS campaign
2424
#
2525
# @param create_sms_campaign Values to create an SMS Campaign
2626
# @param [Hash] opts the optional parameters
@@ -30,7 +30,7 @@ def create_sms_campaign(create_sms_campaign, opts = {})
3030
return data
3131
end
3232

33-
# Creates a SMS campaign
33+
# Creates an SMS campaign
3434
#
3535
# @param create_sms_campaign Values to create an SMS Campaign
3636
# @param [Hash] opts the optional parameters
@@ -129,7 +129,7 @@ def delete_sms_campaigns_with_http_info(campaign_id, opts = {})
129129
return data, status_code, headers
130130
end
131131

132-
# Get a SMS campaign
132+
# Get an SMS campaign
133133
#
134134
# @param campaign_id id of the SMS campaign
135135
# @param get_sms_campaign Values to update an SMS Campaign
@@ -140,7 +140,7 @@ def get_sms_campaign(campaign_id, get_sms_campaign, opts = {})
140140
return data
141141
end
142142

143-
# Get a SMS campaign
143+
# Get an SMS campaign
144144
#
145145
# @param campaign_id id of the SMS campaign
146146
# @param get_sms_campaign Values to update an SMS Campaign
@@ -213,8 +213,8 @@ def get_sms_campaigns_with_http_info(opts = {})
213213
if @api_client.config.debugging
214214
@api_client.config.logger.debug "Calling API: SMSCampaignsApi.get_sms_campaigns ..."
215215
end
216-
if @api_client.config.client_side_validation && opts[:'status'] && !['suspended', 'archived', 'darchived', 'sent', 'queued', 'replicate', 'draft', 'inProcess'].include?(opts[:'status'])
217-
fail ArgumentError, 'invalid value for "status", must be one of suspended, archived, darchived, sent, queued, replicate, draft, inProcess'
216+
if @api_client.config.client_side_validation && opts[:'status'] && !['suspended', 'archived', 'sent', 'queued', 'draft', 'inProcess'].include?(opts[:'status'])
217+
fail ArgumentError, 'invalid value for "status", must be one of suspended, archived, sent, queued, draft, inProcess'
218218
end
219219
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
220220
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMSCampaignsApi.get_sms_campaigns, must be smaller than or equal to 1000.'
@@ -486,7 +486,7 @@ def send_test_sms_with_http_info(campaign_id, send_test_sms, opts = {})
486486
return data, status_code, headers
487487
end
488488

489-
# Updates a SMS campaign
489+
# Updates an SMS campaign
490490
#
491491
# @param campaign_id id of the SMS campaign
492492
# @param update_sms_campaign Values to update an SMS Campaign
@@ -497,7 +497,7 @@ def update_sms_campaign(campaign_id, update_sms_campaign, opts = {})
497497
return nil
498498
end
499499

500-
# Updates a SMS campaign
500+
# Updates an SMS campaign
501501
#
502502
# @param campaign_id id of the SMS campaign
503503
# @param update_sms_campaign Values to update an SMS Campaign

lib/sib-api-v3-sdk/api/smtp_api.rb

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,60 @@ def delete_hardbounces_with_http_info(opts = {})
125125
return data, status_code, headers
126126
end
127127

128+
# Delete an inactive smtp template
129+
#
130+
# @param template_id id of the template
131+
# @param [Hash] opts the optional parameters
132+
# @return [nil]
133+
def delete_smtp_template(template_id, opts = {})
134+
delete_smtp_template_with_http_info(template_id, opts)
135+
return nil
136+
end
137+
138+
# Delete an inactive smtp template
139+
#
140+
# @param template_id id of the template
141+
# @param [Hash] opts the optional parameters
142+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
143+
def delete_smtp_template_with_http_info(template_id, opts = {})
144+
if @api_client.config.debugging
145+
@api_client.config.logger.debug "Calling API: SMTPApi.delete_smtp_template ..."
146+
end
147+
# verify the required parameter 'template_id' is set
148+
if @api_client.config.client_side_validation && template_id.nil?
149+
fail ArgumentError, "Missing the required parameter 'template_id' when calling SMTPApi.delete_smtp_template"
150+
end
151+
# resource path
152+
local_var_path = "/smtp/templates/{templateId}".sub('{' + 'templateId' + '}', template_id.to_s)
153+
154+
# query parameters
155+
query_params = {}
156+
157+
# header parameters
158+
header_params = {}
159+
# HTTP header 'Accept' (if needed)
160+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
161+
# HTTP header 'Content-Type'
162+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
163+
164+
# form parameters
165+
form_params = {}
166+
167+
# http body (model)
168+
post_body = nil
169+
auth_names = ['api-key']
170+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
171+
:header_params => header_params,
172+
:query_params => query_params,
173+
:form_params => form_params,
174+
:body => post_body,
175+
:auth_names => auth_names)
176+
if @api_client.config.debugging
177+
@api_client.config.logger.debug "API called: SMTPApi#delete_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
178+
end
179+
return data, status_code, headers
180+
end
181+
128182
# Get your SMTP activity aggregated over a period of time
129183
#
130184
# @param [Hash] opts the optional parameters

lib/sib-api-v3-sdk/models/create_contact.rb

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class CreateContact
3030
# Ids of the lists to add the contact to
3131
attr_accessor :list_ids
3232

33+
# Facilitate to update existing contact in same request (updateEnabled = true)
34+
attr_accessor :update_enabled
35+
3336

3437
# Attribute mapping from ruby-style variable name to JSON key.
3538
def self.attribute_map
@@ -38,7 +41,8 @@ def self.attribute_map
3841
:'attributes' => :'attributes',
3942
:'email_blacklisted' => :'emailBlacklisted',
4043
:'sms_blacklisted' => :'smsBlacklisted',
41-
:'list_ids' => :'listIds'
44+
:'list_ids' => :'listIds',
45+
:'update_enabled' => :'updateEnabled'
4246
}
4347
end
4448

@@ -49,7 +53,8 @@ def self.swagger_types
4953
:'attributes' => :'Object',
5054
:'email_blacklisted' => :'BOOLEAN',
5155
:'sms_blacklisted' => :'BOOLEAN',
52-
:'list_ids' => :'Array<Integer>'
56+
:'list_ids' => :'Array<Integer>',
57+
:'update_enabled' => :'BOOLEAN'
5358
}
5459
end
5560

@@ -83,6 +88,12 @@ def initialize(attributes = {})
8388
end
8489
end
8590

91+
if attributes.has_key?(:'updateEnabled')
92+
self.update_enabled = attributes[:'updateEnabled']
93+
else
94+
self.update_enabled = false
95+
end
96+
8697
end
8798

8899
# Show invalid properties with the reasons. Usually used together with valid?
@@ -107,7 +118,8 @@ def ==(o)
107118
attributes == o.attributes &&
108119
email_blacklisted == o.email_blacklisted &&
109120
sms_blacklisted == o.sms_blacklisted &&
110-
list_ids == o.list_ids
121+
list_ids == o.list_ids &&
122+
update_enabled == o.update_enabled
111123
end
112124

113125
# @see the `==` method
@@ -119,7 +131,7 @@ def eql?(o)
119131
# Calculates hash code according to all attributes.
120132
# @return [Fixnum] Hash code
121133
def hash
122-
[email, attributes, email_blacklisted, sms_blacklisted, list_ids].hash
134+
[email, attributes, email_blacklisted, sms_blacklisted, list_ids, update_enabled].hash
123135
end
124136

125137
# Builds the object from hash

lib/sib-api-v3-sdk/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
=end
1212

1313
module SibApiV3Sdk
14-
VERSION = "2.1.2"
14+
VERSION = "2.1.3"
1515
end

0 commit comments

Comments
 (0)