Class: AhoSdk::Verifier::RequestsResource Private
- Inherits:
-
Object
- Object
- AhoSdk::Verifier::RequestsResource
- Defined in:
- lib/aho_sdk/verifier.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Requests resource operations
Instance Method Summary collapse
-
#activate(uuid:, idempotency_key: nil) ⇒ Hash
private
Activate a draft presentation request.
-
#close(uuid:, idempotency_key: nil) ⇒ Hash
private
Close an active presentation request.
-
#create(body: nil, idempotency_key: nil) ⇒ Hash
private
Create a presentation request.
-
#delete(uuid:) ⇒ Hash
private
Delete a draft presentation request.
-
#get(uuid:) ⇒ Hash
private
Get presentation request details.
-
#initialize(client) ⇒ RequestsResource
constructor
private
A new instance of RequestsResource.
-
#list(status: nil, page: nil, per_page: nil) ⇒ Hash
private
List presentation requests.
-
#qr_code(uuid:, format: nil, output_format: :svg) ⇒ String
private
Get QR code for presentation request.
-
#update(uuid:, body: nil, idempotency_key: nil) ⇒ Hash
private
Update a draft presentation request.
Constructor Details
#initialize(client) ⇒ RequestsResource
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 RequestsResource.
119 120 121 |
# File 'lib/aho_sdk/verifier.rb', line 119 def initialize(client) @client = client end |
Instance Method Details
#activate(uuid:, idempotency_key: nil) ⇒ Hash
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.
Activate a draft presentation request
165 166 167 |
# File 'lib/aho_sdk/verifier.rb', line 165 def activate(uuid:, idempotency_key: nil) @client.post("/v1/verifier/requests/#{uuid}/activate", idempotency_key: idempotency_key) end |
#close(uuid:, idempotency_key: nil) ⇒ Hash
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.
Close an active presentation request
172 173 174 |
# File 'lib/aho_sdk/verifier.rb', line 172 def close(uuid:, idempotency_key: nil) @client.post("/v1/verifier/requests/#{uuid}/close", idempotency_key: idempotency_key) end |
#create(body: nil, idempotency_key: nil) ⇒ Hash
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.
Create a presentation request
126 127 128 |
# File 'lib/aho_sdk/verifier.rb', line 126 def create(body: nil, idempotency_key: nil) @client.post("/v1/verifier/requests", body: body, idempotency_key: idempotency_key) end |
#delete(uuid:) ⇒ Hash
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.
Delete a draft presentation request
158 159 160 |
# File 'lib/aho_sdk/verifier.rb', line 158 def delete(uuid:) @client.delete("/v1/verifier/requests/#{uuid}") end |
#get(uuid:) ⇒ Hash
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.
Get presentation request details
144 145 146 |
# File 'lib/aho_sdk/verifier.rb', line 144 def get(uuid:) @client.get("/v1/verifier/requests/#{uuid}") end |
#list(status: nil, page: nil, per_page: nil) ⇒ Hash
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.
List presentation requests
133 134 135 136 137 138 139 |
# File 'lib/aho_sdk/verifier.rb', line 133 def list(status: nil, page: nil, per_page: nil) fetch_page = ->(p) { response = @client.get("/v1/verifier/requests", params: { status: status, page: p, per_page: per_page }) Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page) } fetch_page.call(page) end |
#qr_code(uuid:, format: nil, output_format: :svg) ⇒ String
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.
Get QR code for presentation request
179 180 181 182 183 |
# File 'lib/aho_sdk/verifier.rb', line 179 def qr_code(uuid:, format: nil, output_format: :svg) format_map = { svg: "image/svg+xml", png: "image/png", json: "application/json" } accept = format_map[output_format] || format_map.values.first @client.get("/v1/verifier/requests/#{uuid}/qr_code", params: { format: format }, accept: accept) end |
#update(uuid:, body: nil, idempotency_key: nil) ⇒ Hash
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.
Update a draft presentation request
151 152 153 |
# File 'lib/aho_sdk/verifier.rb', line 151 def update(uuid:, body: nil, idempotency_key: nil) @client.patch("/v1/verifier/requests/#{uuid}", body: body, idempotency_key: idempotency_key) end |