Class: Zernio::LeadGenApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zernio-sdk/api/lead_gen_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LeadGenApi

Returns a new instance of LeadGenApi.



19
20
21
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#archive_lead_form(form_id, account_id, opts = {}) ⇒ ArchiveLeadForm200Response

Archive a lead form Meta has no hard delete for forms; this archives the form (status=ARCHIVED).

Parameters:

  • form_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



28
29
30
31
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 28

def archive_lead_form(form_id, , opts = {})
  data, _status_code, _headers = archive_lead_form_with_http_info(form_id, , opts)
  data
end

#archive_lead_form_with_http_info(form_id, account_id, opts = {}) ⇒ Array<(ArchiveLeadForm200Response, Integer, Hash)>

Archive a lead form Meta has no hard delete for forms; this archives the form (status=ARCHIVED).

Parameters:

  • form_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ArchiveLeadForm200Response, Integer, Hash)>)

    ArchiveLeadForm200Response data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 39

def archive_lead_form_with_http_info(form_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LeadGenApi.archive_lead_form ...'
  end
  # verify the required parameter 'form_id' is set
  if @api_client.config.client_side_validation && form_id.nil?
    fail ArgumentError, "Missing the required parameter 'form_id' when calling LeadGenApi.archive_lead_form"
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling LeadGenApi.archive_lead_form"
  end
  # resource path
  local_var_path = '/v1/ads/lead-forms/{formId}'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ArchiveLeadForm200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"LeadGenApi.archive_lead_form",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LeadGenApi#archive_lead_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_lead_form(create_lead_form_request, opts = {}) ⇒ CreateLeadForm200Response

Create a lead form 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.

Parameters:

  • create_lead_form_request (CreateLeadFormRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



97
98
99
100
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 97

def create_lead_form(create_lead_form_request, opts = {})
  data, _status_code, _headers = create_lead_form_with_http_info(create_lead_form_request, opts)
  data
end

#create_lead_form_with_http_info(create_lead_form_request, opts = {}) ⇒ Array<(CreateLeadForm200Response, Integer, Hash)>

Create a lead form 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.

Parameters:

  • create_lead_form_request (CreateLeadFormRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateLeadForm200Response, Integer, Hash)>)

    CreateLeadForm200Response data, response status code and response headers



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 107

def create_lead_form_with_http_info(create_lead_form_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LeadGenApi.create_lead_form ...'
  end
  # verify the required parameter 'create_lead_form_request' is set
  if @api_client.config.client_side_validation && create_lead_form_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_lead_form_request' when calling LeadGenApi.create_lead_form"
  end
  # resource path
  local_var_path = '/v1/ads/lead-forms'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_lead_form_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateLeadForm200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"LeadGenApi.create_lead_form",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LeadGenApi#create_lead_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_test_lead(form_id, create_test_lead_request, opts = {}) ⇒ CreateTestLead200Response

Create a test lead 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.

Parameters:

  • form_id (String)
  • create_test_lead_request (CreateTestLeadRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



166
167
168
169
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 166

def create_test_lead(form_id, create_test_lead_request, opts = {})
  data, _status_code, _headers = create_test_lead_with_http_info(form_id, create_test_lead_request, opts)
  data
end

#create_test_lead_with_http_info(form_id, create_test_lead_request, opts = {}) ⇒ Array<(CreateTestLead200Response, Integer, Hash)>

Create a test lead 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.

Parameters:

  • form_id (String)
  • create_test_lead_request (CreateTestLeadRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateTestLead200Response, Integer, Hash)>)

    CreateTestLead200Response data, response status code and response headers



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 177

def create_test_lead_with_http_info(form_id, create_test_lead_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LeadGenApi.create_test_lead ...'
  end
  # verify the required parameter 'form_id' is set
  if @api_client.config.client_side_validation && form_id.nil?
    fail ArgumentError, "Missing the required parameter 'form_id' when calling LeadGenApi.create_test_lead"
  end
  # verify the required parameter 'create_test_lead_request' is set
  if @api_client.config.client_side_validation && create_test_lead_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_test_lead_request' when calling LeadGenApi.create_test_lead"
  end
  # resource path
  local_var_path = '/v1/ads/lead-forms/{formId}/test-leads'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_test_lead_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateTestLead200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"LeadGenApi.create_test_lead",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LeadGenApi#create_test_lead\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_lead_form(form_id, account_id, opts = {}) ⇒ GetLeadForm200Response

Get a lead form

Parameters:

  • form_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



239
240
241
242
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 239

def get_lead_form(form_id, , opts = {})
  data, _status_code, _headers = get_lead_form_with_http_info(form_id, , opts)
  data
end

#get_lead_form_with_http_info(form_id, account_id, opts = {}) ⇒ Array<(GetLeadForm200Response, Integer, Hash)>

Get a lead form

Parameters:

  • form_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetLeadForm200Response, Integer, Hash)>)

    GetLeadForm200Response data, response status code and response headers



249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 249

def get_lead_form_with_http_info(form_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LeadGenApi.get_lead_form ...'
  end
  # verify the required parameter 'form_id' is set
  if @api_client.config.client_side_validation && form_id.nil?
    fail ArgumentError, "Missing the required parameter 'form_id' when calling LeadGenApi.get_lead_form"
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling LeadGenApi.get_lead_form"
  end
  # resource path
  local_var_path = '/v1/ads/lead-forms/{formId}'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLeadForm200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"LeadGenApi.get_lead_form",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LeadGenApi#get_lead_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_form_leads(form_id, account_id, opts = {}) ⇒ ListFormLeads200Response

List leads for a single form Returns leads for one form. Serves persisted leads (ingested via the leadgen webhook) when available, falling back to a live Graph read.

Parameters:

  • form_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 25
  • :cursor (String)
  • :since (Integer)

    Unix seconds.

Returns:



311
312
313
314
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 311

def list_form_leads(form_id, , opts = {})
  data, _status_code, _headers = list_form_leads_with_http_info(form_id, , opts)
  data
end

#list_form_leads_with_http_info(form_id, account_id, opts = {}) ⇒ Array<(ListFormLeads200Response, Integer, Hash)>

List leads for a single form Returns leads for one form. Serves persisted leads (ingested via the leadgen webhook) when available, falling back to a live Graph read.

Parameters:

  • form_id (String)
  • account_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 25
  • :cursor (String)
  • :since (Integer)

    Unix seconds.

Returns:

  • (Array<(ListFormLeads200Response, Integer, Hash)>)

    ListFormLeads200Response data, response status code and response headers



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 325

def list_form_leads_with_http_info(form_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LeadGenApi.list_form_leads ...'
  end
  # verify the required parameter 'form_id' is set
  if @api_client.config.client_side_validation && form_id.nil?
    fail ArgumentError, "Missing the required parameter 'form_id' when calling LeadGenApi.list_form_leads"
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling LeadGenApi.list_form_leads"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_form_leads, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_form_leads, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/ads/lead-forms/{formId}/leads'.sub('{' + 'formId' + '}', CGI.escape(form_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListFormLeads200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"LeadGenApi.list_form_leads",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LeadGenApi#list_form_leads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_lead_forms(account_id, opts = {}) ⇒ ListLeadForms200Response

List lead forms Lists the Lead Gen forms owned by the connected Facebook Page. Requires the Ads add-on.

Parameters:

  • account_id (String)

    Connected facebook account id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 25
  • :cursor (String)

Returns:



396
397
398
399
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 396

def list_lead_forms(, opts = {})
  data, _status_code, _headers = list_lead_forms_with_http_info(, opts)
  data
end

#list_lead_forms_with_http_info(account_id, opts = {}) ⇒ Array<(ListLeadForms200Response, Integer, Hash)>

List lead forms Lists the Lead Gen forms owned by the connected Facebook Page. Requires the Ads add-on.

Parameters:

  • account_id (String)

    Connected facebook account id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 25
  • :cursor (String)

Returns:

  • (Array<(ListLeadForms200Response, Integer, Hash)>)

    ListLeadForms200Response data, response status code and response headers



408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 408

def list_lead_forms_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LeadGenApi.list_lead_forms ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling LeadGenApi.list_lead_forms"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_lead_forms, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_lead_forms, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/ads/lead-forms'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListLeadForms200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"LeadGenApi.list_lead_forms",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LeadGenApi#list_lead_forms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_leads(opts = {}) ⇒ ListLeads200Response

List submitted leads 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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :form_id (String)

    Filter to a single lead form.

  • :account_id (String)

    Filter to a single connected account.

  • :limit (Integer) — default: default to 25
  • :since (Integer)

    Unix seconds; only leads created at/after this Meta timestamp.

  • :cursor (String)

    Keyset cursor from a previous response's pagination.cursor.

Returns:



476
477
478
479
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 476

def list_leads(opts = {})
  data, _status_code, _headers = list_leads_with_http_info(opts)
  data
end

#list_leads_with_http_info(opts = {}) ⇒ Array<(ListLeads200Response, Integer, Hash)>

List submitted leads 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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :form_id (String)

    Filter to a single lead form.

  • :account_id (String)

    Filter to a single connected account.

  • :limit (Integer) — default: default to 25
  • :since (Integer)

    Unix seconds; only leads created at/after this Meta timestamp.

  • :cursor (String)

    Keyset cursor from a previous response's pagination.cursor.

Returns:

  • (Array<(ListLeads200Response, Integer, Hash)>)

    ListLeads200Response data, response status code and response headers



490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
# File 'lib/zernio-sdk/api/lead_gen_api.rb', line 490

def list_leads_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LeadGenApi.list_leads ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_leads, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LeadGenApi.list_leads, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/ads/leads'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'formId'] = opts[:'form_id'] if !opts[:'form_id'].nil?
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListLeads200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"LeadGenApi.list_leads",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LeadGenApi#list_leads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end