foliolib.folio.api.inventoryStorage.ContributorType
- class foliolib.folio.api.inventoryStorage.ContributorType(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiContributor Types API
This documents the API calls that can be made to query and manage contributor types
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
delete_contributorType(contributorTypeId)Delete contributorType item with given {contributorTypeId}
get_contributorType(contributorTypeId)Retrieve contributorType item with given {contributorTypeId}
get_contributorTypes(**kwargs)Return a list of contributor types
modify_contributorType(contributorTypeId, ...)Update contributorType item with given {contributorTypeId}
set_contributorType(contributorType)Create a new contributor type
- delete_contributorType(contributorTypeId: str)
Delete contributorType item with given {contributorTypeId}
DELETE /contributor-types/{contributorTypeId}- Parameters
contributorTypeId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
- get_contributorType(contributorTypeId: str)
Retrieve contributorType item with given {contributorTypeId}
GET /contributor-types/{contributorTypeId}- Parameters
contributorTypeId (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": "A contributor type", "type": "object", "properties": { "id": { "type": "string" }, "name": { "description": "label for the contributor type", "type": "string" }, "code": { "description": "distinct code for the contributor type", "type": "string" }, "source": { "description": "origin of the contributor type record", "source": "string" }, "metadata": { "type": "object", "$ref": "raml-util/schemas/metadata.schema", "readonly": true } }, "required": [ "name", "code", "source" ] }
- get_contributorTypes(**kwargs)
Return a list of contributor types
GET /contributor-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.
with valid searchable fields
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
name=aaa
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": "A collection of contributor types", "type": "object", "properties": { "contributorTypes": { "description": "List of contributor types", "id": "contributorType", "type": "array", "items": { "type": "object", "$ref": "contributortype.json" } }, "totalRecords": { "description": "Estimated or exact total number of records", "type": "integer" } }, "required": [ "contributorTypes", "totalRecords" ] }
- modify_contributorType(contributorTypeId: str, contributorType: dict)
Update contributorType item with given {contributorTypeId}
PUT /contributor-types/{contributorTypeId}- Parameters
contributorTypeId (str) –
contributorType (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiRequestConflict – Conflict
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A contributor type", "type": "object", "properties": { "id": { "type": "string" }, "name": { "description": "label for the contributor type", "type": "string" }, "code": { "description": "distinct code for the contributor type", "type": "string" }, "source": { "description": "origin of the contributor type record", "source": "string" }, "metadata": { "type": "object", "$ref": "raml-util/schemas/metadata.schema", "readonly": true } }, "required": [ "name", "code", "source" ] }
- set_contributorType(contributorType: dict)
Create a new contributor type
POST /contributor-types- Parameters
contributorType (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the created contributorType item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A contributor type", "type": "object", "properties": { "id": { "type": "string" }, "name": { "description": "label for the contributor type", "type": "string" }, "code": { "description": "distinct code for the contributor type", "type": "string" }, "source": { "description": "origin of the contributor type record", "source": "string" }, "metadata": { "type": "object", "$ref": "raml-util/schemas/metadata.schema", "readonly": true } }, "required": [ "name", "code", "source" ] }