foliolib.folio.api.circulationStorage.ScheduledNoticeStorage

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

Bases: foliolib.folio.FolioApi

Scheduled Notice Storage API

Storage for scheduled notices

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_scheduledNotice(scheduledNoticeId)

Delete scheduledNotice item with given {scheduledNoticeId}

delete_scheduledNotices()

DELETE /scheduled-notice-storage/scheduled-notices

get_scheduledNotice(scheduledNoticeId)

Retrieve scheduledNotice item with given {scheduledNoticeId}

get_scheduledNotices(**kwargs)

Retrieve a list of scheduledNotice items.

modify_scheduledNotice(scheduledNoticeId, ...)

Update scheduledNotice item with given {scheduledNoticeId}

set_scheduledNotice(scheduledNotice)

Create a new scheduledNotice item.

delete_scheduledNotice(scheduledNoticeId: str)

Delete scheduledNotice item with given {scheduledNoticeId}

DELETE /scheduled-notice-storage/scheduled-notices/{scheduledNoticeId}

Parameters

scheduledNoticeId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

delete_scheduledNotices()

DELETE /scheduled-notice-storage/scheduled-notices

get_scheduledNotice(scheduledNoticeId: str)

Retrieve scheduledNotice item with given {scheduledNoticeId}

GET /scheduled-notice-storage/scheduled-notices/{scheduledNoticeId}

Parameters

