foliolib.folio.api.organizationsStorage.OrganizationType
- class foliolib.folio.api.organizationsStorage.OrganizationType(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiOrganization types
CRUD APIs used to manage organization types.
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
delete_organizationType(organizationTypesId)Delete an organization type by id
get_organizationType(organizationTypesId)Retrieve organizationType item with given {organizationTypeId}
get_organizationTypes(**kwargs)Get a list of organization types
modify_organizationType(organizationTypesId, ...)Update an organization type by id
set_organizationType(organizationType)Create an organization type
- delete_organizationType(organizationTypesId: str)
Delete an organization type by id
DELETE /organizations-storage/organization-types/{organizationTypesId}- Parameters
organizationTypesId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
- get_organizationType(organizationTypesId: str)
Retrieve organizationType item with given {organizationTypeId}
GET /organizations-storage/organization-types/{organizationTypesId}- Parameters
organizationTypesId (str) –
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestNotFound – Not Found
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "An organization type", "type": "object", "properties": { "id": { "description": "The unique id of this organization type", "$ref": "../../common/schemas/uuid.json" }, "name": { "description": "The name of this organization type", "type": "string" }, "status": { "description": "The status of this organization type", "type": "string", "enum": [ "Active", "Inactive" ] }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "name", "status" ] }
- get_organizationTypes(**kwargs)
Get a list of organization types
GET /organizations-storage/organization-types- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
query (str) –
A query expressed as a CQL string (see [dev.folio.org/reference/glossary#cql](https://dev.folio.org/reference/glossary#cql)) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.
CQL query
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
status=Active
totalRecords (str) –
(default=auto) How to calculate the totalRecords property. “exact” for the correct number, “estimated” for an estimation, “auto” to automatically select “exact” or “estimated”, “none” for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example
none
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#", "description": "Collection of organization type records", "type": "object", "properties": { "organizationTypes": { "description": "The list of organization types in this collection", "type": "array", "id": "organizationTypes", "items": { "type": "object", "$ref": "organization_type.json" } }, "totalRecords": { "description": "The number of organization type records returned in this collection", "type": "integer" } }, "additionalProperties": false, "required": [ "organizationTypes", "totalRecords" ] }
- modify_organizationType(organizationTypesId: str, organizationType: dict)
Update an organization type by id
PUT /organizations-storage/organization-types/{organizationTypesId}- Parameters
organizationTypesId (str) –
organizationType (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiRequestConflict – Conflict
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "An organization type", "type": "object", "properties": { "id": { "description": "The unique id of this organization type", "$ref": "../../common/schemas/uuid.json" }, "name": { "description": "The name of this organization type", "type": "string" }, "status": { "description": "The status of this organization type", "type": "string", "enum": [ "Active", "Inactive" ] }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "name", "status" ] }
- set_organizationType(organizationType: dict)
Create an organization type
POST /organizations-storage/organization-types- Parameters
organizationType (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the created organizationType item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "An organization type", "type": "object", "properties": { "id": { "description": "The unique id of this organization type", "$ref": "../../common/schemas/uuid.json" }, "name": { "description": "The name of this organization type", "type": "string" }, "status": { "description": "The status of this organization type", "type": "string", "enum": [ "Active", "Inactive" ] }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "name", "status" ] }