Skip to content

Commit 2a9d7ed

Browse files
Merge pull request #46 from sendinblue/feature_swagger_AP_949
AP-949 swagger resync
2 parents dbf21e3 + 107fbbd commit 2a9d7ed

8 files changed

+7
-134
lines changed

docs/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**event_time** | **DateTime** | UTC date-time of the event |
7-
**ip** | **String** | IP from which the user has been unsubscribed |
7+
**ip** | **String** | IP from which the user has been unsubscribed | [optional]
88

99

docs/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**campaign_id** | **Integer** | ID of the campaign which generated the event |
77
**event_time** | **DateTime** | UTC date-time of the event |
8-
**ip** | **String** | IP from which the user has unsubscribed |
8+
**ip** | **String** | IP from which the user has unsubscribed | [optional]
99

1010

docs/SendReportEmail.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**subject** | **String** | Subject of the email message |
76
**to** | **Array<String>** | Email addresses of the recipients |
8-
**content_type** | **String** | Type of the message body | [optional] [default to 'html']
9-
**bcc** | **Array<String>** | Email addresses of the recipients in bcc | [optional]
10-
**cc** | **Array<String>** | Email addresses of the recipients in cc | [optional]
11-
**body** | **String** | Body of the email message |
7+
**body** | **String** | Custom text message to be presented in the report email. |
128

139

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

-5
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,13 @@ def list_invalid_properties
6161
invalid_properties.push('invalid value for "event_time", event_time cannot be nil.')
6262
end
6363

64-
if @ip.nil?
65-
invalid_properties.push('invalid value for "ip", ip cannot be nil.')
66-
end
67-
6864
invalid_properties
6965
end
7066

7167
# Check to see if the all the properties in the model are valid
7268
# @return true if the model is valid
7369
def valid?
7470
return false if @event_time.nil?
75-
return false if @ip.nil?
7671
true
7772
end
7873

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

-5
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ def list_invalid_properties
7474
invalid_properties.push('invalid value for "event_time", event_time cannot be nil.')
7575
end
7676

77-
if @ip.nil?
78-
invalid_properties.push('invalid value for "ip", ip cannot be nil.')
79-
end
80-
8177
invalid_properties
8278
end
8379

@@ -86,7 +82,6 @@ def list_invalid_properties
8682
def valid?
8783
return false if @campaign_id.nil?
8884
return false if @event_time.nil?
89-
return false if @ip.nil?
9085
true
9186
end
9287

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

+3-88
Original file line numberDiff line numberDiff line change
@@ -13,68 +13,26 @@
1313
require 'date'
1414

1515
module SibApiV3Sdk
16-
# Email sending credentials including subject, body, to, cc etc.
16+
# Custom attributes for the report email.
1717
class SendReportEmail
18-
# Subject of the email message
19-
attr_accessor :subject
20-
2118
# Email addresses of the recipients
2219
attr_accessor :to
2320

24-
# Type of the message body
25-
attr_accessor :content_type
26-
27-
# Email addresses of the recipients in bcc
28-
attr_accessor :bcc
29-
30-
# Email addresses of the recipients in cc
31-
attr_accessor :cc
32-
33-
# Body of the email message
21+
# Custom text message to be presented in the report email.
3422
attr_accessor :body
3523

36-
class EnumAttributeValidator
37-
attr_reader :datatype
38-
attr_reader :allowable_values
39-
40-
def initialize(datatype, allowable_values)
41-
@allowable_values = allowable_values.map do |value|
42-
case datatype.to_s
43-
when /Integer/i
44-
value.to_i
45-
when /Float/i
46-
value.to_f
47-
else
48-
value
49-
end
50-
end
51-
end
52-
53-
def valid?(value)
54-
!value || allowable_values.include?(value)
55-
end
56-
end
57-
5824
# Attribute mapping from ruby-style variable name to JSON key.
5925
def self.attribute_map
6026
{
61-
:'subject' => :'subject',
6227
:'to' => :'to',
63-
:'content_type' => :'contentType',
64-
:'bcc' => :'bcc',
65-
:'cc' => :'cc',
6628
:'body' => :'body'
6729
}
6830
end
6931

