foliolib.folio.api.inventoryStorage.Authorities

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

Bases: foliolib.folio.FolioApi

Authority Storage API

Storage for authorities in the inventory

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_authorities()

DELETE /authority-storage/authorities

delete_authority(authorityId)

Delete authority Authority with given {authorityId}

get_authorities(**kwargs)

Retrieve a list of authority items.

get_authority(authorityId)

Retrieve authority Authority with given {authorityId}

modify_authority(authorityId, authority)

Update authority Authority with given {authorityId}

set_authority(authority)

Create a new authority item.

delete_authorities()

DELETE /authority-storage/authorities

delete_authority(authorityId: str)

Delete authority Authority with given {authorityId}

DELETE /authority-storage/authorities/{authorityId}

Parameters

authorityId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_authorities(**kwargs)

Retrieve a list of authority items.

GET /authority-storage/authorities

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.

    using CQL

    Example

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

    • personalName=”root”

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": "A collection of authority records",
  "type": "object",
  "properties": {
    "authorities": {
      "description": "List of authority records",
      "id": "authorities",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "authority.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    },
    "resultInfo": {
      "$ref": "../raml-util/schemas/resultInfo.schema",
      "readonly": true
    }
  },
  "required": [
    "authorities",
    "totalRecords"
  ],
  "additionalProperties": false
}
get_authority(authorityId: str)

Retrieve authority Authority with given {authorityId}

GET /authority-storage/authorities/{authorityId}

Parameters

authorityId (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": "An authority record",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Authority UUID",
      "$ref": "../uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "source": {
      "type": "string",
      "description": "The metadata source of the underlying record to the authority record. (e.g. FOLIO if it's a record created in Inventory;  MARC if it's a MARC record created in data-import)",
      "enum": [
        "MARC",
        "FOLIO"
      ],
      "readonly": true
    },
    "personalName": {
      "type": "string",
      "description": "Heading personal name"
    },
    "sftPersonalName": {
      "type": "array",
      "description": "See from tracing personal name",
      "items": {
        "type": "string"
      }
    },
    "saftPersonalName": {
      "type": "array",
      "description": "See also from tracing personal name",
      "items": {
        "type": "string"
      }
    },
    "personalNameTitle": {
      "type": "string",
      "description": "Heading personal name title"
    },
    "sftPersonalNameTitle": {
      "type": "array",
      "description": "See from tracing personal name title",
      "items": {
        "type": "string"
      }
    },
    "saftPersonalNameTitle": {
      "type": "array",
      "description": "See also from tracing personal name title",
      "items": {
        "type": "string"
      }
    },
    "corporateName": {
      "type": "string",
      "description": "Heading corporate name"
    },
    "sftCorporateName": {
      "type": "array",
      "description": "See from tracing corporate name",
      "items": {
        "type": "string"
      }
    },
    "saftCorporateName": {
      "type": "array",
      "description": "See also from tracing corporate name",
      "items": {
        "type": "string"
      }
    },
    "corporateNameTitle": {
      "type": "string",
      "description": "Heading corporate name title"
    },
    "sftCorporateNameTitle": {
      "type": "array",
      "description": "See from tracing corporate name title",
      "items": {
        "type": "string"
      }
    },
    "saftCorporateNameTitle": {
      "type": "array",
      "description": "See also from tracing corporate name title",
      "items": {
        "type": "string"
      }
    },
    "meetingName": {
      "type": "string",
      "description": "Heading meeting name"
    },
    "sftMeetingName": {
      "type": "array",
      "description": "See from tracing meeting name",
      "items": {
        "type": "string"
      }
    },
    "saftMeetingName": {
      "type": "array",
      "description": "See also from tracing meeting name",
      "items": {
        "type": "string"
      }
    },
    "meetingNameTitle": {
      "type": "string",
      "description": "Heading meeting name title"
    },
    "sftMeetingNameTitle": {
      "type": "array",
      "description": "See from tracing meeting name title",
      "items": {
        "type": "string"
      }
    },
    "saftMeetingNameTitle": {
      "type": "array",
      "description": "See also from tracing meeting name title",
      "items": {
        "type": "string"
      }
    },
    "uniformTitle": {
      "type": "string",
      "description": "Heading uniform title"
    },
    "sftUniformTitle": {
      "type": "array",
      "description": "See from tracing uniform title",
      "items": {
        "type": "string"
      }
    },
    "saftUniformTitle": {
      "type": "array",
      "description": "See also from tracing uniform title",
      "items": {
        "type": "string"
      }
    },
    "topicalTerm": {
      "type": "string",
      "description": "Heading topical term"
    },
    "sftTopicalTerm": {
      "type": "array",
      "description": "See from tracing topical term",
      "items": {
        "type": "string"
      }
    },
    "saftTopicalTerm": {
      "type": "array",
      "description": "See also from tracing topical term",
      "items": {
        "type": "string"
      }
    },
    "subjectHeadings": {
      "type": "string",
      "description": "Children's subject headings"
    },
    "geographicName": {
      "type": "string",
      "description": "Heading geographic name"
    },
    "sftGeographicName": {
      "type": "array",
      "description": "See from tracing geographic name",
      "items": {
        "type": "string"
      }
    },
    "saftGeographicName": {
      "type": "array",
      "description": "See also from tracing geographic name",
      "items": {
        "type": "string"
      }
    },
    "genreTerm": {
      "type": "string",
      "description": "Heading genre/form term"
    },
    "sftGenreTerm": {
      "type": "array",
      "description": "See from tracing genre/form term",
      "items": {
        "type": "string"
      }
    },
    "saftGenreTerm": {
      "type": "array",
      "description": "See also from tracing genre/form term",
      "items": {
        "type": "string"
      }
    },
    "identifiers": {
      "type": "array",
      "description": "An extensible set of name-value pairs of identifiers associated with the resource",
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Resource identifier value"
          },
          "identifierTypeId": {
            "type": "string",
            "description": "Resource identifier type (e.g. Control number, LCCN, Other standard identifier, System control number)",
            "$ref": "../uuid.json"
          }
        },
        "required": [
          "value",
          "identifierTypeId"
        ]
      }
    },
    "notes": {
      "type": "array",
      "description": "Notes (e.g. nonpublic general note)",
      "items": {
        "type": "object",
        "properties": {
          "noteTypeId": {
            "description": "ID of the type of note",
            "$ref": "../uuid.json"
          },
          "note": {
            "type": "string",
            "description": "Text content of the note"
          }
        },
        "required": [
          "note",
          "noteTypeId"
        ]
      }
    },
    "sourceFileId": {
      "type": "string",
      "description": "Authority source file id; UUID",
      "$ref": "../uuid.json"
    },
    "naturalId": {
      "type": "string",
      "description": "Authority Natural ID"
    },
    "metadata": {
      "type": "object",
      "description": "Creater, updater, creation date, last updated date",
      "$ref": "../raml-util/schemas/metadata.schema"
    }
  },
  "additionalProperties": false
}
modify_authority(authorityId: str, authority: dict)

