Class: Merge::Accounting::AsyncContactsClient
- Inherits:
-
Object
- Object
- Merge::Accounting::AsyncContactsClient
- Defined in:
- lib/merge_ruby_client/accounting/contacts/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Accounting::ContactResponse
Creates a ‘Contact` object with the given values.
- #initialize(request_client:) ⇒ Merge::Accounting::AsyncContactsClient constructor
-
#list(company_id: nil, created_after: nil, created_before: nil, cursor: nil, email_address: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, is_customer: nil, is_supplier: nil, modified_after: nil, modified_before: nil, name: nil, page_size: nil, remote_fields: nil, remote_id: nil, show_enum_origins: nil, status: nil, request_options: nil) ⇒ Merge::Accounting::PaginatedContactList
Returns a list of ‘Contact` objects.
-
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Accounting::MetaResponse
Returns metadata for ‘Contact` PATCHs.
-
#meta_post_retrieve(request_options: nil) ⇒ Merge::Accounting::MetaResponse
Returns metadata for ‘Contact` POSTs.
-
#partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Accounting::ContactResponse
Updates a ‘Contact` object with the given `id`.
-
#remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, include_shell_data: nil, is_common_model_field: nil, is_custom: nil, page_size: nil, request_options: nil) ⇒ Merge::Accounting::PaginatedRemoteFieldClassList
Returns a list of ‘RemoteFieldClass` objects.
-
#retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, remote_fields: nil, show_enum_origins: nil, request_options: nil) ⇒ Merge::Accounting::Contact
Returns a ‘Contact` object with the given `id`.
Constructor Details
#initialize(request_client:) ⇒ Merge::Accounting::AsyncContactsClient
385 386 387 |
# File 'lib/merge_ruby_client/accounting/contacts/client.rb', line 385 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::AsyncRequestClient (readonly)
381 382 383 |
# File 'lib/merge_ruby_client/accounting/contacts/client.rb', line 381 def request_client @request_client end |
Instance Method Details
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Accounting::ContactResponse
Creates a ‘Contact` object with the given values.
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 |
# File 'lib/merge_ruby_client/accounting/contacts/client.rb', line 501 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: )}/accounting/v1/contacts" end Merge::Accounting::ContactResponse.from_json(json_object: response.body) end end |
#list(company_id: nil, created_after: nil, created_before: nil, cursor: nil, email_address: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, is_customer: nil, is_supplier: nil, modified_after: nil, modified_before: nil, name: nil, page_size: nil, remote_fields: nil, remote_id: nil, show_enum_origins: nil, status: nil, request_options: nil) ⇒ Merge::Accounting::PaginatedContactList
Returns a list of ‘Contact` objects.
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 |
# File 'lib/merge_ruby_client/accounting/contacts/client.rb', line 430 def list(company_id: nil, created_after: nil, created_before: nil, cursor: nil, email_address: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, is_customer: nil, is_supplier: nil, modified_after: nil, modified_before: nil, name: nil, page_size: nil, remote_fields: nil, remote_id: nil, show_enum_origins: nil, status: 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 || {}), "company_id": company_id, "created_after": created_after, "created_before": created_before, "cursor": cursor, "email_address": email_address, "expand": , "include_deleted_data": include_deleted_data, "include_remote_data": include_remote_data, "include_remote_fields": include_remote_fields, "include_shell_data": include_shell_data, "is_customer": is_customer, "is_supplier": is_supplier, "modified_after": modified_after, "modified_before": modified_before, "name": name, "page_size": page_size, "remote_fields": remote_fields, "remote_id": remote_id, "show_enum_origins": show_enum_origins, "status": status }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/accounting/v1/contacts" end Merge::Accounting::PaginatedContactList.from_json(json_object: response.body) end end |
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Accounting::MetaResponse
Returns metadata for ‘Contact` PATCHs.
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 |
# File 'lib/merge_ruby_client/accounting/contacts/client.rb', line 641 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: )}/accounting/v1/contacts/meta/patch/#{id}" end Merge::Accounting::MetaResponse.from_json(json_object: response.body) end end |
#meta_post_retrieve(request_options: nil) ⇒ Merge::Accounting::MetaResponse
Returns metadata for ‘Contact` POSTs.
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 |
# File 'lib/merge_ruby_client/accounting/contacts/client.rb', line 675 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: )}/accounting/v1/contacts/meta/post" end Merge::Accounting::MetaResponse.from_json(json_object: response.body) end end |
#partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Accounting::ContactResponse
Updates a ‘Contact` object with the given `id`.
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 |
# File 'lib/merge_ruby_client/accounting/contacts/client.rb', line 606 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: )}/accounting/v1/contacts/#{id}" end Merge::Accounting::ContactResponse.from_json(json_object: response.body) end end |
#remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, include_shell_data: nil, is_common_model_field: nil, is_custom: nil, page_size: nil, request_options: nil) ⇒ Merge::Accounting::PaginatedRemoteFieldClassList
Returns a list of ‘RemoteFieldClass` objects.
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 |
# File 'lib/merge_ruby_client/accounting/contacts/client.rb', line 722 def remote_field_classes_list(cursor: nil, include_deleted_data: nil, include_remote_data: nil, include_shell_data: nil, is_common_model_field: nil, is_custom: 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_shell_data": include_shell_data, "is_common_model_field": is_common_model_field, "is_custom": is_custom, "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: )}/accounting/v1/contacts/remote-field-classes" end Merge::Accounting::PaginatedRemoteFieldClassList.from_json(json_object: response.body) end end |
#retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, remote_fields: nil, show_enum_origins: nil, request_options: nil) ⇒ Merge::Accounting::Contact
Returns a ‘Contact` object with the given `id`.
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 |
# File 'lib/merge_ruby_client/accounting/contacts/client.rb', line 548 def retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, remote_fields: nil, show_enum_origins: 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, "include_shell_data": include_shell_data, "remote_fields": remote_fields, "show_enum_origins": show_enum_origins }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/accounting/v1/contacts/#{id}" end Merge::Accounting::Contact.from_json(json_object: response.body) end end |