foliolib.folio.api.inventory.InventoryBatch

class foliolib.folio.api.inventory.InventoryBatch(tenant: str)

Bases: foliolib.folio.FolioApi

Batch API

API for interacting with an inventory of physical resources

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

set_batch(batch)

Create collection of instances in one request

set_batch(batch: dict)

Create collection of instances in one request

POST /inventory/instances/batch

Parameters

batch (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestConflict – Conflict

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of instance records",
  "type": "object",
  "properties": {
    "instances": {
      "description": "List of instance records",
      "id": "instances",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "instance.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "instances",
    "totalRecords"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Response schema for instances batch request",
  "type": "object",
  "properties": {
    "instances": {
      "id": "instancesList",
      "description": "List of Instances",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "instance.json"
      }
    },
    "errorMessages": {
      "id": "errorMessagesList",
      "description": "List of error messages",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "totalRecords": {
      "description": "Total number of successfully saved instances",
      "type": "integer"
    }
  },
  "required": [
    "instances",
    "errorMessages",
    "totalRecords"
  ]
}