Class: PinterestSdkClient::BusinessAccessAssetsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BusinessAccessAssetsApi

Returns a new instance of BusinessAccessAssetsApi.



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

def api_client
  @api_client
end

Instance Method Details

#asset_group_create(business_id, asset_group_input_create, opts = {}) ⇒ AssetGroupInput

Create a new asset group. Create a new asset group with the specified parameters. - An asset group is a custom group of assets based on how you would like to manage your accounts.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 28

def asset_group_create(business_id, asset_group_input_create, opts = {})
  data, _status_code, _headers = asset_group_create_with_http_info(business_id, asset_group_input_create, opts)
  data
end

#asset_group_create_with_http_info(business_id, asset_group_input_create, opts = {}) ⇒ Array<(AssetGroupInput, Integer, Hash)>

Create a new asset group. Create a new asset group with the specified parameters. - An asset group is a custom group of assets based on how you would like to manage your accounts.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:

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

    AssetGroupInput data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 39

def asset_group_create_with_http_info(business_id, asset_group_input_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessAccessAssetsApi.asset_group_create ...'
  end
  # verify the required parameter 'business_id' is set
  if @api_client.config.client_side_validation && business_id.nil?
    fail ArgumentError, "Missing the required parameter 'business_id' when calling BusinessAccessAssetsApi.asset_group_create"
  end
  if @api_client.config.client_side_validation && business_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.asset_group_create, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && business_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.asset_group_create, the character length must be greater than or equal to 1.'
  end

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

  # verify the required parameter 'asset_group_input_create' is set
  if @api_client.config.client_side_validation && asset_group_input_create.nil?
    fail ArgumentError, "Missing the required parameter 'asset_group_input_create' when calling BusinessAccessAssetsApi.asset_group_create"
  end
  # resource path
  local_var_path = '/businesses/{business_id}/asset_groups'.sub('{business_id}', CGI.escape(business_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(asset_group_input_create)

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

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

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

#asset_group_delete(business_id, asset_group_deletion_delete, opts = {}) ⇒ AssetGroupDeletion

Delete asset groups. Delete a batch of asset groups.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:



115
116
117
118
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 115

def asset_group_delete(business_id, asset_group_deletion_delete, opts = {})
  data, _status_code, _headers = asset_group_delete_with_http_info(business_id, asset_group_deletion_delete, opts)
  data
end

#asset_group_delete_with_http_info(business_id, asset_group_deletion_delete, opts = {}) ⇒ Array<(AssetGroupDeletion, Integer, Hash)>

Delete asset groups. Delete a batch of asset groups.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:

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

    AssetGroupDeletion data, response status code and response headers



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
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
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 126

def asset_group_delete_with_http_info(business_id, asset_group_deletion_delete, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessAccessAssetsApi.asset_group_delete ...'
  end
  # verify the required parameter 'business_id' is set
  if @api_client.config.client_side_validation && business_id.nil?
    fail ArgumentError, "Missing the required parameter 'business_id' when calling BusinessAccessAssetsApi.asset_group_delete"
  end
  if @api_client.config.client_side_validation && business_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.asset_group_delete, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && business_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.asset_group_delete, the character length must be greater than or equal to 1.'
  end

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

  # verify the required parameter 'asset_group_deletion_delete' is set
  if @api_client.config.client_side_validation && asset_group_deletion_delete.nil?
    fail ArgumentError, "Missing the required parameter 'asset_group_deletion_delete' when calling BusinessAccessAssetsApi.asset_group_delete"
  end
  # resource path
  local_var_path = '/businesses/{business_id}/asset_groups'.sub('{business_id}', CGI.escape(business_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(asset_group_deletion_delete)

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

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

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

#asset_group_update(business_id, asset_group_modification_read_or_update, opts = {}) ⇒ AssetGroupModification

Update asset groups. Update a batch of asset groups with the specified parameters.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:



202
203
204
205
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 202

def asset_group_update(business_id, asset_group_modification_read_or_update, opts = {})
  data, _status_code, _headers = asset_group_update_with_http_info(business_id, asset_group_modification_read_or_update, opts)
  data
end

#asset_group_update_with_http_info(business_id, asset_group_modification_read_or_update, opts = {}) ⇒ Array<(AssetGroupModification, Integer, Hash)>

Update asset groups. Update a batch of asset groups with the specified parameters.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:

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

    AssetGroupModification data, response status code and response headers



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
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
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 213

def asset_group_update_with_http_info(business_id, asset_group_modification_read_or_update, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessAccessAssetsApi.asset_group_update ...'
  end
  # verify the required parameter 'business_id' is set
  if @api_client.config.client_side_validation && business_id.nil?
    fail ArgumentError, "Missing the required parameter 'business_id' when calling BusinessAccessAssetsApi.asset_group_update"
  end
  if @api_client.config.client_side_validation && business_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.asset_group_update, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && business_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.asset_group_update, the character length must be greater than or equal to 1.'
  end

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

  # verify the required parameter 'asset_group_modification_read_or_update' is set
  if @api_client.config.client_side_validation && asset_group_modification_read_or_update.nil?
    fail ArgumentError, "Missing the required parameter 'asset_group_modification_read_or_update' when calling BusinessAccessAssetsApi.asset_group_update"
  end
  # resource path
  local_var_path = '/businesses/{business_id}/asset_groups'.sub('{business_id}', CGI.escape(business_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(asset_group_modification_read_or_update)

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

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

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

#business_asset_members_get(business_id, asset_id, opts = {}) ⇒ BusinessAssetMembersGet200Response

Get members with access to asset Get all the members the requesting business has granted access to on the given asset.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

  • asset_id (String)

    Unique identifier of a business asset.

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

    the optional parameters

Options Hash (opts):

  • :start_index (Integer)

    An index to start fetching the results from. Only the results starting from this index will be returned. (default to 0)

  • :fetch_system_users (Boolean)

    Fetches system users if True. Fetches regular user employees if False. (default to false)

  • :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:



293
294
295
296
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 293

def business_asset_members_get(business_id, asset_id, opts = {})
  data, _status_code, _headers = business_asset_members_get_with_http_info(business_id, asset_id, opts)
  data
end

#business_asset_members_get_with_http_info(business_id, asset_id, opts = {}) ⇒ Array<(BusinessAssetMembersGet200Response, Integer, Hash)>

Get members with access to asset Get all the members the requesting business has granted access to on the given asset.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

  • asset_id (String)

    Unique identifier of a business asset.

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

    the optional parameters

Options Hash (opts):

  • :start_index (Integer)

    An index to start fetching the results from. Only the results starting from this index will be returned. (default to 0)

  • :fetch_system_users (Boolean)

    Fetches system users if True. Fetches regular user employees if False. (default to false)

  • :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:



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 308

def business_asset_members_get_with_http_info(business_id, asset_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessAccessAssetsApi.business_asset_members_get ...'
  end
  # verify the required parameter 'business_id' is set
  if @api_client.config.client_side_validation && business_id.nil?
    fail ArgumentError, "Missing the required parameter 'business_id' when calling BusinessAccessAssetsApi.business_asset_members_get"
  end
  if @api_client.config.client_side_validation && business_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_asset_members_get, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && business_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_asset_members_get, the character length must be greater than or equal to 1.'
  end

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

  # verify the required parameter 'asset_id' is set
  if @api_client.config.client_side_validation && asset_id.nil?
    fail ArgumentError, "Missing the required parameter 'asset_id' when calling BusinessAccessAssetsApi.business_asset_members_get"
  end
  if @api_client.config.client_side_validation && asset_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "asset_id" when calling BusinessAccessAssetsApi.business_asset_members_get, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && asset_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "asset_id" when calling BusinessAccessAssetsApi.business_asset_members_get, the character length must be greater than or equal to 1.'
  end

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

  if @api_client.config.client_side_validation && !opts[:'start_index'].nil? && opts[:'start_index'] < 0
    fail ArgumentError, 'invalid value for "opts[:"start_index"]" when calling BusinessAccessAssetsApi.business_asset_members_get, must be greater than or equal to 0.'
  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 BusinessAccessAssetsApi.business_asset_members_get, 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 BusinessAccessAssetsApi.business_asset_members_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/businesses/{business_id}/assets/{asset_id}/members'.sub('{business_id}', CGI.escape(business_id.to_s)).sub('{asset_id}', CGI.escape(asset_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].nil?
  query_params[:'fetch_system_users'] = opts[:'fetch_system_users'] if !opts[:'fetch_system_users'].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] || 'BusinessAssetMembersGet200Response'

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

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

#business_asset_partners_get(business_id, asset_id, opts = {}) ⇒ BusinessAssetMembersGet200Response

Get partners with access to asset Get all the partners the requesting business has granted access to on the given asset. Note: If the asset has been shared with you, an empty array will be returned. This is because an asset shared with you cannot be shared with a different partner.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

  • asset_id (String)

    Unique identifier of a business asset.

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

    the optional parameters

Options Hash (opts):

  • :start_index (Integer)

    An index to start fetching the results from. Only the results starting from this index will be returned. (default to 0)

  • :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:



411
412
413
414
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 411

def business_asset_partners_get(business_id, asset_id, opts = {})
  data, _status_code, _headers = business_asset_partners_get_with_http_info(business_id, asset_id, opts)
  data
end

#business_asset_partners_get_with_http_info(business_id, asset_id, opts = {}) ⇒ Array<(BusinessAssetMembersGet200Response, Integer, Hash)>

Get partners with access to asset Get all the partners the requesting business has granted access to on the given asset. Note: If the asset has been shared with you, an empty array will be returned. This is because an asset shared with you cannot be shared with a different partner.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

  • asset_id (String)

    Unique identifier of a business asset.

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

    the optional parameters

Options Hash (opts):

  • :start_index (Integer)

    An index to start fetching the results from. Only the results starting from this index will be returned. (default to 0)

  • :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:



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
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 425

def business_asset_partners_get_with_http_info(business_id, asset_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessAccessAssetsApi.business_asset_partners_get ...'
  end
  # verify the required parameter 'business_id' is set
  if @api_client.config.client_side_validation && business_id.nil?
    fail ArgumentError, "Missing the required parameter 'business_id' when calling BusinessAccessAssetsApi.business_asset_partners_get"
  end
  if @api_client.config.client_side_validation && business_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_asset_partners_get, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && business_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_asset_partners_get, the character length must be greater than or equal to 1.'
  end

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

  # verify the required parameter 'asset_id' is set
  if @api_client.config.client_side_validation && asset_id.nil?
    fail ArgumentError, "Missing the required parameter 'asset_id' when calling BusinessAccessAssetsApi.business_asset_partners_get"
  end
  if @api_client.config.client_side_validation && asset_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "asset_id" when calling BusinessAccessAssetsApi.business_asset_partners_get, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && asset_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "asset_id" when calling BusinessAccessAssetsApi.business_asset_partners_get, the character length must be greater than or equal to 1.'
  end

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

  if @api_client.config.client_side_validation && !opts[:'start_index'].nil? && opts[:'start_index'] < 0
    fail ArgumentError, 'invalid value for "opts[:"start_index"]" when calling BusinessAccessAssetsApi.business_asset_partners_get, must be greater than or equal to 0.'
  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 BusinessAccessAssetsApi.business_asset_partners_get, 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 BusinessAccessAssetsApi.business_asset_partners_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/businesses/{business_id}/assets/{asset_id}/partners'.sub('{business_id}', CGI.escape(business_id.to_s)).sub('{asset_id}', CGI.escape(asset_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].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] || 'BusinessAssetMembersGet200Response'

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

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

#business_assets_get(business_id, opts = {}) ⇒ BusinessAssetsGet200Response

List business assets Get all the assets the requesting business has access to. This includes assets the business owns and assets the business has access to through partnerships.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Options Hash (opts):

  • :permissions (Array<PermissionsWithOwner>)

    A list of asset permissions used to filter the assets. Only assets where the requesting business has at least one of the specified permissions will be returned.

  • :child_asset_id (String)

    A child asset unique identifier. Used to fetch asset groups that contain the asset id as a child.

  • :asset_group_id (String)

    An asset group unique identifier. Used to fetch assets contained within the specified asset group.

  • :asset_type (String)

    A resource type to filter the assets by. Only assets of the specified type will be returned. (default to 'AD_ACCOUNT')

  • :start_index (Integer)

    An index to start fetching the results from. Only the results starting from this index will be returned. (default to 0)

  • :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:



530
531
532
533
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 530

def business_assets_get(business_id, opts = {})
  data, _status_code, _headers = business_assets_get_with_http_info(business_id, opts)
  data
end

#business_assets_get_with_http_info(business_id, opts = {}) ⇒ Array<(BusinessAssetsGet200Response, Integer, Hash)>

List business assets Get all the assets the requesting business has access to. This includes assets the business owns and assets the business has access to through partnerships.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Options Hash (opts):

  • :permissions (Array<PermissionsWithOwner>)

    A list of asset permissions used to filter the assets. Only assets where the requesting business has at least one of the specified permissions will be returned.

  • :child_asset_id (String)

    A child asset unique identifier. Used to fetch asset groups that contain the asset id as a child.

  • :asset_group_id (String)

    An asset group unique identifier. Used to fetch assets contained within the specified asset group.

  • :asset_type (String)

    A resource type to filter the assets by. Only assets of the specified type will be returned. (default to 'AD_ACCOUNT')

  • :start_index (Integer)

    An index to start fetching the results from. Only the results starting from this index will be returned. (default to 0)

  • :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:



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
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
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
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 547

def business_assets_get_with_http_info(business_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessAccessAssetsApi.business_assets_get ...'
  end
  # verify the required parameter 'business_id' is set
  if @api_client.config.client_side_validation && business_id.nil?
    fail ArgumentError, "Missing the required parameter 'business_id' when calling BusinessAccessAssetsApi.business_assets_get"
  end
  if @api_client.config.client_side_validation && business_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_assets_get, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && business_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_assets_get, the character length must be greater than or equal to 1.'
  end

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

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

  if @api_client.config.client_side_validation && !opts[:'child_asset_id'].nil? && opts[:'child_asset_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"child_asset_id"]" when calling BusinessAccessAssetsApi.business_assets_get, the character length must be greater than or equal to 1.'
  end

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

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

  if @api_client.config.client_side_validation && !opts[:'asset_group_id'].nil? && opts[:'asset_group_id'].to_s.length < 1
    fail ArgumentError, 'invalid value for "opts[:"asset_group_id"]" when calling BusinessAccessAssetsApi.business_assets_get, the character length must be greater than or equal to 1.'
  end

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

  allowable_values = ["AD_ACCOUNT", "PROFILE", "ASSET_GROUP", "CATALOG", "CONSUMER"]
  if @api_client.config.client_side_validation && opts[:'asset_type'] && !allowable_values.include?(opts[:'asset_type'])
    fail ArgumentError, "invalid value for \"asset_type\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'start_index'].nil? && opts[:'start_index'] < 0
    fail ArgumentError, 'invalid value for "opts[:"start_index"]" when calling BusinessAccessAssetsApi.business_assets_get, must be greater than or equal to 0.'
  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 BusinessAccessAssetsApi.business_assets_get, 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 BusinessAccessAssetsApi.business_assets_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/businesses/{business_id}/assets'.sub('{business_id}', CGI.escape(business_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'permissions'] = @api_client.build_collection_param(opts[:'permissions'], :multi) if !opts[:'permissions'].nil?
  query_params[:'child_asset_id'] = opts[:'child_asset_id'] if !opts[:'child_asset_id'].nil?
  query_params[:'asset_group_id'] = opts[:'asset_group_id'] if !opts[:'asset_group_id'].nil?
  query_params[:'asset_type'] = opts[:'asset_type'] if !opts[:'asset_type'].nil?
  query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].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] || 'BusinessAssetsGet200Response'

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

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

#business_member_assets_get(business_id, member_id, opts = {}) ⇒ BusinessMemberAssetsGetResponse

Get assets assigned to a member Get assets on which you assigned asset permissions to the given member. Can be used to: - get all assets, regardless of asset type or - get assets of one asset type by using the asset_type query. The return response will include the permissions the member has to that asset and the asset type.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

  • member_id (String)

    The member id to fetch assets for.

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

    the optional parameters

Options Hash (opts):

  • :asset_type (String)

    A resource type to filter the assets by. Only assets of the specified type will be returned. (default to 'AD_ACCOUNT')

  • :start_index (Integer)

    An index to start fetching the results from. Only the results starting from this index will be returned. (default to 0)

  • :sort_by (AssetSortBy)

    The field to sort member assets by

  • :sort_ascending (Boolean)

    Sort assets in ascending order (default to true)

  • :search_by (AssetSearchBy)

    The field to search member assets by

  • :search_value (String)

    The value to search for

  • :asset_permission_type (AssetPermissionType)

    The type of asset permission to filter by

  • :ad_account_statuses (Array<NonDraftEntityStatus>)

    A list of ad account statuses to filter the assets by. Only used when asset_type is 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:



673
674
675
676
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 673

def business_member_assets_get(business_id, member_id, opts = {})
  data, _status_code, _headers = business_member_assets_get_with_http_info(business_id, member_id, opts)
  data
end

#business_member_assets_get_with_http_info(business_id, member_id, opts = {}) ⇒ Array<(BusinessMemberAssetsGetResponse, Integer, Hash)>

Get assets assigned to a member Get assets on which you assigned asset permissions to the given member. Can be used to: - get all assets, regardless of asset type or - get assets of one asset type by using the asset_type query. The return response will include the permissions the member has to that asset and the asset type.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

  • member_id (String)

    The member id to fetch assets for.

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

    the optional parameters

Options Hash (opts):

  • :asset_type (String)

    A resource type to filter the assets by. Only assets of the specified type will be returned. (default to 'AD_ACCOUNT')

  • :start_index (Integer)

    An index to start fetching the results from. Only the results starting from this index will be returned. (default to 0)

  • :sort_by (AssetSortBy)

    The field to sort member assets by

  • :sort_ascending (Boolean)

    Sort assets in ascending order (default to true)

  • :search_by (AssetSearchBy)

    The field to search member assets by

  • :search_value (String)

    The value to search for

  • :asset_permission_type (AssetPermissionType)

    The type of asset permission to filter by

  • :ad_account_statuses (Array<NonDraftEntityStatus>)

    A list of ad account statuses to filter the assets by. Only used when asset_type is 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:



694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
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
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 694

def business_member_assets_get_with_http_info(business_id, member_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessAccessAssetsApi.business_member_assets_get ...'
  end
  # verify the required parameter 'business_id' is set
  if @api_client.config.client_side_validation && business_id.nil?
    fail ArgumentError, "Missing the required parameter 'business_id' when calling BusinessAccessAssetsApi.business_member_assets_get"
  end
  if @api_client.config.client_side_validation && business_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_member_assets_get, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && business_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_member_assets_get, the character length must be greater than or equal to 1.'
  end

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

  # verify the required parameter 'member_id' is set
  if @api_client.config.client_side_validation && member_id.nil?
    fail ArgumentError, "Missing the required parameter 'member_id' when calling BusinessAccessAssetsApi.business_member_assets_get"
  end
  if @api_client.config.client_side_validation && member_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "member_id" when calling BusinessAccessAssetsApi.business_member_assets_get, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && member_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "member_id" when calling BusinessAccessAssetsApi.business_member_assets_get, the character length must be greater than or equal to 1.'
  end

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

  allowable_values = ["AD_ACCOUNT", "PROFILE", "ASSET_GROUP", "CATALOG", "CONSUMER", "CONVERSION_TAG"]
  if @api_client.config.client_side_validation && opts[:'asset_type'] && !allowable_values.include?(opts[:'asset_type'])
    fail ArgumentError, "invalid value for \"asset_type\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'start_index'].nil? && opts[:'start_index'] < 0
    fail ArgumentError, 'invalid value for "opts[:"start_index"]" when calling BusinessAccessAssetsApi.business_member_assets_get, must be greater than or equal to 0.'
  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 BusinessAccessAssetsApi.business_member_assets_get, 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 BusinessAccessAssetsApi.business_member_assets_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/businesses/{business_id}/members/{member_id}/assets'.sub('{business_id}', CGI.escape(business_id.to_s)).sub('{member_id}', CGI.escape(member_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'asset_type'] = opts[:'asset_type'] if !opts[:'asset_type'].nil?
  query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].nil?
  query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
  query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?
  query_params[:'search_by'] = opts[:'search_by'] if !opts[:'search_by'].nil?
  query_params[:'search_value'] = opts[:'search_value'] if !opts[:'search_value'].nil?
  query_params[:'asset_permission_type'] = opts[:'asset_permission_type'] if !opts[:'asset_permission_type'].nil?
  query_params[:'ad_account_statuses'] = @api_client.build_collection_param(opts[:'ad_account_statuses'], :multi) if !opts[:'ad_account_statuses'].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] || 'BusinessMemberAssetsGetResponse'

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

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

#business_members_asset_access_delete(business_id, business_members_asset_access_delete_body, opts = {}) ⇒ DeleteMemberAccessResultsResponseArray

Delete member access to asset Terminate multiple members' access to an asset.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:



804
805
806
807
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 804

def business_members_asset_access_delete(business_id, business_members_asset_access_delete_body, opts = {})
  data, _status_code, _headers = business_members_asset_access_delete_with_http_info(business_id, business_members_asset_access_delete_body, opts)
  data
end

#business_members_asset_access_delete_with_http_info(business_id, business_members_asset_access_delete_body, opts = {}) ⇒ Array<(DeleteMemberAccessResultsResponseArray, Integer, Hash)>

Delete member access to asset Terminate multiple members' access to an asset.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:



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
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 815

def business_members_asset_access_delete_with_http_info(business_id, business_members_asset_access_delete_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessAccessAssetsApi.business_members_asset_access_delete ...'
  end
  # verify the required parameter 'business_id' is set
  if @api_client.config.client_side_validation && business_id.nil?
    fail ArgumentError, "Missing the required parameter 'business_id' when calling BusinessAccessAssetsApi.business_members_asset_access_delete"
  end
  if @api_client.config.client_side_validation && business_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_members_asset_access_delete, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && business_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_members_asset_access_delete, the character length must be greater than or equal to 1.'
  end

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

  # verify the required parameter 'business_members_asset_access_delete_body' is set
  if @api_client.config.client_side_validation && business_members_asset_access_delete_body.nil?
    fail ArgumentError, "Missing the required parameter 'business_members_asset_access_delete_body' when calling BusinessAccessAssetsApi.business_members_asset_access_delete"
  end
  # resource path
  local_var_path = '/businesses/{business_id}/members/assets/access'.sub('{business_id}', CGI.escape(business_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(business_members_asset_access_delete_body)

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

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

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

#business_members_asset_access_update(business_id, update_member_asset_access_body, opts = {}) ⇒ UpdateMemberAssetsResultsResponseArray

Assign/Update member asset permissions Grant multiple members access to assets and/or update multiple member's exisiting permissions to an asset. Note: Not all listed permissions are applicable to each asset type. For example, PROFILE_PUBLISHER would not be applicable to an asset of type AD_ACCOUNT. The permission level PROFILE_PUBLISHER is only available to an asset of the type PROFILE.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:



891
892
893
894
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 891

def business_members_asset_access_update(business_id, update_member_asset_access_body, opts = {})
  data, _status_code, _headers = business_members_asset_access_update_with_http_info(business_id, update_member_asset_access_body, opts)
  data
end

#business_members_asset_access_update_with_http_info(business_id, update_member_asset_access_body, opts = {}) ⇒ Array<(UpdateMemberAssetsResultsResponseArray, Integer, Hash)>

Assign/Update member asset permissions Grant multiple members access to assets and/or update multiple member's exisiting permissions to an asset. Note: Not all listed permissions are applicable to each asset type. For example, PROFILE_PUBLISHER would not be applicable to an asset of type AD_ACCOUNT. The permission level PROFILE_PUBLISHER is only available to an asset of the type PROFILE.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:



902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
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
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 902

def business_members_asset_access_update_with_http_info(business_id, update_member_asset_access_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessAccessAssetsApi.business_members_asset_access_update ...'
  end
  # verify the required parameter 'business_id' is set
  if @api_client.config.client_side_validation && business_id.nil?
    fail ArgumentError, "Missing the required parameter 'business_id' when calling BusinessAccessAssetsApi.business_members_asset_access_update"
  end
  if @api_client.config.client_side_validation && business_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_members_asset_access_update, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && business_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_members_asset_access_update, the character length must be greater than or equal to 1.'
  end

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

  # verify the required parameter 'update_member_asset_access_body' is set
  if @api_client.config.client_side_validation && update_member_asset_access_body.nil?
    fail ArgumentError, "Missing the required parameter 'update_member_asset_access_body' when calling BusinessAccessAssetsApi.business_members_asset_access_update"
  end
  # resource path
  local_var_path = '/businesses/{business_id}/members/assets/access'.sub('{business_id}', CGI.escape(business_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_member_asset_access_body)

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

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

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

#business_partner_asset_access_get(business_id, partner_id, opts = {}) ⇒ BusinessPartnerAssetAccessGet200Response

Get assets assigned to a partner or assets assigned by a partner Can be used to get the business assets your partner has granted you access to or the business assets you have granted your partner access to. If you specify: - partner_type=INTERNAL, you will retrieve your business assets that the partner has access to. - partner_type=EXTERNAL, you will retrieve the partner's business assets that the partner has granted you access to.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

  • partner_id (String)

    The partner id to be bound to the Business

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

    the optional parameters

Options Hash (opts):

  • :partner_type (String)

    Specifies whether to fetch internal or external (shared) partners. If partner_type=INTERNAL, the asset being queried is for accesses the partner has to your business assets. If partner_type=EXTERNAL, the asset being queried is for the accesses you have to the partner's business asset. (default to 'INTERNAL')

  • :asset_type (String)

    A resource type to filter the assets by. Only assets of the specified type will be returned. (default to 'AD_ACCOUNT')

  • :start_index (Integer)

    An index to start fetching the results from. Only the results starting from this index will be returned. (default to 0)

  • :sort_by (AssetSortBy)

    The field to sort member assets by

  • :sort_ascending (Boolean)

    Sort assets in ascending order (default to true)

  • :search_by (AssetSearchBy)

    The field to search member assets by

  • :search_value (String)

    The value to search for

  • :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:



987
988
989
990
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 987

def business_partner_asset_access_get(business_id, partner_id, opts = {})
  data, _status_code, _headers = business_partner_asset_access_get_with_http_info(business_id, partner_id, opts)
  data
end

#business_partner_asset_access_get_with_http_info(business_id, partner_id, opts = {}) ⇒ Array<(BusinessPartnerAssetAccessGet200Response, Integer, Hash)>

Get assets assigned to a partner or assets assigned by a partner Can be used to get the business assets your partner has granted you access to or the business assets you have granted your partner access to. If you specify: - partner_type=INTERNAL, you will retrieve your business assets that the partner has access to. - partner_type=EXTERNAL, you will retrieve the partner's business assets that the partner has granted you access to.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

  • partner_id (String)

    The partner id to be bound to the Business

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

    the optional parameters

Options Hash (opts):

  • :partner_type (String)

    Specifies whether to fetch internal or external (shared) partners. If partner_type=INTERNAL, the asset being queried is for accesses the partner has to your business assets. If partner_type=EXTERNAL, the asset being queried is for the accesses you have to the partner's business asset. (default to 'INTERNAL')

  • :asset_type (String)

    A resource type to filter the assets by. Only assets of the specified type will be returned. (default to 'AD_ACCOUNT')

  • :start_index (Integer)

    An index to start fetching the results from. Only the results starting from this index will be returned. (default to 0)

  • :sort_by (AssetSortBy)

    The field to sort member assets by

  • :sort_ascending (Boolean)

    Sort assets in ascending order (default to true)

  • :search_by (AssetSearchBy)

    The field to search member assets by

  • :search_value (String)

    The value to search for

  • :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:



1007
1008
1009
1010
1011
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
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
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
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 1007

def business_partner_asset_access_get_with_http_info(business_id, partner_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessAccessAssetsApi.business_partner_asset_access_get ...'
  end
  # verify the required parameter 'business_id' is set
  if @api_client.config.client_side_validation && business_id.nil?
    fail ArgumentError, "Missing the required parameter 'business_id' when calling BusinessAccessAssetsApi.business_partner_asset_access_get"
  end
  if @api_client.config.client_side_validation && business_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_partner_asset_access_get, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && business_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.business_partner_asset_access_get, the character length must be greater than or equal to 1.'
  end

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

  # verify the required parameter 'partner_id' is set
  if @api_client.config.client_side_validation && partner_id.nil?
    fail ArgumentError, "Missing the required parameter 'partner_id' when calling BusinessAccessAssetsApi.business_partner_asset_access_get"
  end
  if @api_client.config.client_side_validation && partner_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "partner_id" when calling BusinessAccessAssetsApi.business_partner_asset_access_get, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && partner_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "partner_id" when calling BusinessAccessAssetsApi.business_partner_asset_access_get, the character length must be greater than or equal to 1.'
  end

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

  allowable_values = ["INTERNAL", "EXTERNAL"]
  if @api_client.config.client_side_validation && opts[:'partner_type'] && !allowable_values.include?(opts[:'partner_type'])
    fail ArgumentError, "invalid value for \"partner_type\", must be one of #{allowable_values}"
  end
  allowable_values = ["AD_ACCOUNT", "PROFILE", "ASSET_GROUP", "PINNER_LIST", "CONVERSION_TAG", "CATALOG", "CONSUMER", "CONVERSION_SEGMENT"]
  if @api_client.config.client_side_validation && opts[:'asset_type'] && !allowable_values.include?(opts[:'asset_type'])
    fail ArgumentError, "invalid value for \"asset_type\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'start_index'].nil? && opts[:'start_index'] < 0
    fail ArgumentError, 'invalid value for "opts[:"start_index"]" when calling BusinessAccessAssetsApi.business_partner_asset_access_get, must be greater than or equal to 0.'
  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 BusinessAccessAssetsApi.business_partner_asset_access_get, 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 BusinessAccessAssetsApi.business_partner_asset_access_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/businesses/{business_id}/partners/{partner_id}/assets'.sub('{business_id}', CGI.escape(business_id.to_s)).sub('{partner_id}', CGI.escape(partner_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'partner_type'] = opts[:'partner_type'] if !opts[:'partner_type'].nil?
  query_params[:'asset_type'] = opts[:'asset_type'] if !opts[:'asset_type'].nil?
  query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].nil?
  query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
  query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?
  query_params[:'search_by'] = opts[:'search_by'] if !opts[:'search_by'].nil?
  query_params[:'search_value'] = opts[:'search_value'] if !opts[:'search_value'].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] || 'BusinessPartnerAssetAccessGet200Response'

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

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

#delete_partner_asset_access_handler_impl(business_id, delete_partner_asset_access_body, opts = {}) ⇒ DeletePartnerAssetAccessResultsResponseArray

Delete partner access to asset Terminate multiple partners' access to an asset. If - partner_type=INTERNAL: You will terminate a partner's asset access to your business assets. - partner_type=EXTERNAL: You will terminate your own access to your partner's business assets.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:



1120
1121
1122
1123
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 1120

def delete_partner_asset_access_handler_impl(business_id, delete_partner_asset_access_body, opts = {})
  data, _status_code, _headers = delete_partner_asset_access_handler_impl_with_http_info(business_id, delete_partner_asset_access_body, opts)
  data
end

#delete_partner_asset_access_handler_impl_with_http_info(business_id, delete_partner_asset_access_body, opts = {}) ⇒ Array<(DeletePartnerAssetAccessResultsResponseArray, Integer, Hash)>

Delete partner access to asset Terminate multiple partners' access to an asset. If - partner_type=INTERNAL: You will terminate a partner's asset access to your business assets. - partner_type=EXTERNAL: You will terminate your own access to your partner's business assets.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:



1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
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
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 1131

def delete_partner_asset_access_handler_impl_with_http_info(business_id, delete_partner_asset_access_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessAccessAssetsApi.delete_partner_asset_access_handler_impl ...'
  end
  # verify the required parameter 'business_id' is set
  if @api_client.config.client_side_validation && business_id.nil?
    fail ArgumentError, "Missing the required parameter 'business_id' when calling BusinessAccessAssetsApi.delete_partner_asset_access_handler_impl"
  end
  if @api_client.config.client_side_validation && business_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.delete_partner_asset_access_handler_impl, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && business_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.delete_partner_asset_access_handler_impl, the character length must be greater than or equal to 1.'
  end

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

  # verify the required parameter 'delete_partner_asset_access_body' is set
  if @api_client.config.client_side_validation && delete_partner_asset_access_body.nil?
    fail ArgumentError, "Missing the required parameter 'delete_partner_asset_access_body' when calling BusinessAccessAssetsApi.delete_partner_asset_access_handler_impl"
  end
  # resource path
  local_var_path = '/businesses/{business_id}/partners/assets'.sub('{business_id}', CGI.escape(business_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(delete_partner_asset_access_body)

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

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

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

#update_partner_asset_access_handler_impl(business_id, update_partner_asset_access_body, opts = {}) ⇒ UpdatePartnerAssetsResultsResponseArray

Assign/Update partner asset permissions Grant multiple partners access to assets and/or update multiple partner's exisiting permissions to an asset. If your partner already had permissions on the asset, they will be overriden with the new permissions you assign to them. To learn more about permission levels, visit https://help.pinterest.com/en/business/article/business-manager-overview Note: Not all listed permissions are applicable to each asset type. For example, PROFILE_PUBLISHER would not be applicable to an asset of type AD_ACCOUNT. The permission level PROFILE_PUBLISHER is only available to an asset of the type PROFILE.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:



1207
1208
1209
1210
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 1207

def update_partner_asset_access_handler_impl(business_id, update_partner_asset_access_body, opts = {})
  data, _status_code, _headers = update_partner_asset_access_handler_impl_with_http_info(business_id, update_partner_asset_access_body, opts)
  data
end

#update_partner_asset_access_handler_impl_with_http_info(business_id, update_partner_asset_access_body, opts = {}) ⇒ Array<(UpdatePartnerAssetsResultsResponseArray, Integer, Hash)>

Assign/Update partner asset permissions Grant multiple partners access to assets and/or update multiple partner's exisiting permissions to an asset. If your partner already had permissions on the asset, they will be overriden with the new permissions you assign to them. To learn more about permission levels, visit https://help.pinterest.com/en/business/article/business-manager-overview Note: Not all listed permissions are applicable to each asset type. For example, PROFILE_PUBLISHER would not be applicable to an asset of type AD_ACCOUNT. The permission level PROFILE_PUBLISHER is only available to an asset of the type PROFILE.

Parameters:

  • business_id (String)

    Unique identifier of the requesting business.

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

    the optional parameters

Returns:



1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
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
# File 'lib/pinterest_sdk/api/business_access_assets_api.rb', line 1218

def update_partner_asset_access_handler_impl_with_http_info(business_id, update_partner_asset_access_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BusinessAccessAssetsApi.update_partner_asset_access_handler_impl ...'
  end
  # verify the required parameter 'business_id' is set
  if @api_client.config.client_side_validation && business_id.nil?
    fail ArgumentError, "Missing the required parameter 'business_id' when calling BusinessAccessAssetsApi.update_partner_asset_access_handler_impl"
  end
  if @api_client.config.client_side_validation && business_id.to_s.length > 20
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.update_partner_asset_access_handler_impl, the character length must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && business_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessAssetsApi.update_partner_asset_access_handler_impl, the character length must be greater than or equal to 1.'
  end

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

  # verify the required parameter 'update_partner_asset_access_body' is set
  if @api_client.config.client_side_validation && update_partner_asset_access_body.nil?
    fail ArgumentError, "Missing the required parameter 'update_partner_asset_access_body' when calling BusinessAccessAssetsApi.update_partner_asset_access_handler_impl"
  end
  # resource path
  local_var_path = '/businesses/{business_id}/partners/assets'.sub('{business_id}', CGI.escape(business_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_partner_asset_access_body)

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

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

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