Class: Merge::Crm::AsyncAccountsClient
- Inherits:
-
Object
- Object
- Merge::Crm::AsyncAccountsClient
- Defined in:
- lib/merge_ruby_client/crm/accounts/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Crm::CrmAccountResponse
Creates an ‘Account` object with the given values.
- #initialize(request_client:) ⇒ Merge::Crm::AsyncAccountsClient constructor
-
#list(created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, modified_after: nil, modified_before: nil, name: nil, owner_id: nil, page_size: nil, remote_id: nil, request_options: nil) ⇒ Merge::Crm::PaginatedAccountList
Returns a list of ‘Account` objects.
-
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘CRMAccount` PATCHs.
-
#meta_post_retrieve(request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘CRMAccount` POSTs.
-
#partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Crm::CrmAccountResponse
Updates an ‘Account` object with the given `id`.
-
#remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, is_common_model_field: nil, page_size: nil, request_options: nil) ⇒ Merge::Crm::PaginatedRemoteFieldClassList
Returns a list of ‘RemoteFieldClass` objects.
-
#retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, request_options: nil) ⇒ Merge::Crm::Account
Returns an ‘Account` object with the given `id`.
Constructor Details
#initialize(request_client:) ⇒ Merge::Crm::AsyncAccountsClient
344 345 346 |
# File 'lib/merge_ruby_client/crm/accounts/client.rb', line 344 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::AsyncRequestClient (readonly)
340 341 342 |
# File 'lib/merge_ruby_client/crm/accounts/client.rb', line 340 def request_client @request_client end |
Instance Method Details
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Crm::CrmAccountResponse
Creates an ‘Account` object with the given values.
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 |
# File 'lib/merge_ruby_client/crm/accounts/client.rb', line 438 def create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) Async do response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "is_debug_mode": is_debug_mode, "run_async": run_async }.compact req.body = { **(&.additional_body_parameters || {}), model: model }.compact req.url "#{@request_client.get_url(request_options: )}/crm/v1/accounts" end Merge::Crm::CrmAccountResponse.from_json(json_object: response.body) end end |
#list(created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, modified_after: nil, modified_before: nil, name: nil, owner_id: nil, page_size: nil, remote_id: nil, request_options: nil) ⇒ Merge::Crm::PaginatedAccountList
Returns a list of ‘Account` objects.
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 401 402 403 404 405 406 407 408 409 410 411 |
# File 'lib/merge_ruby_client/crm/accounts/client.rb', line 376 def list(created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, modified_after: nil, modified_before: nil, name: nil, owner_id: nil, page_size: nil, remote_id: nil, request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "created_after": created_after, "created_before": created_before, "cursor": cursor, "expand": , "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "include_remote_fields": include_remote_fields, "modified_after": modified_after, "modified_before": modified_before, "name": name, "owner_id": owner_id, "page_size": page_size, "remote_id": remote_id }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/accounts" end Merge::Crm::PaginatedAccountList.from_json(json_object: response.body) end end |
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘CRMAccount` PATCHs.
566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 |
# File 'lib/merge_ruby_client/crm/accounts/client.rb', line 566 def (id:, request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/accounts/meta/patch/#{id}" end Merge::Crm::MetaResponse.from_json(json_object: response.body) end end |
#meta_post_retrieve(request_options: nil) ⇒ Merge::Crm::MetaResponse
Returns metadata for ‘CRMAccount` POSTs.
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 |
# File 'lib/merge_ruby_client/crm/accounts/client.rb', line 600 def (request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/accounts/meta/post" end Merge::Crm::MetaResponse.from_json(json_object: response.body) end end |
#partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Crm::CrmAccountResponse
Updates an ‘Account` object with the given `id`.
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 |
# File 'lib/merge_ruby_client/crm/accounts/client.rb', line 531 def partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) Async do response = @request_client.conn.patch do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "is_debug_mode": is_debug_mode, "run_async": run_async }.compact req.body = { **(&.additional_body_parameters || {}), model: model }.compact req.url "#{@request_client.get_url(request_options: )}/crm/v1/accounts/#{id}" end Merge::Crm::CrmAccountResponse.from_json(json_object: response.body) end end |
#remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, is_common_model_field: nil, page_size: nil, request_options: nil) ⇒ Merge::Crm::PaginatedRemoteFieldClassList
Returns a list of ‘RemoteFieldClass` objects.
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 |
# File 'lib/merge_ruby_client/crm/accounts/client.rb', line 643 def remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, is_common_model_field: nil, page_size: nil, request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "cursor": cursor, "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "include_remote_fields": include_remote_fields, "is_common_model_field": is_common_model_field, "page_size": page_size }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/accounts/remote-field-classes" end Merge::Crm::PaginatedRemoteFieldClassList.from_json(json_object: response.body) end end |
#retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, request_options: nil) ⇒ Merge::Crm::Account
Returns an ‘Account` object with the given `id`.
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 |
# File 'lib/merge_ruby_client/crm/accounts/client.rb', line 479 def retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers["X-Account-Token"] = .account_token unless &.account_token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "expand": , "include_remote_data": include_remote_data, "include_remote_fields": include_remote_fields }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/crm/v1/accounts/#{id}" end Merge::Crm::Account.from_json(json_object: response.body) end end |