Class: AhoSdk::Issuer::OffersResource Private

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

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.



380
381
382
# File 'lib/aho_sdk/issuer.rb', line 380

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

Returns:

  • (Hash)


398
399
400
# File 'lib/aho_sdk/issuer.rb', line 398

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

Returns:

  • (Hash)


405
406
407
# File 'lib/aho_sdk/issuer.rb', line 405

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

Returns:

  • (Hash)


387
388
389
390
391
392
393
# File 'lib/aho_sdk/issuer.rb', line 387

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

Returns:

  • (Hash)


412
413
414
# File 'lib/aho_sdk/issuer.rb', line 412

def revoke(uuid:, idempotency_key: nil)
  @client.post("/v1/issuer/offers/#{uuid}/revoke", idempotency_key: idempotency_key)
end