foliolib.folio.api.ordersStorage.Alert

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

Bases: foliolib.folio.FolioApi

Alerts

CRUD APIs used to manage alerts.

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_alert(alertsId)

Delete alert item with given {alertId}

get_alert(alertsId)

Retrieve alert item with given {alertId}

get_alerts(**kwargs)

Get list of alerts

modify_alert(alertsId, alert)

Update alert item with given {alertId}

set_alert(alert)

Create a new alert item.

delete_alert(alertsId: str)

Delete alert item with given {alertId}

DELETE /orders-storage/alerts/{alertsId}

Parameters

alertsId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_alert(alertsId: str)

Retrieve alert item with given {alertId}

GET /orders-storage/alerts/{alertsId}

Parameters

alertsId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "purchase order alert",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this alert record",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "alert": {
      "description": "the alert text",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "alert"
  ]
}
get_alerts(**kwargs)

Get list of alerts

GET /orders-storage/alerts

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: for example code

    Example

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

    • [“code”, “MEDGRANT”, “=”]

  • totalRecords (str) –

    (default=auto) How to calculate the totalRecords property. “exact” for the correct number, “estimated” for an estimation, “auto” to automatically select “exact” or “estimated”, “none” for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords

    Example

    • none

  • 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

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of alert records",
  "type": "object",
  "properties": {
    "alerts": {
      "description": "collection of alert records",
      "type": "array",
      "id": "alerts",
      "items": {
        "type": "object",
        "$ref": "alert.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "alerts",
    "totalRecords"
  ]
}
modify_alert(alertsId: str, alert: dict)

Update alert item with given {alertId}

PUT /orders-storage/alerts/{alertsId}

Parameters
  • alertsId (str) –

  • alert (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestConflict – Conflict

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "purchase order alert",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this alert record",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "alert": {
      "description": "the alert text",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "alert"
  ]
}
set_alert(alert: dict)

Create a new alert item.

POST /orders-storage/alerts

Parameters

alert (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created alert item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "purchase order alert",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this alert record",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "alert": {
      "description": "the alert text",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "alert"
  ]
}