late-sdk 0.0.935 → 0.0.937

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 +7 -0
  3. data/docs/CreateAdCreativeRequest.md +1 -1
  4. data/docs/CreateStandaloneAdRequest.md +1 -1
  5. data/docs/GetLeadForm200Response.md +2 -2
  6. data/docs/GetLeadForm200ResponseForm.md +49 -0
  7. data/docs/LeadGenApi.md +11 -5
  8. data/docs/MetaLeadForm.md +58 -0
  9. data/docs/MetaLeadFormContextCard.md +28 -0
  10. data/docs/MetaLeadFormLegalContent.md +22 -0
  11. data/docs/MetaLeadFormLegalContentPrivacyPolicy.md +20 -0
  12. data/docs/MetaLeadFormQuestionsInner.md +34 -0
  13. data/docs/MetaLeadFormThankYouPage.md +38 -0
  14. data/docs/UpdateAdRequestCreative.md +1 -1
  15. data/lib/zernio-sdk/api/lead_gen_api.rb +11 -2
  16. data/lib/zernio-sdk/models/create_ad_creative_request.rb +2 -1
  17. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +2 -1
  18. data/lib/zernio-sdk/models/get_lead_form200_response.rb +1 -1
  19. data/lib/zernio-sdk/models/get_lead_form200_response_form.rb +104 -0
  20. data/lib/zernio-sdk/models/meta_lead_form.rb +337 -0
  21. data/lib/zernio-sdk/models/meta_lead_form_context_card.rb +228 -0
  22. data/lib/zernio-sdk/models/meta_lead_form_legal_content.rb +167 -0
  23. data/lib/zernio-sdk/models/meta_lead_form_legal_content_privacy_policy.rb +156 -0
  24. data/lib/zernio-sdk/models/meta_lead_form_questions_inner.rb +229 -0
  25. data/lib/zernio-sdk/models/meta_lead_form_thank_you_page.rb +238 -0
  26. data/lib/zernio-sdk/models/update_ad_request_creative.rb +2 -1
  27. data/lib/zernio-sdk/version.rb +1 -1
  28. data/lib/zernio-sdk.rb +7 -0
  29. data/openapi.yaml +116 -4
  30. data/spec/api/lead_gen_api_spec.rb +3 -1
  31. data/spec/models/get_lead_form200_response_form_spec.rb +32 -0
  32. data/spec/models/meta_lead_form_context_card_spec.rb +70 -0
  33. data/spec/models/meta_lead_form_legal_content_privacy_policy_spec.rb +42 -0
  34. data/spec/models/meta_lead_form_legal_content_spec.rb +48 -0
  35. data/spec/models/meta_lead_form_questions_inner_spec.rb +84 -0
  36. data/spec/models/meta_lead_form_spec.rb +156 -0
  37. data/spec/models/meta_lead_form_thank_you_page_spec.rb +96 -0
  38. data/zernio-sdk-0.0.937.gem +0 -0
  39. metadata +30 -2
  40. data/zernio-sdk-0.0.935.gem +0 -0
