Skip to content

Commit a7dcfc8

Browse files
Merge pull request #25 from sendinblue/feature_updated_swagger_sync
Swagger updates for sms campaigns
2 parents 303e34d + f2f396d commit a7dcfc8

33 files changed

+99
-87
lines changed

docs/CreateEmailCampaign.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ Name | Type | Description | Notes
2222
**footer** | **String** | Footer of the email campaign | [optional]
2323
**header** | **String** | Header of the email campaign | [optional]
2424
**utm_campaign** | **String** | Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed | [optional]
25-
**params** | **Object** | Pass the set of attributes to customize the type classic campaign. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. Only available if 'type' is 'classic' | [optional]
25+
**params** | **Object** | Pass the set of attributes to customize the type classic campaign. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. Only available if 'type' is 'classic'. It's considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' | [optional]
2626

2727

docs/CreateSmsCampaign.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
**name** | **String** | Name of the campaign |
77
**sender** | **String** | Name of the sender. The number of characters is limited to 11 |
8-
**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]
8+
**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** | [**CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional]
1010
**scheduled_at** | **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]
1111

docs/CreateSmsCampaignRecipients.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**list_ids** | **Array<Integer>** | Lists Ids to send the campaign to. REQUIRED if scheduledAt is not empty |
7-
**exclusion_list_ids** | **Array<Integer>** | List ids which have to be excluded from a campaign |
7+
**exclusion_list_ids** | **Array<Integer>** | List ids which have to be excluded from a campaign | [optional]
88

99

docs/GetAggregatedReport.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ Name | Type | Description | Notes
1515
**spam_reports** | **Integer** | Number of complaint (spam report) for the timeframe |
1616
**blocked** | **Integer** | Number of blocked contact emails for the timeframe |
1717
**invalid** | **Integer** | Number of invalid emails for the timeframe |
18+
**unsubscribed** | **Integer** | Number of unsubscribed emails for the timeframe |
1819

1920

docs/GetReportsReports.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ Name | Type | Description | Notes
1515
**spam_reports** | **Integer** | Number of complaints (spam reports) for the date |
1616
**blocked** | **Integer** | Number of blocked emails for the date |
1717
**invalid** | **Integer** | Number of invalid emails for the date |
18+
**unsubscribed** | **Integer** | Number of unsubscribed emails for the date |
1819

1920

docs/GetSmsCampaign.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Name | Type | Description | Notes
88
**status** | **String** | Status of the SMS Campaign |
99
**content** | **String** | Content of the SMS Campaign |
1010
**scheduled_at** | **DateTime** | UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format |
11-
**test_sent** | **BOOLEAN** | Retrieved the status of test SMS sending. (true=Test SMS has been sent false=Test SMS has not been sent) |
1211
**sender** | **String** | Sender of the SMS Campaign |
1312
**created_at** | **DateTime** | Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
1413
**modified_at** | **DateTime** | UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |

docs/GetSmsCampaignOverview.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Name | Type | Description | Notes
88
**status** | **String** | Status of the SMS Campaign |
99
**content** | **String** | Content of the SMS Campaign |
1010
**scheduled_at** | **DateTime** | UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format |
11-
**test_sent** | **BOOLEAN** | Retrieved the status of test SMS sending. (true=Test SMS has been sent false=Test SMS has not been sent) |
1211
**sender** | **String** | Sender of the SMS Campaign |
1312
**created_at** | **DateTime** | Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |
1413
**modified_at** | **DateTime** | UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) |

docs/SMSCampaignsApi.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ api_instance = SibApiV3Sdk::SMSCampaignsApi.new
195195

196196
opts = {
197197
status: "status_example", # String | Status of campaign.
198+
start_date: DateTime.parse("2013-10-20T19:20:30+01:00"), # DateTime | Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
199+
end_date: DateTime.parse("2013-10-20T19:20:30+01:00"), # DateTime | Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
198200
limit: 500, # Integer | Number limitation for the result returned
199201
offset: 0 # Integer | Beginning point in the list to retrieve from.
200202
}
@@ -213,6 +215,8 @@ end
213215
Name | Type | Description | Notes
214216
------------- | ------------- | ------------- | -------------
215217
**status** | **String**| Status of campaign. | [optional]
218+
**start_date** | **DateTime**| Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional]
219+
**end_date** | **DateTime**| Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional]
216220
**limit** | **Integer**| Number limitation for the result returned | [optional] [default to 500]
217221
**offset** | **Integer**| Beginning point in the list to retrieve from. | [optional] [default to 0]
218222

