sendpost_ruby_sdk 1.0.1 → 1.2.2

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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +109 -0
  3. data/config-ruby.json +1 -1
  4. data/docs/EventMetadata.md +4 -0
  5. data/generate-libs.bash +1 -1
  6. data/git_push.sh +2 -2
  7. data/lib/sendpost_ruby_sdk/api/email_api.rb +1 -1
  8. data/lib/sendpost_ruby_sdk/api/suppression_api.rb +1 -1
  9. data/lib/sendpost_ruby_sdk/api_client.rb +1 -1
  10. data/lib/sendpost_ruby_sdk/api_error.rb +1 -1
  11. data/lib/sendpost_ruby_sdk/configuration.rb +12 -10
  12. data/lib/sendpost_ruby_sdk/models/attachment.rb +13 -18
  13. data/lib/sendpost_ruby_sdk/models/city.rb +13 -18
  14. data/lib/sendpost_ruby_sdk/models/copy_to.rb +13 -18
  15. data/lib/sendpost_ruby_sdk/models/count_stat.rb +13 -18
  16. data/lib/sendpost_ruby_sdk/models/delete_response.rb +13 -18
  17. data/lib/sendpost_ruby_sdk/models/device.rb +13 -18
  18. data/lib/sendpost_ruby_sdk/models/email_message.rb +13 -18
  19. data/lib/sendpost_ruby_sdk/models/email_response.rb +13 -18
  20. data/lib/sendpost_ruby_sdk/models/event_metadata.rb +32 -19
  21. data/lib/sendpost_ruby_sdk/models/from.rb +13 -18
  22. data/lib/sendpost_ruby_sdk/models/os.rb +13 -18
  23. data/lib/sendpost_ruby_sdk/models/q_email_message.rb +13 -18
  24. data/lib/sendpost_ruby_sdk/models/q_event.rb +13 -18
  25. data/lib/sendpost_ruby_sdk/models/r_suppression.rb +13 -18
  26. data/lib/sendpost_ruby_sdk/models/rd_suppression.rb +13 -18
  27. data/lib/sendpost_ruby_sdk/models/reply_to.rb +13 -18
  28. data/lib/sendpost_ruby_sdk/models/suppression.rb +13 -18
  29. data/lib/sendpost_ruby_sdk/models/suppression_email.rb +13 -18
  30. data/lib/sendpost_ruby_sdk/models/to.rb +13 -18
  31. data/lib/sendpost_ruby_sdk/models/user_agent.rb +13 -18
  32. data/lib/sendpost_ruby_sdk/models/webhook_event.rb +13 -18
  33. data/lib/sendpost_ruby_sdk/version.rb +2 -2
  34. data/lib/sendpost_ruby_sdk.rb +1 -1
  35. data/sendpost.yaml +4 -0
  36. data/sendpost_ruby_sdk.gemspec +1 -1
  37. data/spec/api_client_spec.rb +1 -1
  38. data/spec/configuration_spec.rb +1 -1
  39. data/spec/spec_helper.rb +1 -1
  40. metadata +10 -10
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: hello@sendpost.io
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -65,6 +65,7 @@ module Sendpost
65
65
  # Show invalid properties with the reasons. Usually used together with valid?
66
66
  # @return Array for valid properties with the reasons
67
67
  def list_invalid_properties
68
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
68
69
  invalid_properties = Array.new
69
70
  invalid_properties
70
71
  end
@@ -72,6 +73,7 @@ module Sendpost
72
73
  # Check to see if the all the properties in the model are valid
73
74
  # @return true if the model is valid
74
75
  def valid?
76
+ warn '[DEPRECATED] the `valid?` method is obsolete'
75
77
  true
76
78
  end
77
79
 
@@ -99,37 +101,30 @@ module Sendpost
99
101
  # @param [Hash] attributes Model attributes in the form of hash
100
102
  # @return [Object] Returns the model itself
101
103
  def self.build_from_hash(attributes)
