Class: Zernio::ProductCatalogsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProductCatalogsApi

Returns a new instance of ProductCatalogsApi.



19
20
21
# File 'lib/zernio-sdk/api/product_catalogs_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/product_catalogs_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#batch_ad_catalog_products(catalog_id, batch_ad_catalog_products_request, opts = {}) ⇒ BatchAdCatalogProducts202Response

Create, update or delete products in bulk Up to 5000 CREATE / UPDATE / DELETE requests keyed by retailerId, processed asynchronously by Meta. Returns handles; poll GET /v1/ads/catalogs/catalogId/batches/handle for the outcome and per-item errors. CREATE requests need name, url, imageUrl, price and currency.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

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

    the optional parameters

Returns:



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

def batch_ad_catalog_products(catalog_id, batch_ad_catalog_products_request, opts = {})
  data, _status_code, _headers = batch_ad_catalog_products_with_http_info(catalog_id, batch_ad_catalog_products_request, opts)
  data
end

#batch_ad_catalog_products_with_http_info(catalog_id, batch_ad_catalog_products_request, opts = {}) ⇒ Array<(BatchAdCatalogProducts202Response, Integer, Hash)>

Create, update or delete products in bulk Up to 5000 CREATE / UPDATE / DELETE requests keyed by `retailerId`, processed asynchronously by Meta. Returns handles; poll GET /v1/ads/catalogs/catalogId/batches/handle for the outcome and per-item errors. CREATE requests need name, url, imageUrl, price and currency.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

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

    the optional parameters

Returns:



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
91
92
93
94
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 39

