Class: Cadenya::Resources::Tenants::Subjects
- Inherits:
-
Object
- Object
- Cadenya::Resources::Tenants::Subjects
- Defined in:
- lib/cadenya/resources/tenants/subjects.rb,
sig/cadenya/resources/tenants/subjects.rbs
Overview
Read and erase tenants and the subjects under them. Tenants and subjects are created by assertion — on objective creation or widget session mint — never directly, so this service has no create or update: it exists to enumerate what assertions have produced, and to destroy it on request.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Subjects
constructor
private
A new instance of Subjects.
-
#list(tenant_id, workspace_id: nil, cursor: nil, include_info: nil, limit: nil, query: nil, sort_order: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::Subject>
Some parameter documentations has been truncated, see Models::Tenants::SubjectListParams for more details.
Constructor Details
#initialize(client:) ⇒ Subjects
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 Subjects.
60 61 62 |
# File 'lib/cadenya/resources/tenants/subjects.rb', line 60 def initialize(client:) @client = client end |
Instance Method Details
#list(tenant_id, workspace_id: nil, cursor: nil, include_info: nil, limit: nil, query: nil, sort_order: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::Subject>
Some parameter documentations has been truncated, see Models::Tenants::SubjectListParams for more details.
Lists the subjects asserted under a tenant. Subjects are only listable through their tenant: a subject's external_id is unique within its tenant, not across the workspace, so the same key can name different people under different tenants.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/cadenya/resources/tenants/subjects.rb', line 40 def list(tenant_id, params = {}) parsed, = Cadenya::Tenants::SubjectListParams.dump_request(params) query = Cadenya::Internal::Util.encode_query_params(parsed) workspace_id = parsed.delete(:workspace_id) do @client.workspace_id end @client.request( method: :get, path: ["v1/workspaces/%1$s/tenants/%2$s/subjects", workspace_id, tenant_id], query: query.transform_keys(include_info: "includeInfo", sort_order: "sortOrder"), page: Cadenya::Internal::CursorPagination, model: Cadenya::Subject, options: ) end |