Update authority Authority with given {authorityId}

PUT /authority-storage/authorities/{authorityId}

Parameters
  • authorityId (str) –

  • authority (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": "An authority record",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Authority UUID",
      "$ref": "../uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "source": {
      "type": "string",
      "description": "The metadata source of the underlying record to the authority record. (e.g. FOLIO if it's a record created in Inventory;  MARC if it's a MARC record created in data-import)",
      "enum": [
        "MARC",
        "FOLIO"
      ],
      "readonly": true
    },
    "personalName": {
      "type": "string",
      "description": "Heading personal name"
    },
    "sftPersonalName": {
      "type": "array",
      "description": "See from tracing personal name",
      "items": {
        "type": "string"
      }
    },
    "saftPersonalName": {
      "type": "array",
      "description": "See also from tracing personal name",
      "items": {
        "type": "string"
      }
    },
    "personalNameTitle": {
      "type": "string",
      "description": "Heading personal name title"
    },
    "sftPersonalNameTitle": {
      "type": "array",
      "description": "See from tracing personal name title",
      "items": {
        "type": "string"
      }
    },
    "saftPersonalNameTitle": {
      "type": "array",
      "description": "See also from tracing personal name title",
      "items": {
        "type": "string"
      }
    },
    "corporateName": {
      "type": "string",
      "description": "Heading corporate name"
    },
    "sftCorporateName": {
      "type": "array",
      "description": "See from tracing corporate name",
      "items": {
        "type": "string"
      }
    },
    "saftCorporateName": {
      "type": "array",
      "description": "See also from tracing corporate name",
      "items": {
        "type": "string"
      }
    },
    "corporateNameTitle": {
      "type": "string",
      "description": "Heading corporate name title"
    },
    "sftCorporateNameTitle": {
      "type": "array",
      "description": "See from tracing corporate name title",
      "items": {
        "type": "string"
      }
    },
    "saftCorporateNameTitle": {
      "type": "array",
      "description": "See also from tracing corporate name title",
      "items": {
        "type": "string"
      }
    },
    "meetingName": {
      "type": "string",
      "description": "Heading meeting name"
    },
    "sftMeetingName": {
      "type": "array",
      "description": "See from tracing meeting name",
      "items": {
        "type": "string"
      }
    },
    "saftMeetingName": {
      "type": "array",
      "description": "See also from tracing meeting name",
      "items": {
        "type": "string"
      }
    },
    "meetingNameTitle": {
      "type": "string",
      "description": "Heading meeting name title"
    },
    "sftMeetingNameTitle": {
      "type": "array",
      "description": "See from tracing meeting name title",
      "items": {
        "type": "string"
      }
    },
    "saftMeetingNameTitle": {
      "type": "array",
      "description": "See also from tracing meeting name title",
      "items": {
        "type": "string"
      }
    },
    "uniformTitle": {
      "type": "string",
      "description": "Heading uniform title"
    },
    "sftUniformTitle": {
      "type": "array",
      "description": "See from tracing uniform title",
      "items": {
        "type": "string"
      }
    },
    "saftUniformTitle": {
      "type": "array",
      "description": "See also from tracing uniform title",
      "items": {
        "type": "string"
      }
    },
    "topicalTerm": {
      "type": "string",
      "description": "Heading topical term"
    },
    "sftTopicalTerm": {
      "type": "array",
      "description": "See from tracing topical term",
      "items": {
        "type": "string"
      }
    },
    "saftTopicalTerm": {
      "type": "array",
      "description": "See also from tracing topical term",
      "items": {
        "type": "string"
      }
    },
    "subjectHeadings": {
      "type": "string",
      "description": "Children's subject headings"
    },
    "geographicName": {
      "type": "string",
      "description": "Heading geographic name"
    },
    "sftGeographicName": {
      "type": "array",
      "description": "See from tracing geographic name",
      "items": {
        "type": "string"
      }
    },
    "saftGeographicName": {
      "type": "array",
      "description": "See also from tracing geographic name",
      "items": {
        "type": "string"
      }
    },
    "genreTerm": {
      "type": "string",
      "description": "Heading genre/form term"
    },
    "sftGenreTerm": {
      "type": "array",
      "description": "See from tracing genre/form term",
      "items": {
        "type": "string"
      }
    },
    "saftGenreTerm": {
      "type": "array",
      "description": "See also from tracing genre/form term",
      "items": {
        "type": "string"
      }
    },
    "identifiers": {
      "type": "array",
      "description": "An extensible set of name-value pairs of identifiers associated with the resource",
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Resource identifier value"
          },
          "identifierTypeId": {
            "type": "string",
            "description": "Resource identifier type (e.g. Control number, LCCN, Other standard identifier, System control number)",
            "$ref": "../uuid.json"
          }
        },
        "required": [
          "value",
          "identifierTypeId"
        ]
      }
    },
    "notes": {
      "type": "array",
      "description": "Notes (e.g. nonpublic general note)",
      "items": {
        "type": "object",
        "properties": {
          "noteTypeId": {
            "description": "ID of the type of note",
            "$ref": "../uuid.json"
          },
          "note": {
            "type": "string",
            "description": "Text content of the note"
          }
        },
        "required": [
          "note",
          "noteTypeId"
        ]
      }
    },
    "sourceFileId": {
      "type": "string",
      "description": "Authority source file id; UUID",
      "$ref": "../uuid.json"
    },
    "naturalId": {
      "type": "string",
      "description": "Authority Natural ID"
    },
    "metadata": {
      "type": "object",
      "description": "Creater, updater, creation date, last updated date",
      "$ref": "../raml-util/schemas/metadata.schema"
    }
  },
  "additionalProperties": false
}
set_authority(authority: dict)

