foliolib.folio.api.ordersStorage.Titles

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

Bases: foliolib.folio.FolioApi

CRUD API to manage Titles. This API is intended for internal use only. Please use the /orders/titles, /orders/receiving, /orders/check-in, and /orders/receiving-history APIs provided by mod-orders instead.

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_title(titlesId)

Delete title item with given {titleId}

get_title(titlesId)

Retrieve title item with given {titleId}

get_titles(**kwargs)

Get list of titles

modify_title(titlesId, title)

Update title item with given {titleId}

set_title(title)

Create a new title item.

delete_title(titlesId: str)

Delete title item with given {titleId}

DELETE /orders-storage/titles/{titlesId}

Parameters

titlesId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_title(titlesId: str)

Retrieve title item with given {titleId}

GET /orders-storage/titles/{titlesId}

Parameters

titlesId (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": "Title",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this title",
      "$ref": "../../common/schemas/uuid.json"
    },
    "expectedReceiptDate": {
      "description": "Vendor agreed date prior to the Receipt Due date item is expected to be received by",
      "type": "string",
      "format": "date-time"
    },
    "title": {
      "description": "The title name",
      "type": "string"
    },
    "poLineId": {
      "description": "UUID of the purchase order line this Title is associated with",
      "$ref": "../../common/schemas/uuid.json"
    },
    "instanceId": {
      "description": "UUID of the instance associated with this Title",
      "$ref": "../../common/schemas/uuid.json"
    },
    "productIds": {
      "description": "List of product identifiers",
      "id": "productIds",
      "type": "array",
      "items": {
        "$ref": "product_identifier.json"
      }
    },
    "contributors": {
      "description": "List of contributors to the material",
      "id": "contributors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "contributor.json"
      }
    },
    "publisher": {
      "description": "Publisher of the material",
      "type": "string"
    },
    "edition": {
      "description": "Edition of the material",
      "type": "string"
    },
    "packageName": {
      "description": "The name of the package",
      "type": "string"
    },
    "poLineNumber": {
      "description": "The number of the POL identified by poLineId",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{1,16}-[0-9]{1,3}$"
    },
    "publishedDate": {
      "description": "Year of the material's publication",
      "type": "string"
    },
    "receivingNote": {
      "description": "Receiving note of the POL identified by poLineId",
      "type": "string"
    },
    "subscriptionFrom": {
      "description": "The start date of the subscription",
      "type": "string",
      "format": "date-time"
    },
    "subscriptionTo": {
      "description": "The end date of the subscription",
      "type": "string",
      "format": "date-time"
    },
    "subscriptionInterval": {
      "description": "The subscription interval in days",
      "type": "integer"
    },
    "isAcknowledged": {
      "description": "Flag for acknowledge receiving note",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "title",
    "poLineId"
  ]
}
get_titles(**kwargs)

Get list of titles

GET /orders-storage/titles

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 title

    Example

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

    • [“title”, “TITLE”, “=”]

  • 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 titles",
  "type": "object",
  "properties": {
    "titles": {
      "description": "Collection of titles",
      "type": "array",
      "id": "titles",
      "items": {
        "$ref": "title.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "titles",
    "totalRecords"
  ]
}
modify_title(titlesId: str, title: dict)

Update title item with given {titleId}

PUT /orders-storage/titles/{titlesId}

Parameters
  • titlesId (str) –

  • title (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": "Title",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this title",
      "$ref": "../../common/schemas/uuid.json"
    },
    "expectedReceiptDate": {
      "description": "Vendor agreed date prior to the Receipt Due date item is expected to be received by",
      "type": "string",
      "format": "date-time"
    },
    "title": {
      "description": "The title name",
      "type": "string"
    },
    "poLineId": {
      "description": "UUID of the purchase order line this Title is associated with",
      "$ref": "../../common/schemas/uuid.json"
    },
    "instanceId": {
      "description": "UUID of the instance associated with this Title",
      "$ref": "../../common/schemas/uuid.json"
    },
    "productIds": {
      "description": "List of product identifiers",
      "id": "productIds",
      "type": "array",
      "items": {
        "$ref": "product_identifier.json"
      }
    },
    "contributors": {
      "description": "List of contributors to the material",
      "id": "contributors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "contributor.json"
      }
    },
    "publisher": {
      "description": "Publisher of the material",
      "type": "string"
    },
    "edition": {
      "description": "Edition of the material",
      "type": "string"
    },
    "packageName": {
      "description": "The name of the package",
      "type": "string"
    },
    "poLineNumber": {
      "description": "The number of the POL identified by poLineId",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{1,16}-[0-9]{1,3}$"
    },
    "publishedDate": {
      "description": "Year of the material's publication",
      "type": "string"
    },
    "receivingNote": {
      "description": "Receiving note of the POL identified by poLineId",
      "type": "string"
    },
    "subscriptionFrom": {
      "description": "The start date of the subscription",
      "type": "string",
      "format": "date-time"
    },
    "subscriptionTo": {
      "description": "The end date of the subscription",
      "type": "string",
      "format": "date-time"
    },
    "subscriptionInterval": {
      "description": "The subscription interval in days",
      "type": "integer"
    },
    "isAcknowledged": {
      "description": "Flag for acknowledge receiving note",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "title",
    "poLineId"
  ]
}
set_title(title: dict)

Create a new title item.

POST /orders-storage/titles

Parameters

title (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created title item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Title",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this title",
      "$ref": "../../common/schemas/uuid.json"
    },
    "expectedReceiptDate": {
      "description": "Vendor agreed date prior to the Receipt Due date item is expected to be received by",
      "type": "string",
      "format": "date-time"
    },
    "title": {
      "description": "The title name",
      "type": "string"
    },
    "poLineId": {
      "description": "UUID of the purchase order line this Title is associated with",
      "$ref": "../../common/schemas/uuid.json"
    },
    "instanceId": {
      "description": "UUID of the instance associated with this Title",
      "$ref": "../../common/schemas/uuid.json"
    },
    "productIds": {
      "description": "List of product identifiers",
      "id": "productIds",
      "type": "array",
      "items": {
        "$ref": "product_identifier.json"
      }
    },
    "contributors": {
      "description": "List of contributors to the material",
      "id": "contributors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "contributor.json"
      }
    },
    "publisher": {
      "description": "Publisher of the material",
      "type": "string"
    },
    "edition": {
      "description": "Edition of the material",
      "type": "string"
    },
    "packageName": {
      "description": "The name of the package",
      "type": "string"
    },
    "poLineNumber": {
      "description": "The number of the POL identified by poLineId",
      "type": "string",
      "pattern": "^[a-zA-Z0-9]{1,16}-[0-9]{1,3}$"
    },
    "publishedDate": {
      "description": "Year of the material's publication",
      "type": "string"
    },
    "receivingNote": {
      "description": "Receiving note of the POL identified by poLineId",
      "type": "string"
    },
    "subscriptionFrom": {
      "description": "The start date of the subscription",
      "type": "string",
      "format": "date-time"
    },
    "subscriptionTo": {
      "description": "The end date of the subscription",
      "type": "string",
      "format": "date-time"
    },
    "subscriptionInterval": {
      "description": "The subscription interval in days",
      "type": "integer"
    },
    "isAcknowledged": {
      "description": "Flag for acknowledge receiving note",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "title",
    "poLineId"
  ]
}