late-sdk 0.0.104 → 0.0.105

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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -0
  3. data/docs/AdCampaignsApi.md +86 -0
  4. data/docs/AdTreeAdSet.md +30 -0
  5. data/docs/AdTreeCampaign.md +40 -0
  6. data/docs/GetAdTree200Response.md +20 -0
  7. data/docs/ValidateApi.md +287 -0
  8. data/docs/ValidateMedia200Response.md +32 -0
  9. data/docs/ValidateMedia200ResponsePlatformLimitsValue.md +22 -0
  10. data/docs/ValidateMediaRequest.md +18 -0
  11. data/docs/ValidatePost200Response.md +49 -0
  12. data/docs/ValidatePost200ResponseOneOf.md +22 -0
  13. data/docs/ValidatePost200ResponseOneOf1.md +22 -0
  14. data/docs/ValidatePost200ResponseOneOf1ErrorsInner.md +20 -0
  15. data/docs/ValidatePost200ResponseOneOfWarningsInner.md +20 -0
  16. data/docs/ValidatePostLength200Response.md +20 -0
  17. data/docs/ValidatePostLength200ResponsePlatformsValue.md +22 -0
  18. data/docs/ValidatePostLengthRequest.md +18 -0
  19. data/docs/ValidatePostRequest.md +22 -0
  20. data/docs/ValidatePostRequestMediaItemsInner.md +20 -0
  21. data/docs/ValidatePostRequestPlatformsInner.md +24 -0
  22. data/docs/ValidatePostRequestPlatformsInnerCustomMediaInner.md +20 -0
  23. data/docs/ValidateSubreddit200Response.md +49 -0
  24. data/docs/ValidateSubreddit200ResponseOneOf.md +20 -0
  25. data/docs/ValidateSubreddit200ResponseOneOf1.md +20 -0
  26. data/docs/ValidateSubreddit200ResponseOneOfSubreddit.md +32 -0
  27. data/lib/late-sdk/api/ad_campaigns_api.rb +105 -0
  28. data/lib/late-sdk/api/validate_api.rb +290 -0
  29. data/lib/late-sdk/models/ad_tree_ad_set.rb +240 -0
  30. data/lib/late-sdk/models/ad_tree_campaign.rb +297 -0
  31. data/lib/late-sdk/models/get_ad_tree200_response.rb +158 -0
  32. data/lib/late-sdk/models/validate_media200_response.rb +249 -0
  33. data/lib/late-sdk/models/validate_media200_response_platform_limits_value.rb +166 -0
  34. data/lib/late-sdk/models/validate_media_request.rb +165 -0
  35. data/lib/late-sdk/models/validate_post200_response.rb +104 -0
  36. data/lib/late-sdk/models/validate_post200_response_one_of.rb +168 -0
  37. data/lib/late-sdk/models/validate_post200_response_one_of1.rb +170 -0
  38. data/lib/late-sdk/models/validate_post200_response_one_of1_errors_inner.rb +156 -0
  39. data/lib/late-sdk/models/validate_post200_response_one_of_warnings_inner.rb +156 -0
  40. data/lib/late-sdk/models/validate_post_length200_response.rb +158 -0
  41. data/lib/late-sdk/models/validate_post_length200_response_platforms_value.rb +168 -0
  42. data/lib/late-sdk/models/validate_post_length_request.rb +165 -0
  43. data/lib/late-sdk/models/validate_post_request.rb +189 -0
  44. data/lib/late-sdk/models/validate_post_request_media_items_inner.rb +190 -0
  45. data/lib/late-sdk/models/validate_post_request_platforms_inner.rb +217 -0
  46. data/lib/late-sdk/models/validate_post_request_platforms_inner_custom_media_inner.rb +190 -0
  47. data/lib/late-sdk/models/validate_subreddit200_response.rb +104 -0
  48. data/lib/late-sdk/models/validate_subreddit200_response_one_of.rb +157 -0
  49. data/lib/late-sdk/models/validate_subreddit200_response_one_of1.rb +157 -0
  50. data/lib/late-sdk/models/validate_subreddit200_response_one_of_subreddit.rb +244 -0
  51. data/lib/late-sdk/version.rb +1 -1
  52. data/lib/late-sdk.rb +23 -0
  53. data/openapi.yaml +330 -1
  54. data/spec/api/ad_campaigns_api_spec.rb +19 -0
  55. data/spec/api/validate_api_spec.rb +83 -0
  56. data/spec/models/ad_tree_ad_set_spec.rb +76 -0
  57. data/spec/models/ad_tree_campaign_spec.rb +110 -0
  58. data/spec/models/get_ad_tree200_response_spec.rb +42 -0
  59. data/spec/models/validate_media200_response_platform_limits_value_spec.rb +48 -0
  60. data/spec/models/validate_media200_response_spec.rb +82 -0
  61. data/spec/models/validate_media_request_spec.rb +36 -0
  62. data/spec/models/validate_post200_response_one_of1_errors_inner_spec.rb +42 -0
  63. data/spec/models/validate_post200_response_one_of1_spec.rb +48 -0
  64. data/spec/models/validate_post200_response_one_of_spec.rb +48 -0
  65. data/spec/models/validate_post200_response_one_of_warnings_inner_spec.rb +42 -0
  66. data/spec/models/validate_post200_response_spec.rb +32 -0
  67. data/spec/models/validate_post_length200_response_platforms_value_spec.rb +48 -0
  68. data/spec/models/validate_post_length200_response_spec.rb +42 -0
  69. data/spec/models/validate_post_length_request_spec.rb +36 -0
  70. data/spec/models/validate_post_request_media_items_inner_spec.rb +46 -0
  71. data/spec/models/validate_post_request_platforms_inner_custom_media_inner_spec.rb +46 -0
  72. data/spec/models/validate_post_request_platforms_inner_spec.rb +58 -0
  73. data/spec/models/validate_post_request_spec.rb +48 -0
  74. data/spec/models/validate_subreddit200_response_one_of1_spec.rb +42 -0
  75. data/spec/models/validate_subreddit200_response_one_of_spec.rb +42 -0
  76. data/spec/models/validate_subreddit200_response_one_of_subreddit_spec.rb +82 -0
  77. data/spec/models/validate_subreddit200_response_spec.rb +32 -0
  78. data/zernio-sdk-0.0.105.gem +0 -0
  79. metadata +94 -2
  80. data/zernio-sdk-0.0.104.gem +0 -0
