Skip to content

Commit 5c74c53

Browse files
committed
Swagger updates for sms api
1 parent a7dcfc8 commit 5c74c53

28 files changed

+142
-53
lines changed

LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2017 SendinBlue
3+
Copyright (c) 2019 SendinBlue
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
21+
THE SOFTWARE.

docs/CreateWebhook.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
**url** | **String** | URL of the webhook |
77
**description** | **String** | Description of the webhook | [optional]
8-
**events** | **Array<String>** | Events triggering the webhook. Possible values for Transactional type webhook – request, delivered, hardBounce, softBounce, blocked, spam, invalid, deferred, click, opened, uniqueOpened and unsubscribed and possible values for Marketing type webhook – spam, opened, click, hardBounce, softBounce, unsubscribed, listAddition & delivered | [optional]
8+
**events** | **Array<String>** | Events triggering the webhook. Possible values for Transactional type webhook – request, delivered, hardBounce, softBounce, blocked, spam, invalid, deferred, click, opened, uniqueOpened and unsubscribed and possible values for Marketing type webhook – spam, opened, click, hardBounce, softBounce, unsubscribed, listAddition & delivered |
99
**type** | **String** | Type of the webhook | [optional] [default to "transactional"]
1010

1111

docs/GetSmsEventReportEvents.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
**phone_number** | **String** | Phone number which has generated the event |
7-
**date** | **Date** | Date on which the event has been generated |
7+
**date** | **DateTime** | UTC date-time on which the event has been generated |
88
**message_id** | **String** | Message ID which generated the event |
99
**event** | **String** | Event which occurred |
1010
**reason** | **String** | Reason of bounce (only available if the event is hardbounce or softbounce) | [optional]

docs/RequestContactImport.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ Name | Type | Description | Notes
1111
**email_blacklist** | **BOOLEAN** | To blacklist all the contacts for email | [optional] [default to false]
1212
**sms_blacklist** | **BOOLEAN** | To blacklist all the contacts for sms | [optional] [default to false]
1313
**update_existing_contacts** | **BOOLEAN** | To facilitate the choice to update the existing contacts | [optional] [default to true]
14+
**empty_contacts_attributes** | **BOOLEAN** | To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in SendinBlue, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if `updateExistingContacts` set to true ) | [optional] [default to false]
1415

1516

docs/RequestSMSRecipientExport.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
**notify_url** | **String** | URL that will be called once the export process is finished | [optional]
7-
**recipients_type** | **String** | Filter the recipients based on how they interacted with the campaign | [default to "all"]
7+
**recipients_type** | **String** | Filter the recipients based on how they interacted with the campaign |
88

99

docs/SMSCampaignsApi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ nil (empty response body)
401401

402402

403403
# **send_test_sms**
404-
> send_test_sms(campaign_id, send_test_sms)
404+
> send_test_sms(campaign_id, phone_number)
405405
406406
Send an SMS
407407

@@ -421,12 +421,12 @@ api_instance = SibApiV3Sdk::SMSCampaignsApi.new
421421

422422
campaign_id = 789 # Integer | Id of the SMS campaign
423423

424-
send_test_sms = SibApiV3Sdk::SendTestSms.new # SendTestSms | Mobile number to which send the test
424+
phone_number = SibApiV3Sdk::SendTestSms.new # SendTestSms | Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted
425425

426426

427427
begin
428428
#Send an SMS
429-
api_instance.send_test_sms(campaign_id, send_test_sms)
429+
api_instance.send_test_sms(campaign_id, phone_number)
430430
rescue SibApiV3Sdk::ApiError => e
431431
puts "Exception when calling SMSCampaignsApi->send_test_sms: #{e}"
432432
end
@@ -437,7 +437,7 @@ end
437437
Name | Type | Description | Notes
438438
------------- | ------------- | ------------- | -------------
439439
**campaign_id** | **Integer**| Id of the SMS campaign |
440-
**send_test_sms** | [**SendTestSms**](SendTestSms.md)| Mobile number to which send the test |
440+
**phone_number** | [**SendTestSms**](SendTestSms.md)| Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted |
441441

442442
### Return type
443443

docs/SendReportEmail.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**subject** | **String** | Subject of the email message | [optional]
7-
**to** | **Array<String>** | Email addresses of the recipients | [optional]
8-
**content_type** | **String** | Type of the message body | [optional]
6+
**subject** | **String** | Subject of the email message |
7+
**to** | **Array<String>** | Email addresses of the recipients |
8+
**content_type** | **String** | Type of the message body | [optional] [default to "html"]
99
**bcc** | **Array<String>** | Email addresses of the recipients in bcc | [optional]
1010
**cc** | **Array<String>** | Email addresses of the recipients in cc | [optional]
11-
**body** | **String** | Body of the email message | [optional]
11+
**body** | **String** | Body of the email message |
1212

1313

