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,290 @@
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 'cgi'
14
+
15
+ module Late
16
+ class ValidateApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Validate media URL
23
+ # Check if a media URL is accessible and return metadata (content type, file size) plus per-platform size limit comparisons. Performs a HEAD request (with GET fallback) to detect content type and size. Rejects private/localhost URLs for SSRF protection. Platform limits are sourced from each platform's actual upload constraints.
24
+ # @param validate_media_request [ValidateMediaRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [ValidateMedia200Response]
27
+ def validate_media(validate_media_request, opts = {})
28
+ data, _status_code, _headers = validate_media_with_http_info(validate_media_request, opts)
29
+ data
30
+ end
31
+
32
+ # Validate media URL
33
+ # Check if a media URL is accessible and return metadata (content type, file size) plus per-platform size limit comparisons. Performs a HEAD request (with GET fallback) to detect content type and size. Rejects private/localhost URLs for SSRF protection. Platform limits are sourced from each platform's actual upload constraints.
34
+ # @param validate_media_request [ValidateMediaRequest]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(ValidateMedia200Response, Integer, Hash)>] ValidateMedia200Response data, response status code and response headers
37
+ def validate_media_with_http_info(validate_media_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ValidateApi.validate_media ...'
40
+ end
41
+ # verify the required parameter 'validate_media_request' is set
42
+ if @api_client.config.client_side_validation && validate_media_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'validate_media_request' when calling ValidateApi.validate_media"
44
+ end
45
+ # resource path
46
+ local_var_path = '/v1/tools/validate/media'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(validate_media_request)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'ValidateMedia200Response'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"ValidateApi.validate_media",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: ValidateApi#validate_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Validate post content
91
+ # Dry-run the full post validation pipeline without publishing. Catches issues like missing media for Instagram/TikTok/YouTube, hashtag limits, invalid thread formats, Facebook Reel requirements, and character limit violations. Accepts the same body as `POST /v1/posts`. Does NOT validate accounts, process media, or track usage. This is content-only validation. Returns errors for failures and warnings for near-limit content (>90% of character limit).
92
+ # @param validate_post_request [ValidatePostRequest]
93
+ # @param [Hash] opts the optional parameters
94
+ # @return [ValidatePost200Response]
95
+ def validate_post(validate_post_request, opts = {})
96
+ data, _status_code, _headers = validate_post_with_http_info(validate_post_request, opts)
97
+ data
98
+ end
99
+
100
+ # Validate post content
101
+ # Dry-run the full post validation pipeline without publishing. Catches issues like missing media for Instagram/TikTok/YouTube, hashtag limits, invalid thread formats, Facebook Reel requirements, and character limit violations. Accepts the same body as &#x60;POST /v1/posts&#x60;. Does NOT validate accounts, process media, or track usage. This is content-only validation. Returns errors for failures and warnings for near-limit content (&gt;90% of character limit).
102
+ # @param validate_post_request [ValidatePostRequest]
103
+ # @param [Hash] opts the optional parameters
104
+ # @return [Array<(ValidatePost200Response, Integer, Hash)>] ValidatePost200Response data, response status code and response headers
105
+ def validate_post_with_http_info(validate_post_request, opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: ValidateApi.validate_post ...'
108
+ end
109
+ # verify the required parameter 'validate_post_request' is set
110
+ if @api_client.config.client_side_validation && validate_post_request.nil?
111
+ fail ArgumentError, "Missing the required parameter 'validate_post_request' when calling ValidateApi.validate_post"
112
+ end
113
+ # resource path
114
+ local_var_path = '/v1/tools/validate/post'
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+
119
+ # header parameters
120
+ header_params = opts[:header_params] || {}
121
+ # HTTP header 'Accept' (if needed)
122
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
123
+ # HTTP header 'Content-Type'
124
+ content_type = @api_client.select_header_content_type(['application/json'])
125
+ if !content_type.nil?
126
+ header_params['Content-Type'] = content_type
127
+ end
128
+
129
+ # form parameters
130
+ form_params = opts[:form_params] || {}
131
+
132
+ # http body (model)
133
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(validate_post_request)
134
+
135
+ # return_type
136
+ return_type = opts[:debug_return_type] || 'ValidatePost200Response'
137
+
138
+ # auth_names
139
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
140
+
141
+ new_options = opts.merge(
142
+ :operation => :"ValidateApi.validate_post",
143
+ :header_params => header_params,
144
+ :query_params => query_params,
145
+ :form_params => form_params,
146
+ :body => post_body,
147
+ :auth_names => auth_names,
148
+ :return_type => return_type
149
+ )
150
+
151
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
152
+ if @api_client.config.debugging
153
+ @api_client.config.logger.debug "API called: ValidateApi#validate_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
154
+ end
155
+ return data, status_code, headers
156
+ end
157
+
158
+ # Validate post character count
159
+ # Check weighted character count per platform and whether the text is within each platform's limit. Twitter/X uses weighted counting (URLs = 23 chars via t.co, emojis = 2 chars). All other platforms use plain character length. Returns counts and limits for all 15 supported platform variants.
160
+ # @param validate_post_length_request [ValidatePostLengthRequest]
161
+ # @param [Hash] opts the optional parameters
162
+ # @return [ValidatePostLength200Response]
163
+ def validate_post_length(validate_post_length_request, opts = {})
164
+ data, _status_code, _headers = validate_post_length_with_http_info(validate_post_length_request, opts)
165
+ data
166
+ end
167
+
168
+ # Validate post character count
169
+ # Check weighted character count per platform and whether the text is within each platform&#39;s limit. Twitter/X uses weighted counting (URLs &#x3D; 23 chars via t.co, emojis &#x3D; 2 chars). All other platforms use plain character length. Returns counts and limits for all 15 supported platform variants.
170
+ # @param validate_post_length_request [ValidatePostLengthRequest]
171
+ # @param [Hash] opts the optional parameters
172
+ # @return [Array<(ValidatePostLength200Response, Integer, Hash)>] ValidatePostLength200Response data, response status code and response headers
173
+ def validate_post_length_with_http_info(validate_post_length_request, opts = {})
174
+ if @api_client.config.debugging
175
+ @api_client.config.logger.debug 'Calling API: ValidateApi.validate_post_length ...'
176
+ end
177
+ # verify the required parameter 'validate_post_length_request' is set
178
+ if @api_client.config.client_side_validation && validate_post_length_request.nil?
179
+ fail ArgumentError, "Missing the required parameter 'validate_post_length_request' when calling ValidateApi.validate_post_length"
180
+ end
181
+ # resource path
182
+ local_var_path = '/v1/tools/validate/post-length'
183
+
184
+ # query parameters
185
+ query_params = opts[:query_params] || {}
186
+
187
+ # header parameters
188
+ header_params = opts[:header_params] || {}
189
+ # HTTP header 'Accept' (if needed)
190
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
191
+ # HTTP header 'Content-Type'
192
+ content_type = @api_client.select_header_content_type(['application/json'])
193
+ if !content_type.nil?
194
+ header_params['Content-Type'] = content_type
195
+ end
196
+
197
+ # form parameters
198
+ form_params = opts[:form_params] || {}
199
+
200
+ # http body (model)
201
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(validate_post_length_request)
202
+
203
+ # return_type
204
+ return_type = opts[:debug_return_type] || 'ValidatePostLength200Response'
205
+
206
+ # auth_names
207
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
208
+
209
+ new_options = opts.merge(
210
+ :operation => :"ValidateApi.validate_post_length",
211
+ :header_params => header_params,
212
+ :query_params => query_params,
213
+ :form_params => form_params,
214
+ :body => post_body,
215
+ :auth_names => auth_names,
216
+ :return_type => return_type
217
+ )
218
+
219
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
220
+ if @api_client.config.debugging
221
+ @api_client.config.logger.debug "API called: ValidateApi#validate_post_length\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
222
+ end
223
+ return data, status_code, headers
224
+ end
225
+
226
+ # Check subreddit existence
227
+ # Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed). Uses Reddit's public JSON API (no Reddit auth needed). Returns `exists: false` for private, banned, or nonexistent subreddits.
228
+ # @param name [String] Subreddit name (with or without \&quot;r/\&quot; prefix)
229
+ # @param [Hash] opts the optional parameters
230
+ # @return [ValidateSubreddit200Response]
231
+ def validate_subreddit(name, opts = {})
232
+ data, _status_code, _headers = validate_subreddit_with_http_info(name, opts)
233
+ data
234
+ end
235
+
236
+ # Check subreddit existence
237
+ # Check if a subreddit exists and return basic info (title, subscriber count, NSFW status, post types allowed). Uses Reddit&#39;s public JSON API (no Reddit auth needed). Returns &#x60;exists: false&#x60; for private, banned, or nonexistent subreddits.
238
+ # @param name [String] Subreddit name (with or without \&quot;r/\&quot; prefix)
239
+ # @param [Hash] opts the optional parameters
240
+ # @return [Array<(ValidateSubreddit200Response, Integer, Hash)>] ValidateSubreddit200Response data, response status code and response headers
241
+ def validate_subreddit_with_http_info(name, opts = {})
242
+ if @api_client.config.debugging
243
+ @api_client.config.logger.debug 'Calling API: ValidateApi.validate_subreddit ...'
244
+ end
245
+ # verify the required parameter 'name' is set
246
+ if @api_client.config.client_side_validation && name.nil?
247
+ fail ArgumentError, "Missing the required parameter 'name' when calling ValidateApi.validate_subreddit"
248
+ end
249
+ # resource path
250
+ local_var_path = '/v1/tools/validate/subreddit'
251
+
252
+ # query parameters
253
+ query_params = opts[:query_params] || {}
254
+ query_params[:'name'] = name
255
+
256
+ # header parameters
257
+ header_params = opts[:header_params] || {}
258
+ # HTTP header 'Accept' (if needed)
259
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
260
+
261
+ # form parameters
262
+ form_params = opts[:form_params] || {}
263
+
264
+ # http body (model)
265
+ post_body = opts[:debug_body]
266
+
267
+ # return_type
268
+ return_type = opts[:debug_return_type] || 'ValidateSubreddit200Response'
269
+
270
+ # auth_names
271
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
272
+
273
+ new_options = opts.merge(
274
+ :operation => :"ValidateApi.validate_subreddit",
275
+ :header_params => header_params,
276
+ :query_params => query_params,
277
+ :form_params => form_params,
278
+ :body => post_body,
279
+ :auth_names => auth_names,
280
+ :return_type => return_type
281
+ )
282
+
283
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
284
+ if @api_client.config.debugging
285
+ @api_client.config.logger.debug "API called: ValidateApi#validate_subreddit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
286
+ end
287
+ return data, status_code, headers
288
+ end
289
+ end
290
+ end
@@ -0,0 +1,240 @@
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
+ # Ad set (or ad group/line item depending on platform) with rolled-up metrics and child ads
18
+ class AdTreeAdSet < ApiModelBase
19
+ attr_accessor :platform_ad_set_id
20
+
21
+ attr_accessor :ad_set_name
22
+
23
+ # Derived from child ad statuses
24
+ attr_accessor :status
25
+
26
+ attr_accessor :ad_count
27
+
28
+ attr_accessor :budget
29
+
30
+ attr_accessor :metrics
31
+
32
+ # Individual ads within this ad set (capped at 100). Returns a subset of Ad fields from the aggregation (core fields like _id, name, platform, status, budget, metrics, creative, goal are included; targeting and schedule may be absent).
33
+ attr_accessor :ads
34
+
35
+ class EnumAttributeValidator
36
+ attr_reader :datatype
37
+ attr_reader :allowable_values
38
+
39
+ def initialize(datatype, allowable_values)
40
+ @allowable_values = allowable_values.map do |value|
41
+ case datatype.to_s
42
+ when /Integer/i
43
+ value.to_i
44
+ when /Float/i
45
+ value.to_f
46
+ else
47
+ value
48
+ end
49
+ end
50
+ end
51
+
52
+ def valid?(value)
53
+ !value || allowable_values.include?(value)
54
+ end
55
+ end
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'platform_ad_set_id' => :'platformAdSetId',
61
+ :'ad_set_name' => :'adSetName',
62
+ :'status' => :'status',
63
+ :'ad_count' => :'adCount',
64
+ :'budget' => :'budget',
65
+ :'metrics' => :'metrics',
66
+ :'ads' => :'ads'
67
+ }
68
+ end
69
+
70
+ # Returns attribute mapping this model knows about
71
+ def self.acceptable_attribute_map
72
+ attribute_map
73
+ end
74
+
75
+ # Returns all the JSON keys this model knows about
76
+ def self.acceptable_attributes
77
+ acceptable_attribute_map.values
78
+ end
79
+
80
+ # Attribute type mapping.
81
+ def self.openapi_types
82
+ {
83
+ :'platform_ad_set_id' => :'String',
84
+ :'ad_set_name' => :'String',
85
+ :'status' => :'String',
86
+ :'ad_count' => :'Integer',
87
+ :'budget' => :'AdBudget',
88
+ :'metrics' => :'AdMetrics',
89
+ :'ads' => :'Array<Ad>'
90
+ }
91
+ end
92
+
93
+ # List of attributes with nullable: true
94
+ def self.openapi_nullable
95
+ Set.new([
96
+ ])
97
+ end
98
+
99
+ # Initializes the object
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ def initialize(attributes = {})
102
+ if (!attributes.is_a?(Hash))
103
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::AdTreeAdSet` initialize method"
104
+ end
105
+
106
+ # check to see if the attribute exists and convert string to symbol for hash key
107
+ acceptable_attribute_map = self.class.acceptable_attribute_map
108
+ attributes = attributes.each_with_object({}) { |(k, v), h|
109
+ if (!acceptable_attribute_map.key?(k.to_sym))
110
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::AdTreeAdSet`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
111
+ end
112
+ h[k.to_sym] = v
113
+ }
114
+
115
+ if attributes.key?(:'platform_ad_set_id')
116
+ self.platform_ad_set_id = attributes[:'platform_ad_set_id']
117
+ end
118
+
119
+ if attributes.key?(:'ad_set_name')
120
+ self.ad_set_name = attributes[:'ad_set_name']
121
+ end
122
+
123
+ if attributes.key?(:'status')
124
+ self.status = attributes[:'status']
125
+ end
126
+
127
+ if attributes.key?(:'ad_count')
128
+ self.ad_count = attributes[:'ad_count']
129
+ end
130
+
131
+ if attributes.key?(:'budget')
132
+ self.budget = attributes[:'budget']
133
+ end
134
+
135
+ if attributes.key?(:'metrics')
136
+ self.metrics = attributes[:'metrics']
137
+ end
138
+
139
+ if attributes.key?(:'ads')
140
+ if (value = attributes[:'ads']).is_a?(Array)
141
+ self.ads = value
142
+ end
143
+ end
144
+ end
145
+
146
+ # Show invalid properties with the reasons. Usually used together with valid?
147
+ # @return Array for valid properties with the reasons
148
+ def list_invalid_properties
149
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
150
+ invalid_properties = Array.new
151
+ invalid_properties
152
+ end
153
+
154
+ # Check to see if the all the properties in the model are valid
155
+ # @return true if the model is valid
156
+ def valid?
157
+ warn '[DEPRECATED] the `valid?` method is obsolete'
158
+ status_validator = EnumAttributeValidator.new('String', ["active", "paused", "pending_review", "rejected", "completed", "cancelled", "error"])
159
+ return false unless status_validator.valid?(@status)
160
+ true
161
+ end
162
+
163
+ # Custom attribute writer method checking allowed values (enum).
164
+ # @param [Object] status Object to be assigned
165
+ def status=(status)
166
+ validator = EnumAttributeValidator.new('String', ["active", "paused", "pending_review", "rejected", "completed", "cancelled", "error"])
167
+ unless validator.valid?(status)
168
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
169
+ end
170
+ @status = status
171
+ end
172
+
173
+ # Checks equality by comparing each attribute.
174
+ # @param [Object] Object to be compared
175
+ def ==(o)
176
+ return true if self.equal?(o)
177
+ self.class == o.class &&
178
+ platform_ad_set_id == o.platform_ad_set_id &&
179
+ ad_set_name == o.ad_set_name &&
180
+ status == o.status &&
181
+ ad_count == o.ad_count &&
182
+ budget == o.budget &&
183
+ metrics == o.metrics &&
184
+ ads == o.ads
185
+ end
186
+
187
+ # @see the `==` method
188
+ # @param [Object] Object to be compared
189
+ def eql?(o)
190
+ self == o
191
+ end
192
+
193
+ # Calculates hash code according to all attributes.
194
+ # @return [Integer] Hash code
195
+ def hash
196
+ [platform_ad_set_id, ad_set_name, status, ad_count, budget, metrics, ads].hash
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def self.build_from_hash(attributes)
203
+ return nil unless attributes.is_a?(Hash)
204
+ attributes = attributes.transform_keys(&:to_sym)
205
+ transformed_hash = {}
206
+ openapi_types.each_pair do |key, type|
207
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
208
+ transformed_hash["#{key}"] = nil
209
+ elsif type =~ /\AArray<(.*)>/i
210
+ # check to ensure the input is an array given that the attribute
211
+ # is documented as an array but the input is not
212
+ if attributes[attribute_map[key]].is_a?(Array)
213
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
214
+ end
215
+ elsif !attributes[attribute_map[key]].nil?
216
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
217
+ end
218
+ end
219
+ new(transformed_hash)
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ self.class.attribute_map.each_pair do |attr, param|
227
+ value = self.send(attr)
228
+ if value.nil?
229
+ is_nullable = self.class.openapi_nullable.include?(attr)
230
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
231
+ end
232
+
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ end
239
+
240
+ end