Class: MethodRuby::Resources::Accounts::Consent

Inherits:
Object
  • Object
show all
Defined in:
lib/method_ruby/resources/accounts/consent.rb

Overview

Consent management for accounts

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Consent

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 Consent.

Parameters:



47
48
49
# File 'lib/method_ruby/resources/accounts/consent.rb', line 47

def initialize(client:)
  @client = client
end

Instance Method Details

#withdraw(account_id, type:, method_version:, reason: nil, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::ConsentWithdrawResponse

Some parameter documentations has been truncated, see Models::Accounts::ConsentWithdrawParams for more details.

Grants or withdraws consent for data access on the specified account.

Parameters:

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/method_ruby/resources/accounts/consent.rb', line 30

def withdraw(, params)
  parsed, options = MethodRuby::Accounts::ConsentWithdrawParams.dump_request(params)
  header_params = {method_version: "method-version", idempotency_key: "idempotency-key"}
  @client.request(
    method: :post,
    path: ["accounts/%1$s/consent", ],
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: MethodRuby::Models::Accounts::ConsentWithdrawResponse,
    security: {secret_key: true},
    options: options
  )
end