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,227 @@
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 WhatsAppFooterComponent < ApiModelBase
18
+ attr_accessor :type
19
+
20
+ # Static footer text
21
+ attr_accessor :text
22
+
23
+ # OTP code expiry in minutes (authentication templates only)
24
+ attr_accessor :code_expiration_minutes
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'type' => :'type',
52
+ :'text' => :'text',
53
+ :'code_expiration_minutes' => :'code_expiration_minutes'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'type' => :'String',
71
+ :'text' => :'String',
72
+ :'code_expiration_minutes' => :'Integer'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::WhatsAppFooterComponent` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::WhatsAppFooterComponent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'type')
99
+ self.type = attributes[:'type']
100
+ else
101
+ self.type = nil
102
+ end
103
+
104
+ if attributes.key?(:'text')
105
+ self.text = attributes[:'text']
106
+ end
107
+
108
+ if attributes.key?(:'code_expiration_minutes')
109
+ self.code_expiration_minutes = attributes[:'code_expiration_minutes']
110
+ end
111
+ end
112
+
113
+ # Show invalid properties with the reasons. Usually used together with valid?
114
+ # @return Array for valid properties with the reasons
115
+ def list_invalid_properties
116
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
117
+ invalid_properties = Array.new
118
+ if @type.nil?
119
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
120
+ end
121
+
122
+ if !@code_expiration_minutes.nil? && @code_expiration_minutes < 1
123
+ invalid_properties.push('invalid value for "code_expiration_minutes", must be greater than or equal to 1.')
124
+ end
125
+
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ warn '[DEPRECATED] the `valid?` method is obsolete'
133
+ return false if @type.nil?
134
+ type_validator = EnumAttributeValidator.new('String', ["FOOTER"])
135
+ return false unless type_validator.valid?(@type)
136
+ return false if !@code_expiration_minutes.nil? && @code_expiration_minutes < 1
137
+ true
138
+ end
139
+
140
+ # Custom attribute writer method checking allowed values (enum).
141
+ # @param [Object] type Object to be assigned
142
+ def type=(type)
143
+ validator = EnumAttributeValidator.new('String', ["FOOTER"])
144
+ unless validator.valid?(type)
145
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
146
+ end
147
+ @type = type
148
+ end
149
+
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] code_expiration_minutes Value to be assigned
152
+ def code_expiration_minutes=(code_expiration_minutes)
153
+ if code_expiration_minutes.nil?
154
+ fail ArgumentError, 'code_expiration_minutes cannot be nil'
155
+ end
156
+
157
+ if code_expiration_minutes < 1
158
+ fail ArgumentError, 'invalid value for "code_expiration_minutes", must be greater than or equal to 1.'
159
+ end
160
+
161
+ @code_expiration_minutes = code_expiration_minutes
162
+ end
163
+
164
+ # Checks equality by comparing each attribute.
165
+ # @param [Object] Object to be compared
166
+ def ==(o)
167
+ return true if self.equal?(o)
168
+ self.class == o.class &&
169
+ type == o.type &&
170
+ text == o.text &&
171
+ code_expiration_minutes == o.code_expiration_minutes
172
+ end
173
+
174
+ # @see the `==` method
175
+ # @param [Object] Object to be compared
176
+ def eql?(o)
177
+ self == o
178
+ end
179
+
180
+ # Calculates hash code according to all attributes.
181
+ # @return [Integer] Hash code
182
+ def hash
183
+ [type, text, code_expiration_minutes].hash
184
+ end
185
+
186
+ # Builds the object from hash
187
+ # @param [Hash] attributes Model attributes in the form of hash
188
+ # @return [Object] Returns the model itself
189
+ def self.build_from_hash(attributes)
190
+ return nil unless attributes.is_a?(Hash)
191
+ attributes = attributes.transform_keys(&:to_sym)
192
+ transformed_hash = {}
193
+ openapi_types.each_pair do |key, type|
194
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = nil
196
+ elsif type =~ /\AArray<(.*)>/i
197
+ # check to ensure the input is an array given that the attribute
198
+ # is documented as an array but the input is not
199
+ if attributes[attribute_map[key]].is_a?(Array)
200
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
201
+ end
202
+ elsif !attributes[attribute_map[key]].nil?
203
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
204
+ end
205
+ end
206
+ new(transformed_hash)
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.openapi_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ end
226
+
227
+ end
@@ -0,0 +1,235 @@
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 WhatsAppHeaderComponent < ApiModelBase
18
+ attr_accessor :type
19
+
20
+ attr_accessor :format
21
+
22
+ # Header text (may include {{1}} variable). Used when format is TEXT.
23
+ attr_accessor :text
24
+
25
+ attr_accessor :example
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'type' => :'type',
53
+ :'format' => :'format',
54
+ :'text' => :'text',
55
+ :'example' => :'example'
56
+ }
57
+ end
58
+
59
+ # Returns attribute mapping this model knows about
60
+ def self.acceptable_attribute_map
61
+ attribute_map
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ def self.acceptable_attributes
66
+ acceptable_attribute_map.values
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'type' => :'String',
73
+ :'format' => :'String',
74
+ :'text' => :'String',
75
+ :'example' => :'WhatsAppHeaderComponentExample'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ ])
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ if (!attributes.is_a?(Hash))
89
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::WhatsAppHeaderComponent` initialize method"
90
+ end
91
+
92
+ # check to see if the attribute exists and convert string to symbol for hash key
93
+ acceptable_attribute_map = self.class.acceptable_attribute_map
94
+ attributes = attributes.each_with_object({}) { |(k, v), h|
95
+ if (!acceptable_attribute_map.key?(k.to_sym))
96
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::WhatsAppHeaderComponent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
97
+ end
98
+ h[k.to_sym] = v
99
+ }
100
+
101
+ if attributes.key?(:'type')
102
+ self.type = attributes[:'type']
103
+ else
104
+ self.type = nil
105
+ end
106
+
107
+ if attributes.key?(:'format')
108
+ self.format = attributes[:'format']
109
+ else
110
+ self.format = nil
111
+ end
112
+
113
+ if attributes.key?(:'text')
114
+ self.text = attributes[:'text']
115
+ end
116
+
117
+ if attributes.key?(:'example')
118
+ self.example = attributes[:'example']
119
+ end
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properties with the reasons
124
+ def list_invalid_properties
125
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
126
+ invalid_properties = Array.new
127
+ if @type.nil?
128
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
129
+ end
130
+
131
+ if @format.nil?
132
+ invalid_properties.push('invalid value for "format", format cannot be nil.')
133
+ end
134
+
135
+ invalid_properties
136
+ end
137
+
138
+ # Check to see if the all the properties in the model are valid
139
+ # @return true if the model is valid
140
+ def valid?
141
+ warn '[DEPRECATED] the `valid?` method is obsolete'
142
+ return false if @type.nil?
143
+ type_validator = EnumAttributeValidator.new('String', ["HEADER"])
144
+ return false unless type_validator.valid?(@type)
145
+ return false if @format.nil?
146
+ format_validator = EnumAttributeValidator.new('String', ["TEXT", "IMAGE", "VIDEO", "GIF", "DOCUMENT", "LOCATION"])
147
+ return false unless format_validator.valid?(@format)
148
+ true
149
+ end
150
+
151
+ # Custom attribute writer method checking allowed values (enum).
152
+ # @param [Object] type Object to be assigned
153
+ def type=(type)
154
+ validator = EnumAttributeValidator.new('String', ["HEADER"])
155
+ unless validator.valid?(type)
156
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
157
+ end
158
+ @type = type
159
+ end
160
+
161
+ # Custom attribute writer method checking allowed values (enum).
162
+ # @param [Object] format Object to be assigned
163
+ def format=(format)
164
+ validator = EnumAttributeValidator.new('String', ["TEXT", "IMAGE", "VIDEO", "GIF", "DOCUMENT", "LOCATION"])
165
+ unless validator.valid?(format)
166
+ fail ArgumentError, "invalid value for \"format\", must be one of #{validator.allowable_values}."
167
+ end
168
+ @format = format
169
+ end
170
+
171
+ # Checks equality by comparing each attribute.
172
+ # @param [Object] Object to be compared
173
+ def ==(o)
174
+ return true if self.equal?(o)
175
+ self.class == o.class &&
176
+ type == o.type &&
177
+ format == o.format &&
178
+ text == o.text &&
179
+ example == o.example
180
+ end
181
+
182
+ # @see the `==` method
183
+ # @param [Object] Object to be compared
184
+ def eql?(o)
185
+ self == o
186
+ end
187
+
188
+ # Calculates hash code according to all attributes.
189
+ # @return [Integer] Hash code
190
+ def hash
191
+ [type, format, text, example].hash
192
+ end
193
+
194
+ # Builds the object from hash
195
+ # @param [Hash] attributes Model attributes in the form of hash
196
+ # @return [Object] Returns the model itself
197
+ def self.build_from_hash(attributes)
198
+ return nil unless attributes.is_a?(Hash)
199
+ attributes = attributes.transform_keys(&:to_sym)
200
+ transformed_hash = {}
201
+ openapi_types.each_pair do |key, type|
202
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
203
+ transformed_hash["#{key}"] = nil
204
+ elsif type =~ /\AArray<(.*)>/i
205
+ # check to ensure the input is an array given that the attribute
206
+ # is documented as an array but the input is not
207
+ if attributes[attribute_map[key]].is_a?(Array)
208
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
209
+ end
210
+ elsif !attributes[attribute_map[key]].nil?
211
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
212
+ end
213
+ end
214
+ new(transformed_hash)
215
+ end
216
+
217
+ # Returns the object in the form of hash
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_hash
220
+ hash = {}
221
+ self.class.attribute_map.each_pair do |attr, param|
222
+ value = self.send(attr)
223
+ if value.nil?
224
+ is_nullable = self.class.openapi_nullable.include?(attr)
225
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
226
+ end
227
+
228
+ hash[param] = _to_hash(value)
229
+ end
230
+ hash
231
+ end
232
+
233
+ end
234
+
235
+ end
@@ -0,0 +1,190 @@
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 WhatsAppHeaderComponentExample < ApiModelBase
18
+ # Sample values for header text variables
19
+ attr_accessor :header_text
20
+
21
+ # When the header format is a media type (IMAGE, VIDEO, GIF, DOCUMENT), provide a public URL here. Zernio will download and upload it to WhatsApp on your behalf, replacing it with the internal file handle before creating the template.
22
+ attr_accessor :header_handle
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'header_text' => :'header_text',
28
+ :'header_handle' => :'header_handle'
29
+ }
30
+ end
31
+
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ acceptable_attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'header_text' => :'Array<String>',
46
+ :'header_handle' => :'Array<String>'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::WhatsAppHeaderComponentExample` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::WhatsAppHeaderComponentExample`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'header_text')
73
+ if (value = attributes[:'header_text']).is_a?(Array)
74
+ self.header_text = value
75
+ end
76
+ end
77
+
78
+ if attributes.key?(:'header_handle')
79
+ if (value = attributes[:'header_handle']).is_a?(Array)
80
+ self.header_handle = value
81
+ end
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
+ invalid_properties = Array.new
90
+ if !@header_handle.nil? && @header_handle.length > 1
91
+ invalid_properties.push('invalid value for "header_handle", number of items must be less than or equal to 1.')
92
+ end
93
+
94
+ if !@header_handle.nil? && @header_handle.length < 1
95
+ invalid_properties.push('invalid value for "header_handle", number of items must be greater than or equal to 1.')
96
+ end
97
+
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ return false if !@header_handle.nil? && @header_handle.length > 1
106
+ return false if !@header_handle.nil? && @header_handle.length < 1
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method with validation
111
+ # @param [Object] header_handle Value to be assigned
112
+ def header_handle=(header_handle)
113
+ if header_handle.nil?
114
+ fail ArgumentError, 'header_handle cannot be nil'
115
+ end
116
+
117
+ if header_handle.length > 1
118
+ fail ArgumentError, 'invalid value for "header_handle", number of items must be less than or equal to 1.'
119
+ end
120
+
121
+ if header_handle.length < 1
122
+ fail ArgumentError, 'invalid value for "header_handle", number of items must be greater than or equal to 1.'
123
+ end
124
+
125
+ @header_handle = header_handle
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ header_text == o.header_text &&
134
+ header_handle == o.header_handle
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [header_text, header_handle].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ end
189
+
190
+ end