foliolib.folio.api.consortia.Tenants
- class foliolib.folio.api.consortia.Tenants(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiTenant integration API
Tenant integration API
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
createprimaryaffiliations(consortiumId, ...)POST /consortia/{consortiumId}/tenants/{tenantId}/create-primary-affiliationsdeletetenantbyid(consortiumId, tenantId)DELETE /consortia/{consortiumId}/tenants/{tenantId}gettenants(consortiumId, **kwargs)GET /consortia/{consortiumId}/tenantssavetenant(consortiumId, tenant, **kwargs)POST /consortia/{consortiumId}/tenantssyncprimaryaffiliations(consortiumId, tenantId)POST /consortia/{consortiumId}/tenants/{tenantId}/sync-primary-affiliationsupdatetenant(consortiumId, tenantId, tenant)PUT /consortia/{consortiumId}/tenants/{tenantId}- createprimaryaffiliations(consortiumId, tenantId, syncPrimaryAffiliationBody)
POST /consortia/{consortiumId}/tenants/{tenantId}/create-primary-affiliations- Parameters
consortiumId (str) –
tenantId (str) – The ID of the tenant
syncPrimaryAffiliationBody (dict) – See Schema below.
- Raises
OkapiRequestError – Bad request
OkapiRequestNotFound – Resource not found
OkapiRequestConflict – Validation errors
OkapiRequestUnprocessableEntity – Validation errors
OkapiFatalError – Internal server error
Schema
{ "description": "Primary affiliation DTO", "type": "object", "properties": { "tenantId": { "description": "Unique tenant id", "type": "string" }, "users": { "description": "users", "type": "array", "items": { "$ref": "primaryAffiliationBody.yaml#/SyncUser" } } }, "additionalProperties": false, "required": [ "tenantId" ] }
- deletetenantbyid(consortiumId, tenantId)
DELETE /consortia/{consortiumId}/tenants/{tenantId}- Parameters
consortiumId (str) –
tenantId (str) – The ID of the tenant
- Raises
OkapiRequestError – Bad request
OkapiRequestNotFound – Resource not found
OkapiFatalError – Internal server error
- gettenants(consortiumId, **kwargs)
GET /consortia/{consortiumId}/tenants- Parameters
consortiumId (str) –
- Keyword Arguments
offset (int) – Skip over a number of elements by specifying an offset value for the query (default: 0, minimum: 0, maximum: 2147483647)
limit (int) – Limit the number of elements returned in the response (default: 10, minimum: 0, maximum: 2147483647)
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestError – Bad request
OkapiRequestNotFound – Resource not found
OkapiFatalError – Internal server error
Schema
{ "type": "object", "properties": { "tenants": { "type": "array", "description": "Tenants", "items": { "type": "object", "$ref": "tenant.yaml#/Tenant" } }, "totalRecords": { "type": "integer" } }, "additionalProperties": false, "required": [ "tenants", "totalRecords" ] }
- savetenant(consortiumId, tenant, **kwargs)
POST /consortia/{consortiumId}/tenants- Parameters
consortiumId (str) –
tenant (dict) – See Schema below.
- Keyword Arguments
adminUserId (str) –
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestError – Bad request
OkapiRequestNotFound – Resource not found
OkapiRequestConflict – Validation errors
OkapiRequestUnprocessableEntity – Validation errors
OkapiFatalError – Internal server error
Schema
{ "type": "object", "properties": { "id": { "type": "string" }, "code": { "type": "string", "minLength": 3, "maxLength": 3, "pattern": "^[a-zA-Z0-9]*$" }, "name": { "type": "string", "minLength": 2, "maxLength": 150 }, "isCentral": { "type": "boolean" } }, "additionalProperties": false, "required": [ "id", "code", "name", "isCentral" ] }
- syncprimaryaffiliations(consortiumId, tenantId)
POST /consortia/{consortiumId}/tenants/{tenantId}/sync-primary-affiliations- Parameters
consortiumId (str) –
tenantId (str) – The ID of the tenant
- Raises
OkapiRequestError – Bad request
OkapiRequestNotFound – Resource not found
OkapiRequestConflict – Validation errors
OkapiRequestUnprocessableEntity – Validation errors
OkapiFatalError – Internal server error
- updatetenant(consortiumId, tenantId, tenant)
PUT /consortia/{consortiumId}/tenants/{tenantId}- Parameters
consortiumId (str) –
tenantId (str) – The ID of the tenant
tenant (dict) – See Schema below.
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestError – Bad request
OkapiRequestNotFound – Resource not found
OkapiFatalError – Internal server error
Schema
{ "type": "object", "properties": { "id": { "type": "string" }, "code": { "type": "string", "minLength": 3, "maxLength": 3, "pattern": "^[a-zA-Z0-9]*$" }, "name": { "type": "string", "minLength": 2, "maxLength": 150 }, "isCentral": { "type": "boolean" } }, "additionalProperties": false, "required": [ "id", "code", "name", "isCentral" ] }