foliolib.folio.api.ordersStorage.AcquisitionsUnit
- class foliolib.folio.api.ordersStorage.AcquisitionsUnit(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiAcquisitions units
CRUD APIs used to manage acquisitions units.
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
delete_membership(membershipsId)Delete membership item with given {membershipId}
delete_unit(unitsId)Delete unit item with given {unitId}
get_membership(membershipsId)Retrieve membership item with given {membershipId}
get_memberships(**kwargs)Get list of acquisitions units memberships
get_unit(unitsId)Retrieve unit item with given {unitId}
get_units(**kwargs)Get list of acquisitions units
modify_membership(membershipsId, membership)Update acquisitions unit
modify_unit(unitsId, unit)Update acquisitions unit
set_membership(membership)Create new acquisitions unit
set_unit(unit)Create new acquisitions unit
- delete_membership(membershipsId: str)
Delete membership item with given {membershipId}
DELETE /acquisitions-units-storage/memberships/{membershipsId}- Parameters
membershipsId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
- delete_unit(unitsId: str)
Delete unit item with given {unitId}
DELETE /acquisitions-units-storage/units/{unitsId}- Parameters
unitsId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
- get_membership(membershipsId: str)
Retrieve membership item with given {membershipId}
GET /acquisitions-units-storage/memberships/{membershipsId}- Parameters
membershipsId (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": "Relationship between a user and an acquistions Unit", "type": "object", "properties": { "id": { "description": "UUID of this membership record", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "userId": { "description": "The UUID of the user to associate with the acquisitions unit", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "acquisitionsUnitId": { "description": "The acquisition unit the user is a member of", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "userId", "acquisitionsUnitId" ] }
- get_memberships(**kwargs)
Get list of acquisitions units memberships
GET /acquisitions-units-storage/memberships- 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: for example acquisitionUnitId
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
[“acquisitionUnitId”, “0ebb1f7d-983f-3026-8a4c-5318e0ebc041”]
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 acquisition unit membership records", "type": "object", "properties": { "acquisitionsUnitMemberships": { "description": "collection of acquistitions unit membership records", "type": "array", "id": "acquisitionsUnitMemberships", "items": { "type": "object", "$ref": "acquisitions_unit_membership.json" } }, "totalRecords": { "description": "The number of objects contained in this collection", "type": "integer" } }, "additionalProperties": false, "required": [ "acquisitionsUnitMemberships", "totalRecords" ] }
- get_unit(unitsId: str)
Retrieve unit item with given {unitId}
GET /acquisitions-units-storage/units/{unitsId}- Parameters
unitsId (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": "Acquisitions Units", "type": "object", "properties": { "id": { "description": "UUID of this acquisitions unit record", "$ref": "../../common/schemas/uuid.json" }, "name": { "description": "a name for this acquisitions unit", "type": "string" }, "isDeleted": { "description": "If true, the record is marked for deletion at some point. This prevents it from being assigned to any record.", "type": "boolean", "default": false }, "protectCreate": { "description": "if true, only members can create records associated with this acq unit.", "type": "boolean", "default": true }, "protectRead": { "description": "if true, only members can read/view records associated with this acq unit.", "type": "boolean", "default": false }, "protectUpdate": { "description": "if true, only members can update records associated with this acq unit.", "type": "boolean", "default": true }, "protectDelete": { "description": "if true, only members can delete records associated with this acq unit.", "type": "boolean", "default": true }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "name", "isDeleted" ] }
- get_units(**kwargs)
Get list of acquisitions units
GET /acquisitions-units-storage/units- 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: for example protectRead
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
[“protectRead”, “false”]
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 acquisitions unit records", "type": "object", "properties": { "acquisitionsUnits": { "description": "collection of acquisitions unit records", "type": "array", "id": "acquisitionsUnits", "items": { "type": "object", "$ref": "acquisitions_unit.json" } }, "totalRecords": { "description": "The number of objects contained in this collection", "type": "integer" } }, "additionalProperties": false, "required": [ "acquisitionsUnits", "totalRecords" ] }
- modify_membership(membershipsId: str, membership: dict)
Update acquisitions unit
PUT /acquisitions-units-storage/memberships/{membershipsId}- Parameters
membershipsId (str) –
membership (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": "Relationship between a user and an acquistions Unit", "type": "object", "properties": { "id": { "description": "UUID of this membership record", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "userId": { "description": "The UUID of the user to associate with the acquisitions unit", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "acquisitionsUnitId": { "description": "The acquisition unit the user is a member of", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "userId", "acquisitionsUnitId" ] }
- modify_unit(unitsId: str, unit: dict)
Update acquisitions unit
PUT /acquisitions-units-storage/units/{unitsId}- Parameters
unitsId (str) –
unit (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": "Acquisitions Units", "type": "object", "properties": { "id": { "description": "UUID of this acquisitions unit record", "$ref": "../../common/schemas/uuid.json" }, "name": { "description": "a name for this acquisitions unit", "type": "string" }, "isDeleted": { "description": "If true, the record is marked for deletion at some point. This prevents it from being assigned to any record.", "type": "boolean", "default": false }, "protectCreate": { "description": "if true, only members can create records associated with this acq unit.", "type": "boolean", "default": true }, "protectRead": { "description": "if true, only members can read/view records associated with this acq unit.", "type": "boolean", "default": false }, "protectUpdate": { "description": "if true, only members can update records associated with this acq unit.", "type": "boolean", "default": true }, "protectDelete": { "description": "if true, only members can delete records associated with this acq unit.", "type": "boolean", "default": true }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "name", "isDeleted" ] }
- set_membership(membership: dict)
Create new acquisitions unit
POST /acquisitions-units-storage/memberships- Parameters
membership (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the created membership item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Relationship between a user and an acquistions Unit", "type": "object", "properties": { "id": { "description": "UUID of this membership record", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "userId": { "description": "The UUID of the user to associate with the acquisitions unit", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "acquisitionsUnitId": { "description": "The acquisition unit the user is a member of", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "userId", "acquisitionsUnitId" ] }
- set_unit(unit: dict)
Create new acquisitions unit
POST /acquisitions-units-storage/units- Parameters
unit (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the created unit item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Acquisitions Units", "type": "object", "properties": { "id": { "description": "UUID of this acquisitions unit record", "$ref": "../../common/schemas/uuid.json" }, "name": { "description": "a name for this acquisitions unit", "type": "string" }, "isDeleted": { "description": "If true, the record is marked for deletion at some point. This prevents it from being assigned to any record.", "type": "boolean", "default": false }, "protectCreate": { "description": "if true, only members can create records associated with this acq unit.", "type": "boolean", "default": true }, "protectRead": { "description": "if true, only members can read/view records associated with this acq unit.", "type": "boolean", "default": false }, "protectUpdate": { "description": "if true, only members can update records associated with this acq unit.", "type": "boolean", "default": true }, "protectDelete": { "description": "if true, only members can delete records associated with this acq unit.", "type": "boolean", "default": true }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "name", "isDeleted" ] }