foliolib.folio.api.financeStorage.Group

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

Bases: foliolib.folio.FolioApi

Group CRUD APIs

CRUD APIs used to manage groups

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_group(groupsId)

Delete group item with given {groupId}

get_group(groupsId)

Retrieve group item with given {groupId}

get_groups(**kwargs)

Get list of groups

modify_group(groupsId, group)

Update group item with given {groupId}

set_group(group)

Create a new group item.

delete_group(groupsId: str)

Delete group item with given {groupId}

DELETE /finance-storage/groups/{groupsId}

Parameters

groupsId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_group(groupsId: str)

Retrieve group item with given {groupId}

GET /finance-storage/groups/{groupsId}

Parameters

groupsId (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": "A group",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the group record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "acqUnitIds": {
      "description": "UUIDs of the acquisition units associated with this group",
      "type": "array",
      "items": {
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "code": {
      "description": "The code of the group",
      "type": "string"
    },
    "description": {
      "description": "The description of the group",
      "type": "string"
    },
    "name": {
      "description": "The name of the group",
      "type": "string"
    },
    "status": {
      "description": "The status of the group",
      "type": "string",
      "enum": [
        "Active",
        "Frozen",
        "Inactive"
      ]
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "code",
    "name",
    "status"
  ]
}
get_groups(**kwargs)

Get list of groups

GET /finance-storage/groups

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: e.g.

    Example

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

    • status==Active sortBy name

  • 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": "A collection of group records",
  "type": "object",
  "properties": {
    "groups": {
      "description": "The list of groups contained in this collection",
      "type": "array",
      "items": {
        "$ref": "group.json"
      }
    },
    "totalRecords": {
      "description": "The number of records contained in this collection",
      "type": "integer",
      "minimum": 0
    }
  },
  "additionalProperties": false,
  "required": [
    "groups",
    "totalRecords"
  ]
}
modify_group(groupsId: str, group: dict)

Update group item with given {groupId}

PUT /finance-storage/groups/{groupsId}

Parameters
  • groupsId (str) –

  • group (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": "A group",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the group record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "acqUnitIds": {
      "description": "UUIDs of the acquisition units associated with this group",
      "type": "array",
      "items": {
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "code": {
      "description": "The code of the group",
      "type": "string"
    },
    "description": {
      "description": "The description of the group",
      "type": "string"
    },
    "name": {
      "description": "The name of the group",
      "type": "string"
    },
    "status": {
      "description": "The status of the group",
      "type": "string",
      "enum": [
        "Active",
        "Frozen",
        "Inactive"
      ]
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "code",
    "name",
    "status"
  ]
}
set_group(group: dict)

Create a new group item.

POST /finance-storage/groups

Parameters

group (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created group item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A group",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of the group record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "acqUnitIds": {
      "description": "UUIDs of the acquisition units associated with this group",
      "type": "array",
      "items": {
        "$ref": "../../common/schemas/uuid.json"
      }
    },
    "code": {
      "description": "The code of the group",
      "type": "string"
    },
    "description": {
      "description": "The description of the group",
      "type": "string"
    },
    "name": {
      "description": "The name of the group",
      "type": "string"
    },
    "status": {
      "description": "The status of the group",
      "type": "string",
      "enum": [
        "Active",
        "Frozen",
        "Inactive"
      ]
    },
    "metadata": {
      "type": "object",
      "$ref": "../../../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "code",
    "name",
    "status"
  ]
}