foliolib.folio.api.circulationStorage.RequestPolicyStorage
- class foliolib.folio.api.circulationStorage.RequestPolicyStorage(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiRequest Policy Storage API
Storage for request policies
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
DELETE /request-policy-storage/request-policiesdelete_requestPolicy(requestPolicyId)Delete requestPolicy item with given {requestPolicyId}
get_requestPolicies(**kwargs)Retrieve a list of requestPolicy items.
get_requestPolicy(requestPolicyId)Retrieve requestPolicy item with given {requestPolicyId}
modify_requestPolicy(requestPolicyId, ...)Update requestPolicy item with given {requestPolicyId}
set_requestPolicy(requestPolicy)Create a new requestPolicy item.
- delete_requestPolicies()
DELETE /request-policy-storage/request-policies
- delete_requestPolicy(requestPolicyId: str)
Delete requestPolicy item with given {requestPolicyId}
DELETE /request-policy-storage/request-policies/{requestPolicyId}- Parameters
requestPolicyId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
- get_requestPolicies(**kwargs)
Retrieve a list of requestPolicy items.
GET /request-policy-storage/request-policies- 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
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.
searchable using CQL
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
id=”cf23adf0-61ba-4887-bf82-956c4aae2260”
- 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 request policies", "type": "object", "properties": { "requestPolicies": { "description": "List of request policies", "id": "requestPolicies", "type": "array", "items": { "type": "object", "$ref": "request-policy.json" } }, "totalRecords": { "type": "integer" } }, "required": [ "requestPolicies", "totalRecords" ] }
- get_requestPolicy(requestPolicyId: str)
Retrieve requestPolicy item with given {requestPolicyId}
GET /request-policy-storage/request-policies/{requestPolicyId}- Parameters
requestPolicyId (str) –
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestNotFound – Not Found
OkapiFatalError – Server Error
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "request policy schema", "properties": { "id": { "description": "Unique request policy ID", "type": "string" }, "name": { "description": "Unique request policy name, required", "type": "string" }, "description": { "description": "Description of request policy", "type": "string" }, "requestTypes": { "description": "Whether the item should be held upon return, recalled or paged for", "type": "array", "items": { "type": "object", "$ref": "request-type.json" } }, "metadata": { "description": "Metadata about creation and changes to request policy, provided by the server (client should not provide)", "$ref": "raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "name" ] }
- modify_requestPolicy(requestPolicyId: str, requestPolicy: dict)
Update requestPolicy item with given {requestPolicyId}
PUT /request-policy-storage/request-policies/{requestPolicyId}- Parameters
requestPolicyId (str) –
requestPolicy (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiRequestConflict – Conflict
OkapiFatalError – Server Error
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "request policy schema", "properties": { "id": { "description": "Unique request policy ID", "type": "string" }, "name": { "description": "Unique request policy name, required", "type": "string" }, "description": { "description": "Description of request policy", "type": "string" }, "requestTypes": { "description": "Whether the item should be held upon return, recalled or paged for", "type": "array", "items": { "type": "object", "$ref": "request-type.json" } }, "metadata": { "description": "Metadata about creation and changes to request policy, provided by the server (client should not provide)", "$ref": "raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "name" ] }
- set_requestPolicy(requestPolicy: dict)
Create a new requestPolicy item.
POST /request-policy-storage/request-policies- Parameters
requestPolicy (dict) – See Schema below
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
Headers
Location - URI to the created requestPolicy item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "description": "request policy schema", "properties": { "id": { "description": "Unique request policy ID", "type": "string" }, "name": { "description": "Unique request policy name, required", "type": "string" }, "description": { "description": "Description of request policy", "type": "string" }, "requestTypes": { "description": "Whether the item should be held upon return, recalled or paged for", "type": "array", "items": { "type": "object", "$ref": "request-type.json" } }, "metadata": { "description": "Metadata about creation and changes to request policy, provided by the server (client should not provide)", "$ref": "raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "name" ] }