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

Credentials resource operations

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ CredentialsResource

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



148
149
150
# File 'lib/aho_sdk/issuer.rb', line 148

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.

Issue a new credential

Returns:

  • (Hash)


155
156
157
# File 'lib/aho_sdk/issuer.rb', line 155

def create(body: nil, idempotency_key: nil)
  @client.post("/v1/issuer/credentials", 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 issued credential details

Returns:

  • (Hash)


173
174
175
# File 'lib/aho_sdk/issuer.rb', line 173

def get(uuid:)
  @client.get("/v1/issuer/credentials/#{uuid}")
end

#history(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 history

Returns:

  • (Hash)


208
209
210
# File 'lib/aho_sdk/issuer.rb', line 208

def history(uuid:)
  @client.get("/v1/issuer/credentials/#{uuid}/history")
end

#list(status: nil, schema: nil, subject_identifier: nil, issued_after: nil, issued_before: nil, expires_after: nil, expires_before: nil, sort: "issued_at", direction: "desc", page: 1, per_page: 25) ⇒ 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 credentials

Returns:

  • (Hash)


162
163
164
165
166
167
168
# File 'lib/aho_sdk/issuer.rb', line 162

def list(status: nil, schema: nil, subject_identifier: nil, issued_after: nil, issued_before: nil, expires_after: nil, expires_before: nil, sort: "issued_at", direction: "desc", page: 1, per_page: 25)
  fetch_page = ->(p) {
    response = @client.get("/v1/issuer/credentials", params: { status: status, schema: schema, subject_identifier: subject_identifier, issued_after: issued_after, issued_before: issued_before, expires_after: expires_after, expires_before: expires_before, sort: sort, direction: direction, page: p, per_page: per_page })
    Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page)
  }
  fetch_page.call(page)
end

#reinstate(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.

Reinstate a suspended credential

Returns:

  • (Hash)


194
195
196
# File 'lib/aho_sdk/issuer.rb', line 194

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

#reinstate_batch(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.

Reinstate multiple credentials

Returns:

  • (Hash)


229
230
231
# File 'lib/aho_sdk/issuer.rb', line 229

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

#revoke(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.

Revoke a credential

Returns:

  • (Hash)


180
181
182
# File 'lib/aho_sdk/issuer.rb', line 180

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

#revoke_batch(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.

Revoke multiple credentials

Returns:

  • (Hash)


215
216
217
# File 'lib/aho_sdk/issuer.rb', line 215

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

#status(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 status

Returns:

  • (Hash)


201
202
203
# File 'lib/aho_sdk/issuer.rb', line 201

def status(uuid:)
  @client.get("/v1/issuer/credentials/#{uuid}/status")
end

#suspend(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.

Suspend a credential

Returns:

  • (Hash)


187
188
189
# File 'lib/aho_sdk/issuer.rb', line 187

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

#suspend_batch(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.

Suspend multiple credentials

Returns:

  • (Hash)


222
223
224
# File 'lib/aho_sdk/issuer.rb', line 222

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