foliolib.folio.api.invoiceStorage.BatchGroup

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

Bases: foliolib.folio.FolioApi

Batch group CRUD API

This documents the API calls that can be made to manage batch groups; This API is intended for internal use only

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_batchGroup(batchGroupsId)

Delete batchGroup item with given {batchGroupId}

get_batchGroup(batchGroupsId)

Retrieve batchGroup item with given {batchGroupId}

get_batchGroups(**kwargs)

Get list of batch groups

modify_batchGroup(batchGroupsId, batchGroup)

Update batchGroup item with given {batchGroupId}

set_batchGroup(batchGroup)

Create a new batchGroup item.

delete_batchGroup(batchGroupsId: str)

Delete batchGroup item with given {batchGroupId}

DELETE /batch-group-storage/batch-groups/{batchGroupsId}

Parameters

batchGroupsId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_batchGroup(batchGroupsId: str)

Retrieve batchGroup item with given {batchGroupId}

GET /batch-group-storage/batch-groups/{batchGroupsId}

Parameters

batchGroupsId (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": "Simple controlled vocabulary for batch groups",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of batch group",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Name of batch group",
      "type": "string"
    },
    "description": {
      "description": "Free-form description for this batch group",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
get_batchGroups(**kwargs)

Get list of batch groups

GET /batch-group-storage/batch-groups

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • 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

  • 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 name

    Example

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

    • name==”FOLIO”

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 batch groups",
  "type": "object",
  "properties": {
    "batchGroups": {
      "description": "an array of batch group records",
      "id": "batchGroups",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "batch_group.json"
      }
    },
    "totalRecords": {
      "description": "total number of records in the array",
      "type": "integer"
    }
  },
  "required": [
    "batchGroups",
    "totalRecords"
  ]
}
modify_batchGroup(batchGroupsId: str, batchGroup: dict)

Update batchGroup item with given {batchGroupId}

PUT /batch-group-storage/batch-groups/{batchGroupsId}

Parameters
  • batchGroupsId (str) –

  • batchGroup (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": "Simple controlled vocabulary for batch groups",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of batch group",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Name of batch group",
      "type": "string"
    },
    "description": {
      "description": "Free-form description for this batch group",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
set_batchGroup(batchGroup: dict)

Create a new batchGroup item.

POST /batch-group-storage/batch-groups

Parameters

batchGroup (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created batchGroup item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Simple controlled vocabulary for batch groups",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of batch group",
      "$ref": "../../common/schemas/uuid.json"
    },
    "name": {
      "description": "Name of batch group",
      "type": "string"
    },
    "description": {
      "description": "Free-form description for this batch group",
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}