late-sdk 0.0.97 → 0.0.99

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 (128) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +53 -0
  3. data/docs/Ad.md +58 -0
  4. data/docs/AdAudiencesApi.md +365 -0
  5. data/docs/AdBudget.md +20 -0
  6. data/docs/AdCampaign.md +40 -0
  7. data/docs/AdCampaignsApi.md +165 -0
  8. data/docs/AdMetrics.md +34 -0
  9. data/docs/AdSchedule.md +20 -0
  10. data/docs/AddUsersToAdAudience200Response.md +22 -0
  11. data/docs/AddUsersToAdAudienceRequest.md +18 -0
  12. data/docs/AddUsersToAdAudienceRequestUsersInner.md +20 -0
  13. data/docs/AdsApi.md +726 -0
  14. data/docs/BoostPostRequest.md +36 -0
  15. data/docs/BoostPostRequestBudget.md +20 -0
  16. data/docs/BoostPostRequestSchedule.md +20 -0
  17. data/docs/BoostPostRequestTargeting.md +24 -0
  18. data/docs/CreateAdAudience201Response.md +20 -0
  19. data/docs/CreateAdAudienceRequest.md +36 -0
  20. data/docs/CreateStandaloneAdRequest.md +56 -0
  21. data/docs/GetAd200Response.md +18 -0
  22. data/docs/GetAdAnalytics200Response.md +20 -0
  23. data/docs/GetAdAnalytics200ResponseAd.md +24 -0
  24. data/docs/GetAdAnalytics200ResponseAnalytics.md +22 -0
  25. data/docs/GetAdAnalytics200ResponseAnalyticsDailyInner.md +36 -0
  26. data/docs/GetAdAudience200Response.md +20 -0
  27. data/docs/ListAdAccounts200Response.md +18 -0
  28. data/docs/ListAdAccounts200ResponseAccountsInner.md +24 -0
  29. data/docs/ListAdAudiences200Response.md +18 -0
  30. data/docs/ListAdAudiences200ResponseAudiencesInner.md +32 -0
  31. data/docs/ListAdCampaigns200Response.md +20 -0
  32. data/docs/ListAds200Response.md +20 -0
  33. data/docs/SearchAdInterests200Response.md +18 -0
  34. data/docs/SearchAdInterests200ResponseInterestsInner.md +22 -0
  35. data/docs/SyncExternalAds200Response.md +24 -0
  36. data/docs/UpdateAd200Response.md +20 -0
  37. data/docs/UpdateAdCampaignStatus200Response.md +22 -0
  38. data/docs/UpdateAdCampaignStatusRequest.md +20 -0
  39. data/docs/UpdateAdRequest.md +24 -0
  40. data/docs/UpdateAdRequestBudget.md +20 -0
  41. data/docs/UpdateAdRequestTargeting.md +24 -0
  42. data/docs/UpdatePostMetadataRequest.md +7 -1
  43. data/lib/late-sdk/api/ad_audiences_api.rb +368 -0
  44. data/lib/late-sdk/api/ad_campaigns_api.rb +201 -0
  45. data/lib/late-sdk/api/ads_api.rb +719 -0
  46. data/lib/late-sdk/models/ad.rb +399 -0
  47. data/lib/late-sdk/models/ad_budget.rb +190 -0
  48. data/lib/late-sdk/models/ad_campaign.rb +293 -0
  49. data/lib/late-sdk/models/ad_metrics.rb +222 -0
  50. data/lib/late-sdk/models/ad_schedule.rb +156 -0
  51. data/lib/late-sdk/models/add_users_to_ad_audience200_response.rb +165 -0
  52. data/lib/late-sdk/models/add_users_to_ad_audience_request.rb +175 -0
  53. data/lib/late-sdk/models/add_users_to_ad_audience_request_users_inner.rb +157 -0
  54. data/lib/late-sdk/models/boost_post_request.rb +350 -0
  55. data/lib/late-sdk/models/boost_post_request_budget.rb +215 -0
  56. data/lib/late-sdk/models/boost_post_request_schedule.rb +157 -0
  57. data/lib/late-sdk/models/boost_post_request_targeting.rb +234 -0
  58. data/lib/late-sdk/models/create_ad_audience201_response.rb +156 -0
  59. data/lib/late-sdk/models/create_ad_audience_request.rb +391 -0
  60. data/lib/late-sdk/models/create_standalone_ad_request.rb +585 -0
  61. data/lib/late-sdk/models/get_ad200_response.rb +147 -0
  62. data/lib/late-sdk/models/get_ad_analytics200_response.rb +156 -0
  63. data/lib/late-sdk/models/get_ad_analytics200_response_ad.rb +174 -0
  64. data/lib/late-sdk/models/get_ad_analytics200_response_analytics.rb +169 -0
  65. data/lib/late-sdk/models/get_ad_analytics200_response_analytics_daily_inner.rb +238 -0
  66. data/lib/late-sdk/models/get_ad_audience200_response.rb +157 -0
  67. data/lib/late-sdk/models/list_ad_accounts200_response.rb +149 -0
  68. data/lib/late-sdk/models/list_ad_accounts200_response_accounts_inner.rb +175 -0
  69. data/lib/late-sdk/models/list_ad_audiences200_response.rb +149 -0
  70. data/lib/late-sdk/models/list_ad_audiences200_response_audiences_inner.rb +244 -0
  71. data/lib/late-sdk/models/list_ad_campaigns200_response.rb +158 -0
  72. data/lib/late-sdk/models/list_ads200_response.rb +158 -0
  73. data/lib/late-sdk/models/search_ad_interests200_response.rb +149 -0
  74. data/lib/late-sdk/models/search_ad_interests200_response_interests_inner.rb +165 -0
  75. data/lib/late-sdk/models/sync_external_ads200_response.rb +177 -0
  76. data/lib/late-sdk/models/update_ad200_response.rb +156 -0
  77. data/lib/late-sdk/models/update_ad_campaign_status200_response.rb +169 -0
  78. data/lib/late-sdk/models/update_ad_campaign_status_request.rb +216 -0
  79. data/lib/late-sdk/models/update_ad_request.rb +208 -0
  80. data/lib/late-sdk/models/update_ad_request_budget.rb +191 -0
  81. data/lib/late-sdk/models/update_ad_request_targeting.rb +235 -0
  82. data/lib/late-sdk/models/update_post_metadata_request.rb +34 -4
  83. data/lib/late-sdk/version.rb +1 -1
  84. data/lib/late-sdk.rb +39 -0
  85. data/openapi.yaml +693 -0
  86. data/spec/api/ad_audiences_api_spec.rb +98 -0
  87. data/spec/api/ad_campaigns_api_spec.rb +67 -0
  88. data/spec/api/ads_api_spec.rb +163 -0
  89. data/spec/models/ad_budget_spec.rb +46 -0
  90. data/spec/models/ad_campaign_spec.rb +110 -0
  91. data/spec/models/ad_metrics_spec.rb +84 -0
  92. data/spec/models/ad_schedule_spec.rb +42 -0
  93. data/spec/models/ad_spec.rb +172 -0
  94. data/spec/models/add_users_to_ad_audience200_response_spec.rb +48 -0
  95. data/spec/models/add_users_to_ad_audience_request_spec.rb +36 -0
  96. data/spec/models/add_users_to_ad_audience_request_users_inner_spec.rb +42 -0
  97. data/spec/models/boost_post_request_budget_spec.rb +46 -0
  98. data/spec/models/boost_post_request_schedule_spec.rb +42 -0
  99. data/spec/models/boost_post_request_spec.rb +94 -0
  100. data/spec/models/boost_post_request_targeting_spec.rb +54 -0
  101. data/spec/models/create_ad_audience201_response_spec.rb +42 -0
  102. data/spec/models/create_ad_audience_request_spec.rb +94 -0
  103. data/spec/models/create_standalone_ad_request_spec.rb +166 -0
  104. data/spec/models/get_ad200_response_spec.rb +36 -0
  105. data/spec/models/get_ad_analytics200_response_ad_spec.rb +54 -0
  106. data/spec/models/get_ad_analytics200_response_analytics_daily_inner_spec.rb +90 -0
  107. data/spec/models/get_ad_analytics200_response_analytics_spec.rb +48 -0
  108. data/spec/models/get_ad_analytics200_response_spec.rb +42 -0
  109. data/spec/models/get_ad_audience200_response_spec.rb +42 -0
  110. data/spec/models/list_ad_accounts200_response_accounts_inner_spec.rb +54 -0
  111. data/spec/models/list_ad_accounts200_response_spec.rb +36 -0
  112. data/spec/models/list_ad_audiences200_response_audiences_inner_spec.rb +82 -0
  113. data/spec/models/list_ad_audiences200_response_spec.rb +36 -0
  114. data/spec/models/list_ad_campaigns200_response_spec.rb +42 -0
  115. data/spec/models/list_ads200_response_spec.rb +42 -0
  116. data/spec/models/search_ad_interests200_response_interests_inner_spec.rb +48 -0
  117. data/spec/models/search_ad_interests200_response_spec.rb +36 -0
  118. data/spec/models/sync_external_ads200_response_spec.rb +54 -0
  119. data/spec/models/update_ad200_response_spec.rb +42 -0
  120. data/spec/models/update_ad_campaign_status200_response_spec.rb +48 -0
  121. data/spec/models/update_ad_campaign_status_request_spec.rb +50 -0
  122. data/spec/models/update_ad_request_budget_spec.rb +46 -0
  123. data/spec/models/update_ad_request_spec.rb +58 -0
  124. data/spec/models/update_ad_request_targeting_spec.rb +54 -0
  125. data/spec/models/update_post_metadata_request_spec.rb +18 -0
  126. data/zernio-sdk-0.0.99.gem +0 -0
  127. metadata +159 -3
  128. data/zernio-sdk-0.0.97.gem +0 -0