Create a new authority item.

POST /authority-storage/authorities

Parameters

authority (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created authority item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "An authority record",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Authority UUID",
      "$ref": "../uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "source": {
      "type": "string",
      "description": "The metadata source of the underlying record to the authority record. (e.g. FOLIO if it's a record created in Inventory;  MARC if it's a MARC record created in data-import)",
      "enum": [
        "MARC",
        "FOLIO"
      ],
      "readonly": true
    },
    "personalName": {
      "type": "string",
      "description": "Heading personal name"
    },
    "sftPersonalName": {
      "type": "array",
      "description": "See from tracing personal name",
      "items": {
        "type": "string"
      }
    },
    "saftPersonalName": {
      "type": "array",
      "description": "See also from tracing personal name",
      "items": {
        "type": "string"
      }
    },
    "personalNameTitle": {
      "type": "string",
      "description": "Heading personal name title"
    },
    "sftPersonalNameTitle": {
      "type": "array",
      "description": "See from tracing personal name title",
      "items": {
        "type": "string"
      }
    },
    "saftPersonalNameTitle": {
      "type": "array",
      "description": "See also from tracing personal name title",
      "items": {
        "type": "string"
      }
    },
    "corporateName": {
      "type": "string",
      "description": "Heading corporate name"
    },
    "sftCorporateName": {
      "type": "array",
      "description": "See from tracing corporate name",
      "items": {
        "type": "string"
      }
    },
    "saftCorporateName": {
      "type": "array",
      "description": "See also from tracing corporate name",
      "items": {
        "type": "string"
      }
    },
    "corporateNameTitle": {
      "type": "string",
      "description": "Heading corporate name title"
    },
    "sftCorporateNameTitle": {
      "type": "array",
      "description": "See from tracing corporate name title",
      "items": {
        "type": "string"
      }
    },
    "saftCorporateNameTitle": {
      "type": "array",
      "description": "See also from tracing corporate name title",
      "items": {
        "type": "string"
      }
    },
    "meetingName": {
      "type": "string",
      "description": "Heading meeting name"
    },
    "sftMeetingName": {
      "type": "array",
      "description": "See from tracing meeting name",
      "items": {
        "type": "string"
      }
    },
    "saftMeetingName": {
      "type": "array",
      "description": "See also from tracing meeting name",
      "items": {
        "type": "string"
      }
    },
    "meetingNameTitle": {
      "type": "string",
      "description": "Heading meeting name title"
    },
    "sftMeetingNameTitle": {
      "type": "array",
      "description": "See from tracing meeting name title",
      "items": {
        "type": "string"
      }
    },
    "saftMeetingNameTitle": {
      "type": "array",
      "description": "See also from tracing meeting name title",
      "items": {
        "type": "string"
      }
    },
    "uniformTitle": {
      "type": "string",
      "description": "Heading uniform title"
    },
    "sftUniformTitle": {
      "type": "array",
      "description": "See from tracing uniform title",
      "items": {
        "type": "string"
      }
    },
    "saftUniformTitle": {
      "type": "array",
      "description": "See also from tracing uniform title",
      "items": {
        "type": "string"
      }
    },
    "topicalTerm": {
      "type": "string",
      "description": "Heading topical term"
    },
    "sftTopicalTerm": {
      "type": "array",
      "description": "See from tracing topical term",
      "items": {
        "type": "string"
      }
    },
    "saftTopicalTerm": {
      "type": "array",
      "description": "See also from tracing topical term",
      "items": {
        "type": "string"
      }
    },
    "subjectHeadings": {
      "type": "string",
      "description": "Children's subject headings"
    },
    "geographicName": {
      "type": "string",
      "description": "Heading geographic name"
    },
    "sftGeographicName": {
      "type": "array",
      "description": "See from tracing geographic name",
      "items": {
        "type": "string"
      }
    },
    "saftGeographicName": {
      "type": "array",
      "description": "See also from tracing geographic name",
      "items": {
        "type": "string"
      }
    },
    "genreTerm": {
      "type": "string",
      "description": "Heading genre/form term"
    },
    "sftGenreTerm": {
      "type": "array",
      "description": "See from tracing genre/form term",
      "items": {
        "type": "string"
      }
    },
    "saftGenreTerm": {
      "type": "array",
      "description": "See also from tracing genre/form term",
      "items": {
        "type": "string"
      }
    },
    "identifiers": {
      "type": "array",
      "description": "An extensible set of name-value pairs of identifiers associated with the resource",
      "items": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Resource identifier value"
          },
          "identifierTypeId": {
            "type": "string",
            "description": "Resource identifier type (e.g. Control number, LCCN, Other standard identifier, System control number)",
            "$ref": "../uuid.json"
          }
        },
        "required": [
          "value",
          "identifierTypeId"
        ]
      }
    },
    "notes": {
      "type": "array",
      "description": "Notes (e.g. nonpublic general note)",
      "items": {
        "type": "object",
        "properties": {
          "noteTypeId": {
            "description": "ID of the type of note",
            "$ref": "../uuid.json"
          },
          "note": {
            "type": "string",
            "description": "Text content of the note"
          }
        },
        "required": [
          "note",
          "noteTypeId"
        ]
      }
    },
    "sourceFileId": {
      "type": "string",
      "description": "Authority source file id; UUID",
      "$ref": "../uuid.json"
    },
    "naturalId": {
      "type": "string",
      "description": "Authority Natural ID"
    },
    "metadata": {
      "type": "object",
      "description": "Creater, updater, creation date, last updated date",
      "$ref": "../raml-util/schemas/metadata.schema"
    }
  },
  "additionalProperties": false
}