Class: AhoSdk::Issuer::SchemasResource 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.

Schemas resource operations

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ SchemasResource

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 SchemasResource.



421
422
423
# File 'lib/aho_sdk/issuer.rb', line 421

def initialize(client)
  @client = client
end

Instance Method Details

#activate(id:, 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 credential schema

Returns:

  • (Hash)


467
468
469
# File 'lib/aho_sdk/issuer.rb', line 467

def activate(id:, idempotency_key: nil)
  @client.post("/v1/issuer/schemas/#{id}/activate", idempotency_key: idempotency_key)
end

#archive(id:, 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.

Archive an active credential schema

Returns:

  • (Hash)


474
475
476
# File 'lib/aho_sdk/issuer.rb', line 474

def archive(id:, idempotency_key: nil)
  @client.post("/v1/issuer/schemas/#{id}/archive", 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 credential schema

Returns:

  • (Hash)


428
429
430
# File 'lib/aho_sdk/issuer.rb', line 428

def create(body: nil, idempotency_key: nil)
  @client.post("/v1/issuer/schemas", body: body, idempotency_key: idempotency_key)
end

#delete(id:) ⇒ 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 credential schema

Returns:

  • (Hash)


460
461
462
# File 'lib/aho_sdk/issuer.rb', line 460

def delete(id:)
  @client.delete("/v1/issuer/schemas/#{id}")
end

#get(id:) ⇒ 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 schema details

Returns:

  • (Hash)


446
447
448
# File 'lib/aho_sdk/issuer.rb', line 446

def get(id:)
  @client.get("/v1/issuer/schemas/#{id}")
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 issuer credential schemas

Returns:

  • (Hash)


435
436
437
438
439
440
441
# File 'lib/aho_sdk/issuer.rb', line 435

def list(status: nil, page: nil, per_page: nil)
  fetch_page = ->(p) {
    response = @client.get("/v1/issuer/schemas", 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

#update(id:, 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 credential schema

Returns:

  • (Hash)


453
454
455
# File 'lib/aho_sdk/issuer.rb', line 453

def update(id:, body: nil, idempotency_key: nil)
  @client.patch("/v1/issuer/schemas/#{id}", body: body, idempotency_key: idempotency_key)
end