foliolib.folio.api.organizationsStorage.Email

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

Bases: foliolib.folio.FolioApi

Deprecated. Emails

CRUD APIs used to manage emails.

These APIs are not currently in use and may at some point be removed or resurrected

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_email(emailsId)

Delete email item with given {emailId}

get_email(emailsId)

Retrieve email item with given {emailId}

get_emails(**kwargs)

Get list of emails

modify_email(emailsId, email)

Update email item with given {emailId}

set_email(email)

Create a new email item.

delete_email(emailsId: str)

Delete email item with given {emailId}

DELETE /organizations-storage/emails/{emailsId}

Parameters

emailsId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_email(emailsId: str)

Retrieve email item with given {emailId}

GET /organizations-storage/emails/{emailsId}

Parameters

emailsId (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 email record",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique id of this email",
      "$ref": "../../common/schemas/uuid.json"
    },
    "value": {
      "description": "The value for this email",
      "type": "string"
    },
    "description": {
      "description": "The description for this email",
      "type": "string"
    },
    "isPrimary": {
      "description": "Used to set this email as primary for the contact",
      "type": "boolean"
    },
    "categories": {
      "id": "categories",
      "description": "The list of categories for this organization email",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "language": {
      "description": "The language for this organization email",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "value"
  ]
}
get_emails(**kwargs)

Get list of emails

GET /organizations-storage/emails

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 email records",
  "type": "object",
  "properties": {
    "emails": {
      "description": "The list of emails in this collection",
      "type": "array",
      "id": "emails",
      "items": {
        "type": "object",
        "$ref": "email.json"
      }
    },
    "totalRecords": {
      "description": "The number of email records returned in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "emails",
    "totalRecords"
  ]
}
modify_email(emailsId: str, email: dict)

Update email item with given {emailId}

PUT /organizations-storage/emails/{emailsId}

Parameters
  • emailsId (str) –

  • email (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 email record",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique id of this email",
      "$ref": "../../common/schemas/uuid.json"
    },
    "value": {
      "description": "The value for this email",
      "type": "string"
    },
    "description": {
      "description": "The description for this email",
      "type": "string"
    },
    "isPrimary": {
      "description": "Used to set this email as primary for the contact",
      "type": "boolean"
    },
    "categories": {
      "id": "categories",
      "description": "The list of categories for this organization email",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "language": {
      "description": "The language for this organization email",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "value"
  ]
}
set_email(email: dict)

Create a new email item.

POST /organizations-storage/emails

Parameters

email (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created email item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "An email record",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique id of this email",
      "$ref": "../../common/schemas/uuid.json"
    },
    "value": {
      "description": "The value for this email",
      "type": "string"
    },
    "description": {
      "description": "The description for this email",
      "type": "string"
    },
    "isPrimary": {
      "description": "Used to set this email as primary for the contact",
      "type": "boolean"
    },
    "categories": {
      "id": "categories",
      "description": "The list of categories for this organization email",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "language": {
      "description": "The language for this organization email",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "value"
  ]
}