foliolib.folio.api.organizationsStorage.PrivilegedContact

class foliolib.folio.api.organizationsStorage.PrivilegedContact(tenant: str)

Bases: foliolib.folio.FolioApi

Privileged Contacts

CRUD APIs used to manage privileged contacts.

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

delete_privilegedContact(privilegedContactsId)

Delete privilegedContact item with given {privilegedContactId}

get_privilegedContact(privilegedContactsId)

Retrieve privilegedContact item with given {privilegedContactId}

get_privilegedContacts(**kwargs)

Get list of privileged contact persons

modify_privilegedContact(...)

Update privilegedContact item with given {privilegedContactId}

set_privilegedContact(privilegedContact)

Create a new privilegedContact item.

delete_privilegedContact(privilegedContactsId: str)

Delete privilegedContact item with given {privilegedContactId}

DELETE /organizations-storage/privileged-contacts/{privilegedContactsId}

Parameters

privilegedContactsId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

get_privilegedContact(privilegedContactsId: str)

Retrieve privilegedContact item with given {privilegedContactId}

GET /organizations-storage/privileged-contacts/{privilegedContactsId}

Parameters

privilegedContactsId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A contact record",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique id of this contact",
      "$ref": "../../common/schemas/uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "prefix": {
      "description": "The prefix for this contact person",
      "type": "string"
    },
    "firstName": {
      "description": "The first name of this contact person",
      "type": "string"
    },
    "lastName": {
      "description": "The last name of this contact person",
      "type": "string"
    },
    "language": {
      "description": "The preferred language for this contact person",
      "type": "string"
    },
    "notes": {
      "description": "The notes for this contact person",
      "type": "string"
    },
    "phoneNumbers": {
      "id": "phoneNumbers",
      "description": "The list of phone numbers for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "phone_number.json"
      }
    },
    "emails": {
      "id": "emailAddresses",
      "description": "The list of emails for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "email.json"
      }
    },
    "addresses": {
      "id": "addresses",
      "description": "The list of addresses for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "address.json"
      }
    },
    "urls": {
      "id": "urls",
      "description": "The list of URLs for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "url.json"
      }
    },
    "categories": {
      "id": "contactCategory",
      "description": "The list of contact categories associated with this organization contact person",
      "type": "array",
      "items": {
        "description": "UUID of the contact category",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "inactive": {
      "description": "Used to indicate that a contact is no longer active",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "firstName",
    "lastName"
  ]
}
get_privilegedContacts(**kwargs)

Get list of privileged contact persons

GET /organizations-storage/privileged-contacts

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

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of contact records",
  "type": "object",
  "properties": {
    "contacts": {
      "description": "The list of contacts in this collection",
      "type": "array",
      "id": "contacts",
      "items": {
        "type": "object",
        "$ref": "contact.json"
      }
    },
    "totalRecords": {
      "description": "The number of contact person records returned in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "contacts",
    "totalRecords"
  ]
}
modify_privilegedContact(privilegedContactsId: str, privilegedContact: dict)

Update privilegedContact item with given {privilegedContactId}

PUT /organizations-storage/privileged-contacts/{privilegedContactsId}

Parameters
  • privilegedContactsId (str) –

  • privilegedContact (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestConflict – Conflict

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A contact record",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique id of this contact",
      "$ref": "../../common/schemas/uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "prefix": {
      "description": "The prefix for this contact person",
      "type": "string"
    },
    "firstName": {
      "description": "The first name of this contact person",
      "type": "string"
    },
    "lastName": {
      "description": "The last name of this contact person",
      "type": "string"
    },
    "language": {
      "description": "The preferred language for this contact person",
      "type": "string"
    },
    "notes": {
      "description": "The notes for this contact person",
      "type": "string"
    },
    "phoneNumbers": {
      "id": "phoneNumbers",
      "description": "The list of phone numbers for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "phone_number.json"
      }
    },
    "emails": {
      "id": "emailAddresses",
      "description": "The list of emails for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "email.json"
      }
    },
    "addresses": {
      "id": "addresses",
      "description": "The list of addresses for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "address.json"
      }
    },
    "urls": {
      "id": "urls",
      "description": "The list of URLs for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "url.json"
      }
    },
    "categories": {
      "id": "contactCategory",
      "description": "The list of contact categories associated with this organization contact person",
      "type": "array",
      "items": {
        "description": "UUID of the contact category",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "inactive": {
      "description": "Used to indicate that a contact is no longer active",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "firstName",
    "lastName"
  ]
}
set_privilegedContact(privilegedContact: dict)

Create a new privilegedContact item.

POST /organizations-storage/privileged-contacts

Parameters

privilegedContact (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiRequestFatalError – Server Error

Headers

  • Location - URI to the created privilegedContact item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A contact record",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique id of this contact",
      "$ref": "../../common/schemas/uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "prefix": {
      "description": "The prefix for this contact person",
      "type": "string"
    },
    "firstName": {
      "description": "The first name of this contact person",
      "type": "string"
    },
    "lastName": {
      "description": "The last name of this contact person",
      "type": "string"
    },
    "language": {
      "description": "The preferred language for this contact person",
      "type": "string"
    },
    "notes": {
      "description": "The notes for this contact person",
      "type": "string"
    },
    "phoneNumbers": {
      "id": "phoneNumbers",
      "description": "The list of phone numbers for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "phone_number.json"
      }
    },
    "emails": {
      "id": "emailAddresses",
      "description": "The list of emails for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "email.json"
      }
    },
    "addresses": {
      "id": "addresses",
      "description": "The list of addresses for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "address.json"
      }
    },
    "urls": {
      "id": "urls",
      "description": "The list of URLs for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "url.json"
      }
    },
    "categories": {
      "id": "contactCategory",
      "description": "The list of contact categories associated with this organization contact person",
      "type": "array",
      "items": {
        "description": "UUID of the contact category",
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "inactive": {
      "description": "Used to indicate that a contact is no longer active",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "firstName",
    "lastName"
  ]
}