Skip to content

Commit b58d91f

Browse files
Merge pull request #23 from sendinblue/feature_updated_swagger_sync
Updated swagger changes for campaign filters
2 parents d04cfd6 + 22937a0 commit b58d91f

13 files changed

+57
-11
lines changed

docs/CreateAttribute.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**value** | **String** | Value of the attribute. Use only if the attribute's category is 'calculated' or 'global' | [optional]
77
**enumeration** | [**Array<CreateAttributeEnumeration>**](CreateAttributeEnumeration.md) | List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{'value':1, 'label':'male'}, {'value':2, 'label':'female'}] | [optional]
8-
**type** | **String** | Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) | [optional]
8+
**type** | **String** | Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute ) | [optional]
99

1010

docs/EmailCampaignsApi.md

+4
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ api_instance = SibApiV3Sdk::EmailCampaignsApi.new
249249
opts = {
250250
type: "type_example", # String | Filter on the type of the campaigns
251251
status: "status_example", # String | Filter on the status of the campaign
252+
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 email 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' )
253+
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 email 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' )
252254
limit: 500, # Integer | Number of documents per page
253255
offset: 0 # Integer | Index of the first document in the page
254256
}
@@ -268,6 +270,8 @@ Name | Type | Description | Notes
268270
------------- | ------------- | ------------- | -------------
269271
**type** | **String**| Filter on the type of the campaigns | [optional]
270272
**status** | **String**| Filter on the status of the campaign | [optional]
273+
**start_date** | **DateTime**| Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email 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]
274+
**end_date** | **DateTime**| Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email 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]
271275
**limit** | **Integer**| Number of documents per page | [optional] [default to 500]
272276
**offset** | **Integer**| Index of the first document in the page | [optional] [default to 0]
273277

docs/GetEmailCampaign.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Name | Type | Description | Notes
2323
**inline_image_activation** | **BOOLEAN** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional]
2424
**mirror_active** | **BOOLEAN** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional]
2525
**recurring** | **BOOLEAN** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional]
26+
**sent_date** | **DateTime** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional]
2627
**recipients** | **Object** | |
2728
**statistics** | **Object** | |
2829

docs/GetExtendedCampaignOverview.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ Name | Type | Description | Notes
2323
**inline_image_activation** | **BOOLEAN** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional]
2424
**mirror_active** | **BOOLEAN** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional]
2525
**recurring** | **BOOLEAN** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional]
26+
**sent_date** | **DateTime** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional]
2627

2728

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

+6
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ def get_email_campaign_with_http_info(campaign_id, opts = {})
246246
# @param [Hash] opts the optional parameters
247247
# @option opts [String] :type Filter on the type of the campaigns
248248
# @option opts [String] :status Filter on the status of the campaign
249+
# @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 email 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' )
250+
# @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 email 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' )
249251
# @option opts [Integer] :limit Number of documents per page (default to 500)
250252
# @option opts [Integer] :offset Index of the first document in the page (default to 0)
251253
# @return [GetEmailCampaigns]
@@ -259,6 +261,8 @@ def get_email_campaigns(opts = {})
259261
# @param [Hash] opts the optional parameters
260262
# @option opts [String] :type Filter on the type of the campaigns
261263
# @option opts [String] :status Filter on the status of the campaign
264+
# @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 email 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' )
265+
# @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 email 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' )
262266
# @option opts [Integer] :limit Number of documents per page
263267
# @option opts [Integer] :offset Index of the first document in the page
264268
# @return [Array<(GetEmailCampaigns, Fixnum, Hash)>] GetEmailCampaigns data, response status code and response headers
@@ -283,6 +287,8 @@ def get_email_campaigns_with_http_info(opts = {})
283287
query_params = {}
284288
query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
285289
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
290+
query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
291+
query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
286292
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
287293
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
288294

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CreateAttribute
2121
# List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{'value':1, 'label':'male'}, {'value':2, 'label':'female'}]
2222
attr_accessor :enumeration
2323

24-
# Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute )
24+
# Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute )
2525
attr_accessor :type
2626

2727
class EnumAttributeValidator
@@ -98,15 +98,15 @@ def list_invalid_properties
9898
# Check to see if the all the properties in the model are valid
9999
# @return true if the model is valid
100100
def valid?
101-
type_validator = EnumAttributeValidator.new('String', ["text", "date", "float", "id", "category"])
101+
type_validator = EnumAttributeValidator.new('String', ["text", "date", "float", "boolean", "id", "category"])
102102
return false unless type_validator.valid?(@type)
103103
return true
104104
end
105105

106106
# Custom attribute writer method checking allowed values (enum).
107107
# @param [Object] type Object to be assigned
108108
def type=(type)
109-
validator = EnumAttributeValidator.new('String', ["text", "date", "float", "id", "category"])
109+
validator = EnumAttributeValidator.new('String', ["text", "date", "float", "boolean", "id", "category"])
110110
unless validator.valid?(type)
111111
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
112112
end

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

+11-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class GetEmailCampaign
7474
# FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times
7575
attr_accessor :recurring
7676

77+
# Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent'
78+
attr_accessor :sent_date
79+
7780
attr_accessor :recipients
7881

7982
attr_accessor :statistics
@@ -123,6 +126,7 @@ def self.attribute_map
123126
:'inline_image_activation' => :'inlineImageActivation',
124127
:'mirror_active' => :'mirrorActive',
125128
:'recurring' => :'recurring',
129+
:'sent_date' => :'sentDate',
126130
:'recipients' => :'recipients',
127131
:'statistics' => :'statistics'
128132
}
@@ -151,6 +155,7 @@ def self.swagger_types
151155
:'inline_image_activation' => :'BOOLEAN',
152156
:'mirror_active' => :'BOOLEAN',
153157
:'recurring' => :'BOOLEAN',
158+
:'sent_date' => :'DateTime',
154159
:'recipients' => :'Object',
155160
:'statistics' => :'Object'
156161
}
@@ -244,6 +249,10 @@ def initialize(attributes = {})
244249
self.recurring = attributes[:'recurring']
245250
end
246251

