Class: Merge::Accounting::AsyncExpenseReportsClient
- Inherits:
-
Object
- Object
- Merge::Accounting::AsyncExpenseReportsClient
- Defined in:
- lib/merge_ruby_client/accounting/expense_reports/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Accounting::ExpenseReportResponse
Creates an ‘ExpenseReport` object with the given values.
- #initialize(request_client:) ⇒ Merge::Accounting::AsyncExpenseReportsClient constructor
-
#lines_list(expense_report_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, page_size: nil, request_options: nil) ⇒ Merge::Accounting::PaginatedExpenseReportLineList
Returns a list of ‘ExpenseReportLine` objects that point to a `ExpenseReport` with the given id.
-
#lines_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.
-
#list(company_id: nil, created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, modified_after: nil, modified_before: nil, page_size: nil, remote_id: nil, request_options: nil) ⇒ Merge::Accounting::PaginatedExpenseReportList
Returns a list of ‘ExpenseReport` objects.
-
#meta_post_retrieve(request_options: nil) ⇒ Merge::Accounting::MetaResponse
Returns metadata for ‘ExpenseReport` POSTs.
-
#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, request_options: nil) ⇒ Merge::Accounting::ExpenseReport
Returns an ‘ExpenseReport` object with the given `id`.
Constructor Details
#initialize(request_client:) ⇒ Merge::Accounting::AsyncExpenseReportsClient
391 392 393 |
# File 'lib/merge_ruby_client/accounting/expense_reports/client.rb', line 391 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::AsyncRequestClient (readonly)
387 388 389 |
# File 'lib/merge_ruby_client/accounting/expense_reports/client.rb', line 387 def request_client @request_client end |
Instance Method Details
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Accounting::ExpenseReportResponse
Creates an ‘ExpenseReport` object with the given values.
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
# File 'lib/merge_ruby_client/accounting/expense_reports/client.rb', line 491 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/expense-reports" end Merge::Accounting::ExpenseReportResponse.from_json(json_object: response.body) end end |
#lines_list(expense_report_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, page_size: nil, request_options: nil) ⇒ Merge::Accounting::PaginatedExpenseReportLineList
Returns a list of ‘ExpenseReportLine` objects that point to a `ExpenseReport`
with the given id.
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 |
# File 'lib/merge_ruby_client/accounting/expense_reports/client.rb', line 541 def lines_list(expense_report_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: 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, "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, "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/expense-reports/#{expense_report_id}/lines" end Merge::Accounting::PaginatedExpenseReportLineList.from_json(json_object: response.body) end end |
#lines_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.
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 |
# File 'lib/merge_ruby_client/accounting/expense_reports/client.rb', line 644 def lines_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/expense-reports/lines/remote-field-classes" end Merge::Accounting::PaginatedRemoteFieldClassList.from_json(json_object: response.body) end end |
#list(company_id: nil, created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, modified_after: nil, modified_before: nil, page_size: nil, remote_id: nil, request_options: nil) ⇒ Merge::Accounting::PaginatedExpenseReportList
Returns a list of ‘ExpenseReport` objects.
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 |
# File 'lib/merge_ruby_client/accounting/expense_reports/client.rb', line 427 def list(company_id: nil, created_after: nil, created_before: nil, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: nil, modified_after: nil, modified_before: 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 || {}), "company_id": company_id, "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, "include_shell_data": include_shell_data, "modified_after": modified_after, "modified_before": modified_before, "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: )}/accounting/v1/expense-reports" end Merge::Accounting::PaginatedExpenseReportList.from_json(json_object: response.body) end end |
#meta_post_retrieve(request_options: nil) ⇒ Merge::Accounting::MetaResponse
Returns metadata for ‘ExpenseReport` POSTs.
686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 |
# File 'lib/merge_ruby_client/accounting/expense_reports/client.rb', line 686 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/expense-reports/meta/post" end Merge::Accounting::MetaResponse.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.
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 |
# File 'lib/merge_ruby_client/accounting/expense_reports/client.rb', line 733 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/expense-reports/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, request_options: nil) ⇒ Merge::Accounting::ExpenseReport
Returns an ‘ExpenseReport` object with the given `id`.
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 |
# File 'lib/merge_ruby_client/accounting/expense_reports/client.rb', line 592 def retrieve(id:, expand: nil, include_remote_data: nil, include_remote_fields: nil, include_shell_data: 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 }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/accounting/v1/expense-reports/#{id}" end Merge::Accounting::ExpenseReport.from_json(json_object: response.body) end end |