Class: PinterestSdkClient::BusinessAccessRelationshipsApi
- Inherits:
-
Object
- Object
- PinterestSdkClient::BusinessAccessRelationshipsApi
- Defined in:
- lib/pinterest_sdk/api/business_access_relationships_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#brand_accounts_create(business_hierarchy_id, brand_account_create, opts = {}) ⇒ BrandAccount
Create a Brand Account Create a Brand Account that will be a child business of a business hierarchy.
-
#brand_accounts_create_with_http_info(business_hierarchy_id, brand_account_create, opts = {}) ⇒ Array<(BrandAccount, Integer, Hash)>
Create a Brand Account Create a Brand Account that will be a child business of a business hierarchy.
-
#brand_accounts_update(brand_account_id, business_hierarchy_id, brand_account_update, opts = {}) ⇒ BrandAccount
Update a Brand Account Update an existing Brand Account.
-
#brand_accounts_update_with_http_info(brand_account_id, business_hierarchy_id, brand_account_update, opts = {}) ⇒ Array<(BrandAccount, Integer, Hash)>
Update a Brand Account Update an existing Brand Account.
-
#delete_business_membership(business_id, delete_business_membership_body, opts = {}) ⇒ DeleteBusinessMembership200Response
Terminate business memberships Terminate memberships between the specified members and your business.
-
#delete_business_membership_with_http_info(business_id, delete_business_membership_body, opts = {}) ⇒ Array<(DeleteBusinessMembership200Response, Integer, Hash)>
Terminate business memberships Terminate memberships between the specified members and your business.
-
#delete_business_partners(business_id, delete_business_partners_delete, opts = {}) ⇒ DeleteBusinessPartners
Terminate business partnerships Terminate partnerships between the specified partners and your business.
-
#delete_business_partners_with_http_info(business_id, delete_business_partners_delete, opts = {}) ⇒ Array<(DeleteBusinessPartners, Integer, Hash)>
Terminate business partnerships Terminate partnerships between the specified partners and your business.
-
#get_business_employers(opts = {}) ⇒ GetBusinessEmployers200Response
List business employers for user Get all of the viewing user's business employers.
-
#get_business_employers_with_http_info(opts = {}) ⇒ Array<(GetBusinessEmployers200Response, Integer, Hash)>
List business employers for user Get all of the viewing user's business employers.
-
#get_business_members(business_id, opts = {}) ⇒ GetBusinessEmployers200Response
Get business members Get all members of the specified business.
-
#get_business_members_with_http_info(business_id, opts = {}) ⇒ Array<(GetBusinessEmployers200Response, Integer, Hash)>
Get business members Get all members of the specified business.
-
#get_business_partners(business_id, opts = {}) ⇒ GetBusinessEmployers200Response
Get business partners Get all partners of the specified business.
-
#get_business_partners_with_http_info(business_id, opts = {}) ⇒ Array<(GetBusinessEmployers200Response, Integer, Hash)>
Get business partners Get all partners of the specified business.
-
#initialize(api_client = ApiClient.default) ⇒ BusinessAccessRelationshipsApi
constructor
A new instance of BusinessAccessRelationshipsApi.
-
#system_user_update(business_id, system_user_id, system_user_update_with_required_body, opts = {}) ⇒ nil
Update a system user information.
-
#system_user_update_with_http_info(business_id, system_user_id, system_user_update_with_required_body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Update a system user information.
-
#update_business_memberships(business_id, business_membership_member, opts = {}) ⇒ UpdateBusinessMembershipsResponse
Update member's business role Update a member's business role within the business.
-
#update_business_memberships_with_http_info(business_id, business_membership_member, opts = {}) ⇒ Array<(UpdateBusinessMembershipsResponse, Integer, Hash)>
Update member's business role Update a member's business role within the business.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ BusinessAccessRelationshipsApi
Returns a new instance of BusinessAccessRelationshipsApi.
19 20 21 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#brand_accounts_create(business_hierarchy_id, brand_account_create, opts = {}) ⇒ BrandAccount
Create a Brand Account Create a Brand Account that will be a child business of a business hierarchy. Request must contain name, username, and country.
28 29 30 31 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 28 def brand_accounts_create(business_hierarchy_id, brand_account_create, opts = {}) data, _status_code, _headers = brand_accounts_create_with_http_info(business_hierarchy_id, brand_account_create, opts) data end |
#brand_accounts_create_with_http_info(business_hierarchy_id, brand_account_create, opts = {}) ⇒ Array<(BrandAccount, Integer, Hash)>
Create a Brand Account Create a Brand Account that will be a child business of a business hierarchy. Request must contain name, username, and country.
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_relationships_api.rb', line 39 def brand_accounts_create_with_http_info(business_hierarchy_id, brand_account_create, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BusinessAccessRelationshipsApi.brand_accounts_create ...' end # verify the required parameter 'business_hierarchy_id' is set if @api_client.config.client_side_validation && business_hierarchy_id.nil? fail ArgumentError, "Missing the required parameter 'business_hierarchy_id' when calling BusinessAccessRelationshipsApi.brand_accounts_create" end if @api_client.config.client_side_validation && business_hierarchy_id.to_s.length > 20 fail ArgumentError, 'invalid value for "business_hierarchy_id" when calling BusinessAccessRelationshipsApi.brand_accounts_create, the character length must be smaller than or equal to 20.' end if @api_client.config.client_side_validation && business_hierarchy_id.to_s.length < 1 fail ArgumentError, 'invalid value for "business_hierarchy_id" when calling BusinessAccessRelationshipsApi.brand_accounts_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_hierarchy_id !~ pattern fail ArgumentError, "invalid value for 'business_hierarchy_id' when calling BusinessAccessRelationshipsApi.brand_accounts_create, must conform to the pattern #{pattern}." end # verify the required parameter 'brand_account_create' is set if @api_client.config.client_side_validation && brand_account_create.nil? fail ArgumentError, "Missing the required parameter 'brand_account_create' when calling BusinessAccessRelationshipsApi.brand_accounts_create" end # resource path local_var_path = '/business_access/business_hierarchy/{business_hierarchy_id}/brand_accounts'.sub('{business_hierarchy_id}', CGI.escape(business_hierarchy_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(brand_account_create) # return_type return_type = opts[:debug_return_type] || 'BrandAccount' # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2'] = opts.merge( :operation => :"BusinessAccessRelationshipsApi.brand_accounts_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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BusinessAccessRelationshipsApi#brand_accounts_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#brand_accounts_update(brand_account_id, business_hierarchy_id, brand_account_update, opts = {}) ⇒ BrandAccount
Update a Brand Account Update an existing Brand Account
116 117 118 119 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 116 def brand_accounts_update(brand_account_id, business_hierarchy_id, brand_account_update, opts = {}) data, _status_code, _headers = brand_accounts_update_with_http_info(brand_account_id, business_hierarchy_id, brand_account_update, opts) data end |
#brand_accounts_update_with_http_info(brand_account_id, business_hierarchy_id, brand_account_update, opts = {}) ⇒ Array<(BrandAccount, Integer, Hash)>
Update a Brand Account Update an existing Brand Account
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 195 196 197 198 199 200 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 128 def brand_accounts_update_with_http_info(brand_account_id, business_hierarchy_id, brand_account_update, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BusinessAccessRelationshipsApi.brand_accounts_update ...' end # verify the required parameter 'brand_account_id' is set if @api_client.config.client_side_validation && brand_account_id.nil? fail ArgumentError, "Missing the required parameter 'brand_account_id' when calling BusinessAccessRelationshipsApi.brand_accounts_update" end # verify the required parameter 'business_hierarchy_id' is set if @api_client.config.client_side_validation && business_hierarchy_id.nil? fail ArgumentError, "Missing the required parameter 'business_hierarchy_id' when calling BusinessAccessRelationshipsApi.brand_accounts_update" end if @api_client.config.client_side_validation && business_hierarchy_id.to_s.length > 20 fail ArgumentError, 'invalid value for "business_hierarchy_id" when calling BusinessAccessRelationshipsApi.brand_accounts_update, the character length must be smaller than or equal to 20.' end if @api_client.config.client_side_validation && business_hierarchy_id.to_s.length < 1 fail ArgumentError, 'invalid value for "business_hierarchy_id" when calling BusinessAccessRelationshipsApi.brand_accounts_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_hierarchy_id !~ pattern fail ArgumentError, "invalid value for 'business_hierarchy_id' when calling BusinessAccessRelationshipsApi.brand_accounts_update, must conform to the pattern #{pattern}." end # verify the required parameter 'brand_account_update' is set if @api_client.config.client_side_validation && brand_account_update.nil? fail ArgumentError, "Missing the required parameter 'brand_account_update' when calling BusinessAccessRelationshipsApi.brand_accounts_update" end # resource path local_var_path = '/business_access/business_hierarchy/{business_hierarchy_id}/brand_accounts/{brand_account_id}'.sub('{brand_account_id}', CGI.escape(brand_account_id.to_s)).sub('{business_hierarchy_id}', CGI.escape(business_hierarchy_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(brand_account_update) # return_type return_type = opts[:debug_return_type] || 'BrandAccount' # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2'] = opts.merge( :operation => :"BusinessAccessRelationshipsApi.brand_accounts_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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BusinessAccessRelationshipsApi#brand_accounts_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_business_membership(business_id, delete_business_membership_body, opts = {}) ⇒ DeleteBusinessMembership200Response
Terminate business memberships Terminate memberships between the specified members and your business.
208 209 210 211 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 208 def delete_business_membership(business_id, delete_business_membership_body, opts = {}) data, _status_code, _headers = delete_business_membership_with_http_info(business_id, delete_business_membership_body, opts) data end |
#delete_business_membership_with_http_info(business_id, delete_business_membership_body, opts = {}) ⇒ Array<(DeleteBusinessMembership200Response, Integer, Hash)>
Terminate business memberships Terminate memberships between the specified members and your business.
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 282 283 284 285 286 287 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 219 def delete_business_membership_with_http_info(business_id, delete_business_membership_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BusinessAccessRelationshipsApi.delete_business_membership ...' 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 BusinessAccessRelationshipsApi.delete_business_membership" end if @api_client.config.client_side_validation && business_id.to_s.length > 20 fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessRelationshipsApi.delete_business_membership, 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 BusinessAccessRelationshipsApi.delete_business_membership, 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 BusinessAccessRelationshipsApi.delete_business_membership, must conform to the pattern #{pattern}." end # verify the required parameter 'delete_business_membership_body' is set if @api_client.config.client_side_validation && delete_business_membership_body.nil? fail ArgumentError, "Missing the required parameter 'delete_business_membership_body' when calling BusinessAccessRelationshipsApi.delete_business_membership" end # resource path local_var_path = '/businesses/{business_id}/members'.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_business_membership_body) # return_type return_type = opts[:debug_return_type] || 'DeleteBusinessMembership200Response' # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2'] = opts.merge( :operation => :"BusinessAccessRelationshipsApi.delete_business_membership", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BusinessAccessRelationshipsApi#delete_business_membership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_business_partners(business_id, delete_business_partners_delete, opts = {}) ⇒ DeleteBusinessPartners
Terminate business partnerships Terminate partnerships between the specified partners and your business. Note: You may only batch terminate partners of the same partner type.
295 296 297 298 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 295 def delete_business_partners(business_id, delete_business_partners_delete, opts = {}) data, _status_code, _headers = delete_business_partners_with_http_info(business_id, delete_business_partners_delete, opts) data end |
#delete_business_partners_with_http_info(business_id, delete_business_partners_delete, opts = {}) ⇒ Array<(DeleteBusinessPartners, Integer, Hash)>
Terminate business partnerships Terminate partnerships between the specified partners and your business. Note: You may only batch terminate partners of the same partner type.
306 307 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 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 306 def delete_business_partners_with_http_info(business_id, delete_business_partners_delete, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BusinessAccessRelationshipsApi.delete_business_partners ...' 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 BusinessAccessRelationshipsApi.delete_business_partners" end if @api_client.config.client_side_validation && business_id.to_s.length > 20 fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessRelationshipsApi.delete_business_partners, 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 BusinessAccessRelationshipsApi.delete_business_partners, 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 BusinessAccessRelationshipsApi.delete_business_partners, must conform to the pattern #{pattern}." end # verify the required parameter 'delete_business_partners_delete' is set if @api_client.config.client_side_validation && delete_business_partners_delete.nil? fail ArgumentError, "Missing the required parameter 'delete_business_partners_delete' when calling BusinessAccessRelationshipsApi.delete_business_partners" end # resource path local_var_path = '/businesses/{business_id}/partners'.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_business_partners_delete) # return_type return_type = opts[:debug_return_type] || 'DeleteBusinessPartners' # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2'] = opts.merge( :operation => :"BusinessAccessRelationshipsApi.delete_business_partners", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BusinessAccessRelationshipsApi#delete_business_partners\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_business_employers(opts = {}) ⇒ GetBusinessEmployers200Response
List business employers for user Get all of the viewing user's business employers.
383 384 385 386 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 383 def get_business_employers(opts = {}) data, _status_code, _headers = get_business_employers_with_http_info(opts) data end |
#get_business_employers_with_http_info(opts = {}) ⇒ Array<(GetBusinessEmployers200Response, Integer, Hash)>
List business employers for user Get all of the viewing user's business employers.
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 395 def get_business_employers_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BusinessAccessRelationshipsApi.get_business_employers ...' 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 BusinessAccessRelationshipsApi.get_business_employers, 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 BusinessAccessRelationshipsApi.get_business_employers, must be greater than or equal to 1.' end # resource path local_var_path = '/businesses/employers' # query parameters query_params = opts[:query_params] || {} query_params[:'assets_summary'] = opts[:'assets_summary'] if !opts[:'assets_summary'].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] || 'GetBusinessEmployers200Response' # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2'] = opts.merge( :operation => :"BusinessAccessRelationshipsApi.get_business_employers", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BusinessAccessRelationshipsApi#get_business_employers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_business_members(business_id, opts = {}) ⇒ GetBusinessEmployers200Response
Get business members Get all members of the specified business. The return response will include the member's business_role and assets they have access to if assets_summary=TRUE
462 463 464 465 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 462 def get_business_members(business_id, opts = {}) data, _status_code, _headers = get_business_members_with_http_info(business_id, opts) data end |
#get_business_members_with_http_info(business_id, opts = {}) ⇒ Array<(GetBusinessEmployers200Response, Integer, Hash)>
Get business members Get all members of the specified business. The return response will include the member's business_role and assets they have access to if assets_summary=TRUE
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 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 479 def get_business_members_with_http_info(business_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BusinessAccessRelationshipsApi.get_business_members ...' 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 BusinessAccessRelationshipsApi.get_business_members" end if @api_client.config.client_side_validation && business_id.to_s.length > 20 fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessRelationshipsApi.get_business_members, 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 BusinessAccessRelationshipsApi.get_business_members, 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 BusinessAccessRelationshipsApi.get_business_members, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'member_ids'].nil? && opts[:'member_ids'].to_s.length > 500 fail ArgumentError, 'invalid value for "opts[:"member_ids"]" when calling BusinessAccessRelationshipsApi.get_business_members, the character length must be smaller than or equal to 500.' 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 BusinessAccessRelationshipsApi.get_business_members, 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 BusinessAccessRelationshipsApi.get_business_members, 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 BusinessAccessRelationshipsApi.get_business_members, must be greater than or equal to 1.' end # resource path local_var_path = '/businesses/{business_id}/members'.sub('{business_id}', CGI.escape(business_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fetch_system_users'] = opts[:'fetch_system_users'] if !opts[:'fetch_system_users'].nil? query_params[:'assets_summary'] = opts[:'assets_summary'] if !opts[:'assets_summary'].nil? query_params[:'business_roles'] = @api_client.build_collection_param(opts[:'business_roles'], :multi) if !opts[:'business_roles'].nil? query_params[:'member_ids'] = opts[:'member_ids'] if !opts[:'member_ids'].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] || 'GetBusinessEmployers200Response' # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2'] = opts.merge( :operation => :"BusinessAccessRelationshipsApi.get_business_members", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BusinessAccessRelationshipsApi#get_business_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_business_partners(business_id, opts = {}) ⇒ GetBusinessEmployers200Response
Get business partners Get all partners of the specified business. If the assets_summary=TRUE and: - partner_type=INTERNAL, the business assets returned are your business assets the partner has access to. - partner_type=EXTERNAL, the business assets returned are your partner's business assets the partner has granted you access to.
575 576 577 578 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 575 def get_business_partners(business_id, opts = {}) data, _status_code, _headers = get_business_partners_with_http_info(business_id, opts) data end |
#get_business_partners_with_http_info(business_id, opts = {}) ⇒ Array<(GetBusinessEmployers200Response, Integer, Hash)>
Get business partners Get all partners of the specified business. If the assets_summary=TRUE and: - partner_type=INTERNAL, the business assets returned are your business assets the partner has access to. - partner_type=EXTERNAL, the business assets returned are your partner's business assets the partner has granted you access to.
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 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 592 def get_business_partners_with_http_info(business_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BusinessAccessRelationshipsApi.get_business_partners ...' 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 BusinessAccessRelationshipsApi.get_business_partners" end if @api_client.config.client_side_validation && business_id.to_s.length > 20 fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessRelationshipsApi.get_business_partners, 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 BusinessAccessRelationshipsApi.get_business_partners, 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 BusinessAccessRelationshipsApi.get_business_partners, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'partner_ids'].nil? && opts[:'partner_ids'].to_s.length > 500 fail ArgumentError, 'invalid value for "opts[:"partner_ids"]" when calling BusinessAccessRelationshipsApi.get_business_partners, the character length must be smaller than or equal to 500.' 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 BusinessAccessRelationshipsApi.get_business_partners, 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 BusinessAccessRelationshipsApi.get_business_partners, 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 BusinessAccessRelationshipsApi.get_business_partners, must be greater than or equal to 1.' end # resource path local_var_path = '/businesses/{business_id}/partners'.sub('{business_id}', CGI.escape(business_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'assets_summary'] = opts[:'assets_summary'] if !opts[:'assets_summary'].nil? query_params[:'partner_type'] = opts[:'partner_type'] if !opts[:'partner_type'].nil? query_params[:'partner_ids'] = opts[:'partner_ids'] if !opts[:'partner_ids'].nil? query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].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] || 'GetBusinessEmployers200Response' # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2'] = opts.merge( :operation => :"BusinessAccessRelationshipsApi.get_business_partners", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BusinessAccessRelationshipsApi#get_business_partners\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#system_user_update(business_id, system_user_id, system_user_update_with_required_body, opts = {}) ⇒ nil
Update a system user information. Update a system user information such as name.
683 684 685 686 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 683 def system_user_update(business_id, system_user_id, system_user_update_with_required_body, opts = {}) system_user_update_with_http_info(business_id, system_user_id, system_user_update_with_required_body, opts) nil end |
#system_user_update_with_http_info(business_id, system_user_id, system_user_update_with_required_body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Update a system user information. Update a system user information such as name.
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 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 695 def system_user_update_with_http_info(business_id, system_user_id, system_user_update_with_required_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BusinessAccessRelationshipsApi.system_user_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 BusinessAccessRelationshipsApi.system_user_update" end if @api_client.config.client_side_validation && business_id.to_s.length > 20 fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessRelationshipsApi.system_user_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 BusinessAccessRelationshipsApi.system_user_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 BusinessAccessRelationshipsApi.system_user_update, must conform to the pattern #{pattern}." end # verify the required parameter 'system_user_id' is set if @api_client.config.client_side_validation && system_user_id.nil? fail ArgumentError, "Missing the required parameter 'system_user_id' when calling BusinessAccessRelationshipsApi.system_user_update" end if @api_client.config.client_side_validation && system_user_id.to_s.length > 20 fail ArgumentError, 'invalid value for "system_user_id" when calling BusinessAccessRelationshipsApi.system_user_update, the character length must be smaller than or equal to 20.' end if @api_client.config.client_side_validation && system_user_id.to_s.length < 1 fail ArgumentError, 'invalid value for "system_user_id" when calling BusinessAccessRelationshipsApi.system_user_update, the character length must be greater than or equal to 1.' end pattern = Regexp.new(/^\d+$/) if @api_client.config.client_side_validation && system_user_id !~ pattern fail ArgumentError, "invalid value for 'system_user_id' when calling BusinessAccessRelationshipsApi.system_user_update, must conform to the pattern #{pattern}." end # verify the required parameter 'system_user_update_with_required_body' is set if @api_client.config.client_side_validation && system_user_update_with_required_body.nil? fail ArgumentError, "Missing the required parameter 'system_user_update_with_required_body' when calling BusinessAccessRelationshipsApi.system_user_update" end # resource path local_var_path = '/businesses/{business_id}/system_users/{system_user_id}'.sub('{business_id}', CGI.escape(business_id.to_s)).sub('{system_user_id}', CGI.escape(system_user_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(system_user_update_with_required_body) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2'] = opts.merge( :operation => :"BusinessAccessRelationshipsApi.system_user_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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BusinessAccessRelationshipsApi#system_user_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_business_memberships(business_id, business_membership_member, opts = {}) ⇒ UpdateBusinessMembershipsResponse
Update member's business role Update a member's business role within the business.
788 789 790 791 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 788 def update_business_memberships(business_id, business_membership_member, opts = {}) data, _status_code, _headers = update_business_memberships_with_http_info(business_id, business_membership_member, opts) data end |
#update_business_memberships_with_http_info(business_id, business_membership_member, opts = {}) ⇒ Array<(UpdateBusinessMembershipsResponse, Integer, Hash)>
Update member's business role Update a member's business role within the business.
799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 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 |
# File 'lib/pinterest_sdk/api/business_access_relationships_api.rb', line 799 def update_business_memberships_with_http_info(business_id, business_membership_member, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BusinessAccessRelationshipsApi.update_business_memberships ...' 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 BusinessAccessRelationshipsApi.update_business_memberships" end if @api_client.config.client_side_validation && business_id.to_s.length > 20 fail ArgumentError, 'invalid value for "business_id" when calling BusinessAccessRelationshipsApi.update_business_memberships, 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 BusinessAccessRelationshipsApi.update_business_memberships, 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 BusinessAccessRelationshipsApi.update_business_memberships, must conform to the pattern #{pattern}." end # verify the required parameter 'business_membership_member' is set if @api_client.config.client_side_validation && business_membership_member.nil? fail ArgumentError, "Missing the required parameter 'business_membership_member' when calling BusinessAccessRelationshipsApi.update_business_memberships" end if @api_client.config.client_side_validation && business_membership_member.length < 1 fail ArgumentError, 'invalid value for "business_membership_member" when calling BusinessAccessRelationshipsApi.update_business_memberships, number of items must be greater than or equal to 1.' end # resource path local_var_path = '/businesses/{business_id}/members'.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_membership_member) # return_type return_type = opts[:debug_return_type] || 'UpdateBusinessMembershipsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['pinterest_oauth2'] = opts.merge( :operation => :"BusinessAccessRelationshipsApi.update_business_memberships", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BusinessAccessRelationshipsApi#update_business_memberships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |