Skip to content

Commit 261f658

Browse files
committed
SABT functionality updates and response schema modifications for few api's
1 parent 023827c commit 261f658

18 files changed

+316
-105
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ Class | Method | HTTP request | Description
207207
- [SibApiV3Sdk::CreateSmtpEmail](docs/CreateSmtpEmail.md)
208208
- [SibApiV3Sdk::CreateSmtpTemplate](docs/CreateSmtpTemplate.md)
209209
- [SibApiV3Sdk::CreateSmtpTemplateSender](docs/CreateSmtpTemplateSender.md)
210+
- [SibApiV3Sdk::CreateUpdateContactModel](docs/CreateUpdateContactModel.md)
210211
- [SibApiV3Sdk::CreateUpdateFolder](docs/CreateUpdateFolder.md)
211212
- [SibApiV3Sdk::CreateWebhook](docs/CreateWebhook.md)
212213
- [SibApiV3Sdk::CreatedProcessId](docs/CreatedProcessId.md)

docs/ContactsApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ nil (empty response body)
145145

146146

147147
# **create_contact**
148-
> CreateModel create_contact(create_contact)
148+
> CreateUpdateContactModel create_contact(create_contact)
149149
150150
Create a contact
151151

@@ -183,7 +183,7 @@ Name | Type | Description | Notes
183183

184184
### Return type
185185

186-
[**CreateModel**](CreateModel.md)
186+
[**CreateUpdateContactModel**](CreateUpdateContactModel.md)
187187

188188
### Authorization
189189

docs/CreateEmailCampaign.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,18 @@ Name | Type | Description | Notes
99
**html_content** | **String** | Mandatory if htmlUrl and templateId are empty. Body of the message (HTML) | [optional]
1010
**html_url** | **String** | Mandatory if htmlContent and templateId are empty. Url to the message (HTML) | [optional]
1111
**template_id** | **Integer** | Mandatory if htmlContent and htmlUrl are empty. Id of the SMTP template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. | [optional]
12-
**scheduled_at** | **DateTime** | Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional]
12+
**scheduled_at** | **DateTime** | Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). | [optional]
1313
**subject** | **String** | Subject of the campaign |
1414
**reply_to** | **String** | Email on which the campaign recipients will be able to reply to | [optional]
1515
**to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional]
1616
**recipients** | [**CreateEmailCampaignRecipients**](CreateEmailCampaignRecipients.md) | | [optional]
1717
**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]
1818
**inline_image_activation** | **BOOLEAN** | Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts | [optional] [default to false]
1919
**mirror_active** | **BOOLEAN** | Use true to enable the mirror link | [optional]
20-
**recurring** | **BOOLEAN** | For trigger campagins use false to make sure a contact receives the same campaign only once | [optional] [default to false]
21-
**type** | **String** | Type of the campaign |
2220
**footer** | **String** | Footer of the email campaign | [optional]
2321
**header** | **String** | Header of the email campaign | [optional]
2422
**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]
2523
**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]
24+
**send_at_best_time** | **BOOLEAN** | Set this to true if you want to send your campaign at best time. | [optional] [default to false]
2625

2726

docs/CreateUpdateContactModel.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SibApiV3Sdk::CreateUpdateContactModel
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**id** | **Integer** | ID of the contact when a new contact is created | [optional]
7+
8+

docs/PostContactInfoContacts.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**success** | **Array<String>** | |
6+
**success** | **Array<String>** | | [optional]
77
**failure** | **Array<String>** | | [optional]
8+
**total** | **Integer** | Displays the count of total number of contacts removed from list when user opts for \"all\" option. | [optional]
89

910

docs/UpdateEmailCampaign.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
88
**name** | **String** | Name of the campaign | [optional]
99
**html_content** | **String** | Body of the message (HTML version). REQUIRED if htmlUrl is empty | [optional]
1010
**html_url** | **String** | Url which contents the body of the email message. REQUIRED if htmlContent is empty | [optional]
11-
**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]
11+
**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. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). | [optional]
1212
**subject** | **String** | Subject of the campaign | [optional]
1313
**reply_to** | **String** | Email on which campaign recipients will be able to reply to | [optional]
1414
**to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional]
@@ -21,5 +21,6 @@ Name | Type | Description | Notes
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]
2323
**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]
24+
**send_at_best_time** | **BOOLEAN** | Set this to true if you want to send your campaign at best time. Note:- if true, warmup ip will be disabled. | [optional]
2425

