Class: Straddle::Resources::CapabilityRequests
- Inherits:
-
Object
- Object
- Straddle::Resources::CapabilityRequests
- Defined in:
- lib/straddle/resources/capability_requests.rb,
sig/straddle/resources/capability_requests.rbs
Overview
Capability requests change the payment, customer, and consent types available to an account.
Instance Method Summary collapse
-
#create(account_id, businesses: nil, charges: nil, individuals: nil, internet: nil, payouts: nil, signed_agreement: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::CapabilityRequestList
Some parameter documentations has been truncated, see Models::CapabilityRequestCreateParams for more details.
-
#initialize(client:) ⇒ CapabilityRequests
constructor
private
A new instance of CapabilityRequests.
-
#list(account_id, category: nil, page_number: nil, page_size: nil, sort_by: nil, sort_order: nil, status: nil, type: nil, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::CapabilityRequestList
Some parameter documentations has been truncated, see Models::CapabilityRequestListParams for more details.
Constructor Details
#initialize(client:) ⇒ CapabilityRequests
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 CapabilityRequests.
112 113 114 |
# File 'lib/straddle/resources/capability_requests.rb', line 112 def initialize(client:) @client = client end |
Instance Method Details
#create(account_id, businesses: nil, charges: nil, individuals: nil, internet: nil, payouts: nil, signed_agreement: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::CapabilityRequestList
Some parameter documentations has been truncated, see Models::CapabilityRequestCreateParams for more details.
Creates one or more capability requests for an account and returns the resulting requests.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/straddle/resources/capability_requests.rb', line 41 def create(account_id, params = {}) parsed, = Straddle::CapabilityRequestCreateParams.dump_request(params) header_params = { correlation_id: "correlation-id", idempotency_key: "idempotency-key", request_id: "request-id" } @client.request( method: :post, path: ["v1/accounts/%1$s/capability_requests", account_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::CapabilityRequestList, options: ) end |
#list(account_id, category: nil, page_number: nil, page_size: nil, sort_by: nil, sort_order: nil, status: nil, type: nil, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::CapabilityRequestList
Some parameter documentations has been truncated, see Models::CapabilityRequestListParams for more details.
Returns a paginated list of capability requests for an account. Filter the list by capability type, category, or status.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/straddle/resources/capability_requests.rb', line 91 def list(account_id, params = {}) query_params = i[category page_number page_size sort_by sort_order status type] parsed, = Straddle::CapabilityRequestListParams.dump_request(params) query = Straddle::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: ["v1/accounts/%1$s/capability_requests", account_id], query: query, headers: parsed.except(*query_params).transform_keys( correlation_id: "correlation-id", request_id: "request-id" ), model: Straddle::CapabilityRequestList, options: ) end |