docs/SendEmail.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
99
**reply_to** | **String** | Email address which shall be used by campaign recipients to reply back | [optional]
1010
**attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional]
1111
**attachment** | [**Array<SendEmailAttachment>**](SendEmailAttachment.md) | Pass the list of content (base64 encoded) and name of the attachment. For example, [{'content':'base64 encoded content 1', 'name':'attcahment1'}, {'content':'base64 encoded content 2', 'name':'attcahment2'}]. | [optional]
12-
**headers** | **Object** | Pass the set of headers that shall be sent along the mail headers in the original email. 'X-Mailin-IP' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, {'Content-Type':'text/html', 'charset':'iso-8859-1', 'X-Mailin-IP':'1.2.3.4'} | [optional]
12+
**headers** | **Object** | Pass the set of headers that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, {'Content-Type':'text/html', 'charset':'iso-8859-1', 'sender.ip':'1.2.3.4'} | [optional]
1313
**attributes** | **Object** | Pass the set of attributes to customize the template. For example, {'FNAME':'Joe', 'LNAME':'Doe'} | [optional]
1414
**tags** | **Array<String>** | Tag your emails to find them more easily | [optional]
1515

docs/SendSmtpEmail.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Name | Type | Description | Notes
1212
**subject** | **String** | Subject of the message. Mandatory if 'templateId' is not passed | [optional]
1313
**reply_to** | [**SendSmtpEmailReplyTo**](SendSmtpEmailReplyTo.md) | | [optional]
1414
**attachment** | [**Array<SendSmtpEmailAttachment>**](SendSmtpEmailAttachment.md) | Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, [{'url':'https://attachment.domain.com/myAttachmentFromUrl.jpg', 'name':'My attachment 1'}, {'content':'base64 exmaple content', 'name':'My attachment 2'}]. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps ( Ignored if 'templateId' is passed ) | [optional]
15-
**headers** | **Object** | Pass the set of headers that shall be sent along the mail headers in the original email. 'X-Mailin-IP' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, {'Content-Type':'text/html', 'charset':'iso-8859-1', 'X-Mailin-IP':'1.2.3.4'} | [optional]
15+
**headers** | **Object** | Pass the set of headers that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, {'Content-Type':'text/html', 'charset':'iso-8859-1', 'sender.ip':'1.2.3.4'} | [optional]
1616
**template_id** | **Integer** | Id of the template | [optional]
17-
**params** | **Object** | Pass the set of attributes to customize the template. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. | [optional]
17+
**params** | **Object** | Pass the set of attributes to customize the template. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. It's considered only if template is in New Template Language format. | [optional]
1818
**tags** | **Array<String>** | Tag your emails to find them more easily | [optional]
1919

2020

docs/SendTransacSms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name | Type | Description | Notes
66
**sender** | **String** | Name of the sender. Only alphanumeric characters. No more than 11 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 |
9-
**type** | **String** | Type of the SMS | [optional] [default to "transactional"]
9+
**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"]
1010
**tag** | **String** | Tag of the message | [optional]
1111
**web_url** | **String** | Webhook to call for each event triggered by the message (delivered etc.) | [optional]
1212

docs/UpdateEmailCampaign.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ Name | Type | Description | Notes
2020
**footer** | **String** | Footer of the email campaign | [optional]
2121
**header** | **String** | Header of the email campaign | [optional]
2222
**utm_campaign** | **String** | Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed | [optional]
23-
**params** | **Object** | Pass the set of attributes to customize the type 'classic' campaign. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. | [optional]
23+
**params** | **Object** | Pass the set of attributes to customize the type 'classic' campaign. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. The 'params' field will get updated, only if the campaign is in New Template Language, else ignored. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' | [optional]
2424