@@ -0,0 +1,297 @@
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
+ # Campaign with nested ad sets and rolled-up metrics
18
+ class AdTreeCampaign < ApiModelBase
19
+ attr_accessor :platform_campaign_id
20
+
21
+ attr_accessor :platform
22
+
23
+ attr_accessor :campaign_name
24
+
25
+ # Derived from child ad statuses
26
+ attr_accessor :status
27
+
28
+ # Total ads across all ad sets
29
+ attr_accessor :ad_count
30
+
31
+ attr_accessor :ad_set_count
32
+
33
+ attr_accessor :budget
34
+
35
+ attr_accessor :metrics
36
+
37
+ attr_accessor :platform_ad_account_id
38
+
39
+ attr_accessor :account_id
40
+
41
+ attr_accessor :profile_id
42
+
43
+ attr_accessor :ad_sets
44
+
45
+ class EnumAttributeValidator
46
+ attr_reader :datatype
47
+ attr_reader :allowable_values
48
+
49
+ def initialize(datatype, allowable_values)
50
+ @allowable_values = allowable_values.map do |value|
51
+ case datatype.to_s
52
+ when /Integer/i
53
+ value.to_i
54
+ when /Float/i
55
+ value.to_f
56
+ else
57
+ value
58
+ end
59
+ end
60
+ end
61
+
62
+ def valid?(value)
63
+ !value || allowable_values.include?(value)
64
+ end
65
+ end
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ :'platform_campaign_id' => :'platformCampaignId',
71
+ :'platform' => :'platform',
72
+ :'campaign_name' => :'campaignName',
73
+ :'status' => :'status',
74
+ :'ad_count' => :'adCount',
75
+ :'ad_set_count' => :'adSetCount',
76
+ :'budget' => :'budget',
77
+ :'metrics' => :'metrics',
78
+ :'platform_ad_account_id' => :'platformAdAccountId',
79
+ :'account_id' => :'accountId',
80
+ :'profile_id' => :'profileId',
81
+ :'ad_sets' => :'adSets'
82
+ }
83
+ end
84
+
85
+ # Returns attribute mapping this model knows about
86
+ def self.acceptable_attribute_map
87
+ attribute_map
88
+ end
89
+
90
+ # Returns all the JSON keys this model knows about
91
+ def self.acceptable_attributes
92
+ acceptable_attribute_map.values
93
+ end
94
+
95
+ # Attribute type mapping.
96
+ def self.openapi_types
97
+ {
98
+ :'platform_campaign_id' => :'String',
99
+ :'platform' => :'String',
100
+ :'campaign_name' => :'String',
101
+ :'status' => :'String',
102
+ :'ad_count' => :'Integer',
103
+ :'ad_set_count' => :'Integer',
104
+ :'budget' => :'AdBudget',
105
+ :'metrics' => :'AdMetrics',
106
+ :'platform_ad_account_id' => :'String',
107
+ :'account_id' => :'String',
108
+ :'profile_id' => :'String',
109
+ :'ad_sets' => :'Array<AdTreeAdSet>'
110
+ }
111
+ end
112
+
113
+ # List of attributes with nullable: true
114
+ def self.openapi_nullable
115
+ Set.new([
116
+ ])
117
+ end
118
+
119
+ # Initializes the object
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ def initialize(attributes = {})
122
+ if (!attributes.is_a?(Hash))
123
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::AdTreeCampaign` initialize method"
124
+ end
125
+
126
+ # check to see if the attribute exists and convert string to symbol for hash key
127
+ acceptable_attribute_map = self.class.acceptable_attribute_map
128
+ attributes = attributes.each_with_object({}) { |(k, v), h|
129
+ if (!acceptable_attribute_map.key?(k.to_sym))
130
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::AdTreeCampaign`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
131
+ end
132
+ h[k.to_sym] = v
133
+ }
134
+
135
+ if attributes.key?(:'platform_campaign_id')
136
+ self.platform_campaign_id = attributes[:'platform_campaign_id']
137
+ end
138
+
139
+ if attributes.key?(:'platform')
140
+ self.platform = attributes[:'platform']
141
+ end
142
+
143
+ if attributes.key?(:'campaign_name')
144
+ self.campaign_name = attributes[:'campaign_name']
145
+ end
146
+
147
+ if attributes.key?(:'status')
148
+ self.status = attributes[:'status']
149
+ end
150
+
151
+ if attributes.key?(:'ad_count')
152
+ self.ad_count = attributes[:'ad_count']
153
+ end
154
+
155
+ if attributes.key?(:'ad_set_count')
156
+ self.ad_set_count = attributes[:'ad_set_count']
157
+ end
158
+
159
+ if attributes.key?(:'budget')
160
+ self.budget = attributes[:'budget']
161
+ end
162
+
163
+ if attributes.key?(:'metrics')
164
+ self.metrics = attributes[:'metrics']
165
+ end
166
+
167
+ if attributes.key?(:'platform_ad_account_id')
168
+ self.platform_ad_account_id = attributes[:'platform_ad_account_id']
169
+ end
170
+
171
+ if attributes.key?(:'account_id')
172
+ self.account_id = attributes[:'account_id']
173
+ end
174
+
175
+ if attributes.key?(:'profile_id')
176
+ self.profile_id = attributes[:'profile_id']
177
+ end
178
+
179
+ if attributes.key?(:'ad_sets')
180
+ if (value = attributes[:'ad_sets']).is_a?(Array)
181
+ self.ad_sets = value
182
+ end
183
+ end
184
+ end
185
+
186
+ # Show invalid properties with the reasons. Usually used together with valid?
187
+ # @return Array for valid properties with the reasons
188
+ def list_invalid_properties
189
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
190
+ invalid_properties = Array.new
191
+ invalid_properties
192
+ end
193
+
194
+ # Check to see if the all the properties in the model are valid
195
+ # @return true if the model is valid
196
+ def valid?
197
+ warn '[DEPRECATED] the `valid?` method is obsolete'
198
+ platform_validator = EnumAttributeValidator.new('String', ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter"])
199
+ return false unless platform_validator.valid?(@platform)
200
+ status_validator = EnumAttributeValidator.new('String', ["active", "paused", "pending_review", "rejected", "completed", "cancelled", "error"])
201
+ return false unless status_validator.valid?(@status)
202
+ true
203
+ end
204
+
205
+ # Custom attribute writer method checking allowed values (enum).
206
+ # @param [Object] platform Object to be assigned
207
+ def platform=(platform)
208
+ validator = EnumAttributeValidator.new('String', ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter"])
209
+ unless validator.valid?(platform)
210
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
211
+ end
212
+ @platform = platform
213
+ end
214
+
215
+ # Custom attribute writer method checking allowed values (enum).
216
+ # @param [Object] status Object to be assigned
217
+ def status=(status)
218
+ validator = EnumAttributeValidator.new('String', ["active", "paused", "pending_review", "rejected", "completed", "cancelled", "error"])
219
+ unless validator.valid?(status)
220
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
221
+ end
222
+ @status = status
223
+ end
224
+
225
+ # Checks equality by comparing each attribute.
226
+ # @param [Object] Object to be compared
227
+ def ==(o)
228
+ return true if self.equal?(o)
229
+ self.class == o.class &&
230
+ platform_campaign_id == o.platform_campaign_id &&
231
+ platform == o.platform &&
232
+ campaign_name == o.campaign_name &&
233
+ status == o.status &&
234
+ ad_count == o.ad_count &&
235
+ ad_set_count == o.ad_set_count &&
236
+ budget == o.budget &&
237
+ metrics == o.metrics &&
238
+ platform_ad_account_id == o.platform_ad_account_id &&
239
+ account_id == o.account_id &&
240
+ profile_id == o.profile_id &&
241
+ ad_sets == o.ad_sets
242
+ end
243
+
244
+ # @see the `==` method
245
+ # @param [Object] Object to be compared
246
+ def eql?(o)
247
+ self == o
248
+ end
249
+
250
+ # Calculates hash code according to all attributes.
251
+ # @return [Integer] Hash code
252
+ def hash
253
+ [platform_campaign_id, platform, campaign_name, status, ad_count, ad_set_count, budget, metrics, platform_ad_account_id, account_id, profile_id, ad_sets].hash
254
+ end
255
+
256
+ # Builds the object from hash
257
+ # @param [Hash] attributes Model attributes in the form of hash
258
+ # @return [Object] Returns the model itself
259
+ def self.build_from_hash(attributes)
260
+ return nil unless attributes.is_a?(Hash)
261
+ attributes = attributes.transform_keys(&:to_sym)
262
+ transformed_hash = {}
263
+ openapi_types.each_pair do |key, type|
264
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
265
+ transformed_hash["#{key}"] = nil
266
+ elsif type =~ /\AArray<(.*)>/i
267
+ # check to ensure the input is an array given that the attribute
268
+ # is documented as an array but the input is not
269
+ if attributes[attribute_map[key]].is_a?(Array)
270
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
271
+ end
272
+ elsif !attributes[attribute_map[key]].nil?
273
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
274
+ end
275
+ end
276
+ new(transformed_hash)
277
+ end
278
+
279
+ # Returns the object in the form of hash
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_hash
282
+ hash = {}
283
+ self.class.attribute_map.each_pair do |attr, param|
284
+ value = self.send(attr)
285
+ if value.nil?
286
+ is_nullable = self.class.openapi_nullable.include?(attr)
287
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
288
+ end
289
+
290
+ hash[param] = _to_hash(value)
291
+ end
292
+ hash
293
+ end
294
+
295
+ end
296
+
297
+ end
@@ -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 GetAdTree200Response < ApiModelBase
18
+ attr_accessor :campaigns
19
+
20
+ attr_accessor :pagination
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'campaigns' => :'campaigns',
26
+ :'pagination' => :'pagination'
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
+ :'campaigns' => :'Array<AdTreeCampaign>',
44
+ :'pagination' => :'Pagination'
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::GetAdTree200Response` 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::GetAdTree200Response`. 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?(:'campaigns')
71
+ if (value = attributes[:'campaigns']).is_a?(Array)
72
+ self.campaigns = value
73
+ end
74
+ end
75
+
76
+ if attributes.key?(:'pagination')
77
+ self.pagination = attributes[:'pagination']
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
+ campaigns == o.campaigns &&
102
+ pagination == o.pagination
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
+ [campaigns, pagination].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,249 @@
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 ValidateMedia200Response < ApiModelBase
18
+ attr_accessor :valid
19
+
20
+ attr_accessor :url
21
+
22
+ # Error message if valid is false
23
+ attr_accessor :error
24
+
25
+ attr_accessor :content_type
26
+
27
+ # File size in bytes
28
+ attr_accessor :size
29
+
30
+ attr_accessor :size_formatted
31
+
32
+ attr_accessor :type
33
+
34
+ # Per-platform size limit comparison (only present when size and type are known)
35
+ attr_accessor :platform_limits
36
+
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'valid' => :'valid',
63
+ :'url' => :'url',
64
+ :'error' => :'error',
65
+ :'content_type' => :'contentType',
66
+ :'size' => :'size',
67
+ :'size_formatted' => :'sizeFormatted',
68
+ :'type' => :'type',
69
+ :'platform_limits' => :'platformLimits'
70
+ }
71
+ end
72
+
73
+ # Returns attribute mapping this model knows about
74
+ def self.acceptable_attribute_map
75
+ attribute_map
76
+ end
77
+
78
+ # Returns all the JSON keys this model knows about
79
+ def self.acceptable_attributes
80
+ acceptable_attribute_map.values
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.openapi_types
85
+ {
86
+ :'valid' => :'Boolean',
87
+ :'url' => :'String',
88
+ :'error' => :'String',
89
+ :'content_type' => :'String',
90
+ :'size' => :'Integer',
91
+ :'size_formatted' => :'String',
92
+ :'type' => :'String',
93
+ :'platform_limits' => :'Hash<String, ValidateMedia200ResponsePlatformLimitsValue>'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ValidateMedia200Response` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ acceptable_attribute_map = self.class.acceptable_attribute_map
112
+ attributes = attributes.each_with_object({}) { |(k, v), h|
113
+ if (!acceptable_attribute_map.key?(k.to_sym))
114
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ValidateMedia200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
115
+ end
116
+ h[k.to_sym] = v
117
+ }
118
+
119
+ if attributes.key?(:'valid')
120
+ self.valid = attributes[:'valid']
121
+ end
122
+
123
+ if attributes.key?(:'url')
124
+ self.url = attributes[:'url']
125
+ end
126
+
127
+ if attributes.key?(:'error')
128
+ self.error = attributes[:'error']
129
+ end
130
+
131
+ if attributes.key?(:'content_type')
132
+ self.content_type = attributes[:'content_type']
133
+ end
134
+
135
+ if attributes.key?(:'size')
136
+ self.size = attributes[:'size']
137
+ end
138
+
139
+ if attributes.key?(:'size_formatted')
140
+ self.size_formatted = attributes[:'size_formatted']
141
+ end
142
+
143
+ if attributes.key?(:'type')
144
+ self.type = attributes[:'type']
145
+ end
146
+
147
+ if attributes.key?(:'platform_limits')
148
+ if (value = attributes[:'platform_limits']).is_a?(Hash)
149
+ self.platform_limits = value
150
+ end
151
+ end
152
+ end
153
+
154
+ # Show invalid properties with the reasons. Usually used together with valid?
155
+ # @return Array for valid properties with the reasons
156
+ def list_invalid_properties
157
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
158
+ invalid_properties = Array.new
159
+ invalid_properties
160
+ end
161
+
162
+ # Check to see if the all the properties in the model are valid
163
+ # @return true if the model is valid
164
+ def valid?
165
+ warn '[DEPRECATED] the `valid?` method is obsolete'
166
+ type_validator = EnumAttributeValidator.new('String', ["image", "video", "unknown"])
167
+ return false unless type_validator.valid?(@type)
168
+ true
169
+ end
170
+
171
+ # Custom attribute writer method checking allowed values (enum).
172
+ # @param [Object] type Object to be assigned
173
+ def type=(type)
174
+ validator = EnumAttributeValidator.new('String', ["image", "video", "unknown"])
175
+ unless validator.valid?(type)
176
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
177
+ end
178
+ @type = type
179
+ end
180
+
181
+ # Checks equality by comparing each attribute.
182
+ # @param [Object] Object to be compared
183
+ def ==(o)
184
+ return true if self.equal?(o)
185
+ self.class == o.class &&
186
+ valid == o.valid &&
187
+ url == o.url &&
188
+ error == o.error &&
189
+ content_type == o.content_type &&
190
+ size == o.size &&
191
+ size_formatted == o.size_formatted &&
192
+ type == o.type &&
193
+ platform_limits == o.platform_limits
194
+ end
195
+
196
+ # @see the `==` method
197
+ # @param [Object] Object to be compared
198
+ def eql?(o)
199
+ self == o
200
+ end
201
+
202
+ # Calculates hash code according to all attributes.
203
+ # @return [Integer] Hash code
204
+ def hash
205
+ [valid, url, error, content_type, size, size_formatted, type, platform_limits].hash
206
+ end
207
+
208
+ # Builds the object from hash
209
+ # @param [Hash] attributes Model attributes in the form of hash
210
+ # @return [Object] Returns the model itself
211
+ def self.build_from_hash(attributes)
212
+ return nil unless attributes.is_a?(Hash)
213
+ attributes = attributes.transform_keys(&:to_sym)
214
+ transformed_hash = {}
215
+ openapi_types.each_pair do |key, type|
216
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
217
+ transformed_hash["#{key}"] = nil
218
+ elsif type =~ /\AArray<(.*)>/i
219
+ # check to ensure the input is an array given that the attribute
220
+ # is documented as an array but the input is not
221
+ if attributes[attribute_map[key]].is_a?(Array)
222
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
223
+ end
224
+ elsif !attributes[attribute_map[key]].nil?
225
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
226
+ end
227
+ end
228
+ new(transformed_hash)
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ if value.nil?
238
+ is_nullable = self.class.openapi_nullable.include?(attr)
239
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
240
+ end
241
+
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ end
248
+
249
+ end