Class: AhoSdk::Unauthenticated::SchemasResource Private
- Inherits:
-
Object
- Object
- AhoSdk::Unauthenticated::SchemasResource
- Defined in:
- lib/aho_sdk/unauthenticated.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
-
#get(slug:) ⇒ Hash
private
Get schema details.
-
#initialize(client) ⇒ SchemasResource
constructor
private
A new instance of SchemasResource.
-
#list(category: nil, tag: nil, q: nil, page: nil, per_page: nil) ⇒ Hash
private
Browse public credential schemas.
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.
33 34 35 |
# File 'lib/aho_sdk/unauthenticated.rb', line 33 def initialize(client) @client = client end |
Instance Method Details
#get(slug:) ⇒ 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 schema details
51 52 53 54 55 56 57 |
# File 'lib/aho_sdk/unauthenticated.rb', line 51 def get(slug:) fetch_page = ->(p) { response = @client.get("/v1/schemas/#{slug}") Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page) } fetch_page.call(1) end |
#list(category: nil, tag: nil, q: 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.
Browse public credential schemas
40 41 42 43 44 45 46 |
# File 'lib/aho_sdk/unauthenticated.rb', line 40 def list(category: nil, tag: nil, q: nil, page: nil, per_page: nil) fetch_page = ->(p) { response = @client.get("/v1/schemas", params: { category: category, tag: tag, q: q, page: p, per_page: per_page }) Page.new(data: response[:data], meta: response[:meta], fetch_next: fetch_page) } fetch_page.call(page) end |