def batch_ad_catalog_products_with_http_info(catalog_id, batch_ad_catalog_products_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.batch_ad_catalog_products ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.batch_ad_catalog_products"
  end
  # verify the required parameter 'batch_ad_catalog_products_request' is set
  if @api_client.config.client_side_validation && batch_ad_catalog_products_request.nil?
    fail ArgumentError, "Missing the required parameter 'batch_ad_catalog_products_request' when calling ProductCatalogsApi.batch_ad_catalog_products"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/products/batch'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_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(batch_ad_catalog_products_request)

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

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.batch_ad_catalog_products",
    :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: ProductCatalogsApi#batch_ad_catalog_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_ad_catalog(create_ad_catalog_request, opts = {}) ⇒ CreateAdCatalog201Response

Create a Meta product catalog Creates a Meta Commerce catalog in the business portfolio (resolved like GET). The same catalog serves Advantage+ catalog ads, Instagram/Facebook Shops and the WhatsApp Business catalog: link it to a WhatsApp number with POST /v1/whatsapp/catalogs. Needs catalog_management on the Meta login.

Parameters:

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

    the optional parameters

Returns:



101
102
103
104
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 101

def create_ad_catalog(create_ad_catalog_request, opts = {})
  data, _status_code, _headers = create_ad_catalog_with_http_info(create_ad_catalog_request, opts)
  data
end

#create_ad_catalog_feed(catalog_id, create_ad_catalog_feed_request, opts = {}) ⇒ CreateAdCatalogFeed201Response

Create a product feed A feed pulls a CSV/TSV/XML product file from a URL. With schedule Meta fetches it on a cadence; without it, trigger fetches with POST /v1/ads/catalogs/catalogId/feeds/feedId/uploads.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

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

    the optional parameters

Returns:



170
171
172
173
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 170

def create_ad_catalog_feed(catalog_id, create_ad_catalog_feed_request, opts = {})
  data, _status_code, _headers = create_ad_catalog_feed_with_http_info(catalog_id, create_ad_catalog_feed_request, opts)
  data
end

#create_ad_catalog_feed_upload(catalog_id, feed_id, create_ad_catalog_feed_upload_request, opts = {}) ⇒ CreateAdCatalogFeedUpload202Response

Fetch a feed file now Asks Meta to fetch the product file at url into the feed. Processing is asynchronous: read the outcome with GET uploads.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • feed_id (String)
  • create_ad_catalog_feed_upload_request (CreateAdCatalogFeedUploadRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



245
246
247
248
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 245

def create_ad_catalog_feed_upload(catalog_id, feed_id, create_ad_catalog_feed_upload_request, opts = {})
  data, _status_code, _headers = create_ad_catalog_feed_upload_with_http_info(catalog_id, feed_id, create_ad_catalog_feed_upload_request, opts)
  data
end

#create_ad_catalog_feed_upload_with_http_info(catalog_id, feed_id, create_ad_catalog_feed_upload_request, opts = {}) ⇒ Array<(CreateAdCatalogFeedUpload202Response, Integer, Hash)>

Fetch a feed file now Asks Meta to fetch the product file at `url` into the feed. Processing is asynchronous: read the outcome with GET uploads.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • feed_id (String)
  • create_ad_catalog_feed_upload_request (CreateAdCatalogFeedUploadRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 257

def create_ad_catalog_feed_upload_with_http_info(catalog_id, feed_id, create_ad_catalog_feed_upload_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.create_ad_catalog_feed_upload ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.create_ad_catalog_feed_upload"
  end
  # verify the required parameter 'feed_id' is set
  if @api_client.config.client_side_validation && feed_id.nil?
    fail ArgumentError, "Missing the required parameter 'feed_id' when calling ProductCatalogsApi.create_ad_catalog_feed_upload"
  end
  # verify the required parameter 'create_ad_catalog_feed_upload_request' is set
  if @api_client.config.client_side_validation && create_ad_catalog_feed_upload_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_ad_catalog_feed_upload_request' when calling ProductCatalogsApi.create_ad_catalog_feed_upload"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/feeds/{feedId}/uploads'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s)).sub('{' + 'feedId' + '}', CGI.escape(feed_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_ad_catalog_feed_upload_request)

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

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.create_ad_catalog_feed_upload",
    :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: ProductCatalogsApi#create_ad_catalog_feed_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_ad_catalog_feed_with_http_info(catalog_id, create_ad_catalog_feed_request, opts = {}) ⇒ Array<(CreateAdCatalogFeed201Response, Integer, Hash)>

Create a product feed A feed pulls a CSV/TSV/XML product file from a URL. With `schedule` Meta fetches it on a cadence; without it, trigger fetches with POST /v1/ads/catalogs/catalogId/feeds/feedId/uploads.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

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

    the optional parameters

Returns:



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
233
234
235
236
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 181

def create_ad_catalog_feed_with_http_info(catalog_id, create_ad_catalog_feed_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.create_ad_catalog_feed ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.create_ad_catalog_feed"
  end
  # verify the required parameter 'create_ad_catalog_feed_request' is set
  if @api_client.config.client_side_validation && create_ad_catalog_feed_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_ad_catalog_feed_request' when calling ProductCatalogsApi.create_ad_catalog_feed"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/feeds'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_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_ad_catalog_feed_request)

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

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.create_ad_catalog_feed",
    :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: ProductCatalogsApi#create_ad_catalog_feed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_ad_catalog_product(catalog_id, create_ad_catalog_product_request, opts = {}) ⇒ CreateAdCatalogProduct201Response

Add a product to a catalog Adds one product. retailerId is your SKU and stays the handle for later lookups and batch updates. For many products at once use POST /v1/ads/catalogs/catalogId/products/batch. Needs catalog_management on the Meta login.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

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

    the optional parameters

Returns:



324
325
326
327
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 324

def create_ad_catalog_product(catalog_id, create_ad_catalog_product_request, opts = {})
  data, _status_code, _headers = create_ad_catalog_product_with_http_info(catalog_id, create_ad_catalog_product_request, opts)
  data
end

#create_ad_catalog_product_set(catalog_id, create_ad_catalog_product_set_request, opts = {}) ⇒ CreateAdCatalogProductSet201Response

Create a product set A product set is a filter over the catalog, e.g. {\"retailer_id\": {\"is_any\": [\"sku-1\", \"sku-2\"]}} or {\"brand\": {\"i_contains\": \"acme\"}} (Meta's product set filter syntax).

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

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

    the optional parameters

Returns:



398
399
400
401
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 398

def create_ad_catalog_product_set(catalog_id, create_ad_catalog_product_set_request, opts = {})
  data, _status_code, _headers = create_ad_catalog_product_set_with_http_info(catalog_id, create_ad_catalog_product_set_request, opts)
  data
end

#create_ad_catalog_product_set_with_http_info(catalog_id, create_ad_catalog_product_set_request, opts = {}) ⇒ Array<(CreateAdCatalogProductSet201Response, Integer, Hash)>

Create a product set A product set is a filter over the catalog, e.g. `{\"is_any\": [\"sku-1\", \"sku-2\"]}` or `{\"i_contains\": \"acme\"}` (Meta's product set filter syntax).

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

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

    the optional parameters

Returns:



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
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 409

def create_ad_catalog_product_set_with_http_info(catalog_id, create_ad_catalog_product_set_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.create_ad_catalog_product_set ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.create_ad_catalog_product_set"
  end
  # verify the required parameter 'create_ad_catalog_product_set_request' is set
  if @api_client.config.client_side_validation && create_ad_catalog_product_set_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_ad_catalog_product_set_request' when calling ProductCatalogsApi.create_ad_catalog_product_set"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/product-sets'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_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_ad_catalog_product_set_request)

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

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.create_ad_catalog_product_set",
    :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: ProductCatalogsApi#create_ad_catalog_product_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_ad_catalog_product_with_http_info(catalog_id, create_ad_catalog_product_request, opts = {}) ⇒ Array<(CreateAdCatalogProduct201Response, Integer, Hash)>

Add a product to a catalog Adds one product. `retailerId` is your SKU and stays the handle for later lookups and batch updates. For many products at once use POST /v1/ads/catalogs/catalogId/products/batch. Needs catalog_management on the Meta login.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

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

    the optional parameters

Returns:



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
388
389
390
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 335

def create_ad_catalog_product_with_http_info(catalog_id, create_ad_catalog_product_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.create_ad_catalog_product ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.create_ad_catalog_product"
  end
  # verify the required parameter 'create_ad_catalog_product_request' is set
  if @api_client.config.client_side_validation && create_ad_catalog_product_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_ad_catalog_product_request' when calling ProductCatalogsApi.create_ad_catalog_product"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/products'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_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_ad_catalog_product_request)

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

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.create_ad_catalog_product",
    :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: ProductCatalogsApi#create_ad_catalog_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_ad_catalog_with_http_info(create_ad_catalog_request, opts = {}) ⇒ Array<(CreateAdCatalog201Response, Integer, Hash)>

Create a Meta product catalog Creates a Meta Commerce catalog in the business portfolio (resolved like GET). The same catalog serves Advantage+ catalog ads, Instagram/Facebook Shops and the WhatsApp Business catalog: link it to a WhatsApp number with POST /v1/whatsapp/catalogs. Needs catalog_management on the Meta login.

Parameters:

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

    the optional parameters

Returns:

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

    CreateAdCatalog201Response data, response status code and response headers



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
159
160
161
162
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 111

def create_ad_catalog_with_http_info(create_ad_catalog_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.create_ad_catalog ...'
  end
  # verify the required parameter 'create_ad_catalog_request' is set
  if @api_client.config.client_side_validation && create_ad_catalog_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_ad_catalog_request' when calling ProductCatalogsApi.create_ad_catalog"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs'

  # 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_ad_catalog_request)

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

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.create_ad_catalog",
    :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: ProductCatalogsApi#create_ad_catalog\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ad_catalog(catalog_id, account_id, opts = {}) ⇒ DeleteAdCatalog200Response

Delete a product catalog Deletes the catalog and every product in it on Meta. Ads and WhatsApp numbers that use it lose their catalog.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



473
474
475
476
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 473

def delete_ad_catalog(catalog_id, , opts = {})
  data, _status_code, _headers = delete_ad_catalog_with_http_info(catalog_id, , opts)
  data
end

#delete_ad_catalog_product(catalog_id, product_id, account_id, opts = {}) ⇒ DeleteAdCatalogProduct200Response

Delete a product

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • product_id (String)

    Meta product item ID (from the products list; not the retailer id)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



546
547
548
549
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 546

def delete_ad_catalog_product(catalog_id, product_id, , opts = {})
  data, _status_code, _headers = delete_ad_catalog_product_with_http_info(catalog_id, product_id, , opts)
  data
end

#delete_ad_catalog_product_set(catalog_id, product_set_id, account_id, opts = {}) ⇒ DeleteAdCatalogProductSet200Response

Delete a product set

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • product_set_id (String)
  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



623
624
625
626
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 623

def delete_ad_catalog_product_set(catalog_id, product_set_id, , opts = {})
  data, _status_code, _headers = delete_ad_catalog_product_set_with_http_info(catalog_id, product_set_id, , opts)
  data
end

#delete_ad_catalog_product_set_with_http_info(catalog_id, product_set_id, account_id, opts = {}) ⇒ Array<(DeleteAdCatalogProductSet200Response, Integer, Hash)>

Delete a product set

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • product_set_id (String)
  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 635

def delete_ad_catalog_product_set_with_http_info(catalog_id, product_set_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.delete_ad_catalog_product_set ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.delete_ad_catalog_product_set"
  end
  # verify the required parameter 'product_set_id' is set
  if @api_client.config.client_side_validation && product_set_id.nil?
    fail ArgumentError, "Missing the required parameter 'product_set_id' when calling ProductCatalogsApi.delete_ad_catalog_product_set"
  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 ProductCatalogsApi.delete_ad_catalog_product_set"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/product-sets/{productSetId}'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s)).sub('{' + 'productSetId' + '}', CGI.escape(product_set_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'catalogAccountId'] = opts[:'catalog_account_id'] if !opts[:'catalog_account_id'].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] || 'DeleteAdCatalogProductSet200Response'

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.delete_ad_catalog_product_set",
    :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: ProductCatalogsApi#delete_ad_catalog_product_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ad_catalog_product_with_http_info(catalog_id, product_id, account_id, opts = {}) ⇒ Array<(DeleteAdCatalogProduct200Response, Integer, Hash)>

Delete a product

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • product_id (String)

    Meta product item ID (from the products list; not the retailer id)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 558

def delete_ad_catalog_product_with_http_info(catalog_id, product_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.delete_ad_catalog_product ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.delete_ad_catalog_product"
  end
  # verify the required parameter 'product_id' is set
  if @api_client.config.client_side_validation && product_id.nil?
    fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductCatalogsApi.delete_ad_catalog_product"
  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 ProductCatalogsApi.delete_ad_catalog_product"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/products/{productId}'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s)).sub('{' + 'productId' + '}', CGI.escape(product_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'catalogAccountId'] = opts[:'catalog_account_id'] if !opts[:'catalog_account_id'].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] || 'DeleteAdCatalogProduct200Response'

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.delete_ad_catalog_product",
    :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: ProductCatalogsApi#delete_ad_catalog_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ad_catalog_with_http_info(catalog_id, account_id, opts = {}) ⇒ Array<(DeleteAdCatalog200Response, Integer, Hash)>

Delete a product catalog Deletes the catalog and every product in it on Meta. Ads and WhatsApp numbers that use it lose their catalog.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:

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

    DeleteAdCatalog200Response data, response status code and response headers



485
486
487
488
489
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
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 485

def delete_ad_catalog_with_http_info(catalog_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.delete_ad_catalog ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.delete_ad_catalog"
  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 ProductCatalogsApi.delete_ad_catalog"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'catalogAccountId'] = opts[:'catalog_account_id'] if !opts[:'catalog_account_id'].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] || 'DeleteAdCatalog200Response'

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.delete_ad_catalog",
    :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: ProductCatalogsApi#delete_ad_catalog\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ad_catalog(catalog_id, account_id, opts = {}) ⇒ CreateAdCatalog201Response

Get a product catalog

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



699
700
701
702
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 699

def get_ad_catalog(catalog_id, , opts = {})
  data, _status_code, _headers = get_ad_catalog_with_http_info(catalog_id, , opts)
  data
end

#get_ad_catalog_batch(catalog_id, handle, account_id, opts = {}) ⇒ GetAdCatalogBatch200Response

Get a bulk request's status

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • handle (String)

    Handle returned by the batch call

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



771
772
773
774
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 771

def get_ad_catalog_batch(catalog_id, handle, , opts = {})
  data, _status_code, _headers = get_ad_catalog_batch_with_http_info(catalog_id, handle, , opts)
  data
end

#get_ad_catalog_batch_with_http_info(catalog_id, handle, account_id, opts = {}) ⇒ Array<(GetAdCatalogBatch200Response, Integer, Hash)>

Get a bulk request's status

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • handle (String)

    Handle returned by the batch call

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 783

def get_ad_catalog_batch_with_http_info(catalog_id, handle, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.get_ad_catalog_batch ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.get_ad_catalog_batch"
  end
  # verify the required parameter 'handle' is set
  if @api_client.config.client_side_validation && handle.nil?
    fail ArgumentError, "Missing the required parameter 'handle' when calling ProductCatalogsApi.get_ad_catalog_batch"
  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 ProductCatalogsApi.get_ad_catalog_batch"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/batches/{handle}'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s)).sub('{' + 'handle' + '}', CGI.escape(handle.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'catalogAccountId'] = opts[:'catalog_account_id'] if !opts[:'catalog_account_id'].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] || 'GetAdCatalogBatch200Response'

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.get_ad_catalog_batch",
    :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: ProductCatalogsApi#get_ad_catalog_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ad_catalog_product(catalog_id, product_id, account_id, opts = {}) ⇒ CreateAdCatalogProduct201Response

Get a product

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • product_id (String)

    Meta product item ID (from the products list; not the retailer id)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



848
849
850
851
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 848

def get_ad_catalog_product(catalog_id, product_id, , opts = {})
  data, _status_code, _headers = get_ad_catalog_product_with_http_info(catalog_id, product_id, , opts)
  data
end

#get_ad_catalog_product_with_http_info(catalog_id, product_id, account_id, opts = {}) ⇒ Array<(CreateAdCatalogProduct201Response, Integer, Hash)>

Get a product

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • product_id (String)

    Meta product item ID (from the products list; not the retailer id)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 860

def get_ad_catalog_product_with_http_info(catalog_id, product_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.get_ad_catalog_product ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.get_ad_catalog_product"
  end
  # verify the required parameter 'product_id' is set
  if @api_client.config.client_side_validation && product_id.nil?
    fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductCatalogsApi.get_ad_catalog_product"
  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 ProductCatalogsApi.get_ad_catalog_product"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/products/{productId}'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s)).sub('{' + 'productId' + '}', CGI.escape(product_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'catalogAccountId'] = opts[:'catalog_account_id'] if !opts[:'catalog_account_id'].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] || 'CreateAdCatalogProduct201Response'

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.get_ad_catalog_product",
    :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: ProductCatalogsApi#get_ad_catalog_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ad_catalog_with_http_info(catalog_id, account_id, opts = {}) ⇒ Array<(CreateAdCatalog201Response, Integer, Hash)>

Get a product catalog

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:

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

    CreateAdCatalog201Response data, response status code and response headers



710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 710

def get_ad_catalog_with_http_info(catalog_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.get_ad_catalog ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.get_ad_catalog"
  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 ProductCatalogsApi.get_ad_catalog"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'catalogAccountId'] = opts[:'catalog_account_id'] if !opts[:'catalog_account_id'].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] || 'CreateAdCatalog201Response'

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.get_ad_catalog",
    :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: ProductCatalogsApi#get_ad_catalog\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ad_catalog_feed_uploads(catalog_id, feed_id, account_id, opts = {}) ⇒ ListAdCatalogFeedUploads200Response

List a feed's uploads

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • feed_id (String)
  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



925
926
927
928
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 925

def list_ad_catalog_feed_uploads(catalog_id, feed_id, , opts = {})
  data, _status_code, _headers = list_ad_catalog_feed_uploads_with_http_info(catalog_id, feed_id, , opts)
  data
end

#list_ad_catalog_feed_uploads_with_http_info(catalog_id, feed_id, account_id, opts = {}) ⇒ Array<(ListAdCatalogFeedUploads200Response, Integer, Hash)>

List a feed's uploads

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • feed_id (String)
  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 937

def list_ad_catalog_feed_uploads_with_http_info(catalog_id, feed_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.list_ad_catalog_feed_uploads ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.list_ad_catalog_feed_uploads"
  end
  # verify the required parameter 'feed_id' is set
  if @api_client.config.client_side_validation && feed_id.nil?
    fail ArgumentError, "Missing the required parameter 'feed_id' when calling ProductCatalogsApi.list_ad_catalog_feed_uploads"
  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 ProductCatalogsApi.list_ad_catalog_feed_uploads"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/feeds/{feedId}/uploads'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s)).sub('{' + 'feedId' + '}', CGI.escape(feed_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'catalogAccountId'] = opts[:'catalog_account_id'] if !opts[:'catalog_account_id'].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] || 'ListAdCatalogFeedUploads200Response'

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.list_ad_catalog_feed_uploads",
    :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: ProductCatalogsApi#list_ad_catalog_feed_uploads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ad_catalog_feeds(catalog_id, account_id, opts = {}) ⇒ ListAdCatalogFeeds200Response

List a catalog's product feeds

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



1001
1002
1003
1004
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 1001

def list_ad_catalog_feeds(catalog_id, , opts = {})
  data, _status_code, _headers = list_ad_catalog_feeds_with_http_info(catalog_id, , opts)
  data
end

#list_ad_catalog_feeds_with_http_info(catalog_id, account_id, opts = {}) ⇒ Array<(ListAdCatalogFeeds200Response, Integer, Hash)>

List a catalog's product feeds

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 1012

def list_ad_catalog_feeds_with_http_info(catalog_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.list_ad_catalog_feeds ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.list_ad_catalog_feeds"
  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 ProductCatalogsApi.list_ad_catalog_feeds"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/feeds'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'catalogAccountId'] = opts[:'catalog_account_id'] if !opts[:'catalog_account_id'].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] || 'ListAdCatalogFeeds200Response'

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.list_ad_catalog_feeds",
    :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: ProductCatalogsApi#list_ad_catalog_feeds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ad_catalog_product_sets(catalog_id, account_id, opts = {}) ⇒ ListAdCatalogProductSets200Response

List a catalog's product sets Lists a Meta product catalog's product sets, the unit a catalog ad promotes. Pass the chosen set id, not the parent catalog id, as promotedObject.productSetId on POST /v1/ads/create with goal: catalog_sales.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



1073
1074
1075
1076
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 1073

def list_ad_catalog_product_sets(catalog_id, , opts = {})
  data, _status_code, _headers = list_ad_catalog_product_sets_with_http_info(catalog_id, , opts)
  data
end

#list_ad_catalog_product_sets_with_http_info(catalog_id, account_id, opts = {}) ⇒ Array<(ListAdCatalogProductSets200Response, Integer, Hash)>

List a catalog's product sets Lists a Meta product catalog's product sets, the unit a catalog ad promotes. Pass the chosen set id, not the parent catalog id, as `promotedObject.productSetId` on POST /v1/ads/create with `goal: catalog_sales`.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

Returns:



1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 1085

def list_ad_catalog_product_sets_with_http_info(catalog_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.list_ad_catalog_product_sets ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.list_ad_catalog_product_sets"
  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 ProductCatalogsApi.list_ad_catalog_product_sets"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/product-sets'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'catalogAccountId'] = opts[:'catalog_account_id'] if !opts[:'catalog_account_id'].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] || 'ListAdCatalogProductSets200Response'

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.list_ad_catalog_product_sets",
    :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: ProductCatalogsApi#list_ad_catalog_product_sets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ad_catalog_products(catalog_id, account_id, opts = {}) ⇒ ListAdCatalogProducts200Response

List a catalog's products Pages through the catalog's products. Filter by your own retailerId to look one up. price and salePrice come back formatted by Meta (for example "€49.90").

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

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

    Cursor from the previous page's `nextCursor`

  • :retailer_id (String)

    Only the product with this retailer id (your SKU)

Returns:



1149
1150
1151
1152
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 1149

def list_ad_catalog_products(catalog_id, , opts = {})
  data, _status_code, _headers = list_ad_catalog_products_with_http_info(catalog_id, , opts)
  data
end

#list_ad_catalog_products_with_http_info(catalog_id, account_id, opts = {}) ⇒ Array<(ListAdCatalogProducts200Response, Integer, Hash)>

List a catalog's products Pages through the catalog's products. Filter by your own `retailerId` to look one up. `price` and `salePrice` come back formatted by Meta (for example &quot;€49.90&quot;).

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token performs the call instead of the account's own

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

    Cursor from the previous page's `nextCursor`

  • :retailer_id (String)

    Only the product with this retailer id (your SKU)

Returns:



1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 1164

def list_ad_catalog_products_with_http_info(catalog_id, , opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.list_ad_catalog_products ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.list_ad_catalog_products"
  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 ProductCatalogsApi.list_ad_catalog_products"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProductCatalogsApi.list_ad_catalog_products, 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 ProductCatalogsApi.list_ad_catalog_products, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/products'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'catalogAccountId'] = opts[:'catalog_account_id'] if !opts[:'catalog_account_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'retailerId'] = opts[:'retailer_id'] if !opts[:'retailer_id'].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] || 'ListAdCatalogProducts200Response'

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.list_ad_catalog_products",
    :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: ProductCatalogsApi#list_ad_catalog_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ad_catalogs(account_id, opts = {}) ⇒ ListAdCatalogs200Response

List Meta product catalogs Lists the Meta Commerce catalogs of a business portfolio (owned + agency-shared). The business comes from businessId, else the ad account's owner (adAccountId), else the WhatsApp Business Account's owner when accountId is a WhatsApp connection, else the only business the Meta login can see. Reads work with scopes customers already granted.

Parameters:

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token is used instead of the account's own (needed for WhatsApp connections, whose token cannot manage catalogs).

  • :ad_account_id (String)

    Meta ad account ID (act_...) whose owner business to list

  • :business_id (String)

    Meta business portfolio ID to list

Returns:



1237
1238
1239
1240
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 1237

def list_ad_catalogs(, opts = {})
  data, _status_code, _headers = list_ad_catalogs_with_http_info(, opts)
  data
end

#list_ad_catalogs_with_http_info(account_id, opts = {}) ⇒ Array<(ListAdCatalogs200Response, Integer, Hash)>

List Meta product catalogs Lists the Meta Commerce catalogs of a business portfolio (owned + agency-shared). The business comes from `businessId`, else the ad account's owner (`adAccountId`), else the WhatsApp Business Account's owner when `accountId` is a WhatsApp connection, else the only business the Meta login can see. Reads work with scopes customers already granted.

Parameters:

  • account_id (String)

    A facebook, instagram, metaads or whatsapp account ID

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

    the optional parameters

Options Hash (opts):

  • :catalog_account_id (String)

    A facebook, instagram or metaads account whose Meta login carries catalog_management; its token is used instead of the account's own (needed for WhatsApp connections, whose token cannot manage catalogs).

  • :ad_account_id (String)

    Meta ad account ID (act_...) whose owner business to list

  • :business_id (String)

    Meta business portfolio ID to list

Returns:

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

    ListAdCatalogs200Response data, response status code and response headers



1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 1250

def list_ad_catalogs_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.list_ad_catalogs ...'
  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 ProductCatalogsApi.list_ad_catalogs"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = 
  query_params[:'catalogAccountId'] = opts[:'catalog_account_id'] if !opts[:'catalog_account_id'].nil?
  query_params[:'adAccountId'] = opts[:'ad_account_id'] if !opts[:'ad_account_id'].nil?
  query_params[:'businessId'] = opts[:'business_id'] if !opts[:'business_id'].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] || 'ListAdCatalogs200Response'

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.list_ad_catalogs",
    :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: ProductCatalogsApi#list_ad_catalogs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ad_catalog_product(catalog_id, product_id, update_ad_catalog_product_request, opts = {}) ⇒ CreateAdCatalogProduct201Response

Update a product Partial update: only the fields sent change. retailerId cannot change.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • product_id (String)

    Meta product item ID (from the products list; not the retailer id)

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

    the optional parameters

Returns:



1309
1310
1311
1312
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 1309

def update_ad_catalog_product(catalog_id, product_id, update_ad_catalog_product_request, opts = {})
  data, _status_code, _headers = update_ad_catalog_product_with_http_info(catalog_id, product_id, update_ad_catalog_product_request, opts)
  data
end

#update_ad_catalog_product_set(catalog_id, product_set_id, update_ad_catalog_product_set_request, opts = {}) ⇒ CreateAdCatalogProductSet201Response

Update a product set

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • product_set_id (String)
  • update_ad_catalog_product_set_request (UpdateAdCatalogProductSetRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1388
1389
1390
1391
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 1388

def update_ad_catalog_product_set(catalog_id, product_set_id, update_ad_catalog_product_set_request, opts = {})
  data, _status_code, _headers = update_ad_catalog_product_set_with_http_info(catalog_id, product_set_id, update_ad_catalog_product_set_request, opts)
  data
end

#update_ad_catalog_product_set_with_http_info(catalog_id, product_set_id, update_ad_catalog_product_set_request, opts = {}) ⇒ Array<(CreateAdCatalogProductSet201Response, Integer, Hash)>

Update a product set

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • product_set_id (String)
  • update_ad_catalog_product_set_request (UpdateAdCatalogProductSetRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 1399

def update_ad_catalog_product_set_with_http_info(catalog_id, product_set_id, update_ad_catalog_product_set_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.update_ad_catalog_product_set ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.update_ad_catalog_product_set"
  end
  # verify the required parameter 'product_set_id' is set
  if @api_client.config.client_side_validation && product_set_id.nil?
    fail ArgumentError, "Missing the required parameter 'product_set_id' when calling ProductCatalogsApi.update_ad_catalog_product_set"
  end
  # verify the required parameter 'update_ad_catalog_product_set_request' is set
  if @api_client.config.client_side_validation && update_ad_catalog_product_set_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_ad_catalog_product_set_request' when calling ProductCatalogsApi.update_ad_catalog_product_set"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/product-sets/{productSetId}'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s)).sub('{' + 'productSetId' + '}', CGI.escape(product_set_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(update_ad_catalog_product_set_request)

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

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.update_ad_catalog_product_set",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogsApi#update_ad_catalog_product_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ad_catalog_product_with_http_info(catalog_id, product_id, update_ad_catalog_product_request, opts = {}) ⇒ Array<(CreateAdCatalogProduct201Response, Integer, Hash)>

Update a product Partial update: only the fields sent change. `retailerId` cannot change.

Parameters:

  • catalog_id (String)

    Meta product catalog ID (from GET /v1/ads/catalogs)

  • product_id (String)

    Meta product item ID (from the products list; not the retailer id)

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

    the optional parameters

Returns:



1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
# File 'lib/zernio-sdk/api/product_catalogs_api.rb', line 1321

def update_ad_catalog_product_with_http_info(catalog_id, product_id, update_ad_catalog_product_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogsApi.update_ad_catalog_product ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling ProductCatalogsApi.update_ad_catalog_product"
  end
  # verify the required parameter 'product_id' is set
  if @api_client.config.client_side_validation && product_id.nil?
    fail ArgumentError, "Missing the required parameter 'product_id' when calling ProductCatalogsApi.update_ad_catalog_product"
  end
  # verify the required parameter 'update_ad_catalog_product_request' is set
  if @api_client.config.client_side_validation && update_ad_catalog_product_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_ad_catalog_product_request' when calling ProductCatalogsApi.update_ad_catalog_product"
  end
  # resource path
  local_var_path = '/v1/ads/catalogs/{catalogId}/products/{productId}'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s)).sub('{' + 'productId' + '}', CGI.escape(product_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(update_ad_catalog_product_request)

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

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

  new_options = opts.merge(
    :operation => :"ProductCatalogsApi.update_ad_catalog_product",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogsApi#update_ad_catalog_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end