late-sdk 0.0.91 → 0.0.93

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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -1
  3. data/docs/ConnectApi.md +146 -4
  4. data/docs/CreateWhatsAppTemplateRequest.md +1 -1
  5. data/docs/GetYoutubePlaylists200Response.md +20 -0
  6. data/docs/GetYoutubePlaylists200ResponsePlaylistsInner.md +28 -0
  7. data/docs/MessagesApi.md +16 -16
  8. data/docs/UpdateWhatsAppTemplateRequest.md +1 -1
  9. data/docs/{UpdateRedditSubreddits200Response.md → UpdateYoutubeDefaultPlaylist200Response.md} +2 -2
  10. data/docs/UpdateYoutubeDefaultPlaylistRequest.md +20 -0
  11. data/docs/WebhooksApi.md +4 -4
  12. data/docs/WhatsAppApi.md +1 -1
  13. data/docs/WhatsAppBodyComponent.md +24 -0
  14. data/docs/WhatsAppBodyComponentExample.md +18 -0
  15. data/docs/WhatsAppButtonsComponent.md +20 -0
  16. data/docs/WhatsAppFooterComponent.md +22 -0
  17. data/docs/WhatsAppHeaderComponent.md +24 -0
  18. data/docs/WhatsAppHeaderComponentExample.md +20 -0
  19. data/docs/WhatsAppTemplateButton.md +44 -0
  20. data/docs/WhatsAppTemplateComponent.md +85 -0
  21. data/docs/YouTubePlatformData.md +3 -1
  22. data/lib/late-sdk/api/connect_api.rb +140 -3
  23. data/lib/late-sdk/api/messages_api.rb +12 -12
  24. data/lib/late-sdk/api/webhooks_api.rb +3 -3
  25. data/lib/late-sdk/models/create_whats_app_template_request.rb +21 -2
  26. data/lib/late-sdk/models/get_youtube_playlists200_response.rb +158 -0
  27. data/lib/late-sdk/models/get_youtube_playlists200_response_playlists_inner.rb +226 -0
  28. data/lib/late-sdk/models/update_whats_app_template_request.rb +10 -1
  29. data/lib/late-sdk/models/{update_reddit_subreddits200_response.rb → update_youtube_default_playlist200_response.rb} +3 -3
  30. data/lib/late-sdk/models/update_youtube_default_playlist_request.rb +173 -0
  31. data/lib/late-sdk/models/whats_app_body_component.rb +234 -0
  32. data/lib/late-sdk/models/whats_app_body_component_example.rb +150 -0
  33. data/lib/late-sdk/models/whats_app_buttons_component.rb +225 -0
  34. data/lib/late-sdk/models/whats_app_footer_component.rb +227 -0
  35. data/lib/late-sdk/models/whats_app_header_component.rb +235 -0
  36. data/lib/late-sdk/models/whats_app_header_component_example.rb +190 -0
  37. data/lib/late-sdk/models/whats_app_template_button.rb +345 -0
  38. data/lib/late-sdk/models/whats_app_template_component.rb +59 -0
  39. data/lib/late-sdk/models/you_tube_platform_data.rb +14 -4
  40. data/lib/late-sdk/version.rb +1 -1
  41. data/lib/late-sdk.rb +12 -1
  42. data/openapi.yaml +248 -5
  43. data/spec/api/connect_api_spec.rb +26 -1
  44. data/spec/api/messages_api_spec.rb +4 -4
  45. data/spec/api/webhooks_api_spec.rb +1 -1
  46. data/spec/models/get_youtube_playlists200_response_playlists_inner_spec.rb +70 -0
  47. data/spec/models/get_youtube_playlists200_response_spec.rb +42 -0
  48. data/spec/models/{update_reddit_subreddits200_response_spec.rb → update_youtube_default_playlist200_response_spec.rb} +6 -6
  49. data/spec/models/update_youtube_default_playlist_request_spec.rb +42 -0
  50. data/spec/models/whats_app_body_component_example_spec.rb +36 -0
  51. data/spec/models/whats_app_body_component_spec.rb +58 -0
  52. data/spec/models/whats_app_buttons_component_spec.rb +46 -0
  53. data/spec/models/whats_app_footer_component_spec.rb +52 -0
  54. data/spec/models/whats_app_header_component_example_spec.rb +42 -0
  55. data/spec/models/whats_app_header_component_spec.rb +62 -0
  56. data/spec/models/whats_app_template_button_spec.rb +122 -0
  57. data/spec/models/whats_app_template_component_spec.rb +44 -0
  58. data/spec/models/you_tube_platform_data_spec.rb +6 -0
  59. data/zernio-sdk-0.0.93.gem +0 -0
  60. metadata +50 -6
  61. data/zernio-sdk-0.0.91.gem +0 -0
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
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 Late
17
+ class WhatsAppBodyComponent < ApiModelBase
18
+ attr_accessor :type
19
+
20
+ # Body text with optional {{n}} variables
21
+ attr_accessor :text
22
+
23
+ # Add security recommendation text (authentication templates only)
24
+ attr_accessor :add_security_recommendation
25
+
26
+ attr_accessor :example
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'type' => :'type',
54
+ :'text' => :'text',
55
+ :'add_security_recommendation' => :'add_security_recommendation',
56
+ :'example' => :'example'
57
+ }
58
+ end
59
+
60
+ # Returns attribute mapping this model knows about
61
+ def self.acceptable_attribute_map
62
+ attribute_map
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ acceptable_attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'type' => :'String',
74
+ :'text' => :'String',
75
+ :'add_security_recommendation' => :'Boolean',
76
+ :'example' => :'WhatsAppBodyComponentExample'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::WhatsAppBodyComponent` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::WhatsAppBodyComponent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'type')
103
+ self.type = attributes[:'type']
104
+ else
105
+ self.type = nil
106
+ end
107
+
108
+ if attributes.key?(:'text')
109
+ self.text = attributes[:'text']
110
+ else
111
+ self.text = nil
112
+ end
113
+
114
+ if attributes.key?(:'add_security_recommendation')
115
+ self.add_security_recommendation = attributes[:'add_security_recommendation']
116
+ end
117
+
118
+ if attributes.key?(:'example')
119
+ self.example = attributes[:'example']
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
+ invalid_properties = Array.new
128
+ if @type.nil?
129
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
130
+ end
131
+
132
+ if @text.nil?
133
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
134
+ end
135
+
136
+ invalid_properties
137
+ end
138
+
139
+ # Check to see if the all the properties in the model are valid
140
+ # @return true if the model is valid
141
+ def valid?
142
+ warn '[DEPRECATED] the `valid?` method is obsolete'
143
+ return false if @type.nil?
144
+ type_validator = EnumAttributeValidator.new('String', ["BODY"])
145
+ return false unless type_validator.valid?(@type)
146
+ return false if @text.nil?
147
+ true
148
+ end
149
+
150
+ # Custom attribute writer method checking allowed values (enum).
151
+ # @param [Object] type Object to be assigned
152
+ def type=(type)
153
+ validator = EnumAttributeValidator.new('String', ["BODY"])
154
+ unless validator.valid?(type)
155
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
156
+ end
157
+ @type = type
158
+ end
159
+
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] text Value to be assigned
162
+ def text=(text)
163
+ if text.nil?
164
+ fail ArgumentError, 'text cannot be nil'
165
+ end
166
+
167
+ @text = text
168
+ end
169
+
170
+ # Checks equality by comparing each attribute.
171
+ # @param [Object] Object to be compared
172
+ def ==(o)
173
+ return true if self.equal?(o)
174
+ self.class == o.class &&
175
+ type == o.type &&
176
+ text == o.text &&
177
+ add_security_recommendation == o.add_security_recommendation &&
178
+ example == o.example
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Integer] Hash code
189
+ def hash
190
+ [type, text, add_security_recommendation, example].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def self.build_from_hash(attributes)
197
+ return nil unless attributes.is_a?(Hash)
198
+ attributes = attributes.transform_keys(&:to_sym)
199
+ transformed_hash = {}
200
+ openapi_types.each_pair do |key, type|
201
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
202
+ transformed_hash["#{key}"] = nil
203
+ elsif type =~ /\AArray<(.*)>/i
204
+ # check to ensure the input is an array given that the attribute
205
+ # is documented as an array but the input is not
206
+ if attributes[attribute_map[key]].is_a?(Array)
207
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
208
+ end
209
+ elsif !attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
211
+ end
212
+ end
213
+ new(transformed_hash)
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ end
233
+
234
+ end
@@ -0,0 +1,150 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
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 Late
17
+ class WhatsAppBodyComponentExample < ApiModelBase
18
+ # Sample values for body variables (array of arrays)
19
+ attr_accessor :body_text
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'body_text' => :'body_text'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'body_text' => :'Array<Array<String>>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::WhatsAppBodyComponentExample` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::WhatsAppBodyComponentExample`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'body_text')
68
+ if (value = attributes[:'body_text']).is_a?(Array)
69
+ self.body_text = value
70
+ end
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ warn '[DEPRECATED] the `valid?` method is obsolete'
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ body_text == o.body_text
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [body_text].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ attributes = attributes.transform_keys(&:to_sym)
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
119
+ elsif type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
+ end
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
+ end
128
+ end
129
+ new(transformed_hash)
130
+ end
131
+
132
+ # Returns the object in the form of hash
133
+ # @return [Hash] Returns the object in the form of hash
134
+ def to_hash
135
+ hash = {}
136
+ self.class.attribute_map.each_pair do |attr, param|
137
+ value = self.send(attr)
138
+ if value.nil?
139
+ is_nullable = self.class.openapi_nullable.include?(attr)
140
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
141
+ end
142
+
143
+ hash[param] = _to_hash(value)
144
+ end
145
+ hash
146
+ end
147
+
148
+ end
149
+
150
+ end
@@ -0,0 +1,225 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
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 Late
17
+ class WhatsAppButtonsComponent < ApiModelBase
18
+ attr_accessor :type
19
+
20
+ attr_accessor :buttons
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'type' => :'type',
48
+ :'buttons' => :'buttons'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'type' => :'String',
66
+ :'buttons' => :'Array<WhatsAppTemplateButton>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::WhatsAppButtonsComponent` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::WhatsAppButtonsComponent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'type')
93
+ self.type = attributes[:'type']
94
+ else
95
+ self.type = nil
96
+ end
97
+
98
+ if attributes.key?(:'buttons')
99
+ if (value = attributes[:'buttons']).is_a?(Array)
100
+ self.buttons = value
101
+ end
102
+ else
103
+ self.buttons = nil
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
+ if @type.nil?
113
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
114
+ end
115
+
116
+ if @buttons.nil?
117
+ invalid_properties.push('invalid value for "buttons", buttons cannot be nil.')
118
+ end
119
+
120
+ if @buttons.length < 1
121
+ invalid_properties.push('invalid value for "buttons", number of items must be greater than or equal to 1.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @type.nil?
132
+ type_validator = EnumAttributeValidator.new('String', ["BUTTONS"])
133
+ return false unless type_validator.valid?(@type)
134
+ return false if @buttons.nil?
135
+ return false if @buttons.length < 1
136
+ true
137
+ end
138
+
139
+ # Custom attribute writer method checking allowed values (enum).
140
+ # @param [Object] type Object to be assigned
141
+ def type=(type)
142
+ validator = EnumAttributeValidator.new('String', ["BUTTONS"])
143
+ unless validator.valid?(type)
144
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
145
+ end
146
+ @type = type
147
+ end
148
+
149
+ # Custom attribute writer method with validation
150
+ # @param [Object] buttons Value to be assigned
151
+ def buttons=(buttons)
152
+ if buttons.nil?
153
+ fail ArgumentError, 'buttons cannot be nil'
154
+ end
155
+
156
+ if buttons.length < 1
157
+ fail ArgumentError, 'invalid value for "buttons", number of items must be greater than or equal to 1.'
158
+ end
159
+
160
+ @buttons = buttons
161
+ end
162
+
163
+ # Checks equality by comparing each attribute.
164
+ # @param [Object] Object to be compared
165
+ def ==(o)
166
+ return true if self.equal?(o)
167
+ self.class == o.class &&
168
+ type == o.type &&
169
+ buttons == o.buttons
170
+ end
171
+
172
+ # @see the `==` method
173
+ # @param [Object] Object to be compared
174
+ def eql?(o)
175
+ self == o
176
+ end
177
+
178
+ # Calculates hash code according to all attributes.
179
+ # @return [Integer] Hash code
180
+ def hash
181
+ [type, buttons].hash
182
+ end
183
+
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def self.build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ attributes = attributes.transform_keys(&:to_sym)
190
+ transformed_hash = {}
191
+ openapi_types.each_pair do |key, type|
192
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = nil
194
+ elsif type =~ /\AArray<(.*)>/i
195
+ # check to ensure the input is an array given that the attribute
196
+ # is documented as an array but the input is not
197
+ if attributes[attribute_map[key]].is_a?(Array)
198
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
199
+ end
200
+ elsif !attributes[attribute_map[key]].nil?
201
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
202
+ end
203
+ end
204
+ new(transformed_hash)
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ end
224
+
225
+ end