foliolib.folio.api.inventoryStorage.HoldingsSync

class foliolib.folio.api.inventoryStorage.HoldingsSync(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

Inventory Storage Holdings Batch Sync API

Batch API for synchronously uploading holdings records into the inventory

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

Methods

set_synchronou(synchronou, **kwargs)

Create or update a collection of holdings in a single synchronous request; if any holding fails the complete batch will be rejected (all or nothing)

set_synchronou(synchronou: dict, **kwargs)

Create or update a collection of holdings in a single synchronous request; if any holding fails the complete batch will be rejected (all or nothing)

POST /holdings-storage/batch/synchronous

Parameters
  • synchronou (dict) –

  • **kwargs (properties) – Keyword Arguments: See Schema below

Keyword Arguments

upsert (bool) – (default=False) When a record with the same id already exists upsert=true will update it, upsert=false will fail the complete batch. The _version property of each holding to be updated must match the stored _version property (optimistic locking).

Raises
  • OkapiRequestConflict – Conflict

  • OkapiRequestPayloadToLarge – Payload Too Large

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

  • OkapiFatalError – 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"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "holdingsRecords"
  ]
}