2525

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ def get_sms_campaign_with_http_info(campaign_id, get_sms_campaign, opts = {})
194194
#
195195
# @param [Hash] opts the optional parameters
196196
# @option opts [String] :status Status of campaign.
197+
# @option opts [DateTime] :start_date Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
198+
# @option opts [DateTime] :end_date Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
197199
# @option opts [Integer] :limit Number limitation for the result returned (default to 500)
198200
# @option opts [Integer] :offset Beginning point in the list to retrieve from. (default to 0)
199201
# @return [GetSmsCampaigns]
@@ -206,15 +208,17 @@ def get_sms_campaigns(opts = {})
206208
#
207209
# @param [Hash] opts the optional parameters
208210
# @option opts [String] :status Status of campaign.
211+
# @option opts [DateTime] :start_date Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
212+
# @option opts [DateTime] :end_date Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
209213
# @option opts [Integer] :limit Number limitation for the result returned
210214
# @option opts [Integer] :offset Beginning point in the list to retrieve from.
211215
# @return [Array<(GetSmsCampaigns, Fixnum, Hash)>] GetSmsCampaigns data, response status code and response headers
212216
def get_sms_campaigns_with_http_info(opts = {})
213217
if @api_client.config.debugging
214218
@api_client.config.logger.debug "Calling API: SMSCampaignsApi.get_sms_campaigns ..."
215219
end
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'
220+
if @api_client.config.client_side_validation && opts[:'status'] && !['suspended', 'archive', 'sent', 'queued', 'draft', 'inProcess'].include?(opts[:'status'])
221+
fail ArgumentError, 'invalid value for "status", must be one of suspended, archive, sent, queued, draft, inProcess'
218222
end
219223
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000
220224
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMSCampaignsApi.get_sms_campaigns, must be smaller than or equal to 1000.'
@@ -226,6 +230,8 @@ def get_sms_campaigns_with_http_info(opts = {})
226230
# query parameters
227231
query_params = {}
228232
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
233+
query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
234+
query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
229235
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
230236
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
231237

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ def get_email_event_report_with_http_info(opts = {})
281281
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMTPApi.get_email_event_report, must be smaller than or equal to 100.'
282282
end
283283

284-
if @api_client.config.client_side_validation && opts[:'event'] && !['bounces', 'hardBounces', 'softBounces', 'delivered', 'spam', 'requests', 'opened', 'clicks', 'invalid', 'deferred', 'blocked'].include?(opts[:'event'])
285-
fail ArgumentError, 'invalid value for "event", must be one of bounces, hardBounces, softBounces, delivered, spam, requests, opened, clicks, invalid, deferred, blocked'
284+
if @api_client.config.client_side_validation && opts[:'event'] && !['bounces', 'hardBounces', 'softBounces', 'delivered', 'spam', 'requests', 'opened', 'clicks', 'invalid', 'deferred', 'blocked', 'unsubscribed'].include?(opts[:'event'])
285+
fail ArgumentError, 'invalid value for "event", must be one of bounces, hardBounces, softBounces, delivered, spam, requests, opened, clicks, invalid, deferred, blocked, unsubscribed'
286286
end
287287
# resource path
288288
local_var_path = "/smtp/statistics/events"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class CreateEmailCampaign
7070
# Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed
7171
attr_accessor :utm_campaign
7272

73-
# Pass the set of attributes to customize the type classic campaign. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. Only available if 'type' is 'classic'
73+
# Pass the set of attributes to customize the type classic campaign. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. Only available if 'type' is 'classic'. It's considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField'
7474
attr_accessor :params
7575

7676
class EnumAttributeValidator

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def list_invalid_properties
9898
invalid_properties.push("invalid value for 'sender', the character length must be smaller than or equal to 11.")
9999
end
100100

101+
if @content.nil?
102+
invalid_properties.push("invalid value for 'content', content cannot be nil.")
103+
end
104+
101105
return invalid_properties
102106
end
103107

@@ -107,6 +111,7 @@ def valid?
107111
return false if @name.nil?
108112
return false if @sender.nil?
109113
return false if @sender.to_s.length > 11
114+
return false if @content.nil?
110115
return true
111116
end
112117

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,13 @@ def list_invalid_properties
6868
invalid_properties.push("invalid value for 'list_ids', list_ids cannot be nil.")
6969
end
7070

71-
if @exclusion_list_ids.nil?
72-
invalid_properties.push("invalid value for 'exclusion_list_ids', exclusion_list_ids cannot be nil.")
73-
end
74-
7571
return invalid_properties
7672
end
7773

7874
# Check to see if the all the properties in the model are valid
7975
# @return true if the model is valid
8076
def valid?
8177
return false if @list_ids.nil?
82-
return false if @exclusion_list_ids.nil?
8378
return true
8479
end
8580

0 commit comments

Comments
 (0)