foliolib.folio.api.circulationStorage.RequestPreferenceStorage

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

Bases: foliolib.folio.FolioApi

Request Preference Storage API

Storage for request oreferences

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_requestPreference(requestPreferenceId)

Delete requestPreference item with given {requestPreferenceId}

get_requestPreference(requestPreferenceId)

Retrieve requestPreference item with given {requestPreferenceId}

get_requestPreferences(**kwargs)

Retrieve a list of requestPreference items.

modify_requestPreference(...)

Update requestPreference item with given {requestPreferenceId}

set_requestPreference(requestPreference)

Create a new requestPreference item.

delete_requestPreference(requestPreferenceId: str)

Delete requestPreference item with given {requestPreferenceId}

DELETE /request-preference-storage/request-preference/{requestPreferenceId}

Parameters

requestPreferenceId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_requestPreference(requestPreferenceId: str)

Retrieve requestPreference item with given {requestPreferenceId}

GET /request-preference-storage/request-preference/{requestPreferenceId}

Parameters

requestPreferenceId (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",
  "description": "Request preference schema",
  "properties": {
    "id": {
      "description": "Unique request preference ID",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "userId": {
      "description": "UUID of user associated with this request preference",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "holdShelf": {
      "description": "Whether 'Hold Shelf' option is available to the user.",
      "type": "boolean"
    },
    "delivery": {
      "description": "Whether 'Delivery' option is available to the user.",
      "type": "boolean"
    },
    "defaultServicePointId": {
      "description": "UUID of default service point for 'Hold Shelf' option",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "defaultDeliveryAddressTypeId": {
      "description": "UUID of user's address type",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "fulfillment": {
      "description": "Preferred fulfillment type. Possible values are 'Delivery', 'Hold Shelf'",
      "type": "string",
      "enum": [
        "Delivery",
        "Hold Shelf"
      ]
    },
    "metadata": {
      "description": "Metadata about creation and changes to request preference",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "userId",
    "holdShelf",
    "delivery"
  ]
}
get_requestPreferences(**kwargs)

Retrieve a list of requestPreference items.

GET /request-preference-storage/request-preference

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.

    searchable using CQL

    Example

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

    • userId==1e425b93-501e-44b0-a4c7-b3e66a25c42e

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 request preferences",
  "type": "object",
  "properties": {
    "requestPreferences": {
      "description": "List of request preferences",
      "id": "requestPreferences",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "request-preference.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "requestPreferences",
    "totalRecords"
  ]
}
modify_requestPreference(requestPreferenceId: str, requestPreference: dict)

Update requestPreference item with given {requestPreferenceId}

PUT /request-preference-storage/request-preference/{requestPreferenceId}

Parameters
  • requestPreferenceId (str) –

  • requestPreference (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",
  "description": "Request preference schema",
  "properties": {
    "id": {
      "description": "Unique request preference ID",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "userId": {
      "description": "UUID of user associated with this request preference",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "holdShelf": {
      "description": "Whether 'Hold Shelf' option is available to the user.",
      "type": "boolean"
    },
    "delivery": {
      "description": "Whether 'Delivery' option is available to the user.",
      "type": "boolean"
    },
    "defaultServicePointId": {
      "description": "UUID of default service point for 'Hold Shelf' option",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "defaultDeliveryAddressTypeId": {
      "description": "UUID of user's address type",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "fulfillment": {
      "description": "Preferred fulfillment type. Possible values are 'Delivery', 'Hold Shelf'",
      "type": "string",
      "enum": [
        "Delivery",
        "Hold Shelf"
      ]
    },
    "metadata": {
      "description": "Metadata about creation and changes to request preference",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "userId",
    "holdShelf",
    "delivery"
  ]
}
set_requestPreference(requestPreference: dict)

Create a new requestPreference item.

POST /request-preference-storage/request-preference

Parameters

requestPreference (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created requestPreference item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Request preference schema",
  "properties": {
    "id": {
      "description": "Unique request preference ID",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "userId": {
      "description": "UUID of user associated with this request preference",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "holdShelf": {
      "description": "Whether 'Hold Shelf' option is available to the user.",
      "type": "boolean"
    },
    "delivery": {
      "description": "Whether 'Delivery' option is available to the user.",
      "type": "boolean"
    },
    "defaultServicePointId": {
      "description": "UUID of default service point for 'Hold Shelf' option",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "defaultDeliveryAddressTypeId": {
      "description": "UUID of user's address type",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "fulfillment": {
      "description": "Preferred fulfillment type. Possible values are 'Delivery', 'Hold Shelf'",
      "type": "string",
      "enum": [
        "Delivery",
        "Hold Shelf"
      ]
    },
    "metadata": {
      "description": "Metadata about creation and changes to request preference",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "userId",
    "holdShelf",
    "delivery"
  ]
}