scheduledNoticeId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "UUID of scheduled task",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "loanId": {
      "type": "string",
      "description": "UUID of related loan for loan notices",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "requestId": {
      "type": "string",
      "description": "UUID of related request for request notices",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "feeFineActionId": {
      "type": "string",
      "description": "UUID of related action for fee/fine notices",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "recipientUserId": {
      "type": "string",
      "description": "Id of the user to whom this notice should be sent to",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "sessionId": {
      "type": "string",
      "description": "UUID which is the same for all notices generated in scope of the same check-in/check-out session",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "nextRunTime": {
      "type": "string",
      "format": "date-time",
      "description": "Next run time"
    },
    "triggeringEvent": {
      "type": "string",
      "description": "Scheduled notice triggering event",
      "enum": [
        "Hold expiration",
        "Request expiration",
        "Due date",
        "Overdue fine returned",
        "Overdue fine renewed",
        "Aged to lost",
        "Aged to lost - fine charged",
        "Aged to lost & item returned - fine adjusted",
        "Aged to lost & item replaced - fine adjusted",
        "Title level request expiration"
      ]
    },
    "noticeConfig": {
      "type": "object",
      "properties": {
        "timing": {
          "type": "string",
          "description": "Timing represents when we need to send notice, before, at or after loan due date",
          "enum": [
            "Upon At",
            "Before",
            "After"
          ]
        },
        "recurringPeriod": {
          "type": "object",
          "$ref": "period.json",
          "description": "Interval for recurring events"
        },
        "templateId": {
          "type": "string",
          "description": "UUID of related template",
          "$ref": "raml-util/schemas/uuid.schema"
        },
        "format": {
          "type": "string",
          "description": "Notice format",
          "enum": [
            "Email",
            "SMS",
            "Print"
          ]
        },
        "sendInRealTime": {
          "type": "boolean",
          "description": "Real time notice flag"
        }
      },
      "additionalProperties": false,
      "required": [
        "timing",
        "templateId",
        "format"
      ]
    },
    "metadata": {
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "nextRunTime",
    "noticeConfig"
  ]
}
get_scheduledNotices(**kwargs)

Retrieve a list of scheduledNotice items.

GET /scheduled-notice-storage/scheduled-notices

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

    • loanId=188522a4-a2df-4a48-ab3d-44b62daef27f

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of scheduled notices",
  "type": "object",
  "properties": {
    "scheduledNotices": {
      "description": "List of items",
      "id": "scheduledNotices",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "scheduled-notice.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "scheduledNotices"
  ]
}
modify_scheduledNotice(scheduledNoticeId: str, scheduledNotice: dict)

Update scheduledNotice item with given {scheduledNoticeId}

PUT /scheduled-notice-storage/scheduled-notices/{scheduledNoticeId}

Parameters
  • scheduledNoticeId (str) –

  • scheduledNotice (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestConflict – Conflict

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "UUID of scheduled task",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "loanId": {
      "type": "string",
      "description": "UUID of related loan for loan notices",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "requestId": {
      "type": "string",
      "description": "UUID of related request for request notices",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "feeFineActionId": {
      "type": "string",
      "description": "UUID of related action for fee/fine notices",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "recipientUserId": {
      "type": "string",
      "description": "Id of the user to whom this notice should be sent to",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "sessionId": {
      "type": "string",
      "description": "UUID which is the same for all notices generated in scope of the same check-in/check-out session",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "nextRunTime": {
      "type": "string",
      "format": "date-time",
      "description": "Next run time"
    },
    "triggeringEvent": {
      "type": "string",
      "description": "Scheduled notice triggering event",
      "enum": [
        "Hold expiration",
        "Request expiration",
        "Due date",
        "Overdue fine returned",
        "Overdue fine renewed",
        "Aged to lost",
        "Aged to lost - fine charged",
        "Aged to lost & item returned - fine adjusted",
        "Aged to lost & item replaced - fine adjusted",
        "Title level request expiration"
      ]
    },
    "noticeConfig": {
      "type": "object",
      "properties": {
        "timing": {
          "type": "string",
          "description": "Timing represents when we need to send notice, before, at or after loan due date",
          "enum": [
            "Upon At",
            "Before",
            "After"
          ]
        },
        "recurringPeriod": {
          "type": "object",
          "$ref": "period.json",
          "description": "Interval for recurring events"
        },
        "templateId": {
          "type": "string",
          "description": "UUID of related template",
          "$ref": "raml-util/schemas/uuid.schema"
        },
        "format": {
          "type": "string",
          "description": "Notice format",
          "enum": [
            "Email",
            "SMS",
            "Print"
          ]
        },
        "sendInRealTime": {
          "type": "boolean",
          "description": "Real time notice flag"
        }
      },
      "additionalProperties": false,
      "required": [
        "timing",
        "templateId",
        "format"
      ]
    },
    "metadata": {
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "nextRunTime",
    "noticeConfig"
  ]
}
set_scheduledNotice(scheduledNotice: dict)

Create a new scheduledNotice item.

POST /scheduled-notice-storage/scheduled-notices

Parameters

scheduledNotice (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created scheduledNotice item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "UUID of scheduled task",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "loanId": {
      "type": "string",
      "description": "UUID of related loan for loan notices",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "requestId": {
      "type": "string",
      "description": "UUID of related request for request notices",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "feeFineActionId": {
      "type": "string",
      "description": "UUID of related action for fee/fine notices",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "recipientUserId": {
      "type": "string",
      "description": "Id of the user to whom this notice should be sent to",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "sessionId": {
      "type": "string",
      "description": "UUID which is the same for all notices generated in scope of the same check-in/check-out session",
      "$ref": "raml-util/schemas/uuid.schema"
    },
    "nextRunTime": {
      "type": "string",
      "format": "date-time",
      "description": "Next run time"
    },
    "triggeringEvent": {
      "type": "string",
      "description": "Scheduled notice triggering event",
      "enum": [
        "Hold expiration",
        "Request expiration",
        "Due date",
        "Overdue fine returned",
        "Overdue fine renewed",
        "Aged to lost",
        "Aged to lost - fine charged",
        "Aged to lost & item returned - fine adjusted",
        "Aged to lost & item replaced - fine adjusted",
        "Title level request expiration"
      ]
    },
    "noticeConfig": {
      "type": "object",
      "properties": {
        "timing": {
          "type": "string",
          "description": "Timing represents when we need to send notice, before, at or after loan due date",
          "enum": [
            "Upon At",
            "Before",
            "After"
          ]
        },
        "recurringPeriod": {
          "type": "object",
          "$ref": "period.json",
          "description": "Interval for recurring events"
        },
        "templateId": {
          "type": "string",
          "description": "UUID of related template",
          "$ref": "raml-util/schemas/uuid.schema"
        },
        "format": {
          "type": "string",
          "description": "Notice format",
          "enum": [
            "Email",
            "SMS",
            "Print"
          ]
        },
        "sendInRealTime": {
          "type": "boolean",
          "description": "Real time notice flag"
        }
      },
      "additionalProperties": false,
      "required": [
        "timing",
        "templateId",
        "format"
      ]
    },
    "metadata": {
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "nextRunTime",
    "noticeConfig"
  ]
}