pingram 0.1.5 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e0fb4c7eaff1d69b8c4a11b5274f4ceb6647ed04967ee23e1ba8a87e58c081e
4
- data.tar.gz: 4968c7bc0ced946caacde1a4c0414d303ea90467591d18ee546ca501f495a1c9
3
+ metadata.gz: 03baf266fc6aed7346888b141c8e4ab8b4d558c13144c3025e1d140e3008cfef
4
+ data.tar.gz: 3cb20cfd4c84cdac46fd7041a49210671493a381a27f0fcda6fda048a84cbdae
5
5
  SHA512:
6
- metadata.gz: 972ab164c3fd3f815ddac368be8820a96f26a4a10345c2b1faf74835a38e90b74b56677fe4a031ce06a9274878e1ca01532f0a627c10f1fa227ed803957be46a
7
- data.tar.gz: 91aa1a017e6d8dd01deb2e4c97552ef7a93a73dd03de9aa868a56f4e9b25207a144878180f2f7b495d2d60a1e34e1697cd3f38be790e2fb1d41a7d0418bd380c
6
+ metadata.gz: 7c0b0abd461f781ac4a12147f69a47ec130882e1be44b76fb87788fdae9e10fcbe602298ab1834e06975786c0ff971a2db1f66408523d2f446397861bf04a386
7
+ data.tar.gz: b218e6508263cf68f22716bfc1963b2ac8d0248691c79bd60e4fdd101ea021077233782d1ec579d7ff7463c9ed3ea7ac60a6c8a963ecb9e02b00b3b0f1425b17
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pingram (0.1.5)
4
+ pingram (1.0.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
@@ -415,7 +415,7 @@ module Pingram
415
415
  fail ArgumentError, "Missing the required parameter 'set_default_template_request' when calling TemplatesApi.templates_set_default_template"
416
416
  end
417
417
  # resource path
418
- local_var_path = '/notifications/{notificationId}/{channel}/templates/default'.sub('{' + 'notificationId' + '}', CGI.escape(notification_id.to_s)).sub('{' + 'channel' + '}', CGI.escape(channel.to_s))
418
+ local_var_path = '/notifications/{notificationId}/{channel}/templates/default-selection'.sub('{' + 'notificationId' + '}', CGI.escape(notification_id.to_s)).sub('{' + 'channel' + '}', CGI.escape(channel.to_s))
419
419
 
420
420
  # query parameters
421
421
  query_params = opts[:query_params] || {}
@@ -32,7 +32,7 @@ module Pingram
32
32
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
33
33
  def initialize(config = Configuration.default)
34
34
  @config = config
35
- @user_agent = "pingram-ruby/0.1.5"
35
+ @user_agent = "pingram-ruby/1.0.0"
36
36
  @default_headers = {
37
37
  'Content-Type' => 'application/json',
38
38
  'User-Agent' => @user_agent
@@ -14,91 +14,306 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Pingram
17
- # Request body for updating a template. Use EMAIL fields (html, subject, senderName, etc.) when channel is EMAIL. Use INAPP_WEB fields (title, redirectURL, imageURL, instant, batch) when channel is INAPP_WEB. Other channels have their own shapes; only include properties that apply to the channel.
18
- module TemplatePatchRequest
19
- class << self
20
- # List of class defined in anyOf (OpenAPI v3)
21
- def openapi_any_of
22
- [
23
- :'TemplatePatchRequestAnyOf',
24
- :'TemplatePatchRequestAnyOf1'
25
- ]
26
- end
27
-
28
- # Builds the object
29
- # @param [Mixed] Data to be matched against the list of anyOf items
30
- # @return [Object] Returns the model or the data itself
31
- def build(data)
32
- # Go through the list of anyOf items and attempt to identify the appropriate one.
33
- # Note:
34
- # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
- # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
- # - TODO: scalar values are de facto behaving as if they were nullable.
37
- # - TODO: logging when debugging is set.
38
- openapi_any_of.each do |klass|
39
- begin
40
- next if klass == :AnyType # "nullable: true"
41
- return find_and_cast_into_type(klass, data)
42
- rescue # rescue all errors so we keep iterating even if the current item lookup raises
43
- end
17
+ # Request body for updating a template. Include only properties that apply to the channel in the path. EMAIL: html, subject, senderName, etc. | INAPP_WEB: title, redirectURL, instant, batch | SMS/CALL: text | PUSH/WEB_PUSH: title, message, icon, url | SLACK: text, blocks, username, icon
18
+ class TemplatePatchRequest < ApiModelBase
19
+ # HTML body of the email.
20
+ attr_accessor :html
21
+
22
+ # Preview text (e.g. for inbox).
23
+ attr_accessor :preview_text
24
+
25
+ # Internal editor representation of the email content (e.g. Bee or Redactor JSON). Used for editing and component embedding; the actual email sent to recipients uses the html field.
26
+ attr_accessor :internal
27
+
28
+ # Email subject line.
29
+ attr_accessor :subject
30
+
31
+ # Sender display name.
32
+ attr_accessor :sender_name
33
+
34
+ # Sender email address.
35
+ attr_accessor :sender_email
36
+
37
+ # Migration metadata (e.g. from template migration).
38
+ attr_accessor :migration
39
+
40
+ # Notification title (in-app).
41
+ attr_accessor :title
42
+
43
+ # URL to open when the user taps the notification.
44
+ attr_accessor :redirect_url
45
+
46
+ # Image URL shown in the in-app notification.
47
+ attr_accessor :image_url
48
+
49
+ attr_accessor :instant
50
+
51
+ attr_accessor :batch
52
+
53
+ # Message text (SMS or call).
54
+ attr_accessor :text
55
+
56
+ # Push notification body text. (title is shared with INAPP_WEB above.)
57
+ attr_accessor :message
58
+
59
+ # Web push: icon URL. Slack: bot icon (emoji or URL).
60
+ attr_accessor :icon
61
+
62
+ # Web push: URL to open when the notification is clicked.
63
+ attr_accessor :url
64
+
65
+ # Slack message blocks (optional).
66
+ attr_accessor :blocks
67
+
68
+ # Slack bot username.
69
+ attr_accessor :username
70
+
71
+ # Attribute mapping from ruby-style variable name to JSON key.
72
+ def self.attribute_map
73
+ {
74
+ :'html' => :'html',
75
+ :'preview_text' => :'previewText',
76
+ :'internal' => :'internal',
77
+ :'subject' => :'subject',
78
+ :'sender_name' => :'senderName',
79
+ :'sender_email' => :'senderEmail',
80
+ :'migration' => :'migration',
81
+ :'title' => :'title',
82
+ :'redirect_url' => :'redirectURL',
83
+ :'image_url' => :'imageURL',
84
+ :'instant' => :'instant',
85
+ :'batch' => :'batch',
86
+ :'text' => :'text',
87
+ :'message' => :'message',
88
+ :'icon' => :'icon',
89
+ :'url' => :'url',
90
+ :'blocks' => :'blocks',
91
+ :'username' => :'username'
92
+ }
93
+ end
94
+
95
+ # Returns attribute mapping this model knows about
96
+ def self.acceptable_attribute_map
97
+ attribute_map
98
+ end
99
+
100
+ # Returns all the JSON keys this model knows about
101
+ def self.acceptable_attributes
102
+ acceptable_attribute_map.values
103
+ end
104
+
105
+ # Attribute type mapping.
106
+ def self.openapi_types
107
+ {
108
+ :'html' => :'String',
109
+ :'preview_text' => :'String',
110
+ :'internal' => :'String',
111
+ :'subject' => :'String',
112
+ :'sender_name' => :'String',
113
+ :'sender_email' => :'String',
114
+ :'migration' => :'String',
115
+ :'title' => :'String',
116
+ :'redirect_url' => :'String',
117
+ :'image_url' => :'String',
118
+ :'instant' => :'TemplatePatchRequestInstant',
119
+ :'batch' => :'TemplatePatchRequestBatch',
120
+ :'text' => :'String',
121
+ :'message' => :'String',
122
+ :'icon' => :'String',
123
+ :'url' => :'String',
124
+ :'blocks' => :'Array<Hash<String, Object>>',
125
+ :'username' => :'String'
126
+ }
127
+ end
128
+
129
+ # List of attributes with nullable: true
130
+ def self.openapi_nullable
131
+ Set.new([
132
+ ])
133
+ end
134
+
135
+ # Initializes the object
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ def initialize(attributes = {})
138
+ if (!attributes.is_a?(Hash))
139
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequest` initialize method"
140
+ end
141
+
142
+ # check to see if the attribute exists and convert string to symbol for hash key
143
+ acceptable_attribute_map = self.class.acceptable_attribute_map
144
+ attributes = attributes.each_with_object({}) { |(k, v), h|
145
+ if (!acceptable_attribute_map.key?(k.to_sym))
146
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePatchRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
44
147
  end
148
+ h[k.to_sym] = v
149
+ }
45
150
 
46
- openapi_any_of.include?(:AnyType) ? data : nil
47
- end
48
-
49
- private
50
-
51
- SchemaMismatchError = Class.new(StandardError)
52
-
53
- # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
54
- def find_and_cast_into_type(klass, data)
55
- return if data.nil?
56
-
57
- case klass.to_s
58
- when 'Boolean'
59
- return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
60
- when 'Float'
61
- return data if data.instance_of?(Float)
62
- when 'Integer'
63
- return data if data.instance_of?(Integer)
64
- when 'Time'
65
- return Time.parse(data)
66
- when 'Date'
67
- return Date.iso8601(data)
68
- when 'String'
69
- return data if data.instance_of?(String)
70
- when 'Object' # "type: object"
71
- return data if data.instance_of?(Hash)
72
- when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
73
- if data.instance_of?(Array)
74
- sub_type = Regexp.last_match[:sub_type]
75
- return data.map { |item| find_and_cast_into_type(sub_type, item) }
76
- end
77
- when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
78
- if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
79
- sub_type = Regexp.last_match[:sub_type]
80
- return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
81
- end
82
- else # model
83
- const = Pingram.const_get(klass)
84
- if const
85
- if const.respond_to?(:openapi_any_of) # nested anyOf model
86
- model = const.build(data)
87
- return model if model
88
- else
89
- # raise if data contains keys that are not known to the model
90
- raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
- model = const.build_from_hash(data)
92
- return model if model
93
- end
151
+ if attributes.key?(:'html')
152
+ self.html = attributes[:'html']
153
+ end
154
+
155
+ if attributes.key?(:'preview_text')
156
+ self.preview_text = attributes[:'preview_text']
157
+ end
158
+
159
+ if attributes.key?(:'internal')
160
+ self.internal = attributes[:'internal']
161
+ end
162
+
163
+ if attributes.key?(:'subject')
164
+ self.subject = attributes[:'subject']
165
+ end
166
+
167
+ if attributes.key?(:'sender_name')
168
+ self.sender_name = attributes[:'sender_name']
169
+ end
170
+
171
+ if attributes.key?(:'sender_email')
172
+ self.sender_email = attributes[:'sender_email']
173
+ end
174
+
175
+ if attributes.key?(:'migration')
176
+ self.migration = attributes[:'migration']
177
+ end
178
+
179
+ if attributes.key?(:'title')
180
+ self.title = attributes[:'title']
181
+ end
182
+
183
+ if attributes.key?(:'redirect_url')
184
+ self.redirect_url = attributes[:'redirect_url']
185
+ end
186
+
187
+ if attributes.key?(:'image_url')
188
+ self.image_url = attributes[:'image_url']
189
+ end
190
+
191
+ if attributes.key?(:'instant')
192
+ self.instant = attributes[:'instant']
193
+ end
194
+
195
+ if attributes.key?(:'batch')
196
+ self.batch = attributes[:'batch']
197
+ end
198
+
199
+ if attributes.key?(:'text')
200
+ self.text = attributes[:'text']
201
+ end
202
+
203
+ if attributes.key?(:'message')
204
+ self.message = attributes[:'message']
205
+ end
206
+
207
+ if attributes.key?(:'icon')
208
+ self.icon = attributes[:'icon']
209
+ end
210
+
211
+ if attributes.key?(:'url')
212
+ self.url = attributes[:'url']
213
+ end
214
+
215
+ if attributes.key?(:'blocks')
216
+ if (value = attributes[:'blocks']).is_a?(Array)
217
+ self.blocks = value
218
+ end
219
+ end
220
+
221
+ if attributes.key?(:'username')
222
+ self.username = attributes[:'username']
223
+ end
224
+ end
225
+
226
+ # Show invalid properties with the reasons. Usually used together with valid?
227
+ # @return Array for valid properties with the reasons
228
+ def list_invalid_properties
229
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
230
+ invalid_properties = Array.new
231
+ invalid_properties
232
+ end
233
+
234
+ # Check to see if the all the properties in the model are valid
235
+ # @return true if the model is valid
236
+ def valid?
237
+ warn '[DEPRECATED] the `valid?` method is obsolete'
238
+ true
239
+ end
240
+
241
+ # Checks equality by comparing each attribute.
242
+ # @param [Object] Object to be compared
243
+ def ==(o)
244
+ return true if self.equal?(o)
245
+ self.class == o.class &&
246
+ html == o.html &&
247
+ preview_text == o.preview_text &&
248
+ internal == o.internal &&
249
+ subject == o.subject &&
250
+ sender_name == o.sender_name &&
251
+ sender_email == o.sender_email &&
252
+ migration == o.migration &&
253
+ title == o.title &&
254
+ redirect_url == o.redirect_url &&
255
+ image_url == o.image_url &&
256
+ instant == o.instant &&
257
+ batch == o.batch &&
258
+ text == o.text &&
259
+ message == o.message &&
260
+ icon == o.icon &&
261
+ url == o.url &&
262
+ blocks == o.blocks &&
263
+ username == o.username
264
+ end
265
+
266
+ # @see the `==` method
267
+ # @param [Object] Object to be compared
268
+ def eql?(o)
269
+ self == o
270
+ end
271
+
272
+ # Calculates hash code according to all attributes.
273
+ # @return [Integer] Hash code
274
+ def hash
275
+ [html, preview_text, internal, subject, sender_name, sender_email, migration, title, redirect_url, image_url, instant, batch, text, message, icon, url, blocks, username].hash
276
+ end
277
+
278
+ # Builds the object from hash
279
+ # @param [Hash] attributes Model attributes in the form of hash
280
+ # @return [Object] Returns the model itself
281
+ def self.build_from_hash(attributes)
282
+ return nil unless attributes.is_a?(Hash)
283
+ attributes = attributes.transform_keys(&:to_sym)
284
+ transformed_hash = {}
285
+ openapi_types.each_pair do |key, type|
286
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
287
+ transformed_hash["#{key}"] = nil
288
+ elsif type =~ /\AArray<(.*)>/i
289
+ # check to ensure the input is an array given that the attribute
290
+ # is documented as an array but the input is not
291
+ if attributes[attribute_map[key]].is_a?(Array)
292
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
94
293
  end
294
+ elsif !attributes[attribute_map[key]].nil?
295
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
95
296
  end
297
+ end
298
+ new(transformed_hash)
299
+ end
96
300
 
97
- raise # if no match by now, raise
98
- rescue
99
- raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
301
+ # Returns the object in the form of hash
302
+ # @return [Hash] Returns the object in the form of hash
303
+ def to_hash
304
+ hash = {}
305
+ self.class.attribute_map.each_pair do |attr, param|
306
+ value = self.send(attr)
307
+ if value.nil?
308
+ is_nullable = self.class.openapi_nullable.include?(attr)
309
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
310
+ end
311
+
312
+ hash[param] = _to_hash(value)
100
313
  end
314
+ hash
101
315
  end
316
+
102
317
  end
103
318
 
104
319
  end
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Pingram
17
17
  # Copy for batch delivery.
18
- class TemplatePostRequestBatch < ApiModelBase
18
+ class TemplatePatchRequestBatch < ApiModelBase
19
19
  attr_accessor :title
20
20
 
21
21
  attr_accessor :redirect_url
@@ -60,14 +60,14 @@ module Pingram
60
60
  # @param [Hash] attributes Model attributes in the form of hash
61
61
  def initialize(attributes = {})
62
62
  if (!attributes.is_a?(Hash))
63
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePostRequestBatch` initialize method"
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequestBatch` initialize method"
64
64
  end
65
65
 
66
66
  # check to see if the attribute exists and convert string to symbol for hash key
67
67
  acceptable_attribute_map = self.class.acceptable_attribute_map
68
68
  attributes = attributes.each_with_object({}) { |(k, v), h|
69
69
  if (!acceptable_attribute_map.key?(k.to_sym))
70
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePostRequestBatch`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePatchRequestBatch`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
71
  end
72
72
  h[k.to_sym] = v
73
73
  }
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Pingram
17
17
  # Copy for instant (real-time) delivery.
18
- class TemplatePostRequestInstant < ApiModelBase
18
+ class TemplatePatchRequestInstant < ApiModelBase
19
19
  attr_accessor :title
20
20
 
21
21
  attr_accessor :redirect_url
@@ -60,14 +60,14 @@ module Pingram
60
60
  # @param [Hash] attributes Model attributes in the form of hash
61
61
  def initialize(attributes = {})
62
62
  if (!attributes.is_a?(Hash))
63
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePostRequestInstant` initialize method"
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequestInstant` initialize method"
64
64
  end
65
65
 
66
66
  # check to see if the attribute exists and convert string to symbol for hash key
67
67
  acceptable_attribute_map = self.class.acceptable_attribute_map
68
68
  attributes = attributes.each_with_object({}) { |(k, v), h|
69
69
  if (!acceptable_attribute_map.key?(k.to_sym))
70
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePostRequestInstant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePatchRequestInstant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
71
  end
72
72
  h[k.to_sym] = v
73
73
  }
@@ -120,8 +120,8 @@ module Pingram
120
120
  :'title' => :'String',
121
121
  :'redirect_url' => :'String',
122
122
  :'image_url' => :'String',
123
- :'instant' => :'TemplatePostRequestInstant',
124
- :'batch' => :'TemplatePostRequestBatch',
123
+ :'instant' => :'TemplatePatchRequestInstant',
124
+ :'batch' => :'TemplatePatchRequestBatch',
125
125
  :'text' => :'String',
126
126
  :'message' => :'String',
127
127
  :'icon' => :'String',
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Pingram
14
- VERSION = '0.1.5'
14
+ VERSION = '1.0.0'
15
15
  end
data/lib/pingram.rb CHANGED
@@ -176,13 +176,9 @@ require 'pingram/models/supabase_projects_response_projects_inner'
176
176
  require 'pingram/models/supabase_status_response'
177
177
  require 'pingram/models/template'
178
178
  require 'pingram/models/template_patch_request'
179
- require 'pingram/models/template_patch_request_any_of'
180
- require 'pingram/models/template_patch_request_any_of1'
181
- require 'pingram/models/template_patch_request_any_of1_batch'
182
- require 'pingram/models/template_patch_request_any_of1_instant'
179
+ require 'pingram/models/template_patch_request_batch'
180
+ require 'pingram/models/template_patch_request_instant'
183
181
  require 'pingram/models/template_post_request'
184
- require 'pingram/models/template_post_request_batch'
185
- require 'pingram/models/template_post_request_instant'
186
182
  require 'pingram/models/update_address_request'
187
183
  require 'pingram/models/user'
188
184
  require 'pingram/models/user_suppression_delete_response'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pingram
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pingram
@@ -242,13 +242,9 @@ files:
242
242
  - lib/pingram/models/supabase_status_response.rb
243
243
  - lib/pingram/models/template.rb
244
244
  - lib/pingram/models/template_patch_request.rb
245
- - lib/pingram/models/template_patch_request_any_of.rb
246
- - lib/pingram/models/template_patch_request_any_of1.rb
247
- - lib/pingram/models/template_patch_request_any_of1_batch.rb
248
- - lib/pingram/models/template_patch_request_any_of1_instant.rb
245
+ - lib/pingram/models/template_patch_request_batch.rb
246
+ - lib/pingram/models/template_patch_request_instant.rb
249
247
  - lib/pingram/models/template_post_request.rb
250
- - lib/pingram/models/template_post_request_batch.rb
251
- - lib/pingram/models/template_post_request_instant.rb
252
248
  - lib/pingram/models/update_address_request.rb
253
249
  - lib/pingram/models/user.rb
254
250
  - lib/pingram/models/user_suppression_delete_response.rb
@@ -1,199 +0,0 @@
1
- =begin
2
- #Pingram
3
-
4
- #Internal API for notification delivery and management
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.19.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Pingram
17
- # Properties for updating an EMAIL channel template. All fields are optional; only provided fields are updated.
18
- class TemplatePatchRequestAnyOf < ApiModelBase
19
- # HTML body of the email.
20
- attr_accessor :html
21
-
22
- # Internal editor representation of the email content (e.g. Bee or Redactor JSON). Used for editing and component embedding; the actual email sent to recipients uses the html field.
23
- attr_accessor :internal
24
-
25
- # Email subject line.
26
- attr_accessor :subject
27
-
28
- # Sender display name.
29
- attr_accessor :sender_name
30
-
31
- # Sender email address.
32
- attr_accessor :sender_email
33
-
34
- # Migration metadata (e.g. from template migration).
35
- attr_accessor :migration
36
-
37
- # Attribute mapping from ruby-style variable name to JSON key.
38
- def self.attribute_map
39
- {
40
- :'html' => :'html',
41
- :'internal' => :'internal',
42
- :'subject' => :'subject',
43
- :'sender_name' => :'senderName',
44
- :'sender_email' => :'senderEmail',
45
- :'migration' => :'migration'
46
- }
47
- end
48
-
49
- # Returns attribute mapping this model knows about
50
- def self.acceptable_attribute_map
51
- attribute_map
52
- end
53
-
54
- # Returns all the JSON keys this model knows about
55
- def self.acceptable_attributes
56
- acceptable_attribute_map.values
57
- end
58
-
59
- # Attribute type mapping.
60
- def self.openapi_types
61
- {
62
- :'html' => :'String',
63
- :'internal' => :'String',
64
- :'subject' => :'String',
65
- :'sender_name' => :'String',
66
- :'sender_email' => :'String',
67
- :'migration' => :'String'
68
- }
69
- end
70
-
71
- # List of attributes with nullable: true
72
- def self.openapi_nullable
73
- Set.new([
74
- ])
75
- end
76
-
77
- # Initializes the object
78
- # @param [Hash] attributes Model attributes in the form of hash
79
- def initialize(attributes = {})
80
- if (!attributes.is_a?(Hash))
81
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequestAnyOf` initialize method"
82
- end
83
-
84
- # check to see if the attribute exists and convert string to symbol for hash key
85
- acceptable_attribute_map = self.class.acceptable_attribute_map
86
- attributes = attributes.each_with_object({}) { |(k, v), h|
87
- if (!acceptable_attribute_map.key?(k.to_sym))
88
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePatchRequestAnyOf`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
- end
90
- h[k.to_sym] = v
91
- }
92
-
93
- if attributes.key?(:'html')
94
- self.html = attributes[:'html']
95
- end
96
-
97
- if attributes.key?(:'internal')
98
- self.internal = attributes[:'internal']
99
- end
100
-
101
- if attributes.key?(:'subject')
102
- self.subject = attributes[:'subject']
103
- end
104
-
105
- if attributes.key?(:'sender_name')
106
- self.sender_name = attributes[:'sender_name']
107
- end
108
-
109
- if attributes.key?(:'sender_email')
110
- self.sender_email = attributes[:'sender_email']
111
- end
112
-
113
- if attributes.key?(:'migration')
114
- self.migration = attributes[:'migration']
115
- end
116
- end
117
-
118
- # Show invalid properties with the reasons. Usually used together with valid?
119
- # @return Array for valid properties with the reasons
120
- def list_invalid_properties
121
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
122
- invalid_properties = Array.new
123
- invalid_properties
124
- end
125
-
126
- # Check to see if the all the properties in the model are valid
127
- # @return true if the model is valid
128
- def valid?
129
- warn '[DEPRECATED] the `valid?` method is obsolete'
130
- true
131
- end
132
-
133
- # Checks equality by comparing each attribute.
134
- # @param [Object] Object to be compared
135
- def ==(o)
136
- return true if self.equal?(o)
137
- self.class == o.class &&
138
- html == o.html &&
139
- internal == o.internal &&
140
- subject == o.subject &&
141
- sender_name == o.sender_name &&
142
- sender_email == o.sender_email &&
143
- migration == o.migration
144
- end
145
-
146
- # @see the `==` method
147
- # @param [Object] Object to be compared
148
- def eql?(o)
149
- self == o
150
- end
151
-
152
- # Calculates hash code according to all attributes.
153
- # @return [Integer] Hash code
154
- def hash
155
- [html, internal, subject, sender_name, sender_email, migration].hash
156
- end
157
-
158
- # Builds the object from hash
159
- # @param [Hash] attributes Model attributes in the form of hash
160
- # @return [Object] Returns the model itself
161
- def self.build_from_hash(attributes)
162
- return nil unless attributes.is_a?(Hash)
163
- attributes = attributes.transform_keys(&:to_sym)
164
- transformed_hash = {}
165
- openapi_types.each_pair do |key, type|
166
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
167
- transformed_hash["#{key}"] = nil
168
- elsif type =~ /\AArray<(.*)>/i
169
- # check to ensure the input is an array given that the attribute
170
- # is documented as an array but the input is not
171
- if attributes[attribute_map[key]].is_a?(Array)
172
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
173
- end
174
- elsif !attributes[attribute_map[key]].nil?
175
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
176
- end
177
- end
178
- new(transformed_hash)
179
- end
180
-
181
- # Returns the object in the form of hash
182
- # @return [Hash] Returns the object in the form of hash
183
- def to_hash
184
- hash = {}
185
- self.class.attribute_map.each_pair do |attr, param|
186
- value = self.send(attr)
187
- if value.nil?
188
- is_nullable = self.class.openapi_nullable.include?(attr)
189
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
- end
191
-
192
- hash[param] = _to_hash(value)
193
- end
194
- hash
195
- end
196
-
197
- end
198
-
199
- end
@@ -1,187 +0,0 @@
1
- =begin
2
- #Pingram
3
-
4
- #Internal API for notification delivery and management
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.19.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Pingram
17
- # Properties for updating an INAPP_WEB channel template. All fields are optional; only provided fields are updated. instant and batch configure delivery-mode-specific copy (real-time vs batched).
18
- class TemplatePatchRequestAnyOf1 < ApiModelBase
19
- # Notification title (in-app).
20
- attr_accessor :title
21
-
22
- # URL to open when the user taps the notification.
23
- attr_accessor :redirect_url
24
-
25
- # Image URL shown in the in-app notification.
26
- attr_accessor :image_url
27
-
28
- attr_accessor :instant
29
-
30
- attr_accessor :batch
31
-
32
- # Attribute mapping from ruby-style variable name to JSON key.
33
- def self.attribute_map
34
- {
35
- :'title' => :'title',
36
- :'redirect_url' => :'redirectURL',
37
- :'image_url' => :'imageURL',
38
- :'instant' => :'instant',
39
- :'batch' => :'batch'
40
- }
41
- end
42
-
43
- # Returns attribute mapping this model knows about
44
- def self.acceptable_attribute_map
45
- attribute_map
46
- end
47
-
48
- # Returns all the JSON keys this model knows about
49
- def self.acceptable_attributes
50
- acceptable_attribute_map.values
51
- end
52
-
53
- # Attribute type mapping.
54
- def self.openapi_types
55
- {
56
- :'title' => :'String',
57
- :'redirect_url' => :'String',
58
- :'image_url' => :'String',
59
- :'instant' => :'TemplatePatchRequestAnyOf1Instant',
60
- :'batch' => :'TemplatePatchRequestAnyOf1Batch'
61
- }
62
- end
63
-
64
- # List of attributes with nullable: true
65
- def self.openapi_nullable
66
- Set.new([
67
- ])
68
- end
69
-
70
- # Initializes the object
71
- # @param [Hash] attributes Model attributes in the form of hash
72
- def initialize(attributes = {})
73
- if (!attributes.is_a?(Hash))
74
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequestAnyOf1` initialize method"
75
- end
76
-
77
- # check to see if the attribute exists and convert string to symbol for hash key
78
- acceptable_attribute_map = self.class.acceptable_attribute_map
79
- attributes = attributes.each_with_object({}) { |(k, v), h|
80
- if (!acceptable_attribute_map.key?(k.to_sym))
81
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePatchRequestAnyOf1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
82
- end
83
- h[k.to_sym] = v
84
- }
85
-
86
- if attributes.key?(:'title')
87
- self.title = attributes[:'title']
88
- end
89
-
90
- if attributes.key?(:'redirect_url')
91
- self.redirect_url = attributes[:'redirect_url']
92
- end
93
-
94
- if attributes.key?(:'image_url')
95
- self.image_url = attributes[:'image_url']
96
- end
97
-
98
- if attributes.key?(:'instant')
99
- self.instant = attributes[:'instant']
100
- end
101
-
102
- if attributes.key?(:'batch')
103
- self.batch = attributes[:'batch']
104
- end
105
- end
106
-
107
- # Show invalid properties with the reasons. Usually used together with valid?
108
- # @return Array for valid properties with the reasons
109
- def list_invalid_properties
110
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
- invalid_properties = Array.new
112
- invalid_properties
113
- end
114
-
115
- # Check to see if the all the properties in the model are valid
116
- # @return true if the model is valid
117
- def valid?
118
- warn '[DEPRECATED] the `valid?` method is obsolete'
119
- true
120
- end
121
-
122
- # Checks equality by comparing each attribute.
123
- # @param [Object] Object to be compared
124
- def ==(o)
125
- return true if self.equal?(o)
126
- self.class == o.class &&
127
- title == o.title &&
128
- redirect_url == o.redirect_url &&
129
- image_url == o.image_url &&
130
- instant == o.instant &&
131
- batch == o.batch
132
- end
133
-
134
- # @see the `==` method
135
- # @param [Object] Object to be compared
136
- def eql?(o)
137
- self == o
138
- end
139
-
140
- # Calculates hash code according to all attributes.
141
- # @return [Integer] Hash code
142
- def hash
143
- [title, redirect_url, image_url, instant, batch].hash
144
- end
145
-
146
- # Builds the object from hash
147
- # @param [Hash] attributes Model attributes in the form of hash
148
- # @return [Object] Returns the model itself
149
- def self.build_from_hash(attributes)
150
- return nil unless attributes.is_a?(Hash)
151
- attributes = attributes.transform_keys(&:to_sym)
152
- transformed_hash = {}
153
- openapi_types.each_pair do |key, type|
154
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
155
- transformed_hash["#{key}"] = nil
156
- elsif type =~ /\AArray<(.*)>/i
157
- # check to ensure the input is an array given that the attribute
158
- # is documented as an array but the input is not
159
- if attributes[attribute_map[key]].is_a?(Array)
160
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
161
- end
162
- elsif !attributes[attribute_map[key]].nil?
163
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
164
- end
165
- end
166
- new(transformed_hash)
167
- end
168
-
169
- # Returns the object in the form of hash
170
- # @return [Hash] Returns the object in the form of hash
171
- def to_hash
172
- hash = {}
173
- self.class.attribute_map.each_pair do |attr, param|
174
- value = self.send(attr)
175
- if value.nil?
176
- is_nullable = self.class.openapi_nullable.include?(attr)
177
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
178
- end
179
-
180
- hash[param] = _to_hash(value)
181
- end
182
- hash
183
- end
184
-
185
- end
186
-
187
- end
@@ -1,217 +0,0 @@
1
- =begin
2
- #Pingram
3
-
4
- #Internal API for notification delivery and management
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.19.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Pingram
17
- # In-app batch delivery: title, redirect URL, and image URL shown when the notification is delivered in batch.
18
- class TemplatePatchRequestAnyOf1Batch < ApiModelBase
19
- attr_accessor :title
20
-
21
- attr_accessor :redirect_url
22
-
23
- attr_accessor :image_url
24
-
25
- # Attribute mapping from ruby-style variable name to JSON key.
26
- def self.attribute_map
27
- {
28
- :'title' => :'title',
29
- :'redirect_url' => :'redirectURL',
30
- :'image_url' => :'imageURL'
31
- }
32
- end
33
-
34
- # Returns attribute mapping this model knows about
35
- def self.acceptable_attribute_map
36
- attribute_map
37
- end
38
-
39
- # Returns all the JSON keys this model knows about
40
- def self.acceptable_attributes
41
- acceptable_attribute_map.values
42
- end
43
-
44
- # Attribute type mapping.
45
- def self.openapi_types
46
- {
47
- :'title' => :'String',
48
- :'redirect_url' => :'String',
49
- :'image_url' => :'String'
50
- }
51
- end
52
-
53
- # List of attributes with nullable: true
54
- def self.openapi_nullable
55
- Set.new([
56
- ])
57
- end
58
-
59
- # Initializes the object
60
- # @param [Hash] attributes Model attributes in the form of hash
61
- def initialize(attributes = {})
62
- if (!attributes.is_a?(Hash))
63
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequestAnyOf1Batch` initialize method"
64
- end
65
-
66
- # check to see if the attribute exists and convert string to symbol for hash key
67
- acceptable_attribute_map = self.class.acceptable_attribute_map
68
- attributes = attributes.each_with_object({}) { |(k, v), h|
69
- if (!acceptable_attribute_map.key?(k.to_sym))
70
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePatchRequestAnyOf1Batch`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
- end
72
- h[k.to_sym] = v
73
- }
74
-
75
- if attributes.key?(:'title')
76
- self.title = attributes[:'title']
77
- else
78
- self.title = nil
79
- end
80
-
81
- if attributes.key?(:'redirect_url')
82
- self.redirect_url = attributes[:'redirect_url']
83
- else
84
- self.redirect_url = nil
85
- end
86
-
87
- if attributes.key?(:'image_url')
88
- self.image_url = attributes[:'image_url']
89
- else
90
- self.image_url = nil
91
- end
92
- end
93
-
94
- # Show invalid properties with the reasons. Usually used together with valid?
95
- # @return Array for valid properties with the reasons
96
- def list_invalid_properties
97
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
- invalid_properties = Array.new
99
- if @title.nil?
100
- invalid_properties.push('invalid value for "title", title cannot be nil.')
101
- end
102
-
103
- if @redirect_url.nil?
104
- invalid_properties.push('invalid value for "redirect_url", redirect_url cannot be nil.')
105
- end
106
-
107
- if @image_url.nil?
108
- invalid_properties.push('invalid value for "image_url", image_url cannot be nil.')
109
- end
110
-
111
- invalid_properties
112
- end
113
-
114
- # Check to see if the all the properties in the model are valid
115
- # @return true if the model is valid
116
- def valid?
117
- warn '[DEPRECATED] the `valid?` method is obsolete'
118
- return false if @title.nil?
119
- return false if @redirect_url.nil?
120
- return false if @image_url.nil?
121
- true
122
- end
123
-
124
- # Custom attribute writer method with validation
125
- # @param [Object] title Value to be assigned
126
- def title=(title)
127
- if title.nil?
128
- fail ArgumentError, 'title cannot be nil'
129
- end
130
-
131
- @title = title
132
- end
133
-
134
- # Custom attribute writer method with validation
135
- # @param [Object] redirect_url Value to be assigned
136
- def redirect_url=(redirect_url)
137
- if redirect_url.nil?
138
- fail ArgumentError, 'redirect_url cannot be nil'
139
- end
140
-
141
- @redirect_url = redirect_url
142
- end
143
-
144
- # Custom attribute writer method with validation
145
- # @param [Object] image_url Value to be assigned
146
- def image_url=(image_url)
147
- if image_url.nil?
148
- fail ArgumentError, 'image_url cannot be nil'
149
- end
150
-
151
- @image_url = image_url
152
- end
153
-
154
- # Checks equality by comparing each attribute.
155
- # @param [Object] Object to be compared
156
- def ==(o)
157
- return true if self.equal?(o)
158
- self.class == o.class &&
159
- title == o.title &&
160
- redirect_url == o.redirect_url &&
161
- image_url == o.image_url
162
- end
163
-
164
- # @see the `==` method
165
- # @param [Object] Object to be compared
166
- def eql?(o)
167
- self == o
168
- end
169
-
170
- # Calculates hash code according to all attributes.
171
- # @return [Integer] Hash code
172
- def hash
173
- [title, redirect_url, image_url].hash
174
- end
175
-
176
- # Builds the object from hash
177
- # @param [Hash] attributes Model attributes in the form of hash
178
- # @return [Object] Returns the model itself
179
- def self.build_from_hash(attributes)
180
- return nil unless attributes.is_a?(Hash)
181
- attributes = attributes.transform_keys(&:to_sym)
182
- transformed_hash = {}
183
- openapi_types.each_pair do |key, type|
184
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
185
- transformed_hash["#{key}"] = nil
186
- elsif type =~ /\AArray<(.*)>/i
187
- # check to ensure the input is an array given that the attribute
188
- # is documented as an array but the input is not
189
- if attributes[attribute_map[key]].is_a?(Array)
190
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
191
- end
192
- elsif !attributes[attribute_map[key]].nil?
193
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
194
- end
195
- end
196
- new(transformed_hash)
197
- end
198
-
199
- # Returns the object in the form of hash
200
- # @return [Hash] Returns the object in the form of hash
201
- def to_hash
202
- hash = {}
203
- self.class.attribute_map.each_pair do |attr, param|
204
- value = self.send(attr)
205
- if value.nil?
206
- is_nullable = self.class.openapi_nullable.include?(attr)
207
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
- end
209
-
210
- hash[param] = _to_hash(value)
211
- end
212
- hash
213
- end
214
-
215
- end
216
-
217
- end
@@ -1,184 +0,0 @@
1
- =begin
2
- #Pingram
3
-
4
- #Internal API for notification delivery and management
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.19.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Pingram
17
- # In-app instant delivery: title, redirect URL, and image URL shown when the notification is delivered in real time.
18
- class TemplatePatchRequestAnyOf1Instant < ApiModelBase
19
- attr_accessor :title
20
-
21
- attr_accessor :redirect_url
22
-
23
- # Required for instant. Image URL shown in the in-app notification.
24
- attr_accessor :image_url
25
-
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :'title' => :'title',
30
- :'redirect_url' => :'redirectURL',
31
- :'image_url' => :'imageURL'
32
- }
33
- end
34
-
35
- # Returns attribute mapping this model knows about
36
- def self.acceptable_attribute_map
37
- attribute_map
38
- end
39
-
40
- # Returns all the JSON keys this model knows about
41
- def self.acceptable_attributes
42
- acceptable_attribute_map.values
43
- end
44
-
45
- # Attribute type mapping.
46
- def self.openapi_types
47
- {
48
- :'title' => :'String',
49
- :'redirect_url' => :'String',
50
- :'image_url' => :'String'
51
- }
52
- end
53
-
54
- # List of attributes with nullable: true
55
- def self.openapi_nullable
56
- Set.new([
57
- ])
58
- end
59
-
60
- # Initializes the object
61
- # @param [Hash] attributes Model attributes in the form of hash
62
- def initialize(attributes = {})
63
- if (!attributes.is_a?(Hash))
64
- fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::TemplatePatchRequestAnyOf1Instant` initialize method"
65
- end
66
-
67
- # check to see if the attribute exists and convert string to symbol for hash key
68
- acceptable_attribute_map = self.class.acceptable_attribute_map
69
- attributes = attributes.each_with_object({}) { |(k, v), h|
70
- if (!acceptable_attribute_map.key?(k.to_sym))
71
- fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::TemplatePatchRequestAnyOf1Instant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
- end
73
- h[k.to_sym] = v
74
- }
75
-
76
- if attributes.key?(:'title')
77
- self.title = attributes[:'title']
78
- end
79
-
80
- if attributes.key?(:'redirect_url')
81
- self.redirect_url = attributes[:'redirect_url']
82
- end
83
-
84
- if attributes.key?(:'image_url')
85
- self.image_url = attributes[:'image_url']
86
- else
87
- self.image_url = nil
88
- end
89
- end
90
-
91
- # Show invalid properties with the reasons. Usually used together with valid?
92
- # @return Array for valid properties with the reasons
93
- def list_invalid_properties
94
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
- invalid_properties = Array.new
96
- if @image_url.nil?
97
- invalid_properties.push('invalid value for "image_url", image_url cannot be nil.')
98
- end
99
-
100
- invalid_properties
101
- end
102
-
103
- # Check to see if the all the properties in the model are valid
104
- # @return true if the model is valid
105
- def valid?
106
- warn '[DEPRECATED] the `valid?` method is obsolete'
107
- return false if @image_url.nil?
108
- true
109
- end
110
-
111
- # Custom attribute writer method with validation
112
- # @param [Object] image_url Value to be assigned
113
- def image_url=(image_url)
114
- if image_url.nil?
115
- fail ArgumentError, 'image_url cannot be nil'
116
- end
117
-
118
- @image_url = image_url
119
- end
120
-
121
- # Checks equality by comparing each attribute.
122
- # @param [Object] Object to be compared
123
- def ==(o)
124
- return true if self.equal?(o)
125
- self.class == o.class &&
126
- title == o.title &&
127
- redirect_url == o.redirect_url &&
128
- image_url == o.image_url
129
- end
130
-
131
- # @see the `==` method
132
- # @param [Object] Object to be compared
133
- def eql?(o)
134
- self == o
135
- end
136
-
137
- # Calculates hash code according to all attributes.
138
- # @return [Integer] Hash code
139
- def hash
140
- [title, redirect_url, image_url].hash
141
- end
142
-
143
- # Builds the object from hash
144
- # @param [Hash] attributes Model attributes in the form of hash
145
- # @return [Object] Returns the model itself
146
- def self.build_from_hash(attributes)
147
- return nil unless attributes.is_a?(Hash)
148
- attributes = attributes.transform_keys(&:to_sym)
149
- transformed_hash = {}
150
- openapi_types.each_pair do |key, type|
151
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
- transformed_hash["#{key}"] = nil
153
- elsif type =~ /\AArray<(.*)>/i
154
- # check to ensure the input is an array given that the attribute
155
- # is documented as an array but the input is not
156
- if attributes[attribute_map[key]].is_a?(Array)
157
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
158
- end
159
- elsif !attributes[attribute_map[key]].nil?
160
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
- end
162
- end
163
- new(transformed_hash)
164
- end
165
-
166
- # Returns the object in the form of hash
167
- # @return [Hash] Returns the object in the form of hash
168
- def to_hash
169
- hash = {}
170
- self.class.attribute_map.each_pair do |attr, param|
171
- value = self.send(attr)
172
- if value.nil?
173
- is_nullable = self.class.openapi_nullable.include?(attr)
174
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
175
- end
176
-
177
- hash[param] = _to_hash(value)
178
- end
179
- hash
180
- end
181
-
182
- end
183
-
184
- end