2526

lib/sib-api-v3-sdk.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
require 'sib-api-v3-sdk/models/create_smtp_email'
3838
require 'sib-api-v3-sdk/models/create_smtp_template'
3939
require 'sib-api-v3-sdk/models/create_smtp_template_sender'
40+
require 'sib-api-v3-sdk/models/create_update_contact_model'
4041
require 'sib-api-v3-sdk/models/create_update_folder'
4142
require 'sib-api-v3-sdk/models/create_webhook'
4243
require 'sib-api-v3-sdk/models/created_process_id'

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def create_attribute_with_http_info(attribute_category, attribute_name, create_a
155155
#
156156
# @param create_contact Values to create a contact
157157
# @param [Hash] opts the optional parameters
158-
# @return [CreateModel]
158+
# @return [CreateUpdateContactModel]
159159
def create_contact(create_contact, opts = {})
160160
data, _status_code, _headers = create_contact_with_http_info(create_contact, opts)
161161
return data
@@ -165,7 +165,7 @@ def create_contact(create_contact, opts = {})
165165
#
166166
# @param create_contact Values to create a contact
167167
# @param [Hash] opts the optional parameters
168-
# @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers
168+
# @return [Array<(CreateUpdateContactModel, Fixnum, Hash)>] CreateUpdateContactModel data, response status code and response headers
169169
def create_contact_with_http_info(create_contact, opts = {})
170170
if @api_client.config.debugging
171171
@api_client.config.logger.debug "Calling API: ContactsApi.create_contact ..."
@@ -199,7 +199,7 @@ def create_contact_with_http_info(create_contact, opts = {})
199199
:form_params => form_params,
200200
:body => post_body,
201201
:auth_names => auth_names,
202-
:return_type => 'CreateModel')
202+
:return_type => 'CreateUpdateContactModel')
203203
if @api_client.config.debugging
204204
@api_client.config.logger.debug "API called: ContactsApi#create_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
205205
end

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

Lines changed: 16 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class CreateEmailCampaign
3232
# Mandatory if htmlContent and htmlUrl are empty. Id of the SMTP template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature.
3333
attr_accessor :template_id
3434

35-
# Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
35+
# Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part).
3636
attr_accessor :scheduled_at
3737

3838
# Subject of the campaign
@@ -55,12 +55,6 @@ class CreateEmailCampaign
5555
# Use true to enable the mirror link
5656
attr_accessor :mirror_active
5757

58-
# For trigger campagins use false to make sure a contact receives the same campaign only once
59-
attr_accessor :recurring
60-
61-
# Type of the campaign
62-
attr_accessor :type
63-
6458
# Footer of the email campaign
6559
attr_accessor :footer
6660

@@ -73,27 +67,9 @@ class CreateEmailCampaign
7367
# 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'
7468
attr_accessor :params
7569

76-
class EnumAttributeValidator
77-
attr_reader :datatype
78-
attr_reader :allowable_values
79-
80-
def initialize(datatype, allowable_values)
81-
@allowable_values = allowable_values.map do |value|
82-
case datatype.to_s
83-
when /Integer/i
84-
value.to_i
85-
when /Float/i
86-
value.to_f
87-
else
88-
value
89-
end
90-
end
91-
end
70+
# Set this to true if you want to send your campaign at best time.
71+
attr_accessor :send_at_best_time
9272

93-
def valid?(value)
94-
!value || allowable_values.include?(value)
95-
end
96-
end
9773

9874
# Attribute mapping from ruby-style variable name to JSON key.
9975
def self.attribute_map
@@ -112,12 +88,11 @@ def self.attribute_map
11288
:'attachment_url' => :'attachmentUrl',
11389
:'inline_image_activation' => :'inlineImageActivation',
11490
:'mirror_active' => :'mirrorActive',
115-
:'recurring' => :'recurring',
116-
:'type' => :'type',
11791
:'footer' => :'footer',
11892
:'header' => :'header',
11993
:'utm_campaign' => :'utmCampaign',
120-
:'params' => :'params'
94+
:'params' => :'params',
95+
:'send_at_best_time' => :'sendAtBestTime'
12196
}
12297
end
12398