252+
if attributes.has_key?(:'sentDate')
253+
self.sent_date = attributes[:'sentDate']
254+
end
255+
247256
if attributes.has_key?(:'recipients')
248257
self.recipients = attributes[:'recipients']
249258
end
@@ -401,6 +410,7 @@ def ==(o)
401410
inline_image_activation == o.inline_image_activation &&
402411
mirror_active == o.mirror_active &&
403412
recurring == o.recurring &&
413+
sent_date == o.sent_date &&
404414
recipients == o.recipients &&
405415
statistics == o.statistics
406416
end
@@ -414,7 +424,7 @@ def eql?(o)
414424
# Calculates hash code according to all attributes.
415425
# @return [Fixnum] Hash code
416426
def hash
417-
[id, name, subject, type, status, scheduled_at, test_sent, header, footer, sender, reply_to, to_field, html_content, share_link, tag, created_at, modified_at, inline_image_activation, mirror_active, recurring, recipients, statistics].hash
427+
[id, name, subject, type, status, scheduled_at, test_sent, header, footer, sender, reply_to, to_field, html_content, share_link, tag, created_at, modified_at, inline_image_activation, mirror_active, recurring, sent_date, recipients, statistics].hash
418428
end
419429

420430
# Builds the object from hash

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

+14-4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class GetExtendedCampaignOverview
7474
# FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times
7575
attr_accessor :recurring
7676

77+
# Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent'
78+
attr_accessor :sent_date
79+
7780
class EnumAttributeValidator
7881
attr_reader :datatype
7982
attr_reader :allowable_values
@@ -118,7 +121,8 @@ def self.attribute_map
118121
:'modified_at' => :'modifiedAt',
119122
:'inline_image_activation' => :'inlineImageActivation',
120123
:'mirror_active' => :'mirrorActive',
121-
:'recurring' => :'recurring'
124+
:'recurring' => :'recurring',
125+
:'sent_date' => :'sentDate'
122126
}
123127
end
124128

@@ -144,7 +148,8 @@ def self.swagger_types
144148
:'modified_at' => :'DateTime',
145149
:'inline_image_activation' => :'BOOLEAN',
146150
:'mirror_active' => :'BOOLEAN',
147-
:'recurring' => :'BOOLEAN'
151+
:'recurring' => :'BOOLEAN',
152+
:'sent_date' => :'DateTime'
148153
}
149154
end
150155

@@ -236,6 +241,10 @@ def initialize(attributes = {})
236241
self.recurring = attributes[:'recurring']
237242
end
238243

244+
if attributes.has_key?(:'sentDate')
245+
self.sent_date = attributes[:'sentDate']
246+
end
247+
239248
end
240249

241250
# Show invalid properties with the reasons. Usually used together with valid?
@@ -374,7 +383,8 @@ def ==(o)
374383
modified_at == o.modified_at &&
375384
inline_image_activation == o.inline_image_activation &&
376385
mirror_active == o.mirror_active &&
377-
recurring == o.recurring
386+
recurring == o.recurring &&
387+
sent_date == o.sent_date
378388
end
379389

380390
# @see the `==` method
@@ -386,7 +396,7 @@ def eql?(o)
386396
# Calculates hash code according to all attributes.
387397
# @return [Fixnum] Hash code
388398
def hash
389-
[id, name, subject, type, status, scheduled_at, test_sent, header, footer, sender, reply_to, to_field, html_content, share_link, tag, created_at, modified_at, inline_image_activation, mirror_active, recurring].hash
399+
[id, name, subject, type, status, scheduled_at, test_sent, header, footer, sender, reply_to, to_field, html_content, share_link, tag, created_at, modified_at, inline_image_activation, mirror_active, recurring, sent_date].hash
390400
end
391401

392402
# Builds the object from hash

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
=end
1212

1313
module SibApiV3Sdk
14-
VERSION = "5.0.1"
14+
VERSION = "5.1.0"
1515
end

spec/api/email_campaigns_api_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
# @param [Hash] opts the optional parameters
8888
# @option opts [String] :type Filter on the type of the campaigns
8989
# @option opts [String] :status Filter on the status of the campaign
90+
# @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 email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either &#39;status&#39; not passed and if passed is set to &#39;sent&#39; )
91+
# @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 email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either &#39;status&#39; not passed and if passed is set to &#39;sent&#39; )
9092
# @option opts [Integer] :limit Number of documents per page
9193
# @option opts [Integer] :offset Index of the first document in the page
9294
# @return [GetEmailCampaigns]

spec/models/create_attribute_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
describe 'test attribute "type"' do
4848
it 'should work' do
4949
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50-
#validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["text", "date", "float", "id", "category"])
50+
#validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["text", "date", "float", "boolean", "id", "category"])
5151
#validator.allowable_values.each do |value|
5252
# expect { @instance.type = value }.not_to raise_error
5353
#end

spec/models/get_email_campaign_spec.rb

+6
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@
160160
end
161161
end
162162

163+
describe 'test attribute "sent_date"' do
164+
it 'should work' do
165+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
166+
end
167+
end
168+
163169
describe 'test attribute "recipients"' do
164170
it 'should work' do
165171
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers

spec/models/get_extended_campaign_overview_spec.rb

+6
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,11 @@
160160
end
161161
end
162162

163+
describe 'test attribute "sent_date"' do
164+
it 'should work' do
165+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
166+
end
167+
end
168+
163169
end
164170

0 commit comments

Comments
 (0)