Class: AhoSdk::Issuer::OffersResource Private
- Inherits:
-
Object
- Object
- AhoSdk::Issuer::OffersResource
- Defined in:
- lib/aho_sdk/issuer.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.
Offers resource operations
Instance Method Summary collapse
-
#create(body: nil, idempotency_key: nil) ⇒ Hash
private
Create a credential offer.
-
#get(uuid:) ⇒ Hash
private
Get credential offer details.
-
#initialize(client) ⇒ OffersResource
constructor
private
A new instance of OffersResource.
-
#list(page: nil, per_page: nil, status: nil, created_after: nil, created_before: nil, expires_after: nil, expires_before: nil, schema: nil, subject_identifier: nil, sort: nil, direction: nil) ⇒ Hash
private
List credential offers.
-
#revoke(uuid:, idempotency_key: nil) ⇒ Hash
private
Revoke a credential offer.
Constructor Details
#initialize(client) ⇒ OffersResource
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 OffersResource.
341 342 343 |
# File 'lib/aho_sdk/issuer.rb', line 341 def initialize(client) @client = client end |
Instance Method Details
#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 credential offer
359 360 361 |
# File 'lib/aho_sdk/issuer.rb', line 359 def create(body: nil, idempotency_key: nil) @client.post("/v1/issuer/offers", body: body, idempotency_key: idempotency_key) 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 credential offer details
366 367 368 |
# File 'lib/aho_sdk/issuer.rb', line 366 def get(uuid:) @client.get("/v1/issuer/offers/#{uuid}") end |
#list(page: nil, per_page: nil, status: nil, created_after: nil, created_before: nil, expires_after: nil, expires_before: nil, schema: nil, subject_identifier: nil, sort: nil, direction: 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 credential offers
348 349 350 351 352 353 354 |
# File 'lib/aho_sdk/issuer.rb', line 348 def list(page: nil, per_page: nil, status: nil, created_after: nil, created_before: nil, expires_after: nil, expires_before: nil, schema: nil, subject_identifier: nil, sort: nil, direction: nil) fetch_page = ->(p) { response = @client.get("/v1/issuer/offers", params: { page: p, per_page: per_page, status: status, created_after: created_after, created_before: created_before, expires_after: expires_after, expires_before: expires_before, schema: schema, subject_identifier: subject_identifier, sort: sort, direction: direction }) Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page) } fetch_page.call(page) end |
#revoke(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.
Revoke a credential offer
373 374 375 |
# File 'lib/aho_sdk/issuer.rb', line 373 def revoke(uuid:, idempotency_key: nil) @client.post("/v1/issuer/offers/#{uuid}/revoke", idempotency_key: idempotency_key) end |