Class: Seam::Clients::AcsEncoders
- Inherits:
-
Object
- Object
- Seam::Clients::AcsEncoders
- Defined in:
- lib/seam/routes/acs_encoders.rb
Instance Method Summary collapse
-
#encode_credential(acs_encoder_id:, access_method_id: nil, acs_credential_id: nil, wait_for_action_attempt: nil) ⇒ Seam::Resources::ActionAttempt
Encodes an existing credential onto a plastic card placed on the specified encoder.
-
#get(acs_encoder_id:) ⇒ Seam::Resources::AcsEncoder
Returns a specified encoder.
-
#initialize(client:, defaults:) ⇒ AcsEncoders
constructor
A new instance of AcsEncoders.
-
#list(acs_system_id: nil, acs_system_ids: nil, acs_encoder_ids: nil, limit: nil, page_cursor: nil) ⇒ Seam::Resources::AcsEncoder
Returns a list of all encoders.
-
#scan_credential(acs_encoder_id:, salto_ks_metadata: nil, wait_for_action_attempt: nil) ⇒ Seam::Resources::ActionAttempt
Scans an encoded acs_credential from a plastic card placed on the specified encoder.
-
#scan_to_assign_credential(acs_encoder_id:, acs_user_id: nil, salto_ks_metadata: nil, user_identity_id: nil, wait_for_action_attempt: nil) ⇒ Seam::Resources::ActionAttempt
Scans a physical card placed on the specified encoder and assigns the scanned credential to an ACS user.
- #simulate ⇒ Object
Constructor Details
#initialize(client:, defaults:) ⇒ AcsEncoders
Returns a new instance of AcsEncoders.
8 9 10 11 |
# File 'lib/seam/routes/acs_encoders.rb', line 8 def initialize(client:, defaults:) @client = client @defaults = defaults end |
Instance Method Details
#encode_credential(acs_encoder_id:, access_method_id: nil, acs_credential_id: nil, wait_for_action_attempt: nil) ⇒ Seam::Resources::ActionAttempt
Encodes an existing credential onto a plastic card placed on the specified encoder. Either provide an acs_credential_id or an access_method_id
22 23 24 25 26 27 28 |
# File 'lib/seam/routes/acs_encoders.rb', line 22 def encode_credential(acs_encoder_id:, access_method_id: nil, acs_credential_id: nil, wait_for_action_attempt: nil) res = @client.post("/acs/encoders/encode_credential", {acs_encoder_id: acs_encoder_id, access_method_id: access_method_id, acs_credential_id: acs_credential_id}.compact) wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end |
#get(acs_encoder_id:) ⇒ Seam::Resources::AcsEncoder
Returns a specified encoder.
33 34 35 36 37 |
# File 'lib/seam/routes/acs_encoders.rb', line 33 def get(acs_encoder_id:) res = @client.post("/acs/encoders/get", {acs_encoder_id: acs_encoder_id}.compact) Seam::Resources::AcsEncoder.load_from_response(res.body["acs_encoder"]) end |
#list(acs_system_id: nil, acs_system_ids: nil, acs_encoder_ids: nil, limit: nil, page_cursor: nil) ⇒ Seam::Resources::AcsEncoder
Returns a list of all encoders.
46 47 48 49 50 |
# File 'lib/seam/routes/acs_encoders.rb', line 46 def list(acs_system_id: nil, acs_system_ids: nil, acs_encoder_ids: nil, limit: nil, page_cursor: nil) res = @client.post("/acs/encoders/list", {acs_system_id: acs_system_id, acs_system_ids: acs_system_ids, acs_encoder_ids: acs_encoder_ids, limit: limit, page_cursor: page_cursor}.compact) Seam::Resources::AcsEncoder.load_from_response(res.body["acs_encoders"]) end |
#scan_credential(acs_encoder_id:, salto_ks_metadata: nil, wait_for_action_attempt: nil) ⇒ Seam::Resources::ActionAttempt
Scans an encoded acs_credential from a plastic card placed on the specified encoder.
56 57 58 59 60 61 62 |
# File 'lib/seam/routes/acs_encoders.rb', line 56 def scan_credential(acs_encoder_id:, salto_ks_metadata: nil, wait_for_action_attempt: nil) res = @client.post("/acs/encoders/scan_credential", {acs_encoder_id: acs_encoder_id, salto_ks_metadata: }.compact) wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end |
#scan_to_assign_credential(acs_encoder_id:, acs_user_id: nil, salto_ks_metadata: nil, user_identity_id: nil, wait_for_action_attempt: nil) ⇒ Seam::Resources::ActionAttempt
Scans a physical card placed on the specified encoder and assigns the scanned credential to an ACS user. Provide either an acs_user_id or a user_identity_id.
70 71 72 73 74 75 76 |
# File 'lib/seam/routes/acs_encoders.rb', line 70 def scan_to_assign_credential(acs_encoder_id:, acs_user_id: nil, salto_ks_metadata: nil, user_identity_id: nil, wait_for_action_attempt: nil) res = @client.post("/acs/encoders/scan_to_assign_credential", {acs_encoder_id: acs_encoder_id, acs_user_id: acs_user_id, salto_ks_metadata: , user_identity_id: user_identity_id}.compact) wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end |
#simulate ⇒ Object
13 14 15 |
# File 'lib/seam/routes/acs_encoders.rb', line 13 def simulate @simulate ||= Seam::Clients::AcsEncodersSimulate.new(client: @client, defaults: @defaults) end |