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,158 @@
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 GetYoutubePlaylists200Response < ApiModelBase
18
+ attr_accessor :playlists
19
+
20
+ attr_accessor :default_playlist_id
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'playlists' => :'playlists',
26
+ :'default_playlist_id' => :'defaultPlaylistId'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'playlists' => :'Array<GetYoutubePlaylists200ResponsePlaylistsInner>',
44
+ :'default_playlist_id' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::GetYoutubePlaylists200Response` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::GetYoutubePlaylists200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'playlists')
71
+ if (value = attributes[:'playlists']).is_a?(Array)
72
+ self.playlists = value
73
+ end
74
+ end
75
+
76
+ if attributes.key?(:'default_playlist_id')
77
+ self.default_playlist_id = attributes[:'default_playlist_id']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ playlists == o.playlists &&
102
+ default_playlist_id == o.default_playlist_id
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [playlists, default_playlist_id].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ transformed_hash = {}
124
+ openapi_types.each_pair do |key, type|
125
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = nil
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[attribute_map[key]].is_a?(Array)
131
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
132
+ end
133
+ elsif !attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
135
+ end
136
+ end
137
+ new(transformed_hash)
138
+ end
139
+
140
+ # Returns the object in the form of hash
141
+ # @return [Hash] Returns the object in the form of hash
142
+ def to_hash
143
+ hash = {}
144
+ self.class.attribute_map.each_pair do |attr, param|
145
+ value = self.send(attr)
146
+ if value.nil?
147
+ is_nullable = self.class.openapi_nullable.include?(attr)
148
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
149
+ end
150
+
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ end
157
+
158
+ end
@@ -0,0 +1,226 @@
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 GetYoutubePlaylists200ResponsePlaylistsInner < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :title
21
+
22
+ attr_accessor :description
23
+
24
+ attr_accessor :privacy
25
+
26
+ attr_accessor :item_count
27
+
28
+ attr_accessor :thumbnail_url
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
+ :'description' => :'description',
58
+ :'privacy' => :'privacy',
59
+ :'item_count' => :'itemCount',
60
+ :'thumbnail_url' => :'thumbnailUrl'
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
+ :'description' => :'String',
80
+ :'privacy' => :'String',
81
+ :'item_count' => :'Integer',
82
+ :'thumbnail_url' => :'String'
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 `Late::GetYoutubePlaylists200ResponsePlaylistsInner` 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 `Late::GetYoutubePlaylists200ResponsePlaylistsInner`. 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?(:'description')
117
+ self.description = attributes[:'description']
118
+ end
119
+
120
+ if attributes.key?(:'privacy')
121
+ self.privacy = attributes[:'privacy']
122
+ end
123
+
124
+ if attributes.key?(:'item_count')
125
+ self.item_count = attributes[:'item_count']
126
+ end
127
+
128
+ if attributes.key?(:'thumbnail_url')
129
+ self.thumbnail_url = attributes[:'thumbnail_url']
130
+ end
131
+ end
132
+
133
+ # Show invalid properties with the reasons. Usually used together with valid?
134
+ # @return Array for valid properties with the reasons
135
+ def list_invalid_properties
136
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
137
+ invalid_properties = Array.new
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ warn '[DEPRECATED] the `valid?` method is obsolete'
145
+ privacy_validator = EnumAttributeValidator.new('String', ["public", "private", "unlisted"])
146
+ return false unless privacy_validator.valid?(@privacy)
147
+ true
148
+ end
149
+
150
+ # Custom attribute writer method checking allowed values (enum).
151
+ # @param [Object] privacy Object to be assigned
152
+ def privacy=(privacy)
153
+ validator = EnumAttributeValidator.new('String', ["public", "private", "unlisted"])
154
+ unless validator.valid?(privacy)
155
+ fail ArgumentError, "invalid value for \"privacy\", must be one of #{validator.allowable_values}."
156
+ end
157
+ @privacy = privacy
158
+ end
159
+
160
+ # Checks equality by comparing each attribute.
161
+ # @param [Object] Object to be compared
162
+ def ==(o)
163
+ return true if self.equal?(o)
164
+ self.class == o.class &&
165
+ id == o.id &&
166
+ title == o.title &&
167
+ description == o.description &&
168
+ privacy == o.privacy &&
169
+ item_count == o.item_count &&
170
+ thumbnail_url == o.thumbnail_url
171
+ end
172
+
173
+ # @see the `==` method
174
+ # @param [Object] Object to be compared
175
+ def eql?(o)
176
+ self == o
177
+ end
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Integer] Hash code
181
+ def hash
182
+ [id, title, description, privacy, item_count, thumbnail_url].hash
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def self.build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+ attributes = attributes.transform_keys(&:to_sym)
191
+ transformed_hash = {}
192
+ openapi_types.each_pair do |key, type|
193
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = nil
195
+ elsif type =~ /\AArray<(.*)>/i
196
+ # check to ensure the input is an array given that the attribute
197
+ # is documented as an array but the input is not
198
+ if attributes[attribute_map[key]].is_a?(Array)
199
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
200
+ end
201
+ elsif !attributes[attribute_map[key]].nil?
202
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
203
+ end
204
+ end
205
+ new(transformed_hash)
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ if value.nil?
215
+ is_nullable = self.class.openapi_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ end
225
+
226
+ end
@@ -43,7 +43,7 @@ module Late
43
43
  def self.openapi_types
44
44
  {
45
45
  :'account_id' => :'String',
46
- :'components' => :'Array<Object>'
46
+ :'components' => :'Array<WhatsAppTemplateComponent>'
47
47
  }
48
48
  end
49
49
 
@@ -97,6 +97,10 @@ module Late
97
97
  invalid_properties.push('invalid value for "components", components cannot be nil.')
98
98
  end
99
99
 
100
+ if @components.length < 1
101
+ invalid_properties.push('invalid value for "components", number of items must be greater than or equal to 1.')
102
+ end
103
+
100
104
  invalid_properties
101
105
  end
102
106
 
@@ -106,6 +110,7 @@ module Late
106
110
  warn '[DEPRECATED] the `valid?` method is obsolete'
107
111
  return false if @account_id.nil?
108
112
  return false if @components.nil?
113
+ return false if @components.length < 1
109
114
  true
110
115
  end
111
116
 
@@ -126,6 +131,10 @@ module Late
126
131
  fail ArgumentError, 'components cannot be nil'
127
132
  end
128
133
 
134
+ if components.length < 1
135
+ fail ArgumentError, 'invalid value for "components", number of items must be greater than or equal to 1.'
136
+ end
137
+
129
138
  @components = components
130
139
  end
131
140
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Late
17
- class UpdateRedditSubreddits200Response < ApiModelBase
17
+ class UpdateYoutubeDefaultPlaylist200Response < ApiModelBase
18
18
  attr_accessor :success
19
19
 
20
20
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -51,14 +51,14 @@ module Late
51
51
  # @param [Hash] attributes Model attributes in the form of hash
52
52
  def initialize(attributes = {})
53
53
  if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `Late::UpdateRedditSubreddits200Response` initialize method"
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::UpdateYoutubeDefaultPlaylist200Response` initialize method"
55
55
  end