102
- new.build_from_hash(attributes)
103
- end
104
-
105
- # Builds the object from hash
106
- # @param [Hash] attributes Model attributes in the form of hash
107
- # @return [Object] Returns the model itself
108
- def build_from_hash(attributes)
109
104
  return nil unless attributes.is_a?(Hash)
110
105
  attributes = attributes.transform_keys(&:to_sym)
111
- self.class.openapi_types.each_pair do |key, type|
112
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
113
- self.send("#{key}=", nil)
106
+ transformed_hash = {}
107
+ openapi_types.each_pair do |key, type|
108
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
109
+ transformed_hash["#{key}"] = nil
114
110
  elsif type =~ /\AArray<(.*)>/i
115
111
  # check to ensure the input is an array given that the attribute
116
112
  # is documented as an array but the input is not
117
- if attributes[self.class.attribute_map[key]].is_a?(Array)
118
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ if attributes[attribute_map[key]].is_a?(Array)
114
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
119
115
  end
120
- elsif !attributes[self.class.attribute_map[key]].nil?
121
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ elsif !attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
122
118
  end
123
119
  end
124
-
125
- self
120
+ new(transformed_hash)
126
121
  end
127
122
 
128
123
  # Deserializes the data based on type
129
124
  # @param string type Data type
130
125
  # @param string value Value to be deserialized
131
126
  # @return [Object] Deserialized data
132
- def _deserialize(type, value)
127
+ def self._deserialize(type, value)
133
128
  case type.to_sym
134
129
  when :Time
135
130
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: hello@sendpost.io
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -183,6 +183,7 @@ module Sendpost
183
183
  # Show invalid properties with the reasons. Usually used together with valid?
184
184
  # @return Array for valid properties with the reasons
185
185
  def list_invalid_properties
186
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
186
187
  invalid_properties = Array.new
187
188
  invalid_properties
188
189
  end
@@ -190,6 +191,7 @@ module Sendpost
190
191
  # Check to see if the all the properties in the model are valid
191
192
  # @return true if the model is valid
192
193
  def valid?
194
+ warn '[DEPRECATED] the `valid?` method is obsolete'
193
195
  true
194
196
  end
195
197
 
@@ -231,37 +233,30 @@ module Sendpost
231
233
  # @param [Hash] attributes Model attributes in the form of hash
232
234
  # @return [Object] Returns the model itself
233
235
  def self.build_from_hash(attributes)
234
- new.build_from_hash(attributes)
235
- end
236
-
237
- # Builds the object from hash
238
- # @param [Hash] attributes Model attributes in the form of hash
239
- # @return [Object] Returns the model itself
240
- def build_from_hash(attributes)
241
236
  return nil unless attributes.is_a?(Hash)
242
237
  attributes = attributes.transform_keys(&:to_sym)
243
- self.class.openapi_types.each_pair do |key, type|
244
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
245
- self.send("#{key}=", nil)
238
+ transformed_hash = {}
239
+ openapi_types.each_pair do |key, type|
240
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
241
+ transformed_hash["#{key}"] = nil
246
242
  elsif type =~ /\AArray<(.*)>/i
247
243
  # check to ensure the input is an array given that the attribute
248
244
  # is documented as an array but the input is not
249
- if attributes[self.class.attribute_map[key]].is_a?(Array)
250
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
245
+ if attributes[attribute_map[key]].is_a?(Array)
246
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
251
247
  end
252
- elsif !attributes[self.class.attribute_map[key]].nil?
253
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
248
+ elsif !attributes[attribute_map[key]].nil?
249
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
254
250
  end
255
251
  end
256
-
257
- self
252
+ new(transformed_hash)
258
253
  end
259
254
 
260
255
  # Deserializes the data based on type
261
256
  # @param string type Data type
262
257
  # @param string value Value to be deserialized
263
258
  # @return [Object] Deserialized data
264
- def _deserialize(type, value)
259
+ def self._deserialize(type, value)
265
260
  case type.to_sym
266
261
  when :Time
267
262
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: hello@sendpost.io
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -97,6 +97,7 @@ module Sendpost
97
97
  # Show invalid properties with the reasons. Usually used together with valid?
