Class: PinterestSdkClient::CatalogSupplementalApi

Inherits:
Object
  • Object
show all
Defined in:
lib/pinterest_sdk/api/catalog_supplemental_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CatalogSupplementalApi

Returns a new instance of CatalogSupplementalApi.



19
20
21
# File 'lib/pinterest_sdk/api/catalog_supplemental_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/pinterest_sdk/api/catalog_supplemental_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#catalogs_local_inventory_items_batch_operate(catalog_id, local_inventory_items_batch_create, opts = {}) ⇒ SupplementalItemsBatchResponse

Operate on local inventory item batch Managing local inventory information in batches supporting CREATE, UPDATE, UPSERT, DELETE operations. Up to 1000 items per request to match catalogs/items. - Must provide both item_id and store_code to identify a local inventory item. - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

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

    the optional parameters

Options Hash (opts):

  • :ad_account_id (String)

    Unique identifier of an ad account.

Returns:



29
30
31
32
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 29

def catalogs_local_inventory_items_batch_operate(catalog_id, local_inventory_items_batch_create, opts = {})
  data, _status_code, _headers = catalogs_local_inventory_items_batch_operate_with_http_info(catalog_id, local_inventory_items_batch_create, opts)
  data
end

#catalogs_local_inventory_items_batch_operate_with_http_info(catalog_id, local_inventory_items_batch_create, opts = {}) ⇒ Array<(SupplementalItemsBatchResponse, Integer, Hash)>

Operate on local inventory item batch Managing local inventory information in batches supporting CREATE, UPDATE, UPSERT, DELETE operations. Up to 1000 items per request to match catalogs/items. - Must provide both item_id and store_code to identify a local inventory item. - By default, the &quot;operation user_account&quot; is the token user_account. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the &quot;operation user_account&quot;. In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

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

    the optional parameters

Options Hash (opts):

  • :ad_account_id (String)

    Unique identifier of an ad account.

Returns:



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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 41

def catalogs_local_inventory_items_batch_operate_with_http_info(catalog_id, local_inventory_items_batch_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CatalogSupplementalApi.catalogs_local_inventory_items_batch_operate ...'
  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 CatalogSupplementalApi.catalogs_local_inventory_items_batch_operate"
  end
  if @api_client.config.client_side_validation && catalog_id.to_s.length > 19
    fail ArgumentError, 'invalid value for "catalog_id" when calling CatalogSupplementalApi.catalogs_local_inventory_items_batch_operate, the character length must be smaller than or equal to 19.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && catalog_id !~ pattern
    fail ArgumentError, "invalid value for 'catalog_id' when calling CatalogSupplementalApi.catalogs_local_inventory_items_batch_operate, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'local_inventory_items_batch_create' is set
  if @api_client.config.client_side_validation && local_inventory_items_batch_create.nil?
    fail ArgumentError, "Missing the required parameter 'local_inventory_items_batch_create' when calling CatalogSupplementalApi.catalogs_local_inventory_items_batch_operate"
  end
  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'].to_s.length > 18
    fail ArgumentError, 'invalid value for "opts[:"ad_account_id"]" when calling CatalogSupplementalApi.catalogs_local_inventory_items_batch_operate, the character length must be smaller than or equal to 18.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"ad_account_id\"]' when calling CatalogSupplementalApi.catalogs_local_inventory_items_batch_operate, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/catalogs/{catalog_id}/local_inventory_items/batch'.sub('{catalog_id}', CGI.escape(catalog_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ad_account_id'] = opts[:'ad_account_id'] if !opts[:'ad_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']
  # 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(local_inventory_items_batch_create)

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

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

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

#catalogs_local_inventory_items_post(catalog_id, local_inventory_items_get_create, opts = {}) ⇒ LocalInventoryItemsGet

Get local inventory items (POST) Get local inventory items for a catalog owned by the "operation user_account". - Must provide an array of store_code pairs in item filters to identify local inventory items. - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

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

    the optional parameters

Options Hash (opts):

  • :ad_account_id (String)

    Unique identifier of an ad account.

Returns:



124
125
126
127
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 124

def catalogs_local_inventory_items_post(catalog_id, local_inventory_items_get_create, opts = {})
  data, _status_code, _headers = catalogs_local_inventory_items_post_with_http_info(catalog_id, local_inventory_items_get_create, opts)
  data
end

#catalogs_local_inventory_items_post_with_http_info(catalog_id, local_inventory_items_get_create, opts = {}) ⇒ Array<(LocalInventoryItemsGet, Integer, Hash)>

Get local inventory items (POST) Get local inventory items for a catalog owned by the &quot;operation user_account&quot;. - Must provide an array of store_code pairs in item filters to identify local inventory items. - By default, the &quot;operation user_account&quot; is the token user_account. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the &quot;operation user_account&quot;. In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

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

    the optional parameters

Options Hash (opts):

  • :ad_account_id (String)

    Unique identifier of an ad account.

Returns:

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

    LocalInventoryItemsGet data, response status code and response headers



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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
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
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 136

def catalogs_local_inventory_items_post_with_http_info(catalog_id, local_inventory_items_get_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CatalogSupplementalApi.catalogs_local_inventory_items_post ...'
  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 CatalogSupplementalApi.catalogs_local_inventory_items_post"
  end
  if @api_client.config.client_side_validation && catalog_id.to_s.length > 19
    fail ArgumentError, 'invalid value for "catalog_id" when calling CatalogSupplementalApi.catalogs_local_inventory_items_post, the character length must be smaller than or equal to 19.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && catalog_id !~ pattern
    fail ArgumentError, "invalid value for 'catalog_id' when calling CatalogSupplementalApi.catalogs_local_inventory_items_post, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'local_inventory_items_get_create' is set
  if @api_client.config.client_side_validation && local_inventory_items_get_create.nil?
    fail ArgumentError, "Missing the required parameter 'local_inventory_items_get_create' when calling CatalogSupplementalApi.catalogs_local_inventory_items_post"
  end
  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'].to_s.length > 18
    fail ArgumentError, 'invalid value for "opts[:"ad_account_id"]" when calling CatalogSupplementalApi.catalogs_local_inventory_items_post, the character length must be smaller than or equal to 18.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"ad_account_id\"]' when calling CatalogSupplementalApi.catalogs_local_inventory_items_post, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/catalogs/{catalog_id}/local_inventory_items/query'.sub('{catalog_id}', CGI.escape(catalog_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ad_account_id'] = opts[:'ad_account_id'] if !opts[:'ad_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']
  # 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(local_inventory_items_get_create)

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

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

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

#catalogs_local_stores_create(catalog_id, local_store_create, opts = {}) ⇒ Array<CatalogsLocalStoresCreate200ResponseInner>