56
56
 
57
57
  # check to see if the attribute exists and convert string to symbol for hash key
58
58
  acceptable_attribute_map = self.class.acceptable_attribute_map
59
59
  attributes = attributes.each_with_object({}) { |(k, v), h|
60
60
  if (!acceptable_attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `Late::UpdateRedditSubreddits200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::UpdateYoutubeDefaultPlaylist200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
62
  end
63
63
  h[k.to_sym] = v
64
64
  }
@@ -0,0 +1,173 @@
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 UpdateYoutubeDefaultPlaylistRequest < ApiModelBase
18
+ attr_accessor :default_playlist_id
19
+
20
+ attr_accessor :default_playlist_name
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'default_playlist_id' => :'defaultPlaylistId',
26
+ :'default_playlist_name' => :'defaultPlaylistName'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'default_playlist_id' => :'String',
44
+ :'default_playlist_name' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::UpdateYoutubeDefaultPlaylistRequest` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::UpdateYoutubeDefaultPlaylistRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'default_playlist_id')
71
+ self.default_playlist_id = attributes[:'default_playlist_id']
72
+ else
73
+ self.default_playlist_id = nil
74
+ end
75
+
76
+ if attributes.key?(:'default_playlist_name')
77
+ self.default_playlist_name = attributes[:'default_playlist_name']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ if @default_playlist_id.nil?
87
+ invalid_properties.push('invalid value for "default_playlist_id", default_playlist_id cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ return false if @default_playlist_id.nil?
98
+ true
99
+ end
100
+
101
+ # Custom attribute writer method with validation
102
+ # @param [Object] default_playlist_id Value to be assigned
103
+ def default_playlist_id=(default_playlist_id)
104
+ if default_playlist_id.nil?
105
+ fail ArgumentError, 'default_playlist_id cannot be nil'
106
+ end
107
+
108
+ @default_playlist_id = default_playlist_id
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ default_playlist_id == o.default_playlist_id &&
117
+ default_playlist_name == o.default_playlist_name
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [default_playlist_id, default_playlist_name].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ attributes = attributes.transform_keys(&:to_sym)
138
+ transformed_hash = {}
139
+ openapi_types.each_pair do |key, type|
140
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = nil
142
+ elsif type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[attribute_map[key]].is_a?(Array)
146
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
147
+ end
148
+ elsif !attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
150
+ end
151
+ end
152
+ new(transformed_hash)
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ if value.nil?
162
+ is_nullable = self.class.openapi_nullable.include?(attr)
163
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
164
+ end
165
+
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ end
172
+
173
+ end