98
98
  # @return Array for valid properties with the reasons
99
99
  def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
101
  invalid_properties = Array.new
101
102
  invalid_properties
102
103
  end
@@ -104,6 +105,7 @@ module Sendpost
104
105
  # Check to see if the all the properties in the model are valid
105
106
  # @return true if the model is valid
106
107
  def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
109
  true
108
110
  end
109
111
 
@@ -135,37 +137,30 @@ module Sendpost
135
137
  # @param [Hash] attributes Model attributes in the form of hash
136
138
  # @return [Object] Returns the model itself
137
139
  def self.build_from_hash(attributes)
138
- new.build_from_hash(attributes)
139
- end
140
-
141
- # Builds the object from hash
142
- # @param [Hash] attributes Model attributes in the form of hash
143
- # @return [Object] Returns the model itself
144
- def build_from_hash(attributes)
145
140
  return nil unless attributes.is_a?(Hash)
146
141
  attributes = attributes.transform_keys(&:to_sym)
147
- self.class.openapi_types.each_pair do |key, type|
148
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
149
- self.send("#{key}=", nil)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
150
146
  elsif type =~ /\AArray<(.*)>/i
151
147
  # check to ensure the input is an array given that the attribute
152
148
  # is documented as an array but the input is not
153
- if attributes[self.class.attribute_map[key]].is_a?(Array)
154
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
155
151
  end
156
- elsif !attributes[self.class.attribute_map[key]].nil?
157
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
158
154
  end
159
155
  end
160
-
161
- self
156
+ new(transformed_hash)
162
157
  end
163
158
 
164
159
  # Deserializes the data based on type
165
160
  # @param string type Data type
166
161
  # @param string value Value to be deserialized
167
162
  # @return [Object] Deserialized data
168
- def _deserialize(type, value)
163
+ def self._deserialize(type, value)
169
164
  case type.to_sym
170
165
  when :Time
171
166
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: hello@sendpost.io
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -17,6 +17,10 @@ module Sendpost
17
17
  class EventMetadata
18
18
  attr_accessor :clicked_url
19
19
 
20
+ attr_accessor :tracked_ip
21
+
22
+ attr_accessor :raw_user_agent
23
+
20
24
  attr_accessor :device
21
25
 
22
26
  attr_accessor :geo
@@ -33,6 +37,8 @@ module Sendpost
33
37
  def self.attribute_map
