Class: ModernTreasury::Resources::Holds
- Inherits:
-
Object
- Object
- ModernTreasury::Resources::Holds
- Defined in:
- lib/modern_treasury/resources/holds.rb
Instance Method Summary collapse
-
#create(status: , target_id: , target_type: , metadata: nil, reason: nil, request_options: {}) ⇒ ModernTreasury::Models::HoldCreateResponse
Create a new hold.
-
#initialize(client:) ⇒ Holds
constructor
private
A new instance of Holds.
-
#list(after_cursor: nil, metadata: nil, per_page: nil, status: nil, target_id: nil, target_type: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::HoldListResponse>
Some parameter documentations has been truncated, see Models::HoldListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ ModernTreasury::Models::HoldRetrieveResponse
Get a specific hold.
-
#update(id, status: , resolution: nil, request_options: {}) ⇒ ModernTreasury::Models::HoldUpdateResponse
Update a hold.
Constructor Details
#initialize(client:) ⇒ Holds
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Holds.
121 122 123 |
# File 'lib/modern_treasury/resources/holds.rb', line 121 def initialize(client:) @client = client end |
Instance Method Details
#create(status: , target_id: , target_type: , metadata: nil, reason: nil, request_options: {}) ⇒ ModernTreasury::Models::HoldCreateResponse
Create a new hold
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/modern_treasury/resources/holds.rb', line 25 def create(params) parsed, = ModernTreasury::HoldCreateParams.dump_request(params) @client.request( method: :post, path: "api/holds", body: parsed, model: ModernTreasury::Models::HoldCreateResponse, options: ) end |
#list(after_cursor: nil, metadata: nil, per_page: nil, status: nil, target_id: nil, target_type: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::HoldListResponse>
Some parameter documentations has been truncated, see Models::HoldListParams for more details.
Get a list of holds.
106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/modern_treasury/resources/holds.rb', line 106 def list(params = {}) parsed, = ModernTreasury::HoldListParams.dump_request(params) @client.request( method: :get, path: "api/holds", query: parsed, page: ModernTreasury::Internal::Page, model: ModernTreasury::Models::HoldListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ ModernTreasury::Models::HoldRetrieveResponse
Get a specific hold
47 48 49 50 51 52 53 54 |
# File 'lib/modern_treasury/resources/holds.rb', line 47 def retrieve(id, params = {}) @client.request( method: :get, path: ["api/holds/%1$s", id], model: ModernTreasury::Models::HoldRetrieveResponse, options: params[:request_options] ) end |
#update(id, status: , resolution: nil, request_options: {}) ⇒ ModernTreasury::Models::HoldUpdateResponse
Update a hold
71 72 73 74 75 76 77 78 79 80 |
# File 'lib/modern_treasury/resources/holds.rb', line 71 def update(id, params) parsed, = ModernTreasury::HoldUpdateParams.dump_request(params) @client.request( method: :patch, path: ["api/holds/%1$s", id], body: parsed, model: ModernTreasury::Models::HoldUpdateResponse, options: ) end |