foliolib.folio.api.circulationStorage.CancellationReason

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

Bases: foliolib.folio.FolioApi

Cancellation Reasons API

Storage for cancellation reasons

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_cancellationReason(cancellationReasonId)

Delete cancellationReason item with given {cancellationReasonId}

delete_cancellationReasons()

DELETE /cancellation-reason-storage/cancellation-reasons

get_cancellationReason(cancellationReasonId)

Retrieve cancellationReason item with given {cancellationReasonId}

get_cancellationReasons(**kwargs)

Retrieve a list of cancellationReason items.

modify_cancellationReason(...)

Update cancellationReason item with given {cancellationReasonId}

set_cancellationReason(cancellationReason)

Create a new cancellationReason item.

delete_cancellationReason(cancellationReasonId: str)

Delete cancellationReason item with given {cancellationReasonId}

DELETE /cancellation-reason-storage/cancellation-reasons/{cancellationReasonId}

Parameters

cancellationReasonId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

  • OkapiFatalError – Server Error

delete_cancellationReasons()

DELETE /cancellation-reason-storage/cancellation-reasons

get_cancellationReason(cancellationReasonId: str)

Retrieve cancellationReason item with given {cancellationReasonId}

GET /cancellation-reason-storage/cancellation-reasons/{cancellationReasonId}

Parameters

cancellationReasonId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "publicDescription": {
      "type": "string"
    },
    "requiresAdditionalInformation": {
      "type": "boolean"
    },
    "source": {
      "description": "Origin of the cancellation reason record, e.g. 'System', 'User', 'Consortium' etc.",
      "type": "string"
    },
    "metadata": {
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
get_cancellationReasons(**kwargs)

Retrieve a list of cancellationReason items.

GET /cancellation-reason-storage/cancellation-reasons

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • 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.

    with valid searchable fields

    Example

    • (username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode

    • cancellationReason=lost

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of cancellation reasons",
  "type": "object",
  "properties": {
    "cancellationReasons": {
      "description": "List of items",
      "id": "cancellationReasons",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "cancellation-reason.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "cancellationReasons",
    "totalRecords"
  ]
}
modify_cancellationReason(cancellationReasonId: str, cancellationReason: dict)

Update cancellationReason item with given {cancellationReasonId}

PUT /cancellation-reason-storage/cancellation-reasons/{cancellationReasonId}

Parameters
  • cancellationReasonId (str) –

  • cancellationReason (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestConflict – Conflict

  • OkapiFatalError – Server Error

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "publicDescription": {
      "type": "string"
    },
    "requiresAdditionalInformation": {
      "type": "boolean"
    },
    "source": {
      "description": "Origin of the cancellation reason record, e.g. 'System', 'User', 'Consortium' etc.",
      "type": "string"
    },
    "metadata": {
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
set_cancellationReason(cancellationReason: dict)

Create a new cancellationReason item.

POST /cancellation-reason-storage/cancellation-reasons

Parameters

cancellationReason (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created cancellationReason item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "publicDescription": {
      "type": "string"
    },
    "requiresAdditionalInformation": {
      "type": "boolean"
    },
    "source": {
      "description": "Origin of the cancellation reason record, e.g. 'System', 'User', 'Consortium' etc.",
      "type": "string"
    },
    "metadata": {
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}