34
38
  {
35
39
  :'clicked_url' => :'clickedURL',
40
+ :'tracked_ip' => :'trackedIP',
41
+ :'raw_user_agent' => :'rawUserAgent',
36
42
  :'device' => :'device',
37
43
  :'geo' => :'geo',
38
44
  :'os' => :'os',
@@ -51,6 +57,8 @@ module Sendpost
51
57
  def self.openapi_types
52
58
  {
53
59
  :'clicked_url' => :'String',
60
+ :'tracked_ip' => :'String',
61
+ :'raw_user_agent' => :'String',
54
62
  :'device' => :'Device',
55
63
  :'geo' => :'City',
56
64
  :'os' => :'Os',
@@ -85,6 +93,14 @@ module Sendpost
85
93
  self.clicked_url = attributes[:'clicked_url']
86
94
  end
87
95
 
96
+ if attributes.key?(:'tracked_ip')
97
+ self.tracked_ip = attributes[:'tracked_ip']
98
+ end
99
+
100
+ if attributes.key?(:'raw_user_agent')
101
+ self.raw_user_agent = attributes[:'raw_user_agent']
102
+ end
103
+
88
104
  if attributes.key?(:'device')
89
105
  self.device = attributes[:'device']
90
106
  end
@@ -113,6 +129,7 @@ module Sendpost
113
129
  # Show invalid properties with the reasons. Usually used together with valid?
114
130
  # @return Array for valid properties with the reasons
115
131
  def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
133
  invalid_properties = Array.new
117
134
  invalid_properties
118
135
  end
@@ -120,6 +137,7 @@ module Sendpost
120
137
  # Check to see if the all the properties in the model are valid
121
138
  # @return true if the model is valid
122
139
  def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
141
  true
124
142
  end
125
143
 
@@ -129,6 +147,8 @@ module Sendpost
129
147
  return true if self.equal?(o)
130
148
  self.class == o.class &&
131
149
  clicked_url == o.clicked_url &&
150
+ tracked_ip == o.tracked_ip &&
151
+ raw_user_agent == o.raw_user_agent &&
132
152
  device == o.device &&
133
153
  geo == o.geo &&
134
154
  os == o.os &&
@@ -146,44 +166,37 @@ module Sendpost
146
166
  # Calculates hash code according to all attributes.
147
167
  # @return [Integer] Hash code
148
168
  def hash
149
- [clicked_url, device, geo, os, smtp_code, smtp_description, user_agent].hash
169
+ [clicked_url, tracked_ip, raw_user_agent, device, geo, os, smtp_code, smtp_description, user_agent].hash
150
170
  end
151
171
 
152
172
  # Builds the object from hash
153
173
  # @param [Hash] attributes Model attributes in the form of hash
154
174
  # @return [Object] Returns the model itself
155
175
  def self.build_from_hash(attributes)
156
- new.build_from_hash(attributes)
157
- end
158
-
159
- # Builds the object from hash
160
- # @param [Hash] attributes Model attributes in the form of hash
161
- # @return [Object] Returns the model itself
162
- def build_from_hash(attributes)
163
176
  return nil unless attributes.is_a?(Hash)
164
177
  attributes = attributes.transform_keys(&:to_sym)
165
- self.class.openapi_types.each_pair do |key, type|
166
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
167
- self.send("#{key}=", nil)
178
+ transformed_hash = {}
179
+ openapi_types.each_pair do |key, type|
180
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
181
+ transformed_hash["#{key}"] = nil
168
182
  elsif type =~ /\AArray<(.*)>/i
169
183
  # check to ensure the input is an array given that the attribute
170
184
  # is documented as an array but the input is not
171
- if attributes[self.class.attribute_map[key]].is_a?(Array)
172
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
185
+ if attributes[attribute_map[key]].is_a?(Array)
186
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
173
187
  end
174
- elsif !attributes[self.class.attribute_map[key]].nil?
175
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
+ elsif !attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
176
190
  end
177
191
  end
178
-
179
- self
192
+ new(transformed_hash)
180
193
  end
181
194
 
182
195
  # Deserializes the data based on type
183
196
  # @param string type Data type
184
197
  # @param string value Value to be deserialized
185
198
  # @return [Object] Deserialized data
186
- def _deserialize(type, value)
199
+ def self._deserialize(type, value)
187
200
  case type.to_sym
188
201
  when :Time
189
202
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: hello@sendpost.io
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -73,6 +73,7 @@ module Sendpost
73
73
  # Show invalid properties with the reasons. Usually used together with valid?
74
74
  # @return Array for valid properties with the reasons
75
75
  def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
77
  invalid_properties = Array.new
77
78
  invalid_properties
78
79
  end
@@ -80,6 +81,7 @@ module Sendpost
80
81
  # Check to see if the all the properties in the model are valid
81
82
  # @return true if the model is valid
82
83
  def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
85
  true
84
86
  end
85
87
 
@@ -108,37 +110,30 @@ module Sendpost
108
110
  # @param [Hash] attributes Model attributes in the form of hash
109
111
  # @return [Object] Returns the model itself
110
112
  def self.build_from_hash(attributes)
111
- new.build_from_hash(attributes)
112
- end
113
-
114
- # Builds the object from hash
115
- # @param [Hash] attributes Model attributes in the form of hash
116
- # @return [Object] Returns the model itself
117
- def build_from_hash(attributes)
118
113
  return nil unless attributes.is_a?(Hash)
119
114
  attributes = attributes.transform_keys(&:to_sym)
120
- self.class.openapi_types.each_pair do |key, type|
121
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
- self.send("#{key}=", nil)
115
+ transformed_hash = {}
116
+ openapi_types.each_pair do |key, type|
117
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = nil
123
119
  elsif type =~ /\AArray<(.*)>/i
124
120
  # check to ensure the input is an array given that the attribute
125
121
  # is documented as an array but the input is not
126
- if attributes[self.class.attribute_map[key]].is_a?(Array)
127
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
128
124
  end
129
- elsif !attributes[self.class.attribute_map[key]].nil?
130
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
131
127
  end
132
128
  end
133
-
134
- self
129
+ new(transformed_hash)
135
130
  end
136
131
 
137
132
  # Deserializes the data based on type
138
133
  # @param string type Data type
139
134
  # @param string value Value to be deserialized
140
135
  # @return [Object] Deserialized data
141
- def _deserialize(type, value)
136
+ def self._deserialize(type, value)
142
137
  case type.to_sym
143
138
  when :Time
144
139
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: hello@sendpost.io
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -97,6 +97,7 @@ module Sendpost
97
97
  # Show invalid properties with the reasons. Usually used together with valid?
98
98
  # @return Array for valid properties with the reasons
99
99
  def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
101
  invalid_properties = Array.new
101
102
  invalid_properties
102
103
  end
@@ -104,6 +105,7 @@ module Sendpost
104
105
  # Check to see if the all the properties in the model are valid
105
106
  # @return true if the model is valid
106
107
  def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
109
  true
108
110
  end
109
111
 
@@ -135,37 +137,30 @@ module Sendpost
135
137
  # @param [Hash] attributes Model attributes in the form of hash
136
138
  # @return [Object] Returns the model itself
137
139
  def self.build_from_hash(attributes)
138
- new.build_from_hash(attributes)
139
- end
140
-
141
- # Builds the object from hash
142
- # @param [Hash] attributes Model attributes in the form of hash
143
- # @return [Object] Returns the model itself
144
- def build_from_hash(attributes)
145
140
  return nil unless attributes.is_a?(Hash)
146
141
  attributes = attributes.transform_keys(&:to_sym)
147
- self.class.openapi_types.each_pair do |key, type|
148
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
149
- self.send("#{key}=", nil)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
150
146
  elsif type =~ /\AArray<(.*)>/i
151
147
  # check to ensure the input is an array given that the attribute
152
148
  # is documented as an array but the input is not
153
- if attributes[self.class.attribute_map[key]].is_a?(Array)
154
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
155
151
  end
156
- elsif !attributes[self.class.attribute_map[key]].nil?
157
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
158
154
  end
159
155
  end
160
-
161
- self
156
+ new(transformed_hash)
162
157
  end
163
158
 
164
159
  # Deserializes the data based on type
165
160
  # @param string type Data type
166
161
  # @param string value Value to be deserialized
167
162
  # @return [Object] Deserialized data
168
- def _deserialize(type, value)
163
+ def self._deserialize(type, value)
169
164
  case type.to_sym
170
165
  when :Time
171
166
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: hello@sendpost.io
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -281,6 +281,7 @@ module Sendpost
281
281
  # Show invalid properties with the reasons. Usually used together with valid?
282
282
  # @return Array for valid properties with the reasons
283
283
  def list_invalid_properties
284
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
284
285
  invalid_properties = Array.new
285
286
  invalid_properties
286
287
  end
@@ -288,6 +289,7 @@ module Sendpost
288
289
  # Check to see if the all the properties in the model are valid
289
290
  # @return true if the model is valid
290
291
  def valid?
292
+ warn '[DEPRECATED] the `valid?` method is obsolete'
291
293
  true
292
294
  end
293
295
 
@@ -341,37 +343,30 @@ module Sendpost
341
343
  # @param [Hash] attributes Model attributes in the form of hash
342
344
  # @return [Object] Returns the model itself
343
345
  def self.build_from_hash(attributes)
344
- new.build_from_hash(attributes)
345
- end
346
-
347
- # Builds the object from hash
348
- # @param [Hash] attributes Model attributes in the form of hash
349
- # @return [Object] Returns the model itself
350
- def build_from_hash(attributes)
351
346
  return nil unless attributes.is_a?(Hash)
352
347
  attributes = attributes.transform_keys(&:to_sym)
353
- self.class.openapi_types.each_pair do |key, type|
354
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
355
- self.send("#{key}=", nil)
348
+ transformed_hash = {}
349
+ openapi_types.each_pair do |key, type|
350
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
351
+ transformed_hash["#{key}"] = nil
356
352
  elsif type =~ /\AArray<(.*)>/i
357
353
  # check to ensure the input is an array given that the attribute
358
354
  # is documented as an array but the input is not
359
- if attributes[self.class.attribute_map[key]].is_a?(Array)
360
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
355
+ if attributes[attribute_map[key]].is_a?(Array)
356
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
361
357
  end
362
- elsif !attributes[self.class.attribute_map[key]].nil?
363
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
358
+ elsif !attributes[attribute_map[key]].nil?
359
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
364
360
  end
365
361
  end
366
-
367
- self
362
+ new(transformed_hash)
368
363
  end
369
364
 
370
365
  # Deserializes the data based on type
371
366
  # @param string type Data type
372
367
  # @param string value Value to be deserialized
373
368
  # @return [Object] Deserialized data
374
- def _deserialize(type, value)
369
+ def self._deserialize(type, value)
375
370
  case type.to_sym
376
371
  when :Time
377
372
  Time.parse(value)
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: hello@sendpost.io
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.6.0
9
+ OpenAPI Generator version: 7.0.1
10
10
 
11
11
  =end
12
12
 
@@ -163,6 +163,7 @@ module Sendpost
163
163
  # Show invalid properties with the reasons. Usually used together with valid?
164
164
  # @return Array for valid properties with the reasons
165
165
  def list_invalid_properties
166
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
166
167
  invalid_properties = Array.new
167
168
  invalid_properties
168
169
  end
@@ -170,6 +171,7 @@ module Sendpost
170
171
  # Check to see if the all the properties in the model are valid
171
172
  # @return true if the model is valid
172
173
  def valid?
174
+ warn '[DEPRECATED] the `valid?` method is obsolete'
173
175
  true
174
176
  end
175
177
 
@@ -209,37 +211,30 @@ module Sendpost
209
211
  # @param [Hash] attributes Model attributes in the form of hash
210
212
  # @return [Object] Returns the model itself
211
213
  def self.build_from_hash(attributes)
212
- new.build_from_hash(attributes)
213
- end
214
-
215
- # Builds the object from hash
216
- # @param [Hash] attributes Model attributes in the form of hash
217
- # @return [Object] Returns the model itself
218
- def build_from_hash(attributes)
219
214
  return nil unless attributes.is_a?(Hash)
220
215
  attributes = attributes.transform_keys(&:to_sym)
221
- self.class.openapi_types.each_pair do |key, type|
222
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
223
- self.send("#{key}=", nil)
216
+ transformed_hash = {}
217
+ openapi_types.each_pair do |key, type|
218
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
219
+ transformed_hash["#{key}"] = nil
224
220
  elsif type =~ /\AArray<(.*)>/i
225
221
  # check to ensure the input is an array given that the attribute
226
222
  # is documented as an array but the input is not
227
- if attributes[self.class.attribute_map[key]].is_a?(Array)
228
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
223
+ if attributes[attribute_map[key]].is_a?(Array)
224
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
229
225
  end
230
- elsif !attributes[self.class.attribute_map[key]].nil?
231
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
226
+ elsif !attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
232
228
  end
233
229
  end
234
-
235
- self
230
+ new(transformed_hash)
236
231
  end
237
232
 
238
233
  # Deserializes the data based on type
239
234
  # @param string type Data type
240
235
  # @param string value Value to be deserialized
241
236
  # @return [Object] Deserialized data
242
- def _deserialize(type, value)
237
+ def self._deserialize(type, value)
243
238
  case type.to_sym
244
239
  when :Time
245
240
  Time.parse(value)