Class: Merge::Ticketing::AsyncTicketsClient
- Inherits:
-
Object
- Object
- Merge::Ticketing::AsyncTicketsClient
- Defined in:
- lib/merge_ruby_client/ticketing/tickets/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ticketing::TicketResponse
Creates a ‘Ticket` object with the given values.
- #initialize(request_client:) ⇒ Merge::Ticketing::AsyncTicketsClient constructor
-
#list(account_id: nil, assignee_ids: nil, collection_ids: nil, completed_after: nil, completed_before: nil, contact_id: nil, created_after: nil, created_before: nil, creator_id: nil, cursor: nil, due_after: nil, due_before: 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, parent_ticket_id: nil, priority: nil, remote_created_after: nil, remote_created_before: nil, remote_fields: nil, remote_id: nil, remote_updated_after: nil, remote_updated_before: nil, show_enum_origins: nil, status: nil, tags: nil, ticket_type: nil, ticket_url: nil, request_options: nil) ⇒ Merge::Ticketing::PaginatedTicketList
Returns a list of ‘Ticket` objects.
-
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Ticketing::MetaResponse
Returns metadata for ‘Ticket` PATCHs.
-
#meta_post_retrieve(collection_id: nil, ticket_type: nil, request_options: nil) ⇒ Merge::Ticketing::MetaResponse
Returns metadata for ‘Ticket` POSTs.
-
#partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ticketing::TicketResponse
Updates a ‘Ticket` object with the given `id`.
-
#remote_field_classes_list(cursor: nil, ids: 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::Ticketing::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::Ticketing::Ticket
Returns a ‘Ticket` object with the given `id`.
-
#viewers_list(ticket_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_shell_data: nil, page_size: nil, request_options: nil) ⇒ Merge::Ticketing::PaginatedViewerList
Returns a list of ‘Viewer` objects that point to a User id or Team id that is either an assignee or viewer on a `Ticket` with the given id.
Constructor Details
#initialize(request_client:) ⇒ Merge::Ticketing::AsyncTicketsClient
507 508 509 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 507 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ Merge::AsyncRequestClient (readonly)
503 504 505 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 503 def request_client @request_client end |
Instance Method Details
#create(model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ticketing::TicketResponse
Creates a ‘Ticket` object with the given values.
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 670 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: )}/ticketing/v1/tickets" end Merge::Ticketing::TicketResponse.from_json(json_object: response.body) end end |
#list(account_id: nil, assignee_ids: nil, collection_ids: nil, completed_after: nil, completed_before: nil, contact_id: nil, created_after: nil, created_before: nil, creator_id: nil, cursor: nil, due_after: nil, due_before: 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, parent_ticket_id: nil, priority: nil, remote_created_after: nil, remote_created_before: nil, remote_fields: nil, remote_id: nil, remote_updated_after: nil, remote_updated_before: nil, show_enum_origins: nil, status: nil, tags: nil, ticket_type: nil, ticket_url: nil, request_options: nil) ⇒ Merge::Ticketing::PaginatedTicketList
Returns a list of ‘Ticket` objects.
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 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 577 def list(account_id: nil, assignee_ids: nil, collection_ids: nil, completed_after: nil, completed_before: nil, contact_id: nil, created_after: nil, created_before: nil, creator_id: nil, cursor: nil, due_after: nil, due_before: 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, parent_ticket_id: nil, priority: nil, remote_created_after: nil, remote_created_before: nil, remote_fields: nil, remote_id: nil, remote_updated_after: nil, remote_updated_before: nil, show_enum_origins: nil, status: nil, tags: nil, ticket_type: nil, ticket_url: 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 || {}), "account_id": account_id, "assignee_ids": assignee_ids, "collection_ids": collection_ids, "completed_after": completed_after, "completed_before": completed_before, "contact_id": contact_id, "created_after": created_after, "created_before": created_before, "creator_id": creator_id, "cursor": cursor, "due_after": due_after, "due_before": due_before, "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, "parent_ticket_id": parent_ticket_id, "priority": priority, "remote_created_after": remote_created_after, "remote_created_before": remote_created_before, "remote_fields": remote_fields, "remote_id": remote_id, "remote_updated_after": remote_updated_after, "remote_updated_before": remote_updated_before, "show_enum_origins": show_enum_origins, "status": status, "tags": , "ticket_type": ticket_type, "ticket_url": ticket_url }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ticketing/v1/tickets" end Merge::Ticketing::PaginatedTicketList.from_json(json_object: response.body) end end |
#meta_patch_retrieve(id:, request_options: nil) ⇒ Merge::Ticketing::MetaResponse
Returns metadata for ‘Ticket` PATCHs.
874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 874 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: )}/ticketing/v1/tickets/meta/patch/#{id}" end Merge::Ticketing::MetaResponse.from_json(json_object: response.body) end end |
#meta_post_retrieve(collection_id: nil, ticket_type: nil, request_options: nil) ⇒ Merge::Ticketing::MetaResponse
Returns metadata for ‘Ticket` POSTs.
910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 910 def (collection_id: nil, ticket_type: 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 || {}), "collection_id": collection_id, "ticket_type": ticket_type }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/ticketing/v1/tickets/meta/post" end Merge::Ticketing::MetaResponse.from_json(json_object: response.body) end end |
#partial_update(id:, model:, is_debug_mode: nil, run_async: nil, request_options: nil) ⇒ Merge::Ticketing::TicketResponse
Updates a ‘Ticket` object with the given `id`.
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 783 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: )}/ticketing/v1/tickets/#{id}" end Merge::Ticketing::TicketResponse.from_json(json_object: response.body) end end |
#remote_field_classes_list(cursor: nil, ids: 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::Ticketing::PaginatedRemoteFieldClassList
Returns a list of ‘RemoteFieldClass` objects.
960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 960 def remote_field_classes_list(cursor: nil, ids: 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, "ids": ids, "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: )}/ticketing/v1/tickets/remote-field-classes" end Merge::Ticketing::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::Ticketing::Ticket
Returns a ‘Ticket` object with the given `id`.
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 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 717 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: )}/ticketing/v1/tickets/#{id}" end Merge::Ticketing::Ticket.from_json(json_object: response.body) end end |
#viewers_list(ticket_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: nil, include_shell_data: nil, page_size: nil, request_options: nil) ⇒ Merge::Ticketing::PaginatedViewerList
Returns a list of ‘Viewer` objects that point to a User id or Team id that is
either an assignee or viewer on a `Ticket` with the given id. [Learn
(https://help.merge.dev/en/articles/10333658-ticketing-access-control-list-acls)
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 |
# File 'lib/merge_ruby_client/ticketing/tickets/client.rb', line 832 def viewers_list(ticket_id:, cursor: nil, expand: nil, include_deleted_data: nil, include_remote_data: 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_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: )}/ticketing/v1/tickets/#{ticket_id}/viewers" end Merge::Ticketing::PaginatedViewerList.from_json(json_object: response.body) end end |