@@ -0,0 +1,391 @@
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 CreateAdAudienceRequest < ApiModelBase
18
+ attr_accessor :account_id
19
+
20
+ # Must start with act_
21
+ attr_accessor :ad_account_id
22
+
23
+ attr_accessor :name
24
+
25
+ attr_accessor :description
26
+
27
+ attr_accessor :type
28
+
29
+ # Required for website audiences
30
+ attr_accessor :pixel_id
31
+
32
+ # Required for website audiences
33
+ attr_accessor :retention_days
34
+
35
+ # Required for lookalike audiences
36
+ attr_accessor :source_audience_id
37
+
38
+ # 2-letter code, required for lookalike audiences
39
+ attr_accessor :country
40
+
41
+ # Required for lookalike audiences
42
+ attr_accessor :ratio
43
+
44
+ class EnumAttributeValidator
45
+ attr_reader :datatype
46
+ attr_reader :allowable_values
47
+
48
+ def initialize(datatype, allowable_values)
49
+ @allowable_values = allowable_values.map do |value|
50
+ case datatype.to_s
51
+ when /Integer/i
52
+ value.to_i
53
+ when /Float/i
54
+ value.to_f
55
+ else
56
+ value
57
+ end
58
+ end
59
+ end
60
+
61
+ def valid?(value)
62
+ !value || allowable_values.include?(value)
63
+ end
64
+ end
65
+
66
+ # Attribute mapping from ruby-style variable name to JSON key.
67
+ def self.attribute_map
68
+ {
69
+ :'account_id' => :'accountId',
70
+ :'ad_account_id' => :'adAccountId',
71
+ :'name' => :'name',
72
+ :'description' => :'description',
73
+ :'type' => :'type',
74
+ :'pixel_id' => :'pixelId',
75
+ :'retention_days' => :'retentionDays',
76
+ :'source_audience_id' => :'sourceAudienceId',
77
+ :'country' => :'country',
78
+ :'ratio' => :'ratio'
79
+ }
80
+ end
81
+
82
+ # Returns attribute mapping this model knows about
83
+ def self.acceptable_attribute_map
84
+ attribute_map
85
+ end
86
+
87
+ # Returns all the JSON keys this model knows about
88
+ def self.acceptable_attributes
89
+ acceptable_attribute_map.values
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.openapi_types
94
+ {
95
+ :'account_id' => :'String',
96
+ :'ad_account_id' => :'String',
97
+ :'name' => :'String',
98
+ :'description' => :'String',
99
+ :'type' => :'String',
100
+ :'pixel_id' => :'String',
101
+ :'retention_days' => :'Integer',
102
+ :'source_audience_id' => :'String',
103
+ :'country' => :'String',
104
+ :'ratio' => :'Float'
105
+ }
106
+ end
107
+
108
+ # List of attributes with nullable: true
109
+ def self.openapi_nullable
110
+ Set.new([
111
+ ])
112
+ end
113
+
114
+ # Initializes the object
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ def initialize(attributes = {})
117
+ if (!attributes.is_a?(Hash))
118
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::CreateAdAudienceRequest` initialize method"
119
+ end
120
+
121
+ # check to see if the attribute exists and convert string to symbol for hash key
122
+ acceptable_attribute_map = self.class.acceptable_attribute_map
123
+ attributes = attributes.each_with_object({}) { |(k, v), h|
124
+ if (!acceptable_attribute_map.key?(k.to_sym))
125
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::CreateAdAudienceRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
126
+ end
127
+ h[k.to_sym] = v
128
+ }
129
+
130
+ if attributes.key?(:'account_id')
131
+ self.account_id = attributes[:'account_id']
132
+ else
133
+ self.account_id = nil
134
+ end
135
+
136
+ if attributes.key?(:'ad_account_id')
137
+ self.ad_account_id = attributes[:'ad_account_id']
138
+ else
139
+ self.ad_account_id = nil
140
+ end
141
+
142
+ if attributes.key?(:'name')
143
+ self.name = attributes[:'name']
144
+ else
145
+ self.name = nil
146
+ end
147
+
148
+ if attributes.key?(:'description')
149
+ self.description = attributes[:'description']
150
+ end
151
+
152
+ if attributes.key?(:'type')
153
+ self.type = attributes[:'type']
154
+ else
155
+ self.type = nil
156
+ end
157
+
158
+ if attributes.key?(:'pixel_id')
159
+ self.pixel_id = attributes[:'pixel_id']
160
+ end
161
+
162
+ if attributes.key?(:'retention_days')
163
+ self.retention_days = attributes[:'retention_days']
164
+ end
165
+
166
+ if attributes.key?(:'source_audience_id')
167
+ self.source_audience_id = attributes[:'source_audience_id']
168
+ end
169
+
170
+ if attributes.key?(:'country')
171
+ self.country = attributes[:'country']
172
+ end
173
+
174
+ if attributes.key?(:'ratio')
175
+ self.ratio = attributes[:'ratio']
176
+ end
177
+ end
178
+
179
+ # Show invalid properties with the reasons. Usually used together with valid?
180
+ # @return Array for valid properties with the reasons
181
+ def list_invalid_properties
182
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
183
+ invalid_properties = Array.new
184
+ if @account_id.nil?
185
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
186
+ end
187
+
188
+ if @ad_account_id.nil?
189
+ invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.')
190
+ end
191
+
192
+ if @name.nil?
193
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
194
+ end
195
+
196
+ if @name.to_s.length > 255
197
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
198
+ end
199
+
200
+ if @type.nil?
201
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
202
+ end
203
+
204
+ if !@retention_days.nil? && @retention_days > 180
205
+ invalid_properties.push('invalid value for "retention_days", must be smaller than or equal to 180.')
206
+ end
207
+
208
+ if !@retention_days.nil? && @retention_days < 1
209
+ invalid_properties.push('invalid value for "retention_days", must be greater than or equal to 1.')
210
+ end
211
+
212
+ if !@ratio.nil? && @ratio > 0.2
213
+ invalid_properties.push('invalid value for "ratio", must be smaller than or equal to 0.2.')
214
+ end
215
+
216
+ if !@ratio.nil? && @ratio < 0.01
217
+ invalid_properties.push('invalid value for "ratio", must be greater than or equal to 0.01.')
218
+ end
219
+
220
+ invalid_properties
221
+ end
222
+
223
+ # Check to see if the all the properties in the model are valid
224
+ # @return true if the model is valid
225
+ def valid?
226
+ warn '[DEPRECATED] the `valid?` method is obsolete'
227
+ return false if @account_id.nil?
228
+ return false if @ad_account_id.nil?
229
+ return false if @name.nil?
230
+ return false if @name.to_s.length > 255
231
+ return false if @type.nil?
232
+ type_validator = EnumAttributeValidator.new('String', ["customer_list", "website", "lookalike"])
233
+ return false unless type_validator.valid?(@type)
234
+ return false if !@retention_days.nil? && @retention_days > 180
235
+ return false if !@retention_days.nil? && @retention_days < 1
236
+ return false if !@ratio.nil? && @ratio > 0.2
237
+ return false if !@ratio.nil? && @ratio < 0.01
238
+ true
239
+ end
240
+
241
+ # Custom attribute writer method with validation
242
+ # @param [Object] account_id Value to be assigned
243
+ def account_id=(account_id)
244
+ if account_id.nil?
245
+ fail ArgumentError, 'account_id cannot be nil'
246
+ end
247
+
248
+ @account_id = account_id
249
+ end
250
+
251
+ # Custom attribute writer method with validation
252
+ # @param [Object] ad_account_id Value to be assigned
253
+ def ad_account_id=(ad_account_id)
254
+ if ad_account_id.nil?
255
+ fail ArgumentError, 'ad_account_id cannot be nil'
256
+ end
257
+
258
+ @ad_account_id = ad_account_id
259
+ end
260
+
261
+ # Custom attribute writer method with validation
262
+ # @param [Object] name Value to be assigned
263
+ def name=(name)
264
+ if name.nil?
265
+ fail ArgumentError, 'name cannot be nil'
266
+ end
267
+
268
+ if name.to_s.length > 255
269
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
270
+ end
271
+
272
+ @name = name
273
+ end
274
+
275
+ # Custom attribute writer method checking allowed values (enum).
276
+ # @param [Object] type Object to be assigned
277
+ def type=(type)
278
+ validator = EnumAttributeValidator.new('String', ["customer_list", "website", "lookalike"])
279
+ unless validator.valid?(type)
280
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
281
+ end
282
+ @type = type
283
+ end
284
+
285
+ # Custom attribute writer method with validation
286
+ # @param [Object] retention_days Value to be assigned
287
+ def retention_days=(retention_days)
288
+ if retention_days.nil?
289
+ fail ArgumentError, 'retention_days cannot be nil'
290
+ end
291
+
292
+ if retention_days > 180
293
+ fail ArgumentError, 'invalid value for "retention_days", must be smaller than or equal to 180.'
294
+ end
295
+
296
+ if retention_days < 1
297
+ fail ArgumentError, 'invalid value for "retention_days", must be greater than or equal to 1.'
298
+ end
299
+
300
+ @retention_days = retention_days
301
+ end
302
+
303
+ # Custom attribute writer method with validation
304
+ # @param [Object] ratio Value to be assigned
305
+ def ratio=(ratio)
306
+ if ratio.nil?
307
+ fail ArgumentError, 'ratio cannot be nil'
308
+ end
309
+
310
+ if ratio > 0.2
311
+ fail ArgumentError, 'invalid value for "ratio", must be smaller than or equal to 0.2.'
312
+ end
313
+
314
+ if ratio < 0.01
315
+ fail ArgumentError, 'invalid value for "ratio", must be greater than or equal to 0.01.'
316
+ end
317
+
318
+ @ratio = ratio
319
+ end
320
+
321
+ # Checks equality by comparing each attribute.
322
+ # @param [Object] Object to be compared
323
+ def ==(o)
324
+ return true if self.equal?(o)
325
+ self.class == o.class &&
326
+ account_id == o.account_id &&
327
+ ad_account_id == o.ad_account_id &&
328
+ name == o.name &&
329
+ description == o.description &&
330
+ type == o.type &&
331
+ pixel_id == o.pixel_id &&
332
+ retention_days == o.retention_days &&
333
+ source_audience_id == o.source_audience_id &&
334
+ country == o.country &&
335
+ ratio == o.ratio
336
+ end
337
+
338
+ # @see the `==` method
339
+ # @param [Object] Object to be compared
340
+ def eql?(o)
341
+ self == o
342
+ end
343
+
344
+ # Calculates hash code according to all attributes.
345
+ # @return [Integer] Hash code
346
+ def hash
347
+ [account_id, ad_account_id, name, description, type, pixel_id, retention_days, source_audience_id, country, ratio].hash
348
+ end
349
+
350
+ # Builds the object from hash
351
+ # @param [Hash] attributes Model attributes in the form of hash
352
+ # @return [Object] Returns the model itself
353
+ def self.build_from_hash(attributes)
354
+ return nil unless attributes.is_a?(Hash)
355
+ attributes = attributes.transform_keys(&:to_sym)
356
+ transformed_hash = {}
357
+ openapi_types.each_pair do |key, type|
358
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
359
+ transformed_hash["#{key}"] = nil
360
+ elsif type =~ /\AArray<(.*)>/i
361
+ # check to ensure the input is an array given that the attribute
362
+ # is documented as an array but the input is not
363
+ if attributes[attribute_map[key]].is_a?(Array)
364
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
365
+ end
366
+ elsif !attributes[attribute_map[key]].nil?
367
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
368
+ end
369
+ end
370
+ new(transformed_hash)
371
+ end
372
+
373
+ # Returns the object in the form of hash
374
+ # @return [Hash] Returns the object in the form of hash
375
+ def to_hash
376
+ hash = {}
377
+ self.class.attribute_map.each_pair do |attr, param|
378
+ value = self.send(attr)
379
+ if value.nil?
380
+ is_nullable = self.class.openapi_nullable.include?(attr)
381
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
382
+ end
383
+
384
+ hash[param] = _to_hash(value)
385
+ end
386
+ hash
387
+ end
388
+
389
+ end
390
+
391
+ end