foliolib.folio.api.circulationStorage.CheckoutLockStorage

class foliolib.folio.api.circulationStorage.CheckoutLockStorage(tenant: str)

Bases: foliolib.folio.FolioApi

Checkout Lock API

Storage for checkout lock

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

delete_checkOutLockStorage(lockId)

Delete checkout lock

get_checkOutLockStorage(lockId)

Get checkout lock

get_checkOutLockStorages(**kwargs)

Retrieve a list of checkout lock items

set_checkOutLockStorage(checkOutLockStorage)

Create a lock for the given userid

delete_checkOutLockStorage(lockId: str)

Delete checkout lock

DELETE /check-out-lock-storage/{lockId}

Parameters

lockId (str) –

Raises

OkapiRequestFatalError – Server Error

get_checkOutLockStorage(lockId: str)

Get checkout lock

GET /check-out-lock-storage/{lockId}

Parameters

lockId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestNotFound – Not Found

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Checkout Lock",
  "properties": {
    "id": {
      "description": "ID of the lock",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "userId": {
      "description": "ID of the patron the lock is created for",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "creationDate": {
      "description": "Date and time of lock creation",
      "type": "string",
      "format": "date-time"
    }
  }
}
get_checkOutLockStorages(**kwargs)

Retrieve a list of checkout lock items

GET /check-out-lock-storage

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • userId (str) – Filter locks by user ID.

  • offset (int) – The number of items to skip in the result set.

  • limit (int) – The maximum number of locks to return.

Returns

See Schema below

Return type

dict

Raises

OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of checkoutLocks",
  "type": "object",
  "properties": {
    "checkoutLocks": {
      "description": "List of checkoutLocks",
      "id": "checkoutLocks",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "checkout-lock.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "checkoutLocks",
    "totalRecords"
  ]
}
set_checkOutLockStorage(checkOutLockStorage: dict)

Create a lock for the given userid

POST /check-out-lock-storage

Parameters

checkOutLockStorage (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

  • OkapiRequestFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Checkout Lock",
  "properties": {
    "userId": {
      "description": "ID of the patron the lock is created for",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "ttlMs": {
      "description": "Time to live for lock object",
      "type": "integer"
    }
  }
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Checkout Lock",
  "properties": {
    "id": {
      "description": "ID of the lock",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "userId": {
      "description": "ID of the patron the lock is created for",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "creationDate": {
      "description": "Date and time of lock creation",
      "type": "string",
      "format": "date-time"
    }
  }
}