foliolib.folio.api.orders.Configuration

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

Bases: foliolib.folio.FolioApi

Orders configuration

API for managing purchase orders configuration

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_prefix(prefixesId)

Delete prefix item with given {prefixId}

delete_reasonsForClosure(reasonsForClosureId)

Delete reasonsForClosure item with given {reasonsForClosureId}

delete_suffix(suffixesId)

Delete suffix item with given {suffixId}

get_prefix(prefixesId)

Retrieve prefix item with given {prefixId}

get_prefixes(**kwargs)

Get list of prefixes

get_reasonsForClosure(reasonsForClosureId)

Retrieve reasonsForClosure item with given {reasonsForClosureId}

get_reasonsForClosures(**kwargs)

Get list of reasons for closure

get_suffix(suffixesId)

Retrieve suffix item with given {suffixId}

get_suffixes(**kwargs)

Get list of suffixes

modify_prefix(prefixesId, prefix)

Update prefix

modify_reasonsForClosure(...)

Update reason for closure

modify_suffix(suffixesId, suffix)

Update suffix

set_prefix(prefix)

Create new prefix

set_reasonsForClosure(reasonsForClosure)

Create new reason for closure

set_suffix(suffix)

Create new suffix

delete_prefix(prefixesId: str)

Delete prefix item with given {prefixId}

DELETE /orders/configuration/prefixes/{prefixesId}

Parameters

prefixesId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

delete_reasonsForClosure(reasonsForClosureId: str)

Delete reasonsForClosure item with given {reasonsForClosureId}

DELETE /orders/configuration/reasons-for-closure/{reasonsForClosureId}

Parameters

reasonsForClosureId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

delete_suffix(suffixesId: str)

Delete suffix item with given {suffixId}

DELETE /orders/configuration/suffixes/{suffixesId}

Parameters

suffixesId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_prefix(prefixesId: str)

Retrieve prefix item with given {prefixId}

GET /orders/configuration/prefixes/{prefixesId}

Parameters

prefixesId (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": "Purchase order number prefix",
  "type": "object",
  "extends": {
    "$ref": "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this prefix",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Prefix name",
      "type": "string"
    },
    "description": {
      "description": "Prefix description",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
get_prefixes(**kwargs)

Get list of prefixes

GET /orders/configuration/prefixes

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 prefix

    Example

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

    • [“prefix”, “Prx”, “=”]

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

Retrieve reasonsForClosure item with given {reasonsForClosureId}

GET /orders/configuration/reasons-for-closure/{reasonsForClosureId}

Parameters

reasonsForClosureId (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": "Reason for closure object",
  "type": "object",
  "javaType": "org.folio.rest.jaxrs.model.ReasonForClosure",
  "extends": {
    "$ref": "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this Reason for closure record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "reason": {
      "description": "Reason for closure",
      "type": "string"
    },
    "source": {
      "description": "Source of reason for closure",
      "type": "string",
      "enum": [
        "User",
        "System"
      ],
      "default": "User"
    }
  },
  "additionalProperties": false,
  "required": [
    "reason",
    "source"
  ]
}
get_reasonsForClosures(**kwargs)

Get list of reasons for closure

GET /orders/configuration/reasons-for-closure

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 reasonForClosure

    Example

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

    • [“reasonForClosure”, “Denied”, “=”]

  • 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 reasons for closure",
  "type": "object",
  "properties": {
    "reasonsForClosure": {
      "description": "Collection of reasons for closure",
      "type": "array",
      "id": "reasonsForClosure",
      "items": {
        "type": "object",
        "$ref": "reason_for_closure.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "reasonsForClosure",
    "totalRecords"
  ]
}
get_suffix(suffixesId: str)

Retrieve suffix item with given {suffixId}

GET /orders/configuration/suffixes/{suffixesId}

Parameters

suffixesId (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": "Purchase order number suffix",
  "type": "object",
  "extends": {
    "$ref": "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this suffix",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Suffix name",
      "type": "string"
    },
    "description": {
      "description": "Suffix description",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
get_suffixes(**kwargs)

Get list of suffixes

GET /orders/configuration/suffixes

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 suffix

    Example

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

    • [“code”, “Sfx”, “=”]

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

Update prefix

PUT /orders/configuration/prefixes/{prefixesId}

Parameters
  • prefixesId (str) –

  • prefix (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#",
  "description": "Purchase order number prefix",
  "type": "object",
  "extends": {
    "$ref": "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this prefix",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Prefix name",
      "type": "string"
    },
    "description": {
      "description": "Prefix description",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
modify_reasonsForClosure(reasonsForClosureId: str, reasonsForClosure: dict)

Update reason for closure

PUT /orders/configuration/reasons-for-closure/{reasonsForClosureId}

Parameters
  • reasonsForClosureId (str) –

  • reasonsForClosure (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#",
  "description": "Reason for closure object",
  "type": "object",
  "javaType": "org.folio.rest.jaxrs.model.ReasonForClosure",
  "extends": {
    "$ref": "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this Reason for closure record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "reason": {
      "description": "Reason for closure",
      "type": "string"
    },
    "source": {
      "description": "Source of reason for closure",
      "type": "string",
      "enum": [
        "User",
        "System"
      ],
      "default": "User"
    }
  },
  "additionalProperties": false,
  "required": [
    "reason",
    "source"
  ]
}
modify_suffix(suffixesId: str, suffix: dict)

Update suffix

PUT /orders/configuration/suffixes/{suffixesId}

Parameters
  • suffixesId (str) –

  • suffix (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#",
  "description": "Purchase order number suffix",
  "type": "object",
  "extends": {
    "$ref": "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this suffix",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Suffix name",
      "type": "string"
    },
    "description": {
      "description": "Suffix description",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
set_prefix(prefix: dict)

Create new prefix

POST /orders/configuration/prefixes

Parameters

prefix (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created prefix item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Purchase order number prefix",
  "type": "object",
  "extends": {
    "$ref": "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this prefix",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Prefix name",
      "type": "string"
    },
    "description": {
      "description": "Prefix description",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
set_reasonsForClosure(reasonsForClosure: dict)

Create new reason for closure

POST /orders/configuration/reasons-for-closure

Parameters

reasonsForClosure (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created reasonsForClosure item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Reason for closure object",
  "type": "object",
  "javaType": "org.folio.rest.jaxrs.model.ReasonForClosure",
  "extends": {
    "$ref": "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this Reason for closure record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "reason": {
      "description": "Reason for closure",
      "type": "string"
    },
    "source": {
      "description": "Source of reason for closure",
      "type": "string",
      "enum": [
        "User",
        "System"
      ],
      "default": "User"
    }
  },
  "additionalProperties": false,
  "required": [
    "reason",
    "source"
  ]
}
set_suffix(suffix: dict)

Create new suffix

POST /orders/configuration/suffixes

Parameters

suffix (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created suffix item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Purchase order number suffix",
  "type": "object",
  "extends": {
    "$ref": "../../common/schemas/entity.json"
  },
  "properties": {
    "id": {
      "description": "UUID of this suffix",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Suffix name",
      "type": "string"
    },
    "description": {
      "description": "Suffix description",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}