7032
# Attribute type mapping.
7133
def self.swagger_types
7234
{
73-
:'subject' => :'String',
7435
:'to' => :'Array<String>',
75-
:'content_type' => :'String',
76-
:'bcc' => :'Array<String>',
77-
:'cc' => :'Array<String>',
7836
:'body' => :'String'
7937
}
8038
end
@@ -87,34 +45,12 @@ def initialize(attributes = {})
8745
# convert string to symbol for hash key
8846
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
8947

90-
if attributes.has_key?(:'subject')
91-
self.subject = attributes[:'subject']
92-
end
93-
9448
if attributes.has_key?(:'to')
9549
if (value = attributes[:'to']).is_a?(Array)
9650
self.to = value
9751
end
9852
end
9953

100-
if attributes.has_key?(:'contentType')
101-
self.content_type = attributes[:'contentType']
102-
else
103-
self.content_type = 'html'
104-
end
105-
106-
if attributes.has_key?(:'bcc')
107-
if (value = attributes[:'bcc']).is_a?(Array)
108-
self.bcc = value
109-
end
110-
end
111-
112-
if attributes.has_key?(:'cc')
113-
if (value = attributes[:'cc']).is_a?(Array)
114-
self.cc = value
115-
end
116-
end
117-
11854
if attributes.has_key?(:'body')
11955
self.body = attributes[:'body']
12056
end
@@ -124,10 +60,6 @@ def initialize(attributes = {})
12460
# @return Array for valid properties with the reasons
12561
def list_invalid_properties
12662
invalid_properties = Array.new
127-
if @subject.nil?
128-
invalid_properties.push('invalid value for "subject", subject cannot be nil.')
129-
end
130-
13163
if @to.nil?
13264
invalid_properties.push('invalid value for "to", to cannot be nil.')
13365
end
@@ -142,34 +74,17 @@ def list_invalid_properties
14274
# Check to see if the all the properties in the model are valid
14375
# @return true if the model is valid
14476
def valid?
145-
return false if @subject.nil?
14677
return false if @to.nil?
147-
content_type_validator = EnumAttributeValidator.new('String', ['text', 'html'])
148-
return false unless content_type_validator.valid?(@content_type)
14978
return false if @body.nil?
15079
true
15180
end
15281

153-
# Custom attribute writer method checking allowed values (enum).
154-
# @param [Object] content_type Object to be assigned
155-
def content_type=(content_type)
156-
validator = EnumAttributeValidator.new('String', ['text', 'html'])
157-
unless validator.valid?(content_type)
158-
fail ArgumentError, 'invalid value for "content_type", must be one of #{validator.allowable_values}.'
159-
end
160-
@content_type = content_type
161-
end
162-
16382
# Checks equality by comparing each attribute.
16483
# @param [Object] Object to be compared
16584
def ==(o)
16685
return true if self.equal?(o)
16786
self.class == o.class &&
168-
subject == o.subject &&
16987
to == o.to &&
170-
content_type == o.content_type &&
171-
bcc == o.bcc &&
172-
cc == o.cc &&
17388
body == o.body
17489
end
17590

@@ -182,7 +97,7 @@ def eql?(o)
18297
# Calculates hash code according to all attributes.
18398
# @return [Fixnum] Hash code
18499
def hash
185-
[subject, to, content_type, bcc, cc, body].hash
100+
[to, body].hash
186101
end
187102

188103
# 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 = "7.0.0"
14+
VERSION = "7.1.0"
1515
end

spec/models/send_report_email_spec.rb

-28
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,12 @@
3232
expect(@instance).to be_instance_of(SibApiV3Sdk::SendReportEmail)
3333
end
3434
end
35-
describe 'test attribute "subject"' do
36-
it 'should work' do
37-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38-
end
39-
end
40-
4135
describe 'test attribute "to"' do
4236
it 'should work' do
4337
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
4438
end
4539
end
4640

47-
describe 'test attribute "content_type"' do
48-
it 'should work' do
49-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50-
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["text", "html"])
51-
# validator.allowable_values.each do |value|
52-
# expect { @instance.content_type = value }.not_to raise_error
53-
# end
54-
end
55-
end
56-
57-
describe 'test attribute "bcc"' do
58-
it 'should work' do
59-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
60-
end
61-
end
62-
63-
describe 'test attribute "cc"' do
64-
it 'should work' do
65-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
66-
end
67-
end
68-
6941
describe 'test attribute "body"' do
7042
it 'should work' do
7143
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers

0 commit comments

Comments
 (0)