Class: AhoSdk::Verifier::RequestsResource Private

Inherits:
Object
  • Object
show all
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

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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (Hash)


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

Returns:

  • (String)


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

Returns:

  • (Hash)


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