Create local stores Create a local store for a catalog owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. - Supports optional filtering by store codes. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

  • local_store_create (Array<LocalStoreCreate>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ad_account_id (String)

    Unique identifier of an ad account.

Returns:



219
220
221
222
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 219

def catalogs_local_stores_create(catalog_id, local_store_create, opts = {})
  data, _status_code, _headers = catalogs_local_stores_create_with_http_info(catalog_id, local_store_create, opts)
  data
end

#catalogs_local_stores_create_with_http_info(catalog_id, local_store_create, opts = {}) ⇒ Array<(Array<CatalogsLocalStoresCreate200ResponseInner>, Integer, Hash)>

Create local stores Create a local store for a catalog owned by the &quot;operation user_account&quot;. - By default, the &quot;operation user_account&quot; is the token user_account. - Supports optional filtering by store codes. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the &quot;operation user_account&quot;. In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

  • local_store_create (Array<LocalStoreCreate>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ad_account_id (String)

    Unique identifier of an ad account.

Returns:



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
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
301
302
303
304
305
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 231

def catalogs_local_stores_create_with_http_info(catalog_id, local_store_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CatalogSupplementalApi.catalogs_local_stores_create ...'
  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 CatalogSupplementalApi.catalogs_local_stores_create"
  end
  if @api_client.config.client_side_validation && catalog_id.to_s.length > 19
    fail ArgumentError, 'invalid value for "catalog_id" when calling CatalogSupplementalApi.catalogs_local_stores_create, the character length must be smaller than or equal to 19.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && catalog_id !~ pattern
    fail ArgumentError, "invalid value for 'catalog_id' when calling CatalogSupplementalApi.catalogs_local_stores_create, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'local_store_create' is set
  if @api_client.config.client_side_validation && local_store_create.nil?
    fail ArgumentError, "Missing the required parameter 'local_store_create' when calling CatalogSupplementalApi.catalogs_local_stores_create"
  end
  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'].to_s.length > 18
    fail ArgumentError, 'invalid value for "opts[:"ad_account_id"]" when calling CatalogSupplementalApi.catalogs_local_stores_create, the character length must be smaller than or equal to 18.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"ad_account_id\"]' when calling CatalogSupplementalApi.catalogs_local_stores_create, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/catalogs/{catalog_id}/local_stores'.sub('{catalog_id}', CGI.escape(catalog_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ad_account_id'] = opts[:'ad_account_id'] if !opts[:'ad_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']
  # 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(local_store_create)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<CatalogsLocalStoresCreate200ResponseInner>'

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

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

#catalogs_local_stores_delete(catalog_id, ids, opts = {}) ⇒ Array<CatalogsLocalStoresDelete200ResponseInner>

Delete local stores Delete multiple local stores for a catalog owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. - Supports optional filtering by store codes. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

  • ids (Array<String>)

    List of local store IDs to filter by.

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

    the optional parameters

Options Hash (opts):

  • :ad_account_id (String)

    Unique identifier of an ad account.

Returns:



314
315
316
317
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 314

def catalogs_local_stores_delete(catalog_id, ids, opts = {})
  data, _status_code, _headers = catalogs_local_stores_delete_with_http_info(catalog_id, ids, opts)
  data
end

#catalogs_local_stores_delete_with_http_info(catalog_id, ids, opts = {}) ⇒ Array<(Array<CatalogsLocalStoresDelete200ResponseInner>, Integer, Hash)>

Delete local stores Delete multiple local stores for a catalog owned by the &quot;operation user_account&quot;. - By default, the &quot;operation user_account&quot; is the token user_account. - Supports optional filtering by store codes. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the &quot;operation user_account&quot;. In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

  • ids (Array<String>)

    List of local store IDs to filter by.

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

    the optional parameters

Options Hash (opts):

  • :ad_account_id (String)

    Unique identifier of an ad account.

Returns:



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
388
389
390
391
392
393
394
395
396
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 326

def catalogs_local_stores_delete_with_http_info(catalog_id, ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CatalogSupplementalApi.catalogs_local_stores_delete ...'
  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 CatalogSupplementalApi.catalogs_local_stores_delete"
  end
  if @api_client.config.client_side_validation && catalog_id.to_s.length > 19
    fail ArgumentError, 'invalid value for "catalog_id" when calling CatalogSupplementalApi.catalogs_local_stores_delete, the character length must be smaller than or equal to 19.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && catalog_id !~ pattern
    fail ArgumentError, "invalid value for 'catalog_id' when calling CatalogSupplementalApi.catalogs_local_stores_delete, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'ids' is set
  if @api_client.config.client_side_validation && ids.nil?
    fail ArgumentError, "Missing the required parameter 'ids' when calling CatalogSupplementalApi.catalogs_local_stores_delete"
  end
  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'].to_s.length > 18
    fail ArgumentError, 'invalid value for "opts[:"ad_account_id"]" when calling CatalogSupplementalApi.catalogs_local_stores_delete, the character length must be smaller than or equal to 18.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"ad_account_id\"]' when calling CatalogSupplementalApi.catalogs_local_stores_delete, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/catalogs/{catalog_id}/local_stores'.sub('{catalog_id}', CGI.escape(catalog_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = @api_client.build_collection_param(ids, :csv)
  query_params[:'ad_account_id'] = opts[:'ad_account_id'] if !opts[:'ad_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] || 'Array<CatalogsLocalStoresDelete200ResponseInner>'

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

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

#catalogs_local_stores_list(catalog_id, opts = {}) ⇒ CatalogsLocalStoresList200Response

List local stores Fetch local stores for a catalog owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. - Supports optional filtering by store codes. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

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

    the optional parameters

Options Hash (opts):

  • :ids (Array<String>)

    List of local store IDs to filter by.

  • :ad_account_id (String)

    Unique identifier of an ad account.

  • :bookmark (String)

    Cursor used to fetch the next page of items

  • :page_size (Integer)

    Maximum number of items to include in a single page. See documentation on Pagination for more information. (default to 25)

Returns:



407
408
409
410
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 407

def catalogs_local_stores_list(catalog_id, opts = {})
  data, _status_code, _headers = catalogs_local_stores_list_with_http_info(catalog_id, opts)
  data
end

#catalogs_local_stores_list_with_http_info(catalog_id, opts = {}) ⇒ Array<(CatalogsLocalStoresList200Response, Integer, Hash)>

List local stores Fetch local stores for a catalog owned by the &quot;operation user_account&quot;. - By default, the &quot;operation user_account&quot; is the token user_account. - Supports optional filtering by store codes. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the &quot;operation user_account&quot;. In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

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

    the optional parameters

Options Hash (opts):

  • :ids (Array<String>)

    List of local store IDs to filter by.

  • :ad_account_id (String)

    Unique identifier of an ad account.

  • :bookmark (String)

    Cursor used to fetch the next page of items

  • :page_size (Integer)

    Maximum number of items to include in a single page. See documentation on Pagination for more information. (default to 25)

Returns:



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
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 421

def catalogs_local_stores_list_with_http_info(catalog_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CatalogSupplementalApi.catalogs_local_stores_list ...'
  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 CatalogSupplementalApi.catalogs_local_stores_list"
  end
  if @api_client.config.client_side_validation && catalog_id.to_s.length > 19
    fail ArgumentError, 'invalid value for "catalog_id" when calling CatalogSupplementalApi.catalogs_local_stores_list, the character length must be smaller than or equal to 19.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && catalog_id !~ pattern
    fail ArgumentError, "invalid value for 'catalog_id' when calling CatalogSupplementalApi.catalogs_local_stores_list, must conform to the pattern #{pattern}."
  end

  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'].to_s.length > 18
    fail ArgumentError, 'invalid value for "opts[:"ad_account_id"]" when calling CatalogSupplementalApi.catalogs_local_stores_list, the character length must be smaller than or equal to 18.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"ad_account_id\"]' when calling CatalogSupplementalApi.catalogs_local_stores_list, must conform to the pattern #{pattern}."
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 250
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CatalogSupplementalApi.catalogs_local_stores_list, must be smaller than or equal to 250.'
  end

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

  # resource path
  local_var_path = '/catalogs/{catalog_id}/local_stores'.sub('{catalog_id}', CGI.escape(catalog_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
  query_params[:'ad_account_id'] = opts[:'ad_account_id'] if !opts[:'ad_account_id'].nil?
  query_params[:'bookmark'] = opts[:'bookmark'] if !opts[:'bookmark'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].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] || 'CatalogsLocalStoresList200Response'

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

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

#catalogs_local_stores_update(catalog_id, local_store_batch_update, opts = {}) ⇒ Array<CatalogsLocalStoresCreate200ResponseInner>

Update local stores Update a local store for a catalog owned by the "operation user_account". - By default, the "operation user_account" is the token user_account. - Supports optional filtering by store codes. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

  • local_store_batch_update (Array<LocalStoreBatchUpdate>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ad_account_id (String)

    Unique identifier of an ad account.

Returns:



506
507
508
509
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 506

def catalogs_local_stores_update(catalog_id, local_store_batch_update, opts = {})
  data, _status_code, _headers = catalogs_local_stores_update_with_http_info(catalog_id, local_store_batch_update, opts)
  data
end

#catalogs_local_stores_update_with_http_info(catalog_id, local_store_batch_update, opts = {}) ⇒ Array<(Array<CatalogsLocalStoresCreate200ResponseInner>, Integer, Hash)>

Update local stores Update a local store for a catalog owned by the &quot;operation user_account&quot;. - By default, the &quot;operation user_account&quot; is the token user_account. - Supports optional filtering by store codes. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the &quot;operation user_account&quot;. In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

  • local_store_batch_update (Array<LocalStoreBatchUpdate>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ad_account_id (String)

    Unique identifier of an ad account.

Returns:



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
546
547
548
549
550
551
552
553
554
555
556
557
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
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 518

def catalogs_local_stores_update_with_http_info(catalog_id, local_store_batch_update, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CatalogSupplementalApi.catalogs_local_stores_update ...'
  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 CatalogSupplementalApi.catalogs_local_stores_update"
  end
  if @api_client.config.client_side_validation && catalog_id.to_s.length > 19
    fail ArgumentError, 'invalid value for "catalog_id" when calling CatalogSupplementalApi.catalogs_local_stores_update, the character length must be smaller than or equal to 19.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && catalog_id !~ pattern
    fail ArgumentError, "invalid value for 'catalog_id' when calling CatalogSupplementalApi.catalogs_local_stores_update, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'local_store_batch_update' is set
  if @api_client.config.client_side_validation && local_store_batch_update.nil?
    fail ArgumentError, "Missing the required parameter 'local_store_batch_update' when calling CatalogSupplementalApi.catalogs_local_stores_update"
  end
  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'].to_s.length > 18
    fail ArgumentError, 'invalid value for "opts[:"ad_account_id"]" when calling CatalogSupplementalApi.catalogs_local_stores_update, the character length must be smaller than or equal to 18.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"ad_account_id\"]' when calling CatalogSupplementalApi.catalogs_local_stores_update, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/catalogs/{catalog_id}/local_stores'.sub('{catalog_id}', CGI.escape(catalog_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ad_account_id'] = opts[:'ad_account_id'] if !opts[:'ad_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']
  # 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(local_store_batch_update)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<CatalogsLocalStoresCreate200ResponseInner>'

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

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

#catalogs_supplemental_items_batch_get(catalog_id, batch_id, opts = {}) ⇒ SupplementalItemsBatchResponse

Get supplemental items batch status Fetch the status and results of a supplemental items batch operation. - By default, the "operation user_account" is the token user_account. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the "operation user_account". In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

  • batch_id (String)

    Unique identifier of an items batch operation.

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

    the optional parameters

Options Hash (opts):

  • :ad_account_id (String)

    Unique identifier of an ad account.

Returns:



601
602
603
604
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 601

def catalogs_supplemental_items_batch_get(catalog_id, batch_id, opts = {})
  data, _status_code, _headers = catalogs_supplemental_items_batch_get_with_http_info(catalog_id, batch_id, opts)
  data
end

#catalogs_supplemental_items_batch_get_with_http_info(catalog_id, batch_id, opts = {}) ⇒ Array<(SupplementalItemsBatchResponse, Integer, Hash)>

Get supplemental items batch status Fetch the status and results of a supplemental items batch operation. - By default, the &quot;operation user_account&quot; is the token user_account. Optional: Business Access: Specify an ad_account_id (obtained via List ad accounts) to use the owner of that ad_account as the &quot;operation user_account&quot;. In order to do this, the token user_account must have one of the following Business Access roles on the ad_account: Owner, Admin, Catalogs Manager. Learn more

Parameters:

  • catalog_id (String)

    Unique identifier of a catalog.

  • batch_id (String)

    Unique identifier of an items batch operation.

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

    the optional parameters

Options Hash (opts):

  • :ad_account_id (String)

    Unique identifier of an ad account.

Returns:



613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
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
# File 'lib/pinterest_sdk/api/catalog_supplemental_api.rb', line 613

def catalogs_supplemental_items_batch_get_with_http_info(catalog_id, batch_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CatalogSupplementalApi.catalogs_supplemental_items_batch_get ...'
  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 CatalogSupplementalApi.catalogs_supplemental_items_batch_get"
  end
  if @api_client.config.client_side_validation && catalog_id.to_s.length > 19
    fail ArgumentError, 'invalid value for "catalog_id" when calling CatalogSupplementalApi.catalogs_supplemental_items_batch_get, the character length must be smaller than or equal to 19.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && catalog_id !~ pattern
    fail ArgumentError, "invalid value for 'catalog_id' when calling CatalogSupplementalApi.catalogs_supplemental_items_batch_get, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'batch_id' is set
  if @api_client.config.client_side_validation && batch_id.nil?
    fail ArgumentError, "Missing the required parameter 'batch_id' when calling CatalogSupplementalApi.catalogs_supplemental_items_batch_get"
  end
  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && batch_id !~ pattern
    fail ArgumentError, "invalid value for 'batch_id' when calling CatalogSupplementalApi.catalogs_supplemental_items_batch_get, must conform to the pattern #{pattern}."
  end

  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'].to_s.length > 18
    fail ArgumentError, 'invalid value for "opts[:"ad_account_id"]" when calling CatalogSupplementalApi.catalogs_supplemental_items_batch_get, the character length must be smaller than or equal to 18.'
  end

  pattern = Regexp.new(/^\d+$/)
  if @api_client.config.client_side_validation && !opts[:'ad_account_id'].nil? && opts[:'ad_account_id'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"ad_account_id\"]' when calling CatalogSupplementalApi.catalogs_supplemental_items_batch_get, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/catalogs/{catalog_id}/supplemental_items/batch/{batch_id}'.sub('{catalog_id}', CGI.escape(catalog_id.to_s)).sub('{batch_id}', CGI.escape(batch_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ad_account_id'] = opts[:'ad_account_id'] if !opts[:'ad_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] || 'SupplementalItemsBatchResponse'

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

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