Class: MethodRuby::Resources::Entities::Consent
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Entities::Consent
- Defined in:
- lib/method_ruby/resources/entities/consent.rb
Overview
Consent management for entities
Instance Method Summary collapse
-
#initialize(client:) ⇒ Consent
constructor
private
A new instance of Consent.
-
#withdraw(entity_id, type:, method_version:, reason: nil, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Entities::ConsentWithdrawResponse
Some parameter documentations has been truncated, see Models::Entities::ConsentWithdrawParams for more details.
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.
47 48 49 |
# File 'lib/method_ruby/resources/entities/consent.rb', line 47 def initialize(client:) @client = client end |
Instance Method Details
#withdraw(entity_id, type:, method_version:, reason: nil, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Entities::ConsentWithdrawResponse
Some parameter documentations has been truncated, see Models::Entities::ConsentWithdrawParams for more details.
Grants or withdraws consent for the specified entity.
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/method_ruby/resources/entities/consent.rb', line 30 def withdraw(entity_id, params) parsed, = MethodRuby::Entities::ConsentWithdrawParams.dump_request(params) header_params = {method_version: "method-version", idempotency_key: "idempotency-key"} @client.request( method: :post, path: ["entities/%1$s/consent", entity_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: MethodRuby::Models::Entities::ConsentWithdrawResponse, security: {secret_key: true}, options: ) end |