foliolib.folio.api.feesfines.Manualblocks

class foliolib.folio.api.feesfines.Manualblocks(tenant: str)

Bases: foliolib.folio.FolioApi

Manual Patron Blocks API

This documents the API calls that can be made to query and manage manualblock of the system

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

delete_manualblock(manualblockId)

Delete manualblock item with given {manualblockId}

get_manualblock(manualblockId)

Get a single manualblock

get_manualblocks(**kwargs)

Return a list of manualblocks

modify_manualblock(manualblockId, manualblock)

Update manualblock item with given {manualblockId}

set_manualblock(manualblock)

Create a manualblock

delete_manualblock(manualblockId: str)

Delete manualblock item with given {manualblockId}

DELETE /manualblocks/{manualblockId}

Parameters

manualblockId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

get_manualblock(manualblockId: str)

Get a single manualblock

GET /manualblocks/{manualblockId}

Parameters

manualblockId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Manual patron block schema",
  "description": "Allows institution to manually block a patron from borrowing, renewing, and/or requesting until specified issue is resolved",
  "type": "object",
  "properties": {
    "type": {
      "description": "Type of patron block",
      "type": "string"
    },
    "desc": {
      "description": "Patron block description",
      "type": "string"
    },
    "code": {
      "description": "Code of the template if block is defined based on a template (optional)",
      "type": "string"
    },
    "staffInformation": {
      "description": "Additional information to staff (optional)",
      "type": "string"
    },
    "patronMessage": {
      "description": "Message to patron (optional)",
      "type": "string"
    },
    "expirationDate": {
      "description": "Date and time the patron block expiration if is provided the patron block should be automatically removed on that date",
      "type": "string",
      "format": "date-time"
    },
    "borrowing": {
      "description": "A flag to determine borrowing block action",
      "type": "boolean"
    },
    "renewals": {
      "description": "A flag to determine renewal block action",
      "type": "boolean"
    },
    "requests": {
      "description": "A flag to determine request block action",
      "type": "boolean"
    },
    "userId": {
      "description": "ID of the user",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "metadata": {
      "description": "Metadata about creation to patron block, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "id": {
      "description": "Patron block id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "desc",
    "userId"
  ]
}
get_manualblocks(**kwargs)

Return a list of manualblocks

GET /manualblocks

Parameters

**kwargs (properties) – Keyword Arguments

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

    • active=true

  • orderBy (str) – Order by field: field A, field B

  • order (str (desc|asc) – ): (default=desc) Order

  • 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

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of manualblocks",
  "type": "object",
  "properties": {
    "manualblocks": {
      "description": "List of manualblock items",
      "type": "array",
      "id": "manualblocksData",
      "items": {
        "type": "object",
        "$ref": "manualblockdata.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "manualblocks",
    "totalRecords"
  ]
}
modify_manualblock(manualblockId: str, manualblock: dict)

Update manualblock item with given {manualblockId}

PUT /manualblocks/{manualblockId}

Parameters
  • manualblockId (str) –

  • manualblock (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestConflict – Conflict

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Manual patron block schema",
  "description": "Allows institution to manually block a patron from borrowing, renewing, and/or requesting until specified issue is resolved",
  "type": "object",
  "properties": {
    "type": {
      "description": "Type of patron block",
      "type": "string"
    },
    "desc": {
      "description": "Patron block description",
      "type": "string"
    },
    "code": {
      "description": "Code of the template if block is defined based on a template (optional)",
      "type": "string"
    },
    "staffInformation": {
      "description": "Additional information to staff (optional)",
      "type": "string"
    },
    "patronMessage": {
      "description": "Message to patron (optional)",
      "type": "string"
    },
    "expirationDate": {
      "description": "Date and time the patron block expiration if is provided the patron block should be automatically removed on that date",
      "type": "string",
      "format": "date-time"
    },
    "borrowing": {
      "description": "A flag to determine borrowing block action",
      "type": "boolean"
    },
    "renewals": {
      "description": "A flag to determine renewal block action",
      "type": "boolean"
    },
    "requests": {
      "description": "A flag to determine request block action",
      "type": "boolean"
    },
    "userId": {
      "description": "ID of the user",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "metadata": {
      "description": "Metadata about creation to patron block, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "id": {
      "description": "Patron block id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "desc",
    "userId"
  ]
}
set_manualblock(manualblock: dict)

Create a manualblock

POST /manualblocks

Parameters

manualblock (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiRequestFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created manualblock item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Manual patron block schema",
  "description": "Allows institution to manually block a patron from borrowing, renewing, and/or requesting until specified issue is resolved",
  "type": "object",
  "properties": {
    "type": {
      "description": "Type of patron block",
      "type": "string"
    },
    "desc": {
      "description": "Patron block description",
      "type": "string"
    },
    "code": {
      "description": "Code of the template if block is defined based on a template (optional)",
      "type": "string"
    },
    "staffInformation": {
      "description": "Additional information to staff (optional)",
      "type": "string"
    },
    "patronMessage": {
      "description": "Message to patron (optional)",
      "type": "string"
    },
    "expirationDate": {
      "description": "Date and time the patron block expiration if is provided the patron block should be automatically removed on that date",
      "type": "string",
      "format": "date-time"
    },
    "borrowing": {
      "description": "A flag to determine borrowing block action",
      "type": "boolean"
    },
    "renewals": {
      "description": "A flag to determine renewal block action",
      "type": "boolean"
    },
    "requests": {
      "description": "A flag to determine request block action",
      "type": "boolean"
    },
    "userId": {
      "description": "ID of the user",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "metadata": {
      "description": "Metadata about creation to patron block, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "id": {
      "description": "Patron block id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "desc",
    "userId"
  ]
}