@@ -0,0 +1,337 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
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 Zernio
17
+ # A Meta Lead Gen form as Graph returns it, in Meta's own snake_case. Read through GET /v1/ads/lead-forms/{formId}. Every setting POST /v1/ads/lead-forms writes is present here, so a form can be diffed against what was created and drift from edits made in Meta's form builder is detectable. A compound field is omitted entirely when the form has no value for it, and `fields` narrows the selection.
18
+ class MetaLeadForm < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ attr_accessor :name
22
+
23
+ # One of ACTIVE, ARCHIVED, DELETED or DRAFT.
24
+ attr_accessor :status
25
+
26
+ attr_accessor :locale
27
+
28
+ attr_accessor :created_time
29
+
30
+ # Owning Facebook Page. A form on any other Page is a 404, whether read or archived.
31
+ attr_accessor :page_id
32
+
33
+ attr_accessor :leads_count
34
+
35
+ attr_accessor :organic_leads_count
36
+
37
+ # Leads Meta has aged out of the retention window.
38
+ attr_accessor :expired_leads_count
39
+
40
+ attr_accessor :privacy_policy_url
41
+
42
+ attr_accessor :follow_up_action_url
43
+
44
+ attr_accessor :follow_up_action_text
45
+
46
+ attr_accessor :question_page_custom_headline
47
+
48
+ attr_accessor :is_optimized_for_quality
49
+
50
+ attr_accessor :block_display_for_non_targeted_viewer
51
+
52
+ # Whether the form can also be submitted from an organic Page post.
53
+ attr_accessor :allow_organic_lead
54
+
55
+ # Custom key/value pairs attached to every lead of this form.
56
+ attr_accessor :tracking_parameters
57
+
58
+ attr_accessor :legal_content
59
+
60
+ attr_accessor :context_card
61
+
62
+ attr_accessor :thank_you_page
63
+
64
+ attr_accessor :questions
65
+
66
+ # Attribute mapping from ruby-style variable name to JSON key.
67
+ def self.attribute_map
68
+ {
69
+ :'id' => :'id',
70
+ :'name' => :'name',
71
+ :'status' => :'status',
72
+ :'locale' => :'locale',
73
+ :'created_time' => :'created_time',
74
+ :'page_id' => :'page_id',
75
+ :'leads_count' => :'leads_count',
76
+ :'organic_leads_count' => :'organic_leads_count',
77
+ :'expired_leads_count' => :'expired_leads_count',
78
+ :'privacy_policy_url' => :'privacy_policy_url',
79
+ :'follow_up_action_url' => :'follow_up_action_url',
80
+ :'follow_up_action_text' => :'follow_up_action_text',
81
+ :'question_page_custom_headline' => :'question_page_custom_headline',
82
+ :'is_optimized_for_quality' => :'is_optimized_for_quality',
83
+ :'block_display_for_non_targeted_viewer' => :'block_display_for_non_targeted_viewer',
84
+ :'allow_organic_lead' => :'allow_organic_lead',
85
+ :'tracking_parameters' => :'tracking_parameters',
86
+ :'legal_content' => :'legal_content',
87
+ :'context_card' => :'context_card',
88
+ :'thank_you_page' => :'thank_you_page',
89
+ :'questions' => :'questions'
90
+ }
91
+ end
92
+
93
+ # Returns attribute mapping this model knows about
94
+ def self.acceptable_attribute_map
95
+ attribute_map
96
+ end
97
+
98
+ # Returns all the JSON keys this model knows about
99
+ def self.acceptable_attributes
100
+ acceptable_attribute_map.values
101
+ end
102
+
103
+ # Attribute type mapping.
104
+ def self.openapi_types
105
+ {
106
+ :'id' => :'String',
107
+ :'name' => :'String',
108
+ :'status' => :'String',
109
+ :'locale' => :'String',
110
+ :'created_time' => :'Time',
111
+ :'page_id' => :'String',
112
+ :'leads_count' => :'Integer',
113
+ :'organic_leads_count' => :'Integer',
114
+ :'expired_leads_count' => :'Integer',
115
+ :'privacy_policy_url' => :'String',
116
+ :'follow_up_action_url' => :'String',
117
+ :'follow_up_action_text' => :'String',
118
+ :'question_page_custom_headline' => :'String',
119
+ :'is_optimized_for_quality' => :'Boolean',
120
+ :'block_display_for_non_targeted_viewer' => :'Boolean',
121
+ :'allow_organic_lead' => :'Boolean',
122
+ :'tracking_parameters' => :'Array<BoostPostRequestTrackingUrlTagsInner>',
123
+ :'legal_content' => :'MetaLeadFormLegalContent',
124
+ :'context_card' => :'MetaLeadFormContextCard',
125
+ :'thank_you_page' => :'MetaLeadFormThankYouPage',
126
+ :'questions' => :'Array<MetaLeadFormQuestionsInner>'
127
+ }
128
+ end
129
+
130
+ # List of attributes with nullable: true
131
+ def self.openapi_nullable
132
+ Set.new([
133
+ ])
134
+ end
135
+
136
+ # Initializes the object
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ def initialize(attributes = {})
139
+ if (!attributes.is_a?(Hash))
140
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::MetaLeadForm` initialize method"
141
+ end
142
+
143
+ # check to see if the attribute exists and convert string to symbol for hash key
144
+ acceptable_attribute_map = self.class.acceptable_attribute_map
145
+ attributes = attributes.each_with_object({}) { |(k, v), h|
146
+ if (!acceptable_attribute_map.key?(k.to_sym))
147
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::MetaLeadForm`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
148
+ end
149
+ h[k.to_sym] = v
150
+ }
151
+
152
+ if attributes.key?(:'id')
153
+ self.id = attributes[:'id']
154
+ end
155
+
156
+ if attributes.key?(:'name')
157
+ self.name = attributes[:'name']
158
+ end
159
+
160
+ if attributes.key?(:'status')
161
+ self.status = attributes[:'status']
162
+ end
163
+
164
+ if attributes.key?(:'locale')
165
+ self.locale = attributes[:'locale']
166
+ end
167
+
168
+ if attributes.key?(:'created_time')
169
+ self.created_time = attributes[:'created_time']
170
+ end
171
+
172
+ if attributes.key?(:'page_id')
173
+ self.page_id = attributes[:'page_id']
174
+ end
175
+
176
+ if attributes.key?(:'leads_count')
177
+ self.leads_count = attributes[:'leads_count']
178
+ end
179
+
180
+ if attributes.key?(:'organic_leads_count')
181
+ self.organic_leads_count = attributes[:'organic_leads_count']
182
+ end
183
+
184
+ if attributes.key?(:'expired_leads_count')
185
+ self.expired_leads_count = attributes[:'expired_leads_count']
186
+ end
187
+
188
+ if attributes.key?(:'privacy_policy_url')
189
+ self.privacy_policy_url = attributes[:'privacy_policy_url']
190
+ end
191
+
192
+ if attributes.key?(:'follow_up_action_url')
193
+ self.follow_up_action_url = attributes[:'follow_up_action_url']
194
+ end
195
+
196
+ if attributes.key?(:'follow_up_action_text')
197
+ self.follow_up_action_text = attributes[:'follow_up_action_text']
198
+ end
199
+
200
+ if attributes.key?(:'question_page_custom_headline')
201
+ self.question_page_custom_headline = attributes[:'question_page_custom_headline']
202
+ end
203
+
204
+ if attributes.key?(:'is_optimized_for_quality')
205
+ self.is_optimized_for_quality = attributes[:'is_optimized_for_quality']
206
+ end
207
+
208
+ if attributes.key?(:'block_display_for_non_targeted_viewer')
209
+ self.block_display_for_non_targeted_viewer = attributes[:'block_display_for_non_targeted_viewer']
210
+ end
211
+
212
+ if attributes.key?(:'allow_organic_lead')
213
+ self.allow_organic_lead = attributes[:'allow_organic_lead']
214
+ end
215
+
216
+ if attributes.key?(:'tracking_parameters')
217
+ if (value = attributes[:'tracking_parameters']).is_a?(Array)
218
+ self.tracking_parameters = value
219
+ end
220
+ end
221
+
222
+ if attributes.key?(:'legal_content')
223
+ self.legal_content = attributes[:'legal_content']
224
+ end
225
+
226
+ if attributes.key?(:'context_card')
227
+ self.context_card = attributes[:'context_card']
228
+ end
229
+
230
+ if attributes.key?(:'thank_you_page')
231
+ self.thank_you_page = attributes[:'thank_you_page']
232
+ end
233
+
234
+ if attributes.key?(:'questions')
235
+ if (value = attributes[:'questions']).is_a?(Array)
236
+ self.questions = value
237
+ end
238
+ end
239
+ end
240
+
241
+ # Show invalid properties with the reasons. Usually used together with valid?
242
+ # @return Array for valid properties with the reasons
243
+ def list_invalid_properties
244
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
245
+ invalid_properties = Array.new
246
+ invalid_properties
247
+ end
248
+
249
+ # Check to see if the all the properties in the model are valid
250
+ # @return true if the model is valid
251
+ def valid?
252
+ warn '[DEPRECATED] the `valid?` method is obsolete'
253
+ true
254
+ end
255
+
256
+ # Checks equality by comparing each attribute.
257
+ # @param [Object] Object to be compared
258
+ def ==(o)
259
+ return true if self.equal?(o)
260
+ self.class == o.class &&
261
+ id == o.id &&
262
+ name == o.name &&
263
+ status == o.status &&
264
+ locale == o.locale &&
265
+ created_time == o.created_time &&
266
+ page_id == o.page_id &&
267
+ leads_count == o.leads_count &&
268
+ organic_leads_count == o.organic_leads_count &&
269
+ expired_leads_count == o.expired_leads_count &&
270
+ privacy_policy_url == o.privacy_policy_url &&
271
+ follow_up_action_url == o.follow_up_action_url &&
272
+ follow_up_action_text == o.follow_up_action_text &&
273
+ question_page_custom_headline == o.question_page_custom_headline &&
274
+ is_optimized_for_quality == o.is_optimized_for_quality &&
275
+ block_display_for_non_targeted_viewer == o.block_display_for_non_targeted_viewer &&
276
+ allow_organic_lead == o.allow_organic_lead &&
277
+ tracking_parameters == o.tracking_parameters &&
278
+ legal_content == o.legal_content &&
279
+ context_card == o.context_card &&
280
+ thank_you_page == o.thank_you_page &&
281
+ questions == o.questions
282
+ end
283
+
284
+ # @see the `==` method
285
+ # @param [Object] Object to be compared
286
+ def eql?(o)
287
+ self == o
288
+ end
289
+
290
+ # Calculates hash code according to all attributes.
291
+ # @return [Integer] Hash code
292
+ def hash
293
+ [id, name, status, locale, created_time, page_id, leads_count, organic_leads_count, expired_leads_count, privacy_policy_url, follow_up_action_url, follow_up_action_text, question_page_custom_headline, is_optimized_for_quality, block_display_for_non_targeted_viewer, allow_organic_lead, tracking_parameters, legal_content, context_card, thank_you_page, questions].hash
294
+ end
295
+
296
+ # Builds the object from hash
297
+ # @param [Hash] attributes Model attributes in the form of hash
298
+ # @return [Object] Returns the model itself
299
+ def self.build_from_hash(attributes)
300
+ return nil unless attributes.is_a?(Hash)
301
+ attributes = attributes.transform_keys(&:to_sym)
302
+ transformed_hash = {}
303
+ openapi_types.each_pair do |key, type|
304
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
305
+ transformed_hash["#{key}"] = nil
306
+ elsif type =~ /\AArray<(.*)>/i
307
+ # check to ensure the input is an array given that the attribute
308
+ # is documented as an array but the input is not
309
+ if attributes[attribute_map[key]].is_a?(Array)
310
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
311
+ end
312
+ elsif !attributes[attribute_map[key]].nil?
313
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
314
+ end
315
+ end
316
+ new(transformed_hash)
317
+ end
318
+
319
+ # Returns the object in the form of hash
320
+ # @return [Hash] Returns the object in the form of hash
321
+ def to_hash
322
+ hash = {}
323
+ self.class.attribute_map.each_pair do |attr, param|
324
+ value = self.send(attr)
325
+ if value.nil?
326
+ is_nullable = self.class.openapi_nullable.include?(attr)
327
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
328
+ end
329
+
330
+ hash[param] = _to_hash(value)
331
+ end
332
+ hash
333
+ end
334
+
335
+ end
336
+
337
+ end
@@ -0,0 +1,228 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
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 Zernio
17
+ class MetaLeadFormContextCard < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :title
21
+
22
+ attr_accessor :style
23
+
24
+ attr_accessor :content
25
+
26
+ attr_accessor :button_text
27
+
28
+ attr_accessor :cover_photo
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'id' => :'id',
56
+ :'title' => :'title',
57
+ :'style' => :'style',
58
+ :'content' => :'content',
59
+ :'button_text' => :'button_text',
60
+ :'cover_photo' => :'cover_photo'
61
+ }
62
+ end
63
+
64
+ # Returns attribute mapping this model knows about
65
+ def self.acceptable_attribute_map
66
+ attribute_map
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ acceptable_attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'id' => :'String',
78
+ :'title' => :'String',
79
+ :'style' => :'String',
80
+ :'content' => :'Array<String>',
81
+ :'button_text' => :'String',
82
+ :'cover_photo' => :'CreateTestLead200ResponseTestLead'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::MetaLeadFormContextCard` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ acceptable_attribute_map = self.class.acceptable_attribute_map
101
+ attributes = attributes.each_with_object({}) { |(k, v), h|
102
+ if (!acceptable_attribute_map.key?(k.to_sym))
103
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::MetaLeadFormContextCard`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
104
+ end
105
+ h[k.to_sym] = v
106
+ }
107
+
108
+ if attributes.key?(:'id')
109
+ self.id = attributes[:'id']
110
+ end
111
+
112
+ if attributes.key?(:'title')
113
+ self.title = attributes[:'title']
114
+ end
115
+
116
+ if attributes.key?(:'style')
117
+ self.style = attributes[:'style']
118
+ end
119
+
120
+ if attributes.key?(:'content')
121
+ if (value = attributes[:'content']).is_a?(Array)
122
+ self.content = value
123
+ end
124
+ end
125
+
126
+ if attributes.key?(:'button_text')
127
+ self.button_text = attributes[:'button_text']
128
+ end
129
+
130
+ if attributes.key?(:'cover_photo')
131
+ self.cover_photo = attributes[:'cover_photo']
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
139
+ invalid_properties = Array.new
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ style_validator = EnumAttributeValidator.new('String', ["LIST_STYLE", "PARAGRAPH_STYLE"])
148
+ return false unless style_validator.valid?(@style)
149
+ true
150
+ end
151
+
152
+ # Custom attribute writer method checking allowed values (enum).
153
+ # @param [Object] style Object to be assigned
154
+ def style=(style)
155
+ validator = EnumAttributeValidator.new('String', ["LIST_STYLE", "PARAGRAPH_STYLE"])
156
+ unless validator.valid?(style)
157
+ fail ArgumentError, "invalid value for \"style\", must be one of #{validator.allowable_values}."
158
+ end
159
+ @style = style
160
+ end
161
+
162
+ # Checks equality by comparing each attribute.
163
+ # @param [Object] Object to be compared
164
+ def ==(o)
165
+ return true if self.equal?(o)
166
+ self.class == o.class &&
167
+ id == o.id &&
168
+ title == o.title &&
169
+ style == o.style &&
170
+ content == o.content &&
171
+ button_text == o.button_text &&
172
+ cover_photo == o.cover_photo
173
+ end
174
+
175
+ # @see the `==` method
176
+ # @param [Object] Object to be compared
177
+ def eql?(o)
178
+ self == o
179
+ end
180
+
181
+ # Calculates hash code according to all attributes.
182
+ # @return [Integer] Hash code
183
+ def hash
184
+ [id, title, style, content, button_text, cover_photo].hash
185
+ end
186
+
187
+ # Builds the object from hash
188
+ # @param [Hash] attributes Model attributes in the form of hash
189
+ # @return [Object] Returns the model itself
190
+ def self.build_from_hash(attributes)
191
+ return nil unless attributes.is_a?(Hash)
192
+ attributes = attributes.transform_keys(&:to_sym)
193
+ transformed_hash = {}
194
+ openapi_types.each_pair do |key, type|
195
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
196
+ transformed_hash["#{key}"] = nil
197
+ elsif type =~ /\AArray<(.*)>/i
198
+ # check to ensure the input is an array given that the attribute
199
+ # is documented as an array but the input is not
200
+ if attributes[attribute_map[key]].is_a?(Array)
201
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
202
+ end
203
+ elsif !attributes[attribute_map[key]].nil?
204
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
205
+ end
206
+ end
207
+ new(transformed_hash)
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ if value.nil?
217
+ is_nullable = self.class.openapi_nullable.include?(attr)
218
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219
+ end
220
+
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ end
227
+
228
+ end