foliolib.folio.api.users.UserTenants
- class foliolib.folio.api.users.UserTenants(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApimod-users User tenants API
Records that show the primary tenant for a user when doing single-sign-on
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
get_userTenants(**kwargs)Return a list of user tenants
set_userTenant(userTenant)Create a user-tenant
- get_userTenants(**kwargs)
Return a list of user tenants
GET /user-tenants- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
offset (int) –
(default=0) Skip over a number of elements by specifying an offset value for the query
Example
0
limit (int) –
(default=10) Limit the number of elements returned in the response
Example
10
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "Collection of primary tenant records", "properties": { "userTenants": { "description": "List of primary tenant records", "type": "array", "id": "userTenants", "items": { "type": "object", "$ref": "userTenant.json" } }, "totalRecords": { "type": "integer" } }, "required": [ "userTenants", "totalRecords" ] }
- set_userTenant(userTenant: dict)
Create a user-tenant
POST /user-tenants- Parameters
userTenant (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the created userTenant item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Primary tenant of a user used for single-sign-on", "type": "object", "properties": { "id": { "description": "UUID of the user tenant", "$ref": "raml-util/schemas/uuid.schema" }, "userId": { "description": "UUID of the user", "$ref": "raml-util/schemas/uuid.schema" }, "username": { "description": "The user name", "type": "string" }, "tenantId": { "description": "Primary tenant of the user for single-sign-on", "type": "string" }, "centralTenantId": { "description": "Central tenant id in the consortium", "type": "string" }, "phoneNumber": { "description": "The user's primary phone number", "type": "string" }, "mobilePhoneNumber": { "description": "The user's mobile phone number", "type": "string" }, "email": { "description": "The user's email address", "type": "string" } }, "additionalProperties": false, "required": [ "userId", "tenantId" ] }