foliolib.folio.api.feesfines.ManualBlockTemplates

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

Bases: foliolib.folio.FolioApi

Manual Patron Block Templates API

This documents the API calls that can be made to query and manage templates for manualblocks of the system

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

delete_manualBlockTemplate(...)

Delete a single manualblock template

get_manualBlockTemplate(manualBlockTemplatesId)

Get a single manualblock template

get_manualBlockTemplates(**kwargs)

Return a list of manualblock templates

modify_manualBlockTemplate(...)

Update a single manualblock template

set_manualBlockTemplate(manualBlockTemplate)

Create a manualblock template

delete_manualBlockTemplate(manualBlockTemplatesId: str)

Delete a single manualblock template

DELETE /manual-block-templates/{manualBlockTemplatesId}

Parameters

manualBlockTemplatesId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

get_manualBlockTemplate(manualBlockTemplatesId: str)

Get a single manualblock template

GET /manual-block-templates/{manualBlockTemplatesId}

Parameters

manualBlockTemplatesId (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 template schema",
  "description": "Allows institution to specify a template for manual patron blocks.",
  "type": "object",
  "properties": {
    "name": {
      "description": "Name of the template",
      "type": "string"
    },
    "code": {
      "description": "Code of the template. Can be a shorthand of the name (e.g. an acronym).",
      "type": "string"
    },
    "desc": {
      "description": "Description of this template",
      "type": "string"
    },
    "blockTemplate": {
      "type": "object",
      "description": "Contains the actual template values",
      "properties": {
        "desc": {
          "description": "Description of the patron block",
          "type": "string"
        },
        "patronMessage": {
          "description": "Message to patron (optional)",
          "type": "string"
        },
        "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"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation of the patron block template, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "id": {
      "description": "Template id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
get_manualBlockTemplates(**kwargs)

Return a list of manualblock templates

GET /manual-block-templates

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 manual-block templates",
  "type": "object",
  "properties": {
    "manualBlockTemplates": {
      "description": "List of manual-block templates",
      "type": "array",
      "id": "manualBlockTemplate",
      "items": {
        "type": "object",
        "$ref": "manual-block-template.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "manualBlockTemplates",
    "totalRecords"
  ]
}
modify_manualBlockTemplate(manualBlockTemplatesId: str, manualBlockTemplate: dict)

Update a single manualblock template

PUT /manual-block-templates/{manualBlockTemplatesId}

Parameters
  • manualBlockTemplatesId (str) –

  • manualBlockTemplate (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 template schema",
  "description": "Allows institution to specify a template for manual patron blocks.",
  "type": "object",
  "properties": {
    "name": {
      "description": "Name of the template",
      "type": "string"
    },
    "code": {
      "description": "Code of the template. Can be a shorthand of the name (e.g. an acronym).",
      "type": "string"
    },
    "desc": {
      "description": "Description of this template",
      "type": "string"
    },
    "blockTemplate": {
      "type": "object",
      "description": "Contains the actual template values",
      "properties": {
        "desc": {
          "description": "Description of the patron block",
          "type": "string"
        },
        "patronMessage": {
          "description": "Message to patron (optional)",
          "type": "string"
        },
        "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"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation of the patron block template, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "id": {
      "description": "Template id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
set_manualBlockTemplate(manualBlockTemplate: dict)

Create a manualblock template

POST /manual-block-templates

Parameters

manualBlockTemplate (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiRequestFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created manualBlockTemplate item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Manual patron block template schema",
  "description": "Allows institution to specify a template for manual patron blocks.",
  "type": "object",
  "properties": {
    "name": {
      "description": "Name of the template",
      "type": "string"
    },
    "code": {
      "description": "Code of the template. Can be a shorthand of the name (e.g. an acronym).",
      "type": "string"
    },
    "desc": {
      "description": "Description of this template",
      "type": "string"
    },
    "blockTemplate": {
      "type": "object",
      "description": "Contains the actual template values",
      "properties": {
        "desc": {
          "description": "Description of the patron block",
          "type": "string"
        },
        "patronMessage": {
          "description": "Message to patron (optional)",
          "type": "string"
        },
        "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"
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation of the patron block template, provided by the server",
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema"
    },
    "id": {
      "description": "Template id, UUID",
      "$ref": "raml-util/schemas/uuid.schema"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}