late-sdk 0.0.98 → 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 (125) 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/lib/late-sdk/api/ad_audiences_api.rb +368 -0
  43. data/lib/late-sdk/api/ad_campaigns_api.rb +201 -0
  44. data/lib/late-sdk/api/ads_api.rb +719 -0
  45. data/lib/late-sdk/models/ad.rb +399 -0
  46. data/lib/late-sdk/models/ad_budget.rb +190 -0
  47. data/lib/late-sdk/models/ad_campaign.rb +293 -0
  48. data/lib/late-sdk/models/ad_metrics.rb +222 -0
  49. data/lib/late-sdk/models/ad_schedule.rb +156 -0
  50. data/lib/late-sdk/models/add_users_to_ad_audience200_response.rb +165 -0
  51. data/lib/late-sdk/models/add_users_to_ad_audience_request.rb +175 -0
  52. data/lib/late-sdk/models/add_users_to_ad_audience_request_users_inner.rb +157 -0
  53. data/lib/late-sdk/models/boost_post_request.rb +350 -0
  54. data/lib/late-sdk/models/boost_post_request_budget.rb +215 -0
  55. data/lib/late-sdk/models/boost_post_request_schedule.rb +157 -0
  56. data/lib/late-sdk/models/boost_post_request_targeting.rb +234 -0
  57. data/lib/late-sdk/models/create_ad_audience201_response.rb +156 -0
  58. data/lib/late-sdk/models/create_ad_audience_request.rb +391 -0
  59. data/lib/late-sdk/models/create_standalone_ad_request.rb +585 -0
  60. data/lib/late-sdk/models/get_ad200_response.rb +147 -0
  61. data/lib/late-sdk/models/get_ad_analytics200_response.rb +156 -0
  62. data/lib/late-sdk/models/get_ad_analytics200_response_ad.rb +174 -0
  63. data/lib/late-sdk/models/get_ad_analytics200_response_analytics.rb +169 -0
  64. data/lib/late-sdk/models/get_ad_analytics200_response_analytics_daily_inner.rb +238 -0
  65. data/lib/late-sdk/models/get_ad_audience200_response.rb +157 -0
  66. data/lib/late-sdk/models/list_ad_accounts200_response.rb +149 -0
  67. data/lib/late-sdk/models/list_ad_accounts200_response_accounts_inner.rb +175 -0
  68. data/lib/late-sdk/models/list_ad_audiences200_response.rb +149 -0
  69. data/lib/late-sdk/models/list_ad_audiences200_response_audiences_inner.rb +244 -0
  70. data/lib/late-sdk/models/list_ad_campaigns200_response.rb +158 -0
  71. data/lib/late-sdk/models/list_ads200_response.rb +158 -0
  72. data/lib/late-sdk/models/search_ad_interests200_response.rb +149 -0
  73. data/lib/late-sdk/models/search_ad_interests200_response_interests_inner.rb +165 -0
  74. data/lib/late-sdk/models/sync_external_ads200_response.rb +177 -0
  75. data/lib/late-sdk/models/update_ad200_response.rb +156 -0
  76. data/lib/late-sdk/models/update_ad_campaign_status200_response.rb +169 -0
  77. data/lib/late-sdk/models/update_ad_campaign_status_request.rb +216 -0
  78. data/lib/late-sdk/models/update_ad_request.rb +208 -0
  79. data/lib/late-sdk/models/update_ad_request_budget.rb +191 -0
  80. data/lib/late-sdk/models/update_ad_request_targeting.rb +235 -0
  81. data/lib/late-sdk/version.rb +1 -1
  82. data/lib/late-sdk.rb +39 -0
  83. data/openapi.yaml +684 -0
  84. data/spec/api/ad_audiences_api_spec.rb +98 -0
  85. data/spec/api/ad_campaigns_api_spec.rb +67 -0
  86. data/spec/api/ads_api_spec.rb +163 -0
  87. data/spec/models/ad_budget_spec.rb +46 -0
  88. data/spec/models/ad_campaign_spec.rb +110 -0
  89. data/spec/models/ad_metrics_spec.rb +84 -0
  90. data/spec/models/ad_schedule_spec.rb +42 -0
  91. data/spec/models/ad_spec.rb +172 -0
  92. data/spec/models/add_users_to_ad_audience200_response_spec.rb +48 -0
  93. data/spec/models/add_users_to_ad_audience_request_spec.rb +36 -0
  94. data/spec/models/add_users_to_ad_audience_request_users_inner_spec.rb +42 -0
  95. data/spec/models/boost_post_request_budget_spec.rb +46 -0
  96. data/spec/models/boost_post_request_schedule_spec.rb +42 -0
  97. data/spec/models/boost_post_request_spec.rb +94 -0
  98. data/spec/models/boost_post_request_targeting_spec.rb +54 -0
  99. data/spec/models/create_ad_audience201_response_spec.rb +42 -0
  100. data/spec/models/create_ad_audience_request_spec.rb +94 -0
  101. data/spec/models/create_standalone_ad_request_spec.rb +166 -0
  102. data/spec/models/get_ad200_response_spec.rb +36 -0
  103. data/spec/models/get_ad_analytics200_response_ad_spec.rb +54 -0
  104. data/spec/models/get_ad_analytics200_response_analytics_daily_inner_spec.rb +90 -0
  105. data/spec/models/get_ad_analytics200_response_analytics_spec.rb +48 -0
  106. data/spec/models/get_ad_analytics200_response_spec.rb +42 -0
  107. data/spec/models/get_ad_audience200_response_spec.rb +42 -0
  108. data/spec/models/list_ad_accounts200_response_accounts_inner_spec.rb +54 -0
  109. data/spec/models/list_ad_accounts200_response_spec.rb +36 -0
  110. data/spec/models/list_ad_audiences200_response_audiences_inner_spec.rb +82 -0
  111. data/spec/models/list_ad_audiences200_response_spec.rb +36 -0
  112. data/spec/models/list_ad_campaigns200_response_spec.rb +42 -0
  113. data/spec/models/list_ads200_response_spec.rb +42 -0
  114. data/spec/models/search_ad_interests200_response_interests_inner_spec.rb +48 -0
  115. data/spec/models/search_ad_interests200_response_spec.rb +36 -0
  116. data/spec/models/sync_external_ads200_response_spec.rb +54 -0
  117. data/spec/models/update_ad200_response_spec.rb +42 -0
  118. data/spec/models/update_ad_campaign_status200_response_spec.rb +48 -0
  119. data/spec/models/update_ad_campaign_status_request_spec.rb +50 -0
  120. data/spec/models/update_ad_request_budget_spec.rb +46 -0
  121. data/spec/models/update_ad_request_spec.rb +58 -0
  122. data/spec/models/update_ad_request_targeting_spec.rb +54 -0
  123. data/zernio-sdk-0.0.99.gem +0 -0
  124. metadata +158 -2
  125. data/zernio-sdk-0.0.98.gem +0 -0
data/docs/AdsApi.md ADDED
@@ -0,0 +1,726 @@
1
+ # Late::AdsApi
2
+
3
+ All URIs are relative to *https://zernio.com/api*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**boost_post**](AdsApi.md#boost_post) | **POST** /v1/ads/boost | Boost an existing post as a paid ad |
8
+ | [**create_standalone_ad**](AdsApi.md#create_standalone_ad) | **POST** /v1/ads/create | Create a standalone ad with custom creative |
9
+ | [**delete_ad**](AdsApi.md#delete_ad) | **DELETE** /v1/ads/{adId} | Cancel an ad |
10
+ | [**get_ad**](AdsApi.md#get_ad) | **GET** /v1/ads/{adId} | Get ad details |
11
+ | [**get_ad_analytics**](AdsApi.md#get_ad_analytics) | **GET** /v1/ads/{adId}/analytics | Get ad analytics with daily breakdown |
12
+ | [**list_ad_accounts**](AdsApi.md#list_ad_accounts) | **GET** /v1/ads/accounts | List ad accounts for a social account |
13
+ | [**list_ads**](AdsApi.md#list_ads) | **GET** /v1/ads | List ads |
14
+ | [**search_ad_interests**](AdsApi.md#search_ad_interests) | **GET** /v1/ads/interests | Search targeting interests |
15
+ | [**sync_external_ads**](AdsApi.md#sync_external_ads) | **POST** /v1/ads/sync | Sync external ads from platform ad managers |
16
+ | [**update_ad**](AdsApi.md#update_ad) | **PUT** /v1/ads/{adId} | Update ad (pause/resume, budget, targeting, name) |
17
+
18
+
19
+ ## boost_post
20
+
21
+ > <UpdateAd200Response> boost_post(boost_post_request)
22
+
23
+ Boost an existing post as a paid ad
24
+
25
+ Creates a paid ad campaign from an existing published post. Creates the full platform campaign hierarchy (campaign, ad set, ad).
26
+
27
+ ### Examples
28
+
29
+ ```ruby
30
+ require 'time'
31
+ require 'late-sdk'
32
+ # setup authorization
33
+ Late.configure do |config|
34
+ # Configure Bearer authorization (JWT): bearerAuth
35
+ config.access_token = 'YOUR_BEARER_TOKEN'
36
+ end
37
+
38
+ api_instance = Late::AdsApi.new
39
+ boost_post_request = Late::BoostPostRequest.new({account_id: 'account_id_example', ad_account_id: 'ad_account_id_example', name: 'name_example', goal: 'engagement', budget: Late::BoostPostRequestBudget.new({amount: 3.56, type: 'daily'})}) # BoostPostRequest |
40
+
41
+ begin
42
+ # Boost an existing post as a paid ad
43
+ result = api_instance.boost_post(boost_post_request)
44
+ p result
45
+ rescue Late::ApiError => e
46
+ puts "Error when calling AdsApi->boost_post: #{e}"
47
+ end
48
+ ```
49
+
50
+ #### Using the boost_post_with_http_info variant
51
+
52
+ This returns an Array which contains the response data, status code and headers.
53
+
54
+ > <Array(<UpdateAd200Response>, Integer, Hash)> boost_post_with_http_info(boost_post_request)
55
+
56
+ ```ruby
57
+ begin
58
+ # Boost an existing post as a paid ad
59
+ data, status_code, headers = api_instance.boost_post_with_http_info(boost_post_request)
60
+ p status_code # => 2xx
61
+ p headers # => { ... }
62
+ p data # => <UpdateAd200Response>
63
+ rescue Late::ApiError => e
64
+ puts "Error when calling AdsApi->boost_post_with_http_info: #{e}"
65
+ end
66
+ ```
67
+
68
+ ### Parameters
69
+
70
+ | Name | Type | Description | Notes |
71
+ | ---- | ---- | ----------- | ----- |
72
+ | **boost_post_request** | [**BoostPostRequest**](BoostPostRequest.md) | | |
73
+
74
+ ### Return type
75
+
76
+ [**UpdateAd200Response**](UpdateAd200Response.md)
77
+
78
+ ### Authorization
79
+
80
+ [bearerAuth](../README.md#bearerAuth)
81
+
82
+ ### HTTP request headers
83
+
84
+ - **Content-Type**: application/json
85
+ - **Accept**: application/json
86
+
87
+
88
+ ## create_standalone_ad
89
+
90
+ > <UpdateAd200Response> create_standalone_ad(create_standalone_ad_request)
91
+
92
+ Create a standalone ad with custom creative
93
+
94
+ Creates a paid ad with custom creative (headline, body, image/video, link). Creates the full platform campaign hierarchy.
95
+
96
+ ### Examples
97
+
98
+ ```ruby
99
+ require 'time'
100
+ require 'late-sdk'
101
+ # setup authorization
102
+ Late.configure do |config|
103
+ # Configure Bearer authorization (JWT): bearerAuth
104
+ config.access_token = 'YOUR_BEARER_TOKEN'
105
+ end
106
+
107
+ api_instance = Late::AdsApi.new
108
+ create_standalone_ad_request = Late::CreateStandaloneAdRequest.new({account_id: 'account_id_example', ad_account_id: 'ad_account_id_example', name: 'name_example', goal: 'engagement', budget_amount: 3.56, budget_type: 'daily', body: 'body_example', image_url: 'image_url_example'}) # CreateStandaloneAdRequest |
109
+
110
+ begin
111
+ # Create a standalone ad with custom creative
112
+ result = api_instance.create_standalone_ad(create_standalone_ad_request)
113
+ p result
114
+ rescue Late::ApiError => e
115
+ puts "Error when calling AdsApi->create_standalone_ad: #{e}"
116
+ end
117
+ ```
118
+
119
+ #### Using the create_standalone_ad_with_http_info variant
120
+
121
+ This returns an Array which contains the response data, status code and headers.
122
+
123
+ > <Array(<UpdateAd200Response>, Integer, Hash)> create_standalone_ad_with_http_info(create_standalone_ad_request)
124
+
125
+ ```ruby
126
+ begin
127
+ # Create a standalone ad with custom creative
128
+ data, status_code, headers = api_instance.create_standalone_ad_with_http_info(create_standalone_ad_request)
129
+ p status_code # => 2xx
130
+ p headers # => { ... }
131
+ p data # => <UpdateAd200Response>
132
+ rescue Late::ApiError => e
133
+ puts "Error when calling AdsApi->create_standalone_ad_with_http_info: #{e}"
134
+ end
135
+ ```
136
+
137
+ ### Parameters
138
+
139
+ | Name | Type | Description | Notes |
140
+ | ---- | ---- | ----------- | ----- |
141
+ | **create_standalone_ad_request** | [**CreateStandaloneAdRequest**](CreateStandaloneAdRequest.md) | | |
142
+
143
+ ### Return type
144
+
145
+ [**UpdateAd200Response**](UpdateAd200Response.md)
146
+
147
+ ### Authorization
148
+
149
+ [bearerAuth](../README.md#bearerAuth)
150
+
151
+ ### HTTP request headers
152
+
153
+ - **Content-Type**: application/json
154
+ - **Accept**: application/json
155
+
156
+
157
+ ## delete_ad
158
+
159
+ > <DeleteAccountGroup200Response> delete_ad(ad_id)
160
+
161
+ Cancel an ad
162
+
163
+ Cancels the ad on the platform and marks it as cancelled in the database. The ad is preserved for history.
164
+
165
+ ### Examples
166
+
167
+ ```ruby
168
+ require 'time'
169
+ require 'late-sdk'
170
+ # setup authorization
171
+ Late.configure do |config|
172
+ # Configure Bearer authorization (JWT): bearerAuth
173
+ config.access_token = 'YOUR_BEARER_TOKEN'
174
+ end
175
+
176
+ api_instance = Late::AdsApi.new
177
+ ad_id = 'ad_id_example' # String |
178
+
179
+ begin
180
+ # Cancel an ad
181
+ result = api_instance.delete_ad(ad_id)
182
+ p result
183
+ rescue Late::ApiError => e
184
+ puts "Error when calling AdsApi->delete_ad: #{e}"
185
+ end
186
+ ```
187
+
188
+ #### Using the delete_ad_with_http_info variant
189
+
190
+ This returns an Array which contains the response data, status code and headers.
191
+
192
+ > <Array(<DeleteAccountGroup200Response>, Integer, Hash)> delete_ad_with_http_info(ad_id)
193
+
194
+ ```ruby
195
+ begin
196
+ # Cancel an ad
197
+ data, status_code, headers = api_instance.delete_ad_with_http_info(ad_id)
198
+ p status_code # => 2xx
199
+ p headers # => { ... }
200
+ p data # => <DeleteAccountGroup200Response>
201
+ rescue Late::ApiError => e
202
+ puts "Error when calling AdsApi->delete_ad_with_http_info: #{e}"
203
+ end
204
+ ```
205
+
206
+ ### Parameters
207
+
208
+ | Name | Type | Description | Notes |
209
+ | ---- | ---- | ----------- | ----- |
210
+ | **ad_id** | **String** | | |
211
+
212
+ ### Return type
213
+
214
+ [**DeleteAccountGroup200Response**](DeleteAccountGroup200Response.md)
215
+
216
+ ### Authorization
217
+
218
+ [bearerAuth](../README.md#bearerAuth)
219
+
220
+ ### HTTP request headers
221
+
222
+ - **Content-Type**: Not defined
223
+ - **Accept**: application/json
224
+
225
+
226
+ ## get_ad
227
+
228
+ > <GetAd200Response> get_ad(ad_id)
229
+
230
+ Get ad details
231
+
232
+ ### Examples
233
+
234
+ ```ruby
235
+ require 'time'
236
+ require 'late-sdk'
237
+ # setup authorization
238
+ Late.configure do |config|
239
+ # Configure Bearer authorization (JWT): bearerAuth
240
+ config.access_token = 'YOUR_BEARER_TOKEN'
241
+ end
242
+
243
+ api_instance = Late::AdsApi.new
244
+ ad_id = 'ad_id_example' # String |
245
+
246
+ begin
247
+ # Get ad details
248
+ result = api_instance.get_ad(ad_id)
249
+ p result
250
+ rescue Late::ApiError => e
251
+ puts "Error when calling AdsApi->get_ad: #{e}"
252
+ end
253
+ ```
254
+
255
+ #### Using the get_ad_with_http_info variant
256
+
257
+ This returns an Array which contains the response data, status code and headers.
258
+
259
+ > <Array(<GetAd200Response>, Integer, Hash)> get_ad_with_http_info(ad_id)
260
+
261
+ ```ruby
262
+ begin
263
+ # Get ad details
264
+ data, status_code, headers = api_instance.get_ad_with_http_info(ad_id)
265
+ p status_code # => 2xx
266
+ p headers # => { ... }
267
+ p data # => <GetAd200Response>
268
+ rescue Late::ApiError => e
269
+ puts "Error when calling AdsApi->get_ad_with_http_info: #{e}"
270
+ end
271
+ ```
272
+
273
+ ### Parameters
274
+
275
+ | Name | Type | Description | Notes |
276
+ | ---- | ---- | ----------- | ----- |
277
+ | **ad_id** | **String** | | |
278
+
279
+ ### Return type
280
+
281
+ [**GetAd200Response**](GetAd200Response.md)
282
+
283
+ ### Authorization
284
+
285
+ [bearerAuth](../README.md#bearerAuth)
286
+
287
+ ### HTTP request headers
288
+
289
+ - **Content-Type**: Not defined
290
+ - **Accept**: application/json
291
+
292
+
293
+ ## get_ad_analytics
294
+
295
+ > <GetAdAnalytics200Response> get_ad_analytics(ad_id, opts)
296
+
297
+ Get ad analytics with daily breakdown
298
+
299
+ Returns real-time analytics from the platform API (not cached). Includes summary metrics, daily breakdown, and optional demographic breakdowns (Meta and TikTok only).
300
+
301
+ ### Examples
302
+
303
+ ```ruby
304
+ require 'time'
305
+ require 'late-sdk'
306
+ # setup authorization
307
+ Late.configure do |config|
308
+ # Configure Bearer authorization (JWT): bearerAuth
309
+ config.access_token = 'YOUR_BEARER_TOKEN'
310
+ end
311
+
312
+ api_instance = Late::AdsApi.new
313
+ ad_id = 'ad_id_example' # String |
314
+ opts = {
315
+ breakdowns: 'breakdowns_example' # String | Comma-separated breakdown dimensions. Meta: age, gender, country, publisher_platform, device_platform, region. TikTok: gender, age, country_code, platform, ac, language.
316
+ }
317
+
318
+ begin
319
+ # Get ad analytics with daily breakdown
320
+ result = api_instance.get_ad_analytics(ad_id, opts)
321
+ p result
322
+ rescue Late::ApiError => e
323
+ puts "Error when calling AdsApi->get_ad_analytics: #{e}"
324
+ end
325
+ ```
326
+
327
+ #### Using the get_ad_analytics_with_http_info variant
328
+
329
+ This returns an Array which contains the response data, status code and headers.
330
+
331
+ > <Array(<GetAdAnalytics200Response>, Integer, Hash)> get_ad_analytics_with_http_info(ad_id, opts)
332
+
333
+ ```ruby
334
+ begin
335
+ # Get ad analytics with daily breakdown
336
+ data, status_code, headers = api_instance.get_ad_analytics_with_http_info(ad_id, opts)
337
+ p status_code # => 2xx
338
+ p headers # => { ... }
339
+ p data # => <GetAdAnalytics200Response>
340
+ rescue Late::ApiError => e
341
+ puts "Error when calling AdsApi->get_ad_analytics_with_http_info: #{e}"
342
+ end
343
+ ```
344
+
345
+ ### Parameters
346
+
347
+ | Name | Type | Description | Notes |
348
+ | ---- | ---- | ----------- | ----- |
349
+ | **ad_id** | **String** | | |
350
+ | **breakdowns** | **String** | Comma-separated breakdown dimensions. Meta: age, gender, country, publisher_platform, device_platform, region. TikTok: gender, age, country_code, platform, ac, language. | [optional] |
351
+
352
+ ### Return type
353
+
354
+ [**GetAdAnalytics200Response**](GetAdAnalytics200Response.md)
355
+
356
+ ### Authorization
357
+
358
+ [bearerAuth](../README.md#bearerAuth)
359
+
360
+ ### HTTP request headers
361
+
362
+ - **Content-Type**: Not defined
363
+ - **Accept**: application/json
364
+
365
+
366
+ ## list_ad_accounts
367
+
368
+ > <ListAdAccounts200Response> list_ad_accounts(account_id)
369
+
370
+ List ad accounts for a social account
371
+
372
+ Returns the platform ad accounts available for the given social account (e.g. Meta ad accounts, TikTok advertiser IDs, Google Ads customer IDs).
373
+
374
+ ### Examples
375
+
376
+ ```ruby
377
+ require 'time'
378
+ require 'late-sdk'
379
+ # setup authorization
380
+ Late.configure do |config|
381
+ # Configure Bearer authorization (JWT): bearerAuth
382
+ config.access_token = 'YOUR_BEARER_TOKEN'
383
+ end
384
+
385
+ api_instance = Late::AdsApi.new
386
+ account_id = 'account_id_example' # String | Social account ID
387
+
388
+ begin
389
+ # List ad accounts for a social account
390
+ result = api_instance.list_ad_accounts(account_id)
391
+ p result
392
+ rescue Late::ApiError => e
393
+ puts "Error when calling AdsApi->list_ad_accounts: #{e}"
394
+ end
395
+ ```
396
+
397
+ #### Using the list_ad_accounts_with_http_info variant
398
+
399
+ This returns an Array which contains the response data, status code and headers.
400
+
401
+ > <Array(<ListAdAccounts200Response>, Integer, Hash)> list_ad_accounts_with_http_info(account_id)
402
+
403
+ ```ruby
404
+ begin
405
+ # List ad accounts for a social account
406
+ data, status_code, headers = api_instance.list_ad_accounts_with_http_info(account_id)
407
+ p status_code # => 2xx
408
+ p headers # => { ... }
409
+ p data # => <ListAdAccounts200Response>
410
+ rescue Late::ApiError => e
411
+ puts "Error when calling AdsApi->list_ad_accounts_with_http_info: #{e}"
412
+ end
413
+ ```
414
+
415
+ ### Parameters
416
+
417
+ | Name | Type | Description | Notes |
418
+ | ---- | ---- | ----------- | ----- |
419
+ | **account_id** | **String** | Social account ID | |
420
+
421
+ ### Return type
422
+
423
+ [**ListAdAccounts200Response**](ListAdAccounts200Response.md)
424
+
425
+ ### Authorization
426
+
427
+ [bearerAuth](../README.md#bearerAuth)
428
+
429
+ ### HTTP request headers
430
+
431
+ - **Content-Type**: Not defined
432
+ - **Accept**: application/json
433
+
434
+
435
+ ## list_ads
436
+
437
+ > <ListAds200Response> list_ads(opts)
438
+
439
+ List ads
440
+
441
+ Returns a paginated list of ads with cached metrics. Use `source=all` to include externally-synced ads from platform ad managers.
442
+
443
+ ### Examples
444
+
445
+ ```ruby
446
+ require 'time'
447
+ require 'late-sdk'
448
+ # setup authorization
449
+ Late.configure do |config|
450
+ # Configure Bearer authorization (JWT): bearerAuth
451
+ config.access_token = 'YOUR_BEARER_TOKEN'
452
+ end
453
+
454
+ api_instance = Late::AdsApi.new
455
+ opts = {
456
+ page: 56, # Integer | Page number (1-based)
457
+ limit: 56, # Integer |
458
+ source: 'zernio', # String | zernio = Zernio-created only, all = include external ads
459
+ status: 'active', # String |
460
+ platform: 'facebook', # String |
461
+ account_id: 'account_id_example', # String | Social account ID
462
+ profile_id: 'profile_id_example', # String | Profile ID
463
+ campaign_id: 'campaign_id_example' # String | Platform campaign ID (filter ads within a campaign)
464
+ }
465
+
466
+ begin
467
+ # List ads
468
+ result = api_instance.list_ads(opts)
469
+ p result
470
+ rescue Late::ApiError => e
471
+ puts "Error when calling AdsApi->list_ads: #{e}"
472
+ end
473
+ ```
474
+
475
+ #### Using the list_ads_with_http_info variant
476
+
477
+ This returns an Array which contains the response data, status code and headers.
478
+
479
+ > <Array(<ListAds200Response>, Integer, Hash)> list_ads_with_http_info(opts)
480
+
481
+ ```ruby
482
+ begin
483
+ # List ads
484
+ data, status_code, headers = api_instance.list_ads_with_http_info(opts)
485
+ p status_code # => 2xx
486
+ p headers # => { ... }
487
+ p data # => <ListAds200Response>
488
+ rescue Late::ApiError => e
489
+ puts "Error when calling AdsApi->list_ads_with_http_info: #{e}"
490
+ end
491
+ ```
492
+
493
+ ### Parameters
494
+
495
+ | Name | Type | Description | Notes |
496
+ | ---- | ---- | ----------- | ----- |
497
+ | **page** | **Integer** | Page number (1-based) | [optional][default to 1] |
498
+ | **limit** | **Integer** | | [optional][default to 50] |
499
+ | **source** | **String** | zernio &#x3D; Zernio-created only, all &#x3D; include external ads | [optional][default to &#39;zernio&#39;] |
500
+ | **status** | **String** | | [optional] |
501
+ | **platform** | **String** | | [optional] |
502
+ | **account_id** | **String** | Social account ID | [optional] |
503
+ | **profile_id** | **String** | Profile ID | [optional] |
504
+ | **campaign_id** | **String** | Platform campaign ID (filter ads within a campaign) | [optional] |
505
+
506
+ ### Return type
507
+
508
+ [**ListAds200Response**](ListAds200Response.md)
509
+
510
+ ### Authorization
511
+
512
+ [bearerAuth](../README.md#bearerAuth)
513
+
514
+ ### HTTP request headers
515
+
516
+ - **Content-Type**: Not defined
517
+ - **Accept**: application/json
518
+
519
+
520
+ ## search_ad_interests
521
+
522
+ > <SearchAdInterests200Response> search_ad_interests(q, account_id)
523
+
524
+ Search targeting interests
525
+
526
+ Search for interest-based targeting options available on the platform.
527
+
528
+ ### Examples
529
+
530
+ ```ruby
531
+ require 'time'
532
+ require 'late-sdk'
533
+ # setup authorization
534
+ Late.configure do |config|
535
+ # Configure Bearer authorization (JWT): bearerAuth
536
+ config.access_token = 'YOUR_BEARER_TOKEN'
537
+ end
538
+
539
+ api_instance = Late::AdsApi.new
540
+ q = 'q_example' # String | Search query
541
+ account_id = 'account_id_example' # String | Social account ID
542
+
543
+ begin
544
+ # Search targeting interests
545
+ result = api_instance.search_ad_interests(q, account_id)
546
+ p result
547
+ rescue Late::ApiError => e
548
+ puts "Error when calling AdsApi->search_ad_interests: #{e}"
549
+ end
550
+ ```
551
+
552
+ #### Using the search_ad_interests_with_http_info variant
553
+
554
+ This returns an Array which contains the response data, status code and headers.
555
+
556
+ > <Array(<SearchAdInterests200Response>, Integer, Hash)> search_ad_interests_with_http_info(q, account_id)
557
+
558
+ ```ruby
559
+ begin
560
+ # Search targeting interests
561
+ data, status_code, headers = api_instance.search_ad_interests_with_http_info(q, account_id)
562
+ p status_code # => 2xx
563
+ p headers # => { ... }
564
+ p data # => <SearchAdInterests200Response>
565
+ rescue Late::ApiError => e
566
+ puts "Error when calling AdsApi->search_ad_interests_with_http_info: #{e}"
567
+ end
568
+ ```
569
+
570
+ ### Parameters
571
+
572
+ | Name | Type | Description | Notes |
573
+ | ---- | ---- | ----------- | ----- |
574
+ | **q** | **String** | Search query | |
575
+ | **account_id** | **String** | Social account ID | |
576
+
577
+ ### Return type
578
+
579
+ [**SearchAdInterests200Response**](SearchAdInterests200Response.md)
580
+
581
+ ### Authorization
582
+
583
+ [bearerAuth](../README.md#bearerAuth)
584
+
585
+ ### HTTP request headers
586
+
587
+ - **Content-Type**: Not defined
588
+ - **Accept**: application/json
589
+
590
+
591
+ ## sync_external_ads
592
+
593
+ > <SyncExternalAds200Response> sync_external_ads
594
+
595
+ Sync external ads from platform ad managers
596
+
597
+ Discovers and imports ads created outside Zernio (e.g. in Meta Ads Manager, Google Ads). Upserts new ads and updates metrics/status for existing ones. Also runs automatically every 30 minutes.
598
+
599
+ ### Examples
600
+
601
+ ```ruby
602
+ require 'time'
603
+ require 'late-sdk'
604
+ # setup authorization
605
+ Late.configure do |config|
606
+ # Configure Bearer authorization (JWT): bearerAuth
607
+ config.access_token = 'YOUR_BEARER_TOKEN'
608
+ end
609
+
610
+ api_instance = Late::AdsApi.new
611
+
612
+ begin
613
+ # Sync external ads from platform ad managers
614
+ result = api_instance.sync_external_ads
615
+ p result
616
+ rescue Late::ApiError => e
617
+ puts "Error when calling AdsApi->sync_external_ads: #{e}"
618
+ end
619
+ ```
620
+
621
+ #### Using the sync_external_ads_with_http_info variant
622
+
623
+ This returns an Array which contains the response data, status code and headers.
624
+
625
+ > <Array(<SyncExternalAds200Response>, Integer, Hash)> sync_external_ads_with_http_info
626
+
627
+ ```ruby
628
+ begin
629
+ # Sync external ads from platform ad managers
630
+ data, status_code, headers = api_instance.sync_external_ads_with_http_info
631
+ p status_code # => 2xx
632
+ p headers # => { ... }
633
+ p data # => <SyncExternalAds200Response>
634
+ rescue Late::ApiError => e
635
+ puts "Error when calling AdsApi->sync_external_ads_with_http_info: #{e}"
636
+ end
637
+ ```
638
+
639
+ ### Parameters
640
+
641
+ This endpoint does not need any parameter.
642
+
643
+ ### Return type
644
+
645
+ [**SyncExternalAds200Response**](SyncExternalAds200Response.md)
646
+
647
+ ### Authorization
648
+
649
+ [bearerAuth](../README.md#bearerAuth)
650
+
651
+ ### HTTP request headers
652
+
653
+ - **Content-Type**: Not defined
654
+ - **Accept**: application/json
655
+
656
+
657
+ ## update_ad
658
+
659
+ > <UpdateAd200Response> update_ad(ad_id, update_ad_request)
660
+
661
+ Update ad (pause/resume, budget, targeting, name)
662
+
663
+ Update one or more fields on an ad. Status changes and budget updates are propagated to the platform. Targeting updates are Meta-only.
664
+
665
+ ### Examples
666
+
667
+ ```ruby
668
+ require 'time'
669
+ require 'late-sdk'
670
+ # setup authorization
671
+ Late.configure do |config|
672
+ # Configure Bearer authorization (JWT): bearerAuth
673
+ config.access_token = 'YOUR_BEARER_TOKEN'
674
+ end
675
+
676
+ api_instance = Late::AdsApi.new
677
+ ad_id = 'ad_id_example' # String |
678
+ update_ad_request = Late::UpdateAdRequest.new # UpdateAdRequest |
679
+
680
+ begin
681
+ # Update ad (pause/resume, budget, targeting, name)
682
+ result = api_instance.update_ad(ad_id, update_ad_request)
683
+ p result
684
+ rescue Late::ApiError => e
685
+ puts "Error when calling AdsApi->update_ad: #{e}"
686
+ end
687
+ ```
688
+
689
+ #### Using the update_ad_with_http_info variant
690
+
691
+ This returns an Array which contains the response data, status code and headers.
692
+
693
+ > <Array(<UpdateAd200Response>, Integer, Hash)> update_ad_with_http_info(ad_id, update_ad_request)
694
+
695
+ ```ruby
696
+ begin
697
+ # Update ad (pause/resume, budget, targeting, name)
698
+ data, status_code, headers = api_instance.update_ad_with_http_info(ad_id, update_ad_request)
699
+ p status_code # => 2xx
700
+ p headers # => { ... }
701
+ p data # => <UpdateAd200Response>
702
+ rescue Late::ApiError => e
703
+ puts "Error when calling AdsApi->update_ad_with_http_info: #{e}"
704
+ end
705
+ ```
706
+
707
+ ### Parameters
708
+
709
+ | Name | Type | Description | Notes |
710
+ | ---- | ---- | ----------- | ----- |
711
+ | **ad_id** | **String** | | |
712
+ | **update_ad_request** | [**UpdateAdRequest**](UpdateAdRequest.md) | | |
713
+
714
+ ### Return type
715
+
716
+ [**UpdateAd200Response**](UpdateAd200Response.md)
717
+
718
+ ### Authorization
719
+
720
+ [bearerAuth](../README.md#bearerAuth)
721
+
722
+ ### HTTP request headers
723
+
724
+ - **Content-Type**: application/json
725
+ - **Accept**: application/json
726
+