Class: Virgil::SDK::Client::Requests::RevokeCardRequest
- Inherits:
-
SignableRequest
- Object
- SignableRequest
- Virgil::SDK::Client::Requests::RevokeCardRequest
- Defined in:
- lib/virgil/sdk/client/requests/revoke_card_request.rb
Overview
Revoke card signable API request.
Direct Known Subclasses
Defined Under Namespace
Classes: Reasons
Instance Attribute Summary collapse
-
#card_id ⇒ Object
Returns the value of attribute card_id.
-
#reason ⇒ Object
Returns the value of attribute reason.
Attributes inherited from SignableRequest
#relations, #signatures, #snapshot, #validation_token
Instance Method Summary collapse
-
#initialize(attributes) ⇒ RevokeCardRequest
constructor
Constructs new CreateCardRequest object.
- #restore(validation_token) ⇒ Object
-
#restore_from_snapshot_model(snapshot_model) ⇒ Object
Restores request from snapshot model.
-
#snapshot_model ⇒ Hash
Constructs snapshot model for exporting and signing.
Methods inherited from SignableRequest
#export, #request_model, #sign_with, #take_snapshot
Constructor Details
#initialize(attributes) ⇒ RevokeCardRequest
Constructs new CreateCardRequest object.
53 54 55 56 57 |
# File 'lib/virgil/sdk/client/requests/revoke_card_request.rb', line 53 def initialize(attributes) super() self.card_id = attributes[:card_id] self.reason = attributes[:reason] || Reasons::Unspecified end |
Instance Attribute Details
#card_id ⇒ Object
Returns the value of attribute card_id
49 50 51 |
# File 'lib/virgil/sdk/client/requests/revoke_card_request.rb', line 49 def card_id @card_id end |
#reason ⇒ Object
Returns the value of attribute reason
49 50 51 |
# File 'lib/virgil/sdk/client/requests/revoke_card_request.rb', line 49 def reason @reason end |
Instance Method Details
#restore(validation_token) ⇒ Object
66 67 68 |
# File 'lib/virgil/sdk/client/requests/revoke_card_request.rb', line 66 def restore(validation_token) @validation_token = validation_token end |
#restore_from_snapshot_model(snapshot_model) ⇒ Object
Restores request from snapshot model.
61 62 63 64 |
# File 'lib/virgil/sdk/client/requests/revoke_card_request.rb', line 61 def restore_from_snapshot_model(snapshot_model) self.card_id = snapshot_model['card_id'] self.reason = snapshot_model['revocation_reason'] end |
#snapshot_model ⇒ Hash
Constructs snapshot model for exporting and signing.
73 74 75 76 77 78 |
# File 'lib/virgil/sdk/client/requests/revoke_card_request.rb', line 73 def snapshot_model return { 'card_id': self.card_id, 'revocation_reason': self.reason, } end |