reacon-sdk 0.2.0.beta.1 → 0.3.0.beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -5
- data/lib/reacon-sdk/http_policy.rb +15 -0
- data/lib/reacon-sdk/models/mail_post_analytics_export_response200.rb +1 -15
- data/lib/reacon-sdk/models/mail_post_analytics_export_response200_next_cursor.rb +160 -73
- data/lib/reacon-sdk/version.rb +1 -1
- data/lib/reacon-sdk.rb +0 -1
- metadata +1 -2
- data/lib/reacon-sdk/models/mail_post_analytics_export_response200_next_cursor_any_of.rb +0 -190
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 897408c4281525947833e2306d9e11a57df06022695b9ae9bd25216d08058b35
|
|
4
|
+
data.tar.gz: 5a8c2dc3483ddf117279d76ef61171d044f9f3ae233ce0fdcfaefd8603a8bdbf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1f51b94f9d6bb66223ba478926310c36a1193d302b345d124d4a5ac501706eaa0cd8b282d4bb86597c09352de81263aa88d7f4b38beafd6d6e47edb743b4241f
|
|
7
|
+
data.tar.gz: a2a2be562564e6aab734fa2e96ac2d2619f8ec7e8990b3ded67d32a3515fe213138121f7a98d6ede033396f136f276ac44aa3ea6eba7fccb989ff0d42be60718
|
data/README.md
CHANGED
|
@@ -7,7 +7,7 @@ No description provided (generated by Openapi Generator https://github.com/opena
|
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
8
8
|
|
|
9
9
|
- API version: 0.1.0
|
|
10
|
-
- Package version: 0.
|
|
10
|
+
- Package version: 0.3.0.beta.1
|
|
11
11
|
- Generator version: 7.25.0
|
|
12
12
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
|
13
13
|
|
|
@@ -24,16 +24,16 @@ gem build reacon-sdk.gemspec
|
|
|
24
24
|
Then either install the gem locally:
|
|
25
25
|
|
|
26
26
|
```shell
|
|
27
|
-
gem install ./reacon-sdk-0.
|
|
27
|
+
gem install ./reacon-sdk-0.3.0.beta.1.gem
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
(for development, run `gem install --dev ./reacon-sdk-0.
|
|
30
|
+
(for development, run `gem install --dev ./reacon-sdk-0.3.0.beta.1.gem` to install the development dependencies)
|
|
31
31
|
|
|
32
32
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
|
33
33
|
|
|
34
34
|
Finally add this to the Gemfile:
|
|
35
35
|
|
|
36
|
-
gem 'reacon-sdk', '~> 0.
|
|
36
|
+
gem 'reacon-sdk', '~> 0.3.0.beta.1'
|
|
37
37
|
|
|
38
38
|
### Install from Git
|
|
39
39
|
|
|
@@ -560,7 +560,6 @@ Class | Method | HTTP request | Description
|
|
|
560
560
|
- [Reacon::MailPostAnalyticsExportRequestAfter](docs/MailPostAnalyticsExportRequestAfter.md)
|
|
561
561
|
- [Reacon::MailPostAnalyticsExportResponse200](docs/MailPostAnalyticsExportResponse200.md)
|
|
562
562
|
- [Reacon::MailPostAnalyticsExportResponse200NextCursor](docs/MailPostAnalyticsExportResponse200NextCursor.md)
|
|
563
|
-
- [Reacon::MailPostAnalyticsExportResponse200NextCursorAnyOf](docs/MailPostAnalyticsExportResponse200NextCursorAnyOf.md)
|
|
564
563
|
- [Reacon::MailPostCadenceCampaignsByCampaignIdStateRequest](docs/MailPostCadenceCampaignsByCampaignIdStateRequest.md)
|
|
565
564
|
- [Reacon::MailPostCadenceCampaignsByCampaignIdStateResponse200](docs/MailPostCadenceCampaignsByCampaignIdStateResponse200.md)
|
|
566
565
|
- [Reacon::MailPostCadenceCampaignsByCampaignIdStateResponse200AnyOf](docs/MailPostCadenceCampaignsByCampaignIdStateResponse200AnyOf.md)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
# Copyright Reacon contributors. Licensed under Apache-2.0.
|
|
3
3
|
require 'timeout'
|
|
4
|
+
require 'date'
|
|
5
|
+
require 'time'
|
|
4
6
|
|
|
5
7
|
module Reacon
|
|
6
8
|
class RequestTimeoutError < StandardError
|
|
@@ -112,6 +114,19 @@ module Reacon
|
|
|
112
114
|
end
|
|
113
115
|
|
|
114
116
|
module HttpClientPolicy
|
|
117
|
+
# JSON's default Time encoder emits a human-readable, non-RFC3339 string.
|
|
118
|
+
# Traverse nested generated models/maps so every date uses its wire format.
|
|
119
|
+
def object_to_hash(value)
|
|
120
|
+
case value
|
|
121
|
+
when Time then value.getutc.iso8601(9).sub(/\.0+Z$/, 'Z').sub(/(\.\d*?[1-9])0+Z$/, '\\1Z')
|
|
122
|
+
when DateTime then value.new_offset(0).iso8601(9).sub('+00:00', 'Z').sub(/\.0+Z$/, 'Z').sub(/(\.\d*?[1-9])0+Z$/, '\\1Z')
|
|
123
|
+
when Date then value.iso8601
|
|
124
|
+
when Array then value.map { |item| object_to_hash(item) }
|
|
125
|
+
when Hash then value.transform_values { |item| object_to_hash(item) }
|
|
126
|
+
else value.respond_to?(:to_hash) ? object_to_hash(value.to_hash) : value
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
115
130
|
def call_api(http_method, path, opts = {})
|
|
116
131
|
seconds = HttpPolicy.seconds(opts.fetch(:request_timeout, config.timeout))
|
|
117
132
|
stream = nil
|
|
@@ -82,6 +82,7 @@ module Reacon
|
|
|
82
82
|
# List of attributes with nullable: true
|
|
83
83
|
def self.openapi_nullable
|
|
84
84
|
Set.new([
|
|
85
|
+
:'next_cursor',
|
|
85
86
|
])
|
|
86
87
|
end
|
|
87
88
|
|
|
@@ -149,10 +150,6 @@ module Reacon
|
|
|
149
150
|
invalid_properties.push('invalid value for "filename", filename cannot be nil.')
|
|
150
151
|
end
|
|
151
152
|
|
|
152
|
-
if @next_cursor.nil?
|
|
153
|
-
invalid_properties.push('invalid value for "next_cursor", next_cursor cannot be nil.')
|
|
154
|
-
end
|
|
155
|
-
|
|
156
153
|
if @row_count.nil?
|
|
157
154
|
invalid_properties.push('invalid value for "row_count", row_count cannot be nil.')
|
|
158
155
|
end
|
|
@@ -169,7 +166,6 @@ module Reacon
|
|
|
169
166
|
content_type_validator = EnumAttributeValidator.new('String', ["text/csv; charset=utf-8"])
|
|
170
167
|
return false unless content_type_validator.valid?(@content_type)
|
|
171
168
|
return false if @filename.nil?
|
|
172
|
-
return false if @next_cursor.nil?
|
|
173
169
|
return false if @row_count.nil?
|
|
174
170
|
true
|
|
175
171
|
end
|
|
@@ -204,16 +200,6 @@ module Reacon
|
|
|
204
200
|
@filename = filename
|
|
205
201
|
end
|
|
206
202
|
|
|
207
|
-
# Custom attribute writer method with validation
|
|
208
|
-
# @param [Object] next_cursor Value to be assigned
|
|
209
|
-
def next_cursor=(next_cursor)
|
|
210
|
-
if next_cursor.nil?
|
|
211
|
-
fail ArgumentError, 'next_cursor cannot be nil'
|
|
212
|
-
end
|
|
213
|
-
|
|
214
|
-
@next_cursor = next_cursor
|
|
215
|
-
end
|
|
216
|
-
|
|
217
203
|
# Custom attribute writer method with validation
|
|
218
204
|
# @param [Object] row_count Value to be assigned
|
|
219
205
|
def row_count=(row_count)
|
|
@@ -14,90 +14,177 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Reacon
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
class MailPostAnalyticsExportResponse200NextCursor < ApiModelBase
|
|
18
|
+
attr_accessor :created_at
|
|
19
|
+
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'created_at' => :'createdAt',
|
|
26
|
+
:'id' => :'id'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'created_at' => :'String',
|
|
44
|
+
:'id' => :'String'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Reacon::MailPostAnalyticsExportResponse200NextCursor` initialize method"
|
|
25
59
|
end
|
|
26
60
|
|
|
27
|
-
#
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
# Note:
|
|
33
|
-
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
34
|
-
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
35
|
-
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
36
|
-
# - TODO: logging when debugging is set.
|
|
37
|
-
openapi_any_of.each do |klass|
|
|
38
|
-
begin
|
|
39
|
-
next if klass == :AnyType # "nullable: true"
|
|
40
|
-
return find_and_cast_into_type(klass, data)
|
|
41
|
-
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
42
|
-
end
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Reacon::MailPostAnalyticsExportResponse200NextCursor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
43
66
|
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
44
69
|
|
|
45
|
-
|
|
70
|
+
if attributes.key?(:'created_at')
|
|
71
|
+
self.created_at = attributes[:'created_at']
|
|
72
|
+
else
|
|
73
|
+
self.created_at = nil
|
|
46
74
|
end
|
|
47
75
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
76
|
+
if attributes.key?(:'id')
|
|
77
|
+
self.id = attributes[:'id']
|
|
78
|
+
else
|
|
79
|
+
self.id = nil
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if @created_at.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if @id.nil?
|
|
93
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
+
return false if @created_at.nil?
|
|
104
|
+
return false if @id.nil?
|
|
105
|
+
true
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Custom attribute writer method with validation
|
|
109
|
+
# @param [Object] created_at Value to be assigned
|
|
110
|
+
def created_at=(created_at)
|
|
111
|
+
if created_at.nil?
|
|
112
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
@created_at = created_at
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method with validation
|
|
119
|
+
# @param [Object] id Value to be assigned
|
|
120
|
+
def id=(id)
|
|
121
|
+
if id.nil?
|
|
122
|
+
fail ArgumentError, 'id cannot be nil'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
@id = id
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Checks equality by comparing each attribute.
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def ==(o)
|
|
131
|
+
return true if self.equal?(o)
|
|
132
|
+
self.class == o.class &&
|
|
133
|
+
created_at == o.created_at &&
|
|
134
|
+
id == o.id
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# @see the `==` method
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def eql?(o)
|
|
140
|
+
self == o
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Calculates hash code according to all attributes.
|
|
144
|
+
# @return [Integer] Hash code
|
|
145
|
+
def hash
|
|
146
|
+
[created_at, id].hash
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Builds the object from hash
|
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
+
# @return [Object] Returns the model itself
|
|
152
|
+
def self.build_from_hash(attributes)
|
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
93
164
|
end
|
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
94
167
|
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
95
171
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
172
|
+
# Returns the object in the form of hash
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_hash
|
|
175
|
+
hash = {}
|
|
176
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
177
|
+
value = self.send(attr)
|
|
178
|
+
if value.nil?
|
|
179
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
180
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
hash[param] = _to_hash(value)
|
|
99
184
|
end
|
|
185
|
+
hash
|
|
100
186
|
end
|
|
187
|
+
|
|
101
188
|
end
|
|
102
189
|
|
|
103
190
|
end
|
data/lib/reacon-sdk/version.rb
CHANGED
data/lib/reacon-sdk.rb
CHANGED
|
@@ -303,7 +303,6 @@ require 'reacon-sdk/models/mail_post_analytics_export_request'
|
|
|
303
303
|
require 'reacon-sdk/models/mail_post_analytics_export_request_after'
|
|
304
304
|
require 'reacon-sdk/models/mail_post_analytics_export_response200'
|
|
305
305
|
require 'reacon-sdk/models/mail_post_analytics_export_response200_next_cursor'
|
|
306
|
-
require 'reacon-sdk/models/mail_post_analytics_export_response200_next_cursor_any_of'
|
|
307
306
|
require 'reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_request'
|
|
308
307
|
require 'reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_response200'
|
|
309
308
|
require 'reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_response200_any_of'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: reacon-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0.beta.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Reacon
|
|
@@ -447,7 +447,6 @@ files:
|
|
|
447
447
|
- lib/reacon-sdk/models/mail_post_analytics_export_request_after.rb
|
|
448
448
|
- lib/reacon-sdk/models/mail_post_analytics_export_response200.rb
|
|
449
449
|
- lib/reacon-sdk/models/mail_post_analytics_export_response200_next_cursor.rb
|
|
450
|
-
- lib/reacon-sdk/models/mail_post_analytics_export_response200_next_cursor_any_of.rb
|
|
451
450
|
- lib/reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_request.rb
|
|
452
451
|
- lib/reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_response200.rb
|
|
453
452
|
- lib/reacon-sdk/models/mail_post_cadence_campaigns_by_campaign_id_state_response200_any_of.rb
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
#Reacon API
|
|
3
|
-
|
|
4
|
-
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
-
|
|
6
|
-
The version of the OpenAPI document: 0.1.0
|
|
7
|
-
|
|
8
|
-
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.25.0
|
|
10
|
-
|
|
11
|
-
=end
|
|
12
|
-
|
|
13
|
-
require 'date'
|
|
14
|
-
require 'time'
|
|
15
|
-
|
|
16
|
-
module Reacon
|
|
17
|
-
class MailPostAnalyticsExportResponse200NextCursorAnyOf < ApiModelBase
|
|
18
|
-
attr_accessor :created_at
|
|
19
|
-
|
|
20
|
-
attr_accessor :id
|
|
21
|
-
|
|
22
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
-
def self.attribute_map
|
|
24
|
-
{
|
|
25
|
-
:'created_at' => :'createdAt',
|
|
26
|
-
:'id' => :'id'
|
|
27
|
-
}
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Returns attribute mapping this model knows about
|
|
31
|
-
def self.acceptable_attribute_map
|
|
32
|
-
attribute_map
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# Returns all the JSON keys this model knows about
|
|
36
|
-
def self.acceptable_attributes
|
|
37
|
-
acceptable_attribute_map.values
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# Attribute type mapping.
|
|
41
|
-
def self.openapi_types
|
|
42
|
-
{
|
|
43
|
-
:'created_at' => :'String',
|
|
44
|
-
:'id' => :'String'
|
|
45
|
-
}
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# List of attributes with nullable: true
|
|
49
|
-
def self.openapi_nullable
|
|
50
|
-
Set.new([
|
|
51
|
-
])
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Initializes the object
|
|
55
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
-
def initialize(attributes = {})
|
|
57
|
-
if (!attributes.is_a?(Hash))
|
|
58
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Reacon::MailPostAnalyticsExportResponse200NextCursorAnyOf` initialize method"
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
-
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
-
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Reacon::MailPostAnalyticsExportResponse200NextCursorAnyOf`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
-
end
|
|
67
|
-
h[k.to_sym] = v
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if attributes.key?(:'created_at')
|
|
71
|
-
self.created_at = attributes[:'created_at']
|
|
72
|
-
else
|
|
73
|
-
self.created_at = nil
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
if attributes.key?(:'id')
|
|
77
|
-
self.id = attributes[:'id']
|
|
78
|
-
else
|
|
79
|
-
self.id = nil
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
-
# @return Array for valid properties with the reasons
|
|
85
|
-
def list_invalid_properties
|
|
86
|
-
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
-
invalid_properties = Array.new
|
|
88
|
-
if @created_at.nil?
|
|
89
|
-
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
if @id.nil?
|
|
93
|
-
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
invalid_properties
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
# Check to see if the all the properties in the model are valid
|
|
100
|
-
# @return true if the model is valid
|
|
101
|
-
def valid?
|
|
102
|
-
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
-
return false if @created_at.nil?
|
|
104
|
-
return false if @id.nil?
|
|
105
|
-
true
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
# Custom attribute writer method with validation
|
|
109
|
-
# @param [Object] created_at Value to be assigned
|
|
110
|
-
def created_at=(created_at)
|
|
111
|
-
if created_at.nil?
|
|
112
|
-
fail ArgumentError, 'created_at cannot be nil'
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
@created_at = created_at
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
# Custom attribute writer method with validation
|
|
119
|
-
# @param [Object] id Value to be assigned
|
|
120
|
-
def id=(id)
|
|
121
|
-
if id.nil?
|
|
122
|
-
fail ArgumentError, 'id cannot be nil'
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
@id = id
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
# Checks equality by comparing each attribute.
|
|
129
|
-
# @param [Object] Object to be compared
|
|
130
|
-
def ==(o)
|
|
131
|
-
return true if self.equal?(o)
|
|
132
|
-
self.class == o.class &&
|
|
133
|
-
created_at == o.created_at &&
|
|
134
|
-
id == o.id
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
# @see the `==` method
|
|
138
|
-
# @param [Object] Object to be compared
|
|
139
|
-
def eql?(o)
|
|
140
|
-
self == o
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
# Calculates hash code according to all attributes.
|
|
144
|
-
# @return [Integer] Hash code
|
|
145
|
-
def hash
|
|
146
|
-
[created_at, id].hash
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
# Builds the object from hash
|
|
150
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
-
# @return [Object] Returns the model itself
|
|
152
|
-
def self.build_from_hash(attributes)
|
|
153
|
-
return nil unless attributes.is_a?(Hash)
|
|
154
|
-
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
-
transformed_hash = {}
|
|
156
|
-
openapi_types.each_pair do |key, type|
|
|
157
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
-
transformed_hash["#{key}"] = nil
|
|
159
|
-
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
-
# check to ensure the input is an array given that the attribute
|
|
161
|
-
# is documented as an array but the input is not
|
|
162
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
-
end
|
|
165
|
-
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
-
end
|
|
168
|
-
end
|
|
169
|
-
new(transformed_hash)
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
# Returns the object in the form of hash
|
|
173
|
-
# @return [Hash] Returns the object in the form of hash
|
|
174
|
-
def to_hash
|
|
175
|
-
hash = {}
|
|
176
|
-
self.class.attribute_map.each_pair do |attr, param|
|
|
177
|
-
value = self.send(attr)
|
|
178
|
-
if value.nil?
|
|
179
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
180
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
hash[param] = _to_hash(value)
|
|
184
|
-
end
|
|
185
|
-
hash
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
end
|
|
189
|
-
|
|
190
|
-
end
|