@@ -138,12 +113,11 @@ def self.swagger_types
138113
:'attachment_url' => :'String',
139114
:'inline_image_activation' => :'BOOLEAN',
140115
:'mirror_active' => :'BOOLEAN',
141-
:'recurring' => :'BOOLEAN',
142-
:'type' => :'String',
143116
:'footer' => :'String',
144117
:'header' => :'String',
145118
:'utm_campaign' => :'String',
146-
:'params' => :'Object'
119+
:'params' => :'Object',
120+
:'send_at_best_time' => :'BOOLEAN'
147121
}
148122
end
149123

@@ -213,16 +187,6 @@ def initialize(attributes = {})
213187
self.mirror_active = attributes[:'mirrorActive']
214188
end
215189

216-
if attributes.has_key?(:'recurring')
217-
self.recurring = attributes[:'recurring']
218-
else
219-
self.recurring = false
220-
end
221-
222-
if attributes.has_key?(:'type')
223-
self.type = attributes[:'type']
224-
end
225-
226190
if attributes.has_key?(:'footer')
227191
self.footer = attributes[:'footer']
228192
end
@@ -239,6 +203,12 @@ def initialize(attributes = {})
239203
self.params = attributes[:'params']
240204
end
241205

206+
if attributes.has_key?(:'sendAtBestTime')
207+
self.send_at_best_time = attributes[:'sendAtBestTime']
208+
else
209+
self.send_at_best_time = false
210+
end
211+
242212
end
243213

244214
# Show invalid properties with the reasons. Usually used together with valid?
@@ -257,10 +227,6 @@ def list_invalid_properties
257227
invalid_properties.push("invalid value for 'subject', subject cannot be nil.")
258228
end
259229

260-
if @type.nil?
261-
invalid_properties.push("invalid value for 'type', type cannot be nil.")
262-
end
263-
264230
return invalid_properties
265231
end
266232

@@ -270,22 +236,9 @@ def valid?
270236
return false if @sender.nil?
271237
return false if @name.nil?
272238
return false if @subject.nil?
273-
return false if @type.nil?
274-
type_validator = EnumAttributeValidator.new('String', ["classic", "trigger"])
275-
return false unless type_validator.valid?(@type)
276239
return true
277240
end
278241

279-
# Custom attribute writer method checking allowed values (enum).
280-
# @param [Object] type Object to be assigned
281-
def type=(type)
282-
validator = EnumAttributeValidator.new('String', ["classic", "trigger"])
283-
unless validator.valid?(type)
284-
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
285-
end
286-
@type = type
287-
end
288-
289242
# Checks equality by comparing each attribute.
290243
# @param [Object] Object to be compared
291244
def ==(o)
@@ -305,12 +258,11 @@ def ==(o)
305258
attachment_url == o.attachment_url &&
306259
inline_image_activation == o.inline_image_activation &&
307260
mirror_active == o.mirror_active &&
308-
recurring == o.recurring &&
309-
type == o.type &&
310261
footer == o.footer &&
311262
header == o.header &&
312263
utm_campaign == o.utm_campaign &&
313-
params == o.params
264+
params == o.params &&
265+
send_at_best_time == o.send_at_best_time
314266
end
315267

316268
# @see the `==` method
@@ -322,7 +274,7 @@ def eql?(o)
322274
# Calculates hash code according to all attributes.
323275
# @return [Fixnum] Hash code
324276
def hash
325-
[tag, sender, name, html_content, html_url, template_id, scheduled_at, subject, reply_to, to_field, recipients, attachment_url, inline_image_activation, mirror_active, recurring, type, footer, header, utm_campaign, params].hash
277+
[tag, sender, name, html_content, html_url, template_id, scheduled_at, subject, reply_to, to_field, recipients, attachment_url, inline_image_activation, mirror_active, footer, header, utm_campaign, params, send_at_best_time].hash
326278
end
327279

328280
# Builds the object from hash

0 commit comments

Comments
 (0)