foliolib.folio.api.inventoryStorage.HoldingsStorage
- class foliolib.folio.api.inventoryStorage.HoldingsStorage(tenant: str)
Bases:
foliolib.folio.FolioApiHoldings Records Storage API
Storage for holdings in the inventory
Base class of the Folio API
- Parameters
tenant (str) – Tenant id
Methods
delete_holding(holdingsRecordId)Delete holding item with given {holdingId}
DELETE /holdings-storage/holdingsget_holding(holdingsRecordId)Retrieve holding item with given {holdingId}
get_holdings(**kwargs)Retrieve a list of holding items.
modify_holding(holdingsRecordId, holding)Update holding item with given {holdingId}
set_holding(holding)Create a new holding item.
- delete_holding(holdingsRecordId: str)
Delete holding item with given {holdingId}
DELETE /holdings-storage/holdings/{holdingsRecordId}- Parameters
holdingsRecordId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiRequestFatalError – Server Error
- delete_holdings()
DELETE /holdings-storage/holdings
- get_holding(holdingsRecordId: str)
Retrieve holding item with given {holdingId}
GET /holdings-storage/holdings/{holdingsRecordId}- Parameters
holdingsRecordId (str) –
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A holdings record", "javaType": "org.folio.rest.jaxrs.model.HoldingsRecord", "additionalProperties": false, "type": "object", "properties": { "id": { "type": "string", "description": "the unique ID of the holdings record; UUID", "$ref": "../uuid.json" }, "_version": { "type": "integer", "description": "Record version for optimistic locking" }, "sourceId": { "description": "(A reference to) the source of a holdings record", "type": "string", "$ref": "../uuid.json" }, "hrid": { "type": "string", "description": "the human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID" }, "holdingsTypeId": { "type": "string", "description": "unique ID for the type of this holdings record, a UUID", "$ref": "../uuid.json" }, "formerIds": { "type": "array", "description": "Previous ID(s) assigned to the holdings record", "items": { "type": "string" }, "uniqueItems": true }, "instanceId": { "description": "Inventory instances identifier", "type": "string", "$ref": "../uuid.json" }, "permanentLocationId": { "type": "string", "description": "The permanent shelving location in which an item resides.", "$ref": "../uuid.json" }, "temporaryLocationId": { "type": "string", "description": "Temporary location is the temporary location, shelving location, or holding which is a physical place where items are stored, or an Online location.", "$ref": "../uuid.json" }, "effectiveLocationId": { "type": "string", "description": "Effective location is calculated by the system based on the values in the permanent and temporary locationId fields.", "$ref": "../uuid.json" }, "electronicAccess": { "description": "List of electronic access items", "type": "array", "items": { "type": "object", "$ref": "electronicAccessItem.json" } }, "callNumberTypeId": { "type": "string", "description": "unique ID for the type of call number on a holdings record, a UUID", "$ref": "../uuid.json" }, "callNumberPrefix": { "type": "string", "description": "Prefix of the call number on the holding level." }, "callNumber": { "type": "string", "description": "Call Number is an identifier assigned to an item, usually printed on a label attached to the item." }, "callNumberSuffix": { "type": "string", "description": "Suffix of the call number on the holding level." }, "shelvingTitle": { "type": "string", "description": "Indicates the shelving form of title." }, "acquisitionFormat": { "type": "string", "description": "Format of holdings record acquisition" }, "acquisitionMethod": { "type": "string", "description": "Method of holdings record acquisition" }, "receiptStatus": { "type": "string", "description": "Receipt status (e.g. pending, awaiting receipt, partially received, fully received, receipt not required, and cancelled)" }, "administrativeNotes": { "type": "array", "description": "Administrative notes", "minItems": 0, "items": { "type": "string" } }, "notes": { "type": "array", "description": "Notes about action, copy, binding etc.", "items": { "type": "object", "$ref": "holdingsNote.json" } }, "illPolicyId": { "type": "string", "description": "unique ID for an ILL policy, a UUID", "$ref": "../uuid.json" }, "retentionPolicy": { "type": "string", "description": "Records information regarding how long we have agreed to keep something." }, "digitizationPolicy": { "description": "Records information regarding digitization aspects.", "type": "string" }, "holdingsStatements": { "description": "Holdings record statements", "type": "array", "items": { "type": "object", "$ref": "holdingsStatement.json" } }, "holdingsStatementsForIndexes": { "description": "Holdings record indexes statements", "type": "array", "items": { "type": "object", "$ref": "holdingsStatement.json" } }, "holdingsStatementsForSupplements": { "description": "Holdings record supplements statements", "type": "array", "items": { "type": "object", "$ref": "holdingsStatement.json" } }, "copyNumber": { "type": "string", "description": "Item/Piece ID (usually barcode) for systems that do not use item records. Ability to designate the copy number if institution chooses to use copy numbers." }, "numberOfItems": { "type": "string", "description": "Text (Number)" }, "receivingHistory": { "description": "Receiving history of holdings record", "$ref": "holdingsReceivingHistory.json" }, "discoverySuppress": { "type": "boolean", "description": "records the fact that the record should not be displayed in a discovery system" }, "statisticalCodeIds": { "type": "array", "description": "List of statistical code IDs", "items": { "type": "string", "$ref": "../uuid.json" }, "uniqueItems": true }, "tags": { "description": "arbitrary tags associated with this holding", "id": "tags", "type": "object", "$ref": "../raml-util/schemas/tags.schema" }, "metadata": { "type": "object", "$ref": "../raml-util/schemas/metadata.schema", "readonly": true } }, "required": [ "instanceId", "permanentLocationId" ] }
- get_holdings(**kwargs)
Retrieve a list of holding items.
GET /holdings-storage/holdings- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
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
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.
by instance ID (using CQL)
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
instanceId=”2b94c631-fca9-4892-a730-03ee529ffe2a”
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiRequestFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A collection of holdings records", "type": "object", "properties": { "holdingsRecords": { "description": "List of holdings records", "id": "holdingsRecord", "type": "array", "items": { "type": "object", "$ref": "holdingsRecord.json" } }, "totalRecords": { "description": "Estimated or exact total number of records", "type": "integer" }, "resultInfo": { "$ref": "../raml-util/schemas/resultInfo.schema", "readonly": true } }, "required": [ "holdingsRecords", "totalRecords" ] }
- modify_holding(holdingsRecordId: str, holding: dict)
Update holding item with given {holdingId}
PUT /holdings-storage/holdings/{holdingsRecordId}- Parameters
holdingsRecordId (str) –
holding (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiRequestConflict – Conflict
OkapiRequestFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A holdings record", "javaType": "org.folio.rest.jaxrs.model.HoldingsRecord", "additionalProperties": false, "type": "object", "properties": { "id": { "type": "string", "description": "the unique ID of the holdings record; UUID", "$ref": "../uuid.json" }, "_version": { "type": "integer", "description": "Record version for optimistic locking" }, "sourceId": { "description": "(A reference to) the source of a holdings record", "type": "string", "$ref": "../uuid.json" }, "hrid": { "type": "string", "description": "the human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID" }, "holdingsTypeId": { "type": "string", "description": "unique ID for the type of this holdings record, a UUID", "$ref": "../uuid.json" }, "formerIds": { "type": "array", "description": "Previous ID(s) assigned to the holdings record", "items": { "type": "string" }, "uniqueItems": true }, "instanceId": { "description": "Inventory instances identifier", "type": "string", "$ref": "../uuid.json" }, "permanentLocationId": { "type": "string", "description": "The permanent shelving location in which an item resides.", "$ref": "../uuid.json" }, "temporaryLocationId": { "type": "string", "description": "Temporary location is the temporary location, shelving location, or holding which is a physical place where items are stored, or an Online location.", "$ref": "../uuid.json" }, "effectiveLocationId": { "type": "string", "description": "Effective location is calculated by the system based on the values in the permanent and temporary locationId fields.", "$ref": "../uuid.json" }, "electronicAccess": { "description": "List of electronic access items", "type": "array", "items": { "type": "object", "$ref": "electronicAccessItem.json" } }, "callNumberTypeId": { "type": "string", "description": "unique ID for the type of call number on a holdings record, a UUID", "$ref": "../uuid.json" }, "callNumberPrefix": { "type": "string", "description": "Prefix of the call number on the holding level." }, "callNumber": { "type": "string", "description": "Call Number is an identifier assigned to an item, usually printed on a label attached to the item." }, "callNumberSuffix": { "type": "string", "description": "Suffix of the call number on the holding level." }, "shelvingTitle": { "type": "string", "description": "Indicates the shelving form of title." }, "acquisitionFormat": { "type": "string", "description": "Format of holdings record acquisition" }, "acquisitionMethod": { "type": "string", "description": "Method of holdings record acquisition" }, "receiptStatus": { "type": "string", "description": "Receipt status (e.g. pending, awaiting receipt, partially received, fully received, receipt not required, and cancelled)" }, "administrativeNotes": { "type": "array", "description": "Administrative notes", "minItems": 0, "items": { "type": "string" } }, "notes": { "type": "array", "description": "Notes about action, copy, binding etc.", "items": { "type": "object", "$ref": "holdingsNote.json" } }, "illPolicyId": { "type": "string", "description": "unique ID for an ILL policy, a UUID", "$ref": "../uuid.json" }, "retentionPolicy": { "type": "string", "description": "Records information regarding how long we have agreed to keep something." }, "digitizationPolicy": { "description": "Records information regarding digitization aspects.", "type": "string" }, "holdingsStatements": { "description": "Holdings record statements", "type": "array", "items": { "type": "object", "$ref": "holdingsStatement.json" } }, "holdingsStatementsForIndexes": { "description": "Holdings record indexes statements", "type": "array", "items": { "type": "object", "$ref": "holdingsStatement.json" } }, "holdingsStatementsForSupplements": { "description": "Holdings record supplements statements", "type": "array", "items": { "type": "object", "$ref": "holdingsStatement.json" } }, "copyNumber": { "type": "string", "description": "Item/Piece ID (usually barcode) for systems that do not use item records. Ability to designate the copy number if institution chooses to use copy numbers." }, "numberOfItems": { "type": "string", "description": "Text (Number)" }, "receivingHistory": { "description": "Receiving history of holdings record", "$ref": "holdingsReceivingHistory.json" }, "discoverySuppress": { "type": "boolean", "description": "records the fact that the record should not be displayed in a discovery system" }, "statisticalCodeIds": { "type": "array", "description": "List of statistical code IDs", "items": { "type": "string", "$ref": "../uuid.json" }, "uniqueItems": true }, "tags": { "description": "arbitrary tags associated with this holding", "id": "tags", "type": "object", "$ref": "../raml-util/schemas/tags.schema" }, "metadata": { "type": "object", "$ref": "../raml-util/schemas/metadata.schema", "readonly": true } }, "required": [ "instanceId", "permanentLocationId" ] }
- set_holding(holding: dict)
Create a new holding item.
POST /holdings-storage/holdings- Parameters
holding (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiRequestFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the created holding item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A holdings record", "javaType": "org.folio.rest.jaxrs.model.HoldingsRecord", "additionalProperties": false, "type": "object", "properties": { "id": { "type": "string", "description": "the unique ID of the holdings record; UUID", "$ref": "../uuid.json" }, "_version": { "type": "integer", "description": "Record version for optimistic locking" }, "sourceId": { "description": "(A reference to) the source of a holdings record", "type": "string", "$ref": "../uuid.json" }, "hrid": { "type": "string", "description": "the human readable ID, also called eye readable ID. A system-assigned sequential ID which maps to the Instance ID" }, "holdingsTypeId": { "type": "string", "description": "unique ID for the type of this holdings record, a UUID", "$ref": "../uuid.json" }, "formerIds": { "type": "array", "description": "Previous ID(s) assigned to the holdings record", "items": { "type": "string" }, "uniqueItems": true }, "instanceId": { "description": "Inventory instances identifier", "type": "string", "$ref": "../uuid.json" }, "permanentLocationId": { "type": "string", "description": "The permanent shelving location in which an item resides.", "$ref": "../uuid.json" }, "temporaryLocationId": { "type": "string", "description": "Temporary location is the temporary location, shelving location, or holding which is a physical place where items are stored, or an Online location.", "$ref": "../uuid.json" }, "effectiveLocationId": { "type": "string", "description": "Effective location is calculated by the system based on the values in the permanent and temporary locationId fields.", "$ref": "../uuid.json" }, "electronicAccess": { "description": "List of electronic access items", "type": "array", "items": { "type": "object", "$ref": "electronicAccessItem.json" } }, "callNumberTypeId": { "type": "string", "description": "unique ID for the type of call number on a holdings record, a UUID", "$ref": "../uuid.json" }, "callNumberPrefix": { "type": "string", "description": "Prefix of the call number on the holding level." }, "callNumber": { "type": "string", "description": "Call Number is an identifier assigned to an item, usually printed on a label attached to the item." }, "callNumberSuffix": { "type": "string", "description": "Suffix of the call number on the holding level." }, "shelvingTitle": { "type": "string", "description": "Indicates the shelving form of title." }, "acquisitionFormat": { "type": "string", "description": "Format of holdings record acquisition" }, "acquisitionMethod": { "type": "string", "description": "Method of holdings record acquisition" }, "receiptStatus": { "type": "string", "description": "Receipt status (e.g. pending, awaiting receipt, partially received, fully received, receipt not required, and cancelled)" }, "administrativeNotes": { "type": "array", "description": "Administrative notes", "minItems": 0, "items": { "type": "string" } }, "notes": { "type": "array", "description": "Notes about action, copy, binding etc.", "items": { "type": "object", "$ref": "holdingsNote.json" } }, "illPolicyId": { "type": "string", "description": "unique ID for an ILL policy, a UUID", "$ref": "../uuid.json" }, "retentionPolicy": { "type": "string", "description": "Records information regarding how long we have agreed to keep something." }, "digitizationPolicy": { "description": "Records information regarding digitization aspects.", "type": "string" }, "holdingsStatements": { "description": "Holdings record statements", "type": "array", "items": { "type": "object", "$ref": "holdingsStatement.json" } }, "holdingsStatementsForIndexes": { "description": "Holdings record indexes statements", "type": "array", "items": { "type": "object", "$ref": "holdingsStatement.json" } }, "holdingsStatementsForSupplements": { "description": "Holdings record supplements statements", "type": "array", "items": { "type": "object", "$ref": "holdingsStatement.json" } }, "copyNumber": { "type": "string", "description": "Item/Piece ID (usually barcode) for systems that do not use item records. Ability to designate the copy number if institution chooses to use copy numbers." }, "numberOfItems": { "type": "string", "description": "Text (Number)" }, "receivingHistory": { "description": "Receiving history of holdings record", "$ref": "holdingsReceivingHistory.json" }, "discoverySuppress": { "type": "boolean", "description": "records the fact that the record should not be displayed in a discovery system" }, "statisticalCodeIds": { "type": "array", "description": "List of statistical code IDs", "items": { "type": "string", "$ref": "../uuid.json" }, "uniqueItems": true }, "tags": { "description": "arbitrary tags associated with this holding", "id": "tags", "type": "object", "$ref": "../raml-util/schemas/tags.schema" }, "metadata": { "type": "object", "$ref": "../raml-util/schemas/metadata.schema", "readonly": true } }, "required": [ "instanceId", "permanentLocationId" ] }