class Virgil::SDK::Client::Requests::RevokeCardRequest

Revoke card signable API request.

Attributes

card_id[RW]
reason[RW]

Public Class Methods

new(attributes) click to toggle source

Constructs new CreateCardRequest object

Calls superclass method
# File lib/virgil/sdk/client/requests/revoke_card_request.rb, line 52
def initialize(attributes)
  super()
  self.card_id = attributes[:card_id]
  self.reason = attributes[:reason] || Reasons::Unspecified
end

Public Instance Methods

restore(validation_token) click to toggle source
# File lib/virgil/sdk/client/requests/revoke_card_request.rb, line 67
def restore(validation_token)
  @validation_token = validation_token
end
restore_from_snapshot_model(snapshot_model) click to toggle source

Restores request from snapshot model.

Args:

snapshot_model: snapshot model dict
# File lib/virgil/sdk/client/requests/revoke_card_request.rb, line 62
def restore_from_snapshot_model(snapshot_model)
  self.card_id = snapshot_model['card_id']
  self.reason = snapshot_model['revocation_reason']
end
snapshot_model() click to toggle source

Constructs snapshot model for exporting and signing.

Returns:

Dict containing snapshot data model used for card revocation request.
# File lib/virgil/sdk/client/requests/revoke_card_request.rb, line 75
def snapshot_model
  return {
    'card_id': self.card_id,
    'revocation_reason': self.reason,
  }
end