zernio-sdk 0.0.550 → 0.0.552

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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +73 -75
  3. data/docs/AdAccountsApi.md +915 -0
  4. data/docs/AdCampaignsApi.md +615 -15
  5. data/docs/AdCreativesApi.md +815 -0
  6. data/docs/AdInsightsApi.md +415 -0
  7. data/docs/AdTargetingApi.md +371 -0
  8. data/docs/AnalyticsApi.md +7 -7
  9. data/docs/BoostPostRequestTracking.md +1 -1
  10. data/docs/{CreateLeadFormRequestQuestionsInnerOptionsInner.md → BoostPostRequestTrackingUrlTagsInner.md} +2 -2
  11. data/docs/ConversionsApi.md +890 -0
  12. data/docs/CreateLeadFormRequestQuestionsInner.md +1 -1
  13. data/docs/LeadGenApi.md +527 -0
  14. data/docs/MessagingAdsApi.md +215 -0
  15. data/docs/ReachAndFrequencyApi.md +294 -0
  16. data/docs/TrackingTagsApi.md +141 -0
  17. data/docs/YouTubeDailyViewsResponse.md +2 -0
  18. data/docs/YouTubeDemographicsResponse.md +2 -0
  19. data/docs/YouTubeVideoRetentionResponse.md +2 -0
  20. data/lib/zernio-sdk/api/ad_accounts_api.rb +958 -0
  21. data/lib/zernio-sdk/api/ad_campaigns_api.rb +618 -12
  22. data/lib/zernio-sdk/api/ad_creatives_api.rb +826 -0
  23. data/lib/zernio-sdk/api/ad_insights_api.rb +446 -0
  24. data/lib/zernio-sdk/api/ad_targeting_api.rb +404 -0
  25. data/lib/zernio-sdk/api/analytics_api.rb +8 -8
  26. data/lib/zernio-sdk/api/conversions_api.rb +936 -0
  27. data/lib/zernio-sdk/api/lead_gen_api.rb +547 -0
  28. data/lib/zernio-sdk/api/messaging_ads_api.rb +226 -0
  29. data/lib/zernio-sdk/api/reach_and_frequency_api.rb +316 -0
  30. data/lib/zernio-sdk/api/tracking_tags_api.rb +137 -0
  31. data/lib/zernio-sdk/models/boost_post_request_tracking.rb +5 -2
  32. data/lib/zernio-sdk/models/{create_lead_form_request_questions_inner_options_inner.rb → boost_post_request_tracking_url_tags_inner.rb} +3 -3
  33. data/lib/zernio-sdk/models/create_lead_form_request_questions_inner.rb +1 -1
  34. data/lib/zernio-sdk/models/you_tube_daily_views_response.rb +11 -1
  35. data/lib/zernio-sdk/models/you_tube_demographics_response.rb +11 -1
  36. data/lib/zernio-sdk/models/you_tube_video_retention_response.rb +11 -1
  37. data/lib/zernio-sdk/version.rb +1 -1
  38. data/lib/zernio-sdk.rb +9 -2
  39. data/openapi.yaml +329 -163
  40. data/spec/api/ad_accounts_api_spec.rb +206 -0
  41. data/spec/api/ad_campaigns_api_spec.rb +119 -6
  42. data/spec/api/ad_creatives_api_spec.rb +182 -0
  43. data/spec/api/ad_insights_api_spec.rb +120 -0
  44. data/spec/api/ad_targeting_api_spec.rb +101 -0
  45. data/spec/api/analytics_api_spec.rb +4 -4
  46. data/spec/api/conversions_api_spec.rb +199 -0
  47. data/spec/api/lead_gen_api_spec.rb +131 -0
  48. data/spec/api/messaging_ads_api_spec.rb +71 -0
  49. data/spec/api/reach_and_frequency_api_spec.rb +87 -0
  50. data/spec/api/tracking_tags_api_spec.rb +25 -0
  51. data/spec/models/{create_lead_form_request_questions_inner_options_inner_spec.rb → boost_post_request_tracking_url_tags_inner_spec.rb} +6 -6
  52. data/spec/models/you_tube_daily_views_response_spec.rb +6 -0
  53. data/spec/models/you_tube_demographics_response_spec.rb +6 -0
  54. data/spec/models/you_tube_video_retention_response_spec.rb +6 -0
  55. metadata +38 -10
  56. data/docs/AdsApi.md +0 -5278
  57. data/lib/zernio-sdk/api/ads_api.rb +0 -5391
  58. data/spec/api/ads_api_spec.rb +0 -1015