docs/SendSms.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**reference** | **String** | |
77
**message_id** | **Integer** | |
8+
**sms_count** | **Integer** | Count of SMS's to send multiple text messages | [optional]
9+
**used_credits** | **Float** | SMS credits used per text message | [optional]
10+
**remaining_credits** | **Float** | Remaining SMS credits of the user | [optional]
811

912

docs/SendSmtpEmail.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Name | Type | Description | Notes
1111
**text_content** | **String** | Plain Text body of the message ( Ignored if 'templateId' is passed ) | [optional]
1212
**subject** | **String** | Subject of the message. Mandatory if 'templateId' is not passed | [optional]
1313
**reply_to** | [**SendSmtpEmailReplyTo**](SendSmtpEmailReplyTo.md) | | [optional]
14-
**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]
14+
**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, eps and odt ( Ignored if 'templateId' is passed ) | [optional]
1515
**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]
1717
**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]

docs/SendTestSms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**phone_numbers** | **Array<String>** | Mobile number with the country code to send test SMS. The mobile number defined here must belong to one of your contacts in SendinBlue account and must not be blacklisted | [optional]
6+
**phone_number** | **String** | Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted | [optional]
77

88

docs/UpdateCampaignStatus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**status** | **String** | | [optional]
6+
**status** | **String** | Note:- replicateTemplate status will be available only for template type campaigns. | [optional]
77

88

docs/UpdateContact.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-
**attributes** | **Object** | Pass the set of attributes to be updated. These attributes must be present in your account. For eg. {'FNAME':'Ellie', 'LNAME':'Roger'} | [optional]
6+
**attributes** | **Object** | Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For eg. { 'EMAIL':'[email protected]', 'FNAME':'Ellie', 'LNAME':'Roger'} | [optional]
77
**email_blacklisted** | **BOOLEAN** | Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) | [optional]
88
**sms_blacklisted** | **BOOLEAN** | Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) | [optional]
99
**list_ids** | **Array<Integer>** | Ids of the lists to add the contact to | [optional]

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -435,31 +435,31 @@ def send_sms_report_with_http_info(campaign_id, send_report, opts = {})
435435
# Send an SMS
436436
#
437437
# @param campaign_id Id of the SMS campaign
438-
# @param send_test_sms Mobile number to which send the test
438+
# @param phone_number Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted
439439
# @param [Hash] opts the optional parameters
440440
# @return [nil]
441-
def send_test_sms(campaign_id, send_test_sms, opts = {})
442-
send_test_sms_with_http_info(campaign_id, send_test_sms, opts)
441+
def send_test_sms(campaign_id, phone_number, opts = {})
442+
send_test_sms_with_http_info(campaign_id, phone_number, opts)
443443
return nil
444444
end
445445

446446
# Send an SMS
447447
#
448448
# @param campaign_id Id of the SMS campaign
449-
# @param send_test_sms Mobile number to which send the test
449+
# @param phone_number Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted
450450
# @param [Hash] opts the optional parameters
451451
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
452-
def send_test_sms_with_http_info(campaign_id, send_test_sms, opts = {})
452+
def send_test_sms_with_http_info(campaign_id, phone_number, opts = {})
453453
if @api_client.config.debugging
454454
@api_client.config.logger.debug "Calling API: SMSCampaignsApi.send_test_sms ..."
455455
end
456456
# verify the required parameter 'campaign_id' is set
457457
if @api_client.config.client_side_validation && campaign_id.nil?
458458
fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.send_test_sms"
459459
end
460-
# verify the required parameter 'send_test_sms' is set
461-
if @api_client.config.client_side_validation && send_test_sms.nil?
462-
fail ArgumentError, "Missing the required parameter 'send_test_sms' when calling SMSCampaignsApi.send_test_sms"
460+
# verify the required parameter 'phone_number' is set
461+
if @api_client.config.client_side_validation && phone_number.nil?
462+
fail ArgumentError, "Missing the required parameter 'phone_number' when calling SMSCampaignsApi.send_test_sms"
463463
end
464464
# resource path
465465
local_var_path = "/smsCampaigns/{campaignId}/sendTest".sub('{' + 'campaignId' + '}', campaign_id.to_s)
@@ -478,7 +478,7 @@ def send_test_sms_with_http_info(campaign_id, send_test_sms, opts = {})
478478
form_params = {}
479479

480480
# http body (model)
481-
post_body = @api_client.object_to_http_body(send_test_sms)
481+
post_body = @api_client.object_to_http_body(phone_number)
482482
auth_names = ['api-key']
483483
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
484484
:header_params => header_params,

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,18 @@ def list_invalid_properties
107107
invalid_properties.push("invalid value for 'url', url cannot be nil.")
108108
end
109109

110+
if @events.nil?
111+
invalid_properties.push("invalid value for 'events', events cannot be nil.")
112+
end
113+
110114
return invalid_properties
111115
end
112116

113117
# Check to see if the all the properties in the model are valid
114118
# @return true if the model is valid
115119
def valid?
116120
return false if @url.nil?
121+
return false if @events.nil?
117122
type_validator = EnumAttributeValidator.new('String', ["transactional", "marketing"])
118123
return false unless type_validator.valid?(@type)
119124
return true

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class GetSmsEventReportEvents
1818
# Phone number which has generated the event
1919
attr_accessor :phone_number
2020

21-
# Date on which the event has been generated
21+
# UTC date-time on which the event has been generated
2222
attr_accessor :date
2323

2424
# Message ID which generated the event
@@ -74,7 +74,7 @@ def self.attribute_map
7474
def self.swagger_types
7575
{
7676
:'phone_number' => :'String',
77-
:'date' => :'Date',
77+
:'date' => :'DateTime',
7878
:'message_id' => :'String',
7979
:'event' => :'String',
8080
:'reason' => :'String',

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class RequestContactImport
3838
# To facilitate the choice to update the existing contacts
3939
attr_accessor :update_existing_contacts
4040

41+
# To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in SendinBlue, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if `updateExistingContacts` set to true )
42+
attr_accessor :empty_contacts_attributes
43+
4144

4245
# Attribute mapping from ruby-style variable name to JSON key.
4346
def self.attribute_map
@@ -49,7 +52,8 @@ def self.attribute_map
4952
:'new_list' => :'newList',
5053
:'email_blacklist' => :'emailBlacklist',
5154
:'sms_blacklist' => :'smsBlacklist',
52-
:'update_existing_contacts' => :'updateExistingContacts'
55+
:'update_existing_contacts' => :'updateExistingContacts',
56+
:'empty_contacts_attributes' => :'emptyContactsAttributes'
5357
}
5458
end
5559

@@ -63,7 +67,8 @@ def self.swagger_types
6367
:'new_list' => :'RequestContactImportNewList',
6468
:'email_blacklist' => :'BOOLEAN',
6569
:'sms_blacklist' => :'BOOLEAN',
66-
:'update_existing_contacts' => :'BOOLEAN'
70+
:'update_existing_contacts' => :'BOOLEAN',
71+
:'empty_contacts_attributes' => :'BOOLEAN'
6772
}
6873
end
6974

@@ -115,6 +120,12 @@ def initialize(attributes = {})
115120
self.update_existing_contacts = true
116121
end
117122

123+
if attributes.has_key?(:'emptyContactsAttributes')
124+
self.empty_contacts_attributes = attributes[:'emptyContactsAttributes']
125+
else
126+
self.empty_contacts_attributes = false
127+
end
128+
118129
end
119130

120131
# Show invalid properties with the reasons. Usually used together with valid?
@@ -142,7 +153,8 @@ def ==(o)
142153
new_list == o.new_list &&
143154
email_blacklist == o.email_blacklist &&
144155
sms_blacklist == o.sms_blacklist &&
145-
update_existing_contacts == o.update_existing_contacts
156+
update_existing_contacts == o.update_existing_contacts &&
157+
empty_contacts_attributes == o.empty_contacts_attributes
146158
end
147159

148160
# @see the `==` method
@@ -154,7 +166,7 @@ def eql?(o)
154166
# Calculates hash code according to all attributes.
155167
# @return [Fixnum] Hash code
156168
def hash
157-
[file_url, file_body, list_ids, notify_url, new_list, email_blacklist, sms_blacklist, update_existing_contacts].hash
169+
[file_url, file_body, list_ids, notify_url, new_list, email_blacklist, sms_blacklist, update_existing_contacts, empty_contacts_attributes].hash
158170
end
159171

160172
# Builds the object from hash

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ def initialize(attributes = {})
7373

7474
if attributes.has_key?(:'recipientsType')
7575
self.recipients_type = attributes[:'recipientsType']
76-
else
77-
self.recipients_type = "all"
7876
end
7977

8078
end

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ def initialize(attributes = {})
9999

100100
if attributes.has_key?(:'contentType')
101101
self.content_type = attributes[:'contentType']
102+
else
103+
self.content_type = "html"
102104
end
103105

104106
if attributes.has_key?(:'bcc')
@@ -123,14 +125,29 @@ def initialize(attributes = {})
123125
# @return Array for valid properties with the reasons
124126
def list_invalid_properties
125127
invalid_properties = Array.new
128+
if @subject.nil?
129+
invalid_properties.push("invalid value for 'subject', subject cannot be nil.")
130+
end
131+
132+
if @to.nil?
133+
invalid_properties.push("invalid value for 'to', to cannot be nil.")
134+
end
135+
136+
if @body.nil?
137+
invalid_properties.push("invalid value for 'body', body cannot be nil.")
138+
end
139+
126140
return invalid_properties
127141
end
128142

129143
# Check to see if the all the properties in the model are valid
130144
# @return true if the model is valid
131145
def valid?
146+
return false if @subject.nil?
147+
return false if @to.nil?
132148
content_type_validator = EnumAttributeValidator.new('String', ["text", "html"])
133149
return false unless content_type_validator.valid?(@content_type)
150+
return false if @body.nil?
134151
return true
135152
end
136153

0 commit comments

Comments
 (0)