foliolib.folio.api.inventoryStorage.InventoryHierarchy
- class foliolib.folio.api.inventoryStorage.InventoryHierarchy(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiInventory Hierarchy API
This documents the streaming API for the data needed for Inventory Storage, RTAC and other modules
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
Stream updated instances ids for Inventory
set_itemsAndHolding(itemsAndHolding)Stream instances view data for Inventory
- get_updatedInstanceIds()
Stream updated instances ids for Inventory
GET /inventory-hierarchy/updated-instance-ids- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiRequestNotFound – Not Found
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Response schema for Inventory updated instances ids view", "type": "object", "properties": { "instanceId": { "description": "Inventory updated instances ids", "type": "string", "$ref": "../uuid.json" }, "source": { "description": "Source of metadata and format of the underlying record to the instance record", "type": "string" }, "updatedDate": { "description": "The last updated date or deleted date of an instance or it's items and holdings", "type": "string", "format": "date-time" }, "suppressFromDiscovery": { "description": "Indicates if instance is suppressed from discovery", "type": "boolean" }, "deleted": { "description": "Indicates if an instance was deleted in inventory", "type": "boolean" } }, "additionalProperties": false }
- set_itemsAndHolding(itemsAndHolding: dict)
Stream instances view data for Inventory
POST /inventory-hierarchy/items-and-holdings- Parameters
itemsAndHolding (dict) – See Schema below
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestUnprocessableEntity – Unprocessable Entity
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Define format of request data with instances ids", "type": "object", "properties": { "instanceIds": { "description": "Inventory instances identifiers", "type": "array", "items": { "$ref": "../uuid.json" } }, "skipSuppressedFromDiscoveryRecords": { "description": "Configuration param which defines if discovery suppressed items and holdings records should be skipped or not", "type": "boolean" } }, "required": [ "instanceIds", "skipSuppressedFromDiscoveryRecords" ], "additionalProperties": false }
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Response schema for Inventory items and holdings view", "type": "object", "properties": { "instanceId": { "description": "Inventory updated instance identifier", "type": "string", "$ref": "../uuid.json" }, "source": { "description": "Source of metadata and format of the underlying record to the instance record", "type": "string" }, "modeOfIssuance": { "description": "The mode of issuance would tell if the material is a serial or not", "type": "string" }, "natureOfContent": { "description": "A periodical (which is a subset of serials) might also have a nature of content periodical (journal, newspaper)", "type": "array", "items": { "type": "string" } }, "holdings": { "type": "array", "description": "Holdings record fields", "items": { "type": "object", "properties": { "id": { "description": "System assigned unique ID of the holdings record", "type": "string", "$ref": "../uuid.json" }, "hrId": { "description": "System-assigned sequential ID which maps to the Instance ID", "type": "string" }, "suppressFromDiscovery": { "description": "Indicate if record should not be displayed in a discovery system", "type": "boolean" }, "holdingsType": { "description": "Name of the holdings type", "type": "string" }, "formerIds": { "type": "array", "description": "Identifiers of previously assigned ID(s) to the holdings record", "items": { "type": "string" } }, "location": { "description": "Holdings record effective location", "type": "object", "properties": { "permanentLocation": { "type": "object", "description": "Permanent shelving location in which an item resides", "properties": { "name": { "description": "Name of the (shelf) location", "type": "string" }, "campusName": { "description": "The name of the campus, the second-level location unit, this (shelf) location belongs to", "type": "string" }, "libraryName": { "description": "The name of the library, the third-level location unit, this (shelf) location belongs to", "type": "string" }, "institutionName": { "description": "The name of the institution, the first-level location unit, this (shelf) location belongs to", "type": "string" }, "code": { "description": "Code of the (shelf) location, usually an abbreviation of the name", "type": "string" } }, "required": [ "name", "campusName", "libraryName", "institutionName", "code" ] }, "temporaryLocation": { "type": "object", "description": "Temporary location, shelving location, or holding which is a physical place where items are stored, or an Online location", "properties": { "name": { "description": "Name of the (shelf) location", "type": "string" }, "campusName": { "description": "The name of the campus, the second-level location unit, this (shelf) location belongs to", "type": "string" }, "libraryName": { "description": "The name of the library, the third-level location unit, this (shelf) location belongs to", "type": "string" }, "institutionName": { "description": "The name of the institution, the first-level location unit, this (shelf) location belongs to", "type": "string" }, "code": { "description": "Code of the (shelf) location, usually an abbreviation of the name", "type": "string" } } }, "effectiveLocation": { "type": "object", "description": "Effective location, shelving location, or holding which is a physical place where items are stored, or an Online location", "properties": { "name": { "description": "Name of the (shelf) location", "type": "string" }, "campusName": { "description": "The name of the campus, the second-level location unit, this (shelf) location belongs to", "type": "string" }, "libraryName": { "description": "The name of the library, the third-level location unit, this (shelf) location belongs to", "type": "string" }, "institutionName": { "description": "The name of the institution, the first-level location unit, this (shelf) location belongs to", "type": "string" }, "code": { "description": "Code of the (shelf) location, usually an abbreviation of the name", "type": "string" } } } }, "required": [ "permanentLocation" ] }, "callNumber": { "description": "Call Number is an identifier assigned to a holding", "type": "object", "properties": { "prefix": { "description": "Prefix of the call number on the holding level", "type": "string" }, "suffix": { "description": "Suffix of the call number on the holding level", "type": "string" }, "typeId": { "description": "Unique ID for the type of call number on a holdings record", "type": "string", "$ref": "../uuid.json" }, "typeName": { "description": "Name of the call number type", "type": "string" }, "callNumber": { "description": "Call Number identifier assigned to a holding", "type": "string" } } }, "shelvingTitle": { "description": "Indicates the shelving form of title", "type": "string" }, "acquisitionFormat": { "description": "Format of holdings record acquisition", "type": "string" }, "acquisitionMethod": { "description": "Method of holdings record acquisition", "type": "string" }, "receiptStatus": { "description": "Receipt status (e.g. pending, awaiting receipt, partially received, fully received, receipt not required, and cancelled)", "type": "string" }, "electronicAccess": { "description": "Aggregated electronic access from holdings", "type": "array", "items": { "type": "object", "properties": { "uri": { "description": "Electronic access URI", "type": "string" }, "name": { "description": "Electronic access name", "type": "string" }, "linkText": { "description": "Electronic access link text", "type": "string" }, "publicNote": { "description": "Electronic access public note", "type": "string" }, "relationshipId": { "description": "Electronic access relationship id", "type": "string", "$ref": "../uuid.json" }, "materialsSpecification": { "description": "Electronic access materials specification", "type": "string" } }, "required": [ "uri" ] } }, "notes": { "description": "Notes about action, copy, binding etc.", "type": "array", "items": { "type": "object", "properties": { "holdingsNoteTypeName": { "description": "Name of the holdings note type", "type": "string" }, "note": { "description": "Text content of the note", "type": "string" } } } }, "illPolicy": { "description": "Name of the ILL policy", "type": "string" }, "retentionPolicy": { "description": "Records information regarding how long we have agreed to keep something", "type": "string" }, "digitizationPolicy": { "description": "Records information regarding digitization aspects", "type": "string" }, "holdingsStatements": { "description": "Notes about action, copy, binding etc.", "type": "array", "items": { "type": "object", "properties": { "statement": { "description": "Name of the holdings note type", "type": "string" }, "note": { "description": "Text content of the note", "type": "string" } } } }, "holdingsStatementsForIndexes": { "description": "Holdings record indexes statements", "type": "array", "items": { "type": "object", "properties": { "statement": { "description": "Textual description of the holdings of indexes", "type": "string" }, "note": { "description": "Note attached to a holdings statement", "type": "string" } } } }, "holdingsStatementsForSupplements": { "description": "Holdings record supplements statements", "type": "array", "items": { "type": "object", "properties": { "statement": { "description": "Textual description of the holdings of supplementary material", "type": "string" }, "note": { "description": "Note attached to a holdings statement", "type": "string" } } } }, "copyNumber": { "description": "Piece ID (usually barcode) for systems that do not use holdings record", "type": "string" }, "numberOfItems": { "description": "Amount of items of holdings record", "type": "string" }, "receivingHistory": { "description": "Receiving history of holdings record", "type": "object", "properties": { "entries": { "description": "Entries of receiving history", "type": "array", "items": { "type": "object", "properties": { "publicDisplay": { "description": "Defines if the receiving history should be visible to the public", "type": "boolean" }, "enumeration": { "description": "This is the volume/issue number (e.g. v.71:no.6-2)", "type": "string" }, "chronology": { "description": "Repeated element from Receiving history - Enumeration AND Receiving history - Chronology", "type": "string" } } } } } }, "tags": { "description": "Arbitrary tags associated with this holding", "type": "object", "properties": { "tagList": { "description": "List of tags", "type": "array", "items": { "important": { "description": "Indicate if tag is important", "type": "string" } } } } }, "statisticalCodes": { "description": "Holdings record statistical codes", "type": "array", "items": { "type": "object", "properties": { "id": { "description": "Unique ID of the statistical code", "type": "string", "$ref": "../uuid.json" }, "code": { "description": "Statistical code, a distinct label", "type": "string" }, "name": { "description": "Name or description of a statistical code", "type": "string" }, "statisticalCodeType": { "description": "Name of a statistical code type", "type": "string" }, "source": { "description": "Label indicating where the statistical code type entry originates from, i.e. 'folio' or 'local'", "type": "string" } } } } }, "required": [ "id", "location" ] } }, "items": { "type": "array", "description": "Item records", "items": { "type": "object", "properties": { "id": { "description": "Unique ID of the item record", "type": "string", "$ref": "../uuid.json" }, "hrId": { "description": "System-assigned sequential ID which maps to the Instance ID", "type": "string" }, "holdingsRecordId": { "description": "Unique ID for the type of this holdings record", "type": "string", "$ref": "../uuid.json" }, "suppressFromDiscovery": { "description": "Indicate if record should not be displayed in a discovery system", "type": "boolean" }, "status": { "description": "The status of the item", "type": "string" }, "formerIds": { "type": "array", "description": "Previous identifiers assigned to the item", "items": { "type": "string" } }, "location": { "description": "Item location", "type": "object", "properties": { "location": { "type": "object", "description": "Current home location for the item", "properties": { "name": { "description": "Name of the (shelf) location", "type": "string" }, "campusName": { "description": "The name of the campus, the second-level location unit, this (shelf) location belongs to", "type": "string" }, "libraryName": { "description": "The name of the library, the third-level location unit, this (shelf) location belongs to", "type": "string" }, "institutionName": { "description": "The name of the institution, the first-level location unit, this (shelf) location belongs to", "type": "string" }, "code": { "description": "Code of the (shelf) location, usually an abbreviation of the name", "type": "string" } } }, "permanentLocation": { "type": "object", "description": "Permanent shelving location in which an item resides", "properties": { "name": { "description": "Name of the (shelf) location", "type": "string" }, "campusName": { "description": "The name of the campus, the second-level location unit, this (shelf) location belongs to", "type": "string" }, "libraryName": { "description": "The name of the library, the third-level location unit, this (shelf) location belongs to", "type": "string" }, "institutionName": { "description": "The name of the institution, the first-level location unit, this (shelf) location belongs to", "type": "string" }, "code": { "description": "Code of the (shelf) location, usually an abbreviation of the name", "type": "string" } } }, "temporaryLocation": { "type": "object", "description": "Temporary location, shelving location, or holding which is a physical place where items are stored, or an Online location", "properties": { "name": { "description": "Name of the (shelf) location", "type": "string" }, "campusName": { "description": "The name of the campus, the second-level location unit, this (shelf) location belongs to", "type": "string" }, "libraryName": { "description": "The name of the library, the third-level location unit, this (shelf) location belongs to", "type": "string" }, "institutionName": { "description": "The name of the institution, the first-level location unit, this (shelf) location belongs to", "type": "string" }, "code": { "description": "Code of the (shelf) location, usually an abbreviation of the name", "type": "string" } } } } }, "callNumber": { "description": "An identifier assigned to an item, usually printed on a label attached to the item", "type": "object", "properties": { "prefix": { "description": "Prefix of the call number on the item level", "type": "string" }, "suffix": { "description": "Suffix of the call number on the item level", "type": "string" }, "typeName": { "description": "Name of the call number type", "type": "string" }, "callNumber": { "description": "Identifier assigned to an item, used to determine the items physical position in a shelving sequence", "type": "string" } } }, "accessionNumber": { "description": "Inventar number of item", "type": "string" }, "barcode": { "description": "Unique inventory control number for physical resources, used largely for circulation purposes", "type": "string" }, "copyNumber": { "description": "Copy number reflects if the library has a copy of a single-volume monograph; one copy of a multi-volume", "type": "string" }, "volume": { "description": "Volume is intended for monographs when a multipart monograph", "type": "string" }, "enumeration": { "description": "Descriptive information for the numbering scheme of a serial", "type": "string" }, "chronology": { "description": "Descriptive information for the dating scheme of a serial", "type": "string" }, "yearCaption": { "description": "Character(s) used to label a level of chronology, e.g., year 1985", "type": "array", "items": { "type": "string" } }, "itemIdentifier": { "description": "Item identifier number, e.g. imported from the union catalogue", "type": "string" }, "numberOfPieces": { "description": "Used when an item is checked out or returned to verify that all parts are present (e.g. 7 CDs in a set)", "type": "string" }, "descriptionOfPieces": { "description": "Description of item pieces", "type": "string" }, "numberOfMissingPieces": { "description": "Number of missing pieces", "type": "string" }, "missingPieces": { "description": "Description of the missing pieces", "type": "string" }, "missingPiecesDate": { "description": "Date when the piece(s) went missing", "type": "string" }, "itemDamagedStatus": { "description": "Item dame status", "type": "string" }, "itemDamagedStatusDate": { "description": "Date and time when the item was damaged", "type": "string" }, "materialType": { "description": "Define what type of thing the item is", "type": "string" }, "permanentLoanType": { "description": "Default loan type for a given item. Loan types are tenant-defined", "type": "string" }, "temporaryLoanType": { "description": "Temporary loan type for a given item", "type": "string" }, "electronicAccess": { "description": "References for accessing the item by URL", "type": "array", "items": { "type": "object", "properties": { "uri": { "description": "Uniform resource identifier (URI) is a string of characters designed for unambiguous identification of resources", "type": "string" }, "name": { "description": "Electronic access name", "type": "string" }, "linkText": { "description": "Value of the MARC tag field 856 2nd indicator, where the values are", "type": "string" }, "publicNote": { "description": "URL public note to be displayed in the discovery", "type": "string" }, "relationshipId": { "description": "Relationship between the electronic resource at the location identified", "type": "string", "$ref": "../uuid.json" }, "materialsSpecification": { "description": "Used to specify to what portion or aspect of the resource the electronic location and access information applies", "type": "string" } }, "required": [ "uri" ] } }, "notes": { "description": "Notes about action, copy, binding etc.", "type": "array", "items": { "type": "object", "properties": { "itemNoteTypeName": { "description": "Name of the item note type", "type": "string" }, "note": { "description": "Text content of the note", "type": "string" } } } }, "tags": { "description": "Arbitrary tags associated with this item", "type": "object", "properties": { "tagList": { "description": "List of tags", "type": "array", "items": { "important": { "description": "Indicate if tag is important", "type": "string" } } } } }, "statisticalCodes": { "description": "Item record statistical codes", "type": "array", "items": { "type": "object", "properties": { "id": { "description": "Unique ID of the statistical code", "type": "string", "$ref": "../uuid.json" }, "code": { "description": "Statistical code, a distinct label", "type": "string" }, "name": { "description": "Name or description of a statistical code", "type": "string" }, "statisticalCodeType": { "description": "Name of a statistical code type", "type": "string" }, "source": { "description": "Label indicating where the statistical code type entry originates from, i.e. 'folio' or 'local'", "type": "string" } } } } }, "required": [ "id", "holdingsRecordId", "status", "materialType", "permanentLoanType" ] } } }, "required": [ "instanceId", "source" ], "additionalProperties": false }