@@ -0,0 +1,547 @@
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.4
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 Zernio
16
+ class LeadGenApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Archive a lead form
23
+ # Meta has no hard delete for forms; this archives the form (status=ARCHIVED).
24
+ # @param form_id [String]
25
+ # @param account_id [String]
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [ArchiveLeadForm200Response]
28
+ def archive_lead_form(form_id, account_id, opts = {})
29
+ data, _status_code, _headers = archive_lead_form_with_http_info(form_id, account_id, opts)
30
+ data
31
+ end
32
+
33
+ # Archive a lead form
34
+ # Meta has no hard delete for forms; this archives the form (status=ARCHIVED).
35
+ # @param form_id [String]
36
+ # @param account_id [String]
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(ArchiveLeadForm200Response, Integer, Hash)>] ArchiveLeadForm200Response data, response status code and response headers
39
+ def archive_lead_form_with_http_info(form_id, account_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: LeadGenApi.archive_lead_form ...'
42
+ end
43
+ # verify the required parameter 'form_id' is set
44
+ if @api_client.config.client_side_validation && form_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'form_id' when calling LeadGenApi.archive_lead_form"
46
+ end
47
+ # verify the required parameter 'account_id' is set
48
+ if @api_client.config.client_side_validation && account_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling LeadGenApi.archive_lead_form"
50
+ end
51
+ # resource path
52
+ local_var_path = '/v1/ads/lead-forms/{formId}'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+ query_params[:'accountId'] = account_id
57
+
58
+ # header parameters
59
+ header_params = opts[:header_params] || {}
60
+ # HTTP header 'Accept' (if needed)
61
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
62
+
63
+ # form parameters
64
+ form_params = opts[:form_params] || {}
65
+
66
+ # http body (model)
67
+ post_body = opts[:debug_body]
68
+
69
+ # return_type
70
+ return_type = opts[:debug_return_type] || 'ArchiveLeadForm200Response'
71
+
72
+ # auth_names
73
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
74
+
75
+ new_options = opts.merge(
76
+ :operation => :"LeadGenApi.archive_lead_form",
77
+ :header_params => header_params,
78
+ :query_params => query_params,
79
+ :form_params => form_params,
80
+ :body => post_body,
81
+ :auth_names => auth_names,
82
+ :return_type => return_type
83
+ )
84
+
85
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
86
+ if @api_client.config.debugging
87
+ @api_client.config.logger.debug "API called: LeadGenApi#archive_lead_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88
+ end
89
+ return data, status_code, headers
90
+ end
91
+
92
+ # Create a lead form
93
+ # Creates a Lead Gen form on the connected Facebook Page (POST /{page-id}/leadgen_forms). NOT idempotent — a retry creates a second form. Prefilled question types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM questions require both. Requires the Ads add-on.
94
+ # @param create_lead_form_request [CreateLeadFormRequest]
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [CreateLeadForm200Response]
97
+ def create_lead_form(create_lead_form_request, opts = {})
98
+ data, _status_code, _headers = create_lead_form_with_http_info(create_lead_form_request, opts)
99
+ data
100
+ end
101
+
102
+ # Create a lead form
103
+ # Creates a Lead Gen form on the connected Facebook Page (POST /{page-id}/leadgen_forms). NOT idempotent — a retry creates a second form. Prefilled question types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM questions require both. Requires the Ads add-on.
104
+ # @param create_lead_form_request [CreateLeadFormRequest]
105
+ # @param [Hash] opts the optional parameters
106
+ # @return [Array<(CreateLeadForm200Response, Integer, Hash)>] CreateLeadForm200Response data, response status code and response headers
107
+ def create_lead_form_with_http_info(create_lead_form_request, opts = {})
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug 'Calling API: LeadGenApi.create_lead_form ...'
110
+ end
111
+ # verify the required parameter 'create_lead_form_request' is set
112
+ if @api_client.config.client_side_validation && create_lead_form_request.nil?
113
+ fail ArgumentError, "Missing the required parameter 'create_lead_form_request' when calling LeadGenApi.create_lead_form"
114
+ end
115
+ # resource path
116
+ local_var_path = '/v1/ads/lead-forms'
117
+
118
+ # query parameters
119
+ query_params = opts[:query_params] || {}
120
+
121
+ # header parameters
122
+ header_params = opts[:header_params] || {}
123
+ # HTTP header 'Accept' (if needed)
124
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
125
+ # HTTP header 'Content-Type'
126
+ content_type = @api_client.select_header_content_type(['application/json'])
127
+ if !content_type.nil?
128
+ header_params['Content-Type'] = content_type
129
+ end
130
+
131
+ # form parameters
132
+ form_params = opts[:form_params] || {}
133
+
134
+ # http body (model)
135
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_lead_form_request)
136
+
137
+ # return_type
138
+ return_type = opts[:debug_return_type] || 'CreateLeadForm200Response'
139
+
140
+ # auth_names
141
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
142
+
143
+ new_options = opts.merge(
144
+ :operation => :"LeadGenApi.create_lead_form",
145
+ :header_params => header_params,
146
+ :query_params => query_params,
147
+ :form_params => form_params,
148
+ :body => post_body,
149
+ :auth_names => auth_names,
150
+ :return_type => return_type
151
+ )
152
+
153
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
154
+ if @api_client.config.debugging
155
+ @api_client.config.logger.debug "API called: LeadGenApi#create_lead_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
156
+ end
157
+ return data, status_code, headers
158
+ end
159
+
160
+ # Create a test lead
161
+ # Submits a test lead against the form (POST /{form-id}/test_leads) to exercise retrieval without waiting for real ad impressions. Meta allows one test lead per form at a time.
162
+ # @param form_id [String]
163
+ # @param create_test_lead_request [CreateTestLeadRequest]
164
+ # @param [Hash] opts the optional parameters
165
+ # @return [CreateTestLead200Response]
166
+ def create_test_lead(form_id, create_test_lead_request, opts = {})
167
+ data, _status_code, _headers = create_test_lead_with_http_info(form_id, create_test_lead_request, opts)
168
+ data
169
+ end
170
+
171
+ # Create a test lead
172
+ # Submits a test lead against the form (POST /{form-id}/test_leads) to exercise retrieval without waiting for real ad impressions. Meta allows one test lead per form at a time.
173
+ # @param form_id [String]
174
+ # @param create_test_lead_request [CreateTestLeadRequest]
175
+ # @param [Hash] opts the optional parameters
176
+ # @return [Array<(CreateTestLead200Response, Integer, Hash)>] CreateTestLead200Response data, response status code and response headers
177
+ def create_test_lead_with_http_info(form_id, create_test_lead_request, opts = {})
178
+ if @api_client.config.debugging
179
+ @api_client.config.logger.debug 'Calling API: LeadGenApi.create_test_lead ...'
180
+ end
181
+ # verify the required parameter 'form_id' is set
182
+ if @api_client.config.client_side_validation && form_id.nil?
183
+ fail ArgumentError, "Missing the required parameter 'form_id' when calling LeadGenApi.create_test_lead"
184
+ end
185
+ # verify the required parameter 'create_test_lead_request' is set
186
+ if @api_client.config.client_side_validation && create_test_lead_request.nil?
187
+ fail ArgumentError, "Missing the required parameter 'create_test_lead_request' when calling LeadGenApi.create_test_lead"
188
+ end
189
+ # resource path
190
+ local_var_path = '/v1/ads/lead-forms/{formId}/test-leads'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s))
191
+
192
+ # query parameters
193
+ query_params = opts[:query_params] || {}
194
+
195
+ # header parameters
196
+ header_params = opts[:header_params] || {}
197
+ # HTTP header 'Accept' (if needed)
198
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
199
+ # HTTP header 'Content-Type'
200
+ content_type = @api_client.select_header_content_type(['application/json'])
201
+ if !content_type.nil?
202
+ header_params['Content-Type'] = content_type
203
+ end
204
+
205
+ # form parameters
206
+ form_params = opts[:form_params] || {}
207
+
208
+ # http body (model)
209
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_test_lead_request)
210
+
211
+ # return_type
212
+ return_type = opts[:debug_return_type] || 'CreateTestLead200Response'
213
+
214
+ # auth_names
215
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
216
+
217
+ new_options = opts.merge(
218
+ :operation => :"LeadGenApi.create_test_lead",
219
+ :header_params => header_params,
220
+ :query_params => query_params,
221
+ :form_params => form_params,
222
+ :body => post_body,
223
+ :auth_names => auth_names,
224
+ :return_type => return_type
225
+ )
226
+
227
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
228
+ if @api_client.config.debugging
229
+ @api_client.config.logger.debug "API called: LeadGenApi#create_test_lead\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
230
+ end
231
+ return data, status_code, headers
232
+ end
233
+
234
+ # Get a lead form
235
+ # @param form_id [String]
236
+ # @param account_id [String]
237
+ # @param [Hash] opts the optional parameters
238
+ # @return [GetLeadForm200Response]
239
+ def get_lead_form(form_id, account_id, opts = {})
240
+ data, _status_code, _headers = get_lead_form_with_http_info(form_id, account_id, opts)
241
+ data
242
+ end
243
+
244
+ # Get a lead form
245
+ # @param form_id [String]
246
+ # @param account_id [String]
247
+ # @param [Hash] opts the optional parameters
248
+ # @return [Array<(GetLeadForm200Response, Integer, Hash)>] GetLeadForm200Response data, response status code and response headers
249
+ def get_lead_form_with_http_info(form_id, account_id, opts = {})
250
+ if @api_client.config.debugging
251
+ @api_client.config.logger.debug 'Calling API: LeadGenApi.get_lead_form ...'
252
+ end
253
+ # verify the required parameter 'form_id' is set
254
+ if @api_client.config.client_side_validation && form_id.nil?
255
+ fail ArgumentError, "Missing the required parameter 'form_id' when calling LeadGenApi.get_lead_form"
256
+ end
257
+ # verify the required parameter 'account_id' is set
258
+ if @api_client.config.client_side_validation && account_id.nil?
259
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling LeadGenApi.get_lead_form"
260
+ end
261
+ # resource path
262
+ local_var_path = '/v1/ads/lead-forms/{formId}'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s))
263
+
264
+ # query parameters
265
+ query_params = opts[:query_params] || {}
266
+ query_params[:'accountId'] = account_id
267
+
268
+ # header parameters
269
+ header_params = opts[:header_params] || {}
270
+ # HTTP header 'Accept' (if needed)
271
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
272
+
273
+ # form parameters
274
+ form_params = opts[:form_params] || {}
275
+
276
+ # http body (model)
277
+ post_body = opts[:debug_body]
278
+
279
+ # return_type
280
+ return_type = opts[:debug_return_type] || 'GetLeadForm200Response'
281
+
282
+ # auth_names
283
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
284
+
285
+ new_options = opts.merge(
286
+ :operation => :"LeadGenApi.get_lead_form",
287
+ :header_params => header_params,
288
+ :query_params => query_params,
289
+ :form_params => form_params,
290
+ :body => post_body,
291
+ :auth_names => auth_names,
292
+ :return_type => return_type
293
+ )
294
+
295
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
296
+ if @api_client.config.debugging
297
+ @api_client.config.logger.debug "API called: LeadGenApi#get_lead_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
298
+ end
299
+ return data, status_code, headers
300
+ end
301
+
302
+ # List leads for a single form
303
+ # Returns leads for one form. Serves persisted leads (ingested via the leadgen webhook) when available, falling back to a live Graph read.
304
+ # @param form_id [String]
305
+ # @param account_id [String]
306
+ # @param [Hash] opts the optional parameters
307
+ # @option opts [Integer] :limit (default to 25)
308
+ # @option opts [String] :cursor
309
+ # @option opts [Integer] :since Unix seconds.
310
+ # @return [ListFormLeads200Response]
311
+ def list_form_leads(form_id, account_id, opts = {})
312
+ data, _status_code, _headers = list_form_leads_with_http_info(form_id, account_id, opts)
313
+ data
314
+ end
315
+
316
+ # List leads for a single form
317
+ # Returns leads for one form. Serves persisted leads (ingested via the leadgen webhook) when available, falling back to a live Graph read.
318
+ # @param form_id [String]
319
+ # @param account_id [String]
320
+ # @param [Hash] opts the optional parameters
321
+ # @option opts [Integer] :limit (default to 25)
322
+ # @option opts [String] :cursor
323
+ # @option opts [Integer] :since Unix seconds.
324
+ # @return [Array<(ListFormLeads200Response, Integer, Hash)>] ListFormLeads200Response data, response status code and response headers
325
+ def list_form_leads_with_http_info(form_id, account_id, opts = {})
326
+ if @api_client.config.debugging
327
+ @api_client.config.logger.debug 'Calling API: LeadGenApi.list_form_leads ...'
328
+ end
329
+ # verify the required parameter 'form_id' is set
330
+ if @api_client.config.client_side_validation && form_id.nil?
331
+ fail ArgumentError, "Missing the required parameter 'form_id' when calling LeadGenApi.list_form_leads"
332
+ end
333
+ # verify the required parameter 'account_id' is set
334
+ if @api_client.config.client_side_validation && account_id.nil?
335
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling LeadGenApi.list_form_leads"
336
+ end
337
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
338
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_form_leads, must be smaller than or equal to 100.'
339
+ end
340
+
341
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
342
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_form_leads, must be greater than or equal to 1.'
343
+ end
344
+
345
+ # resource path
346
+ local_var_path = '/v1/ads/lead-forms/{formId}/leads'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s))
347
+
348
+ # query parameters
349
+ query_params = opts[:query_params] || {}
350
+ query_params[:'accountId'] = account_id
351
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
352
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
353
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
354
+
355
+ # header parameters
356
+ header_params = opts[:header_params] || {}
357
+ # HTTP header 'Accept' (if needed)
358
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
359
+
360
+ # form parameters
361
+ form_params = opts[:form_params] || {}
362
+
363
+ # http body (model)
364
+ post_body = opts[:debug_body]
365
+
366
+ # return_type
367
+ return_type = opts[:debug_return_type] || 'ListFormLeads200Response'
368
+
369
+ # auth_names
370
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
371
+
372
+ new_options = opts.merge(
373
+ :operation => :"LeadGenApi.list_form_leads",
374
+ :header_params => header_params,
375
+ :query_params => query_params,
376
+ :form_params => form_params,
377
+ :body => post_body,
378
+ :auth_names => auth_names,
379
+ :return_type => return_type
380
+ )
381
+
382
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
383
+ if @api_client.config.debugging
384
+ @api_client.config.logger.debug "API called: LeadGenApi#list_form_leads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
385
+ end
386
+ return data, status_code, headers
387
+ end
388
+
389
+ # List lead forms
390
+ # Lists the Lead Gen forms owned by the connected Facebook Page. Requires the Ads add-on.
391
+ # @param account_id [String] Connected facebook account id.
392
+ # @param [Hash] opts the optional parameters
393
+ # @option opts [Integer] :limit (default to 25)
394
+ # @option opts [String] :cursor
395
+ # @return [ListLeadForms200Response]
396
+ def list_lead_forms(account_id, opts = {})
397
+ data, _status_code, _headers = list_lead_forms_with_http_info(account_id, opts)
398
+ data
399
+ end
400
+
401
+ # List lead forms
402
+ # Lists the Lead Gen forms owned by the connected Facebook Page. Requires the Ads add-on.
403
+ # @param account_id [String] Connected facebook account id.
404
+ # @param [Hash] opts the optional parameters
405
+ # @option opts [Integer] :limit (default to 25)
406
+ # @option opts [String] :cursor
407
+ # @return [Array<(ListLeadForms200Response, Integer, Hash)>] ListLeadForms200Response data, response status code and response headers
408
+ def list_lead_forms_with_http_info(account_id, opts = {})
409
+ if @api_client.config.debugging
410
+ @api_client.config.logger.debug 'Calling API: LeadGenApi.list_lead_forms ...'
411
+ end
412
+ # verify the required parameter 'account_id' is set
413
+ if @api_client.config.client_side_validation && account_id.nil?
414
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling LeadGenApi.list_lead_forms"
415
+ end
416
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
417
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_lead_forms, must be smaller than or equal to 100.'
418
+ end
419
+
420
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
421
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_lead_forms, must be greater than or equal to 1.'
422
+ end
423
+
424
+ # resource path
425
+ local_var_path = '/v1/ads/lead-forms'
426
+
427
+ # query parameters
428
+ query_params = opts[:query_params] || {}
429
+ query_params[:'accountId'] = account_id
430
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
431
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
432
+
433
+ # header parameters
434
+ header_params = opts[:header_params] || {}
435
+ # HTTP header 'Accept' (if needed)
436
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
437
+
438
+ # form parameters
439
+ form_params = opts[:form_params] || {}
440
+
441
+ # http body (model)
442
+ post_body = opts[:debug_body]
443
+
444
+ # return_type
445
+ return_type = opts[:debug_return_type] || 'ListLeadForms200Response'
446
+
447
+ # auth_names
448
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
449
+
450
+ new_options = opts.merge(
451
+ :operation => :"LeadGenApi.list_lead_forms",
452
+ :header_params => header_params,
453
+ :query_params => query_params,
454
+ :form_params => form_params,
455
+ :body => post_body,
456
+ :auth_names => auth_names,
457
+ :return_type => return_type
458
+ )
459
+
460
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
461
+ if @api_client.config.debugging
462
+ @api_client.config.logger.debug "API called: LeadGenApi#list_lead_forms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
463
+ end
464
+ return data, status_code, headers
465
+ end
466
+
467
+ # List submitted leads
468
+ # Returns persisted Meta Lead Gen leads for your team, newest-first, with keyset pagination on `cursor`. Leads are ingested in real time from the `leadgen` webhook. Requires the Ads add-on.
469
+ # @param [Hash] opts the optional parameters
470
+ # @option opts [String] :form_id Filter to a single lead form.
471
+ # @option opts [String] :account_id Filter to a single connected account.
472
+ # @option opts [Integer] :limit (default to 25)
473
+ # @option opts [Integer] :since Unix seconds; only leads created at/after this Meta timestamp.
474
+ # @option opts [String] :cursor Keyset cursor from a previous response&#39;s pagination.cursor.
475
+ # @return [ListLeads200Response]
476
+ def list_leads(opts = {})
477
+ data, _status_code, _headers = list_leads_with_http_info(opts)
478
+ data
479
+ end
480
+
481
+ # List submitted leads
482
+ # Returns persisted Meta Lead Gen leads for your team, newest-first, with keyset pagination on &#x60;cursor&#x60;. Leads are ingested in real time from the &#x60;leadgen&#x60; webhook. Requires the Ads add-on.
483
+ # @param [Hash] opts the optional parameters
484
+ # @option opts [String] :form_id Filter to a single lead form.
485
+ # @option opts [String] :account_id Filter to a single connected account.
486
+ # @option opts [Integer] :limit (default to 25)
487
+ # @option opts [Integer] :since Unix seconds; only leads created at/after this Meta timestamp.
488
+ # @option opts [String] :cursor Keyset cursor from a previous response&#39;s pagination.cursor.
489
+ # @return [Array<(ListLeads200Response, Integer, Hash)>] ListLeads200Response data, response status code and response headers
490
+ def list_leads_with_http_info(opts = {})
491
+ if @api_client.config.debugging
492
+ @api_client.config.logger.debug 'Calling API: LeadGenApi.list_leads ...'
493
+ end
494
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
495
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_leads, must be smaller than or equal to 100.'
496
+ end
497
+
498
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
499
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_leads, must be greater than or equal to 1.'
500
+ end
501
+
502
+ # resource path
503
+ local_var_path = '/v1/ads/leads'
504
+
505
+ # query parameters
506
+ query_params = opts[:query_params] || {}
507
+ query_params[:'formId'] = opts[:'form_id'] if !opts[:'form_id'].nil?
508
+ query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?
509
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
510
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
511
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
512
+
513
+ # header parameters
514
+ header_params = opts[:header_params] || {}
515
+ # HTTP header 'Accept' (if needed)
516
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
517
+
518
+ # form parameters
519
+ form_params = opts[:form_params] || {}
520
+
521
+ # http body (model)
522
+ post_body = opts[:debug_body]
523
+
524
+ # return_type
525
+ return_type = opts[:debug_return_type] || 'ListLeads200Response'
526
+
527
+ # auth_names
528
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
529
+
530
+ new_options = opts.merge(
531
+ :operation => :"LeadGenApi.list_leads",
532
+ :header_params => header_params,
533
+ :query_params => query_params,
534
+ :form_params => form_params,
535
+ :body => post_body,
536
+ :auth_names => auth_names,
537
+ :return_type => return_type
538
+ )
539
+
540
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
541
+ if @api_client.config.debugging
542
+ @api_client.config.logger.debug "API called: LeadGenApi#list_leads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
543
+ end
544
+ return data, status_code, headers
545
+ end
546
+ end
547
+ end