foliolib.folio.api.finance.FundTypes

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

Bases: foliolib.folio.FolioApi

Fund types APIs

This documents the API calls that can be made to manage fund types

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_fundType(fundTypesId)

Delete fundType item with given {fundTypeId}

get_fundType(fundTypesId)

Retrieve fundType item with given {fundTypeId}

get_fundTypes(**kwargs)

Retrieve a list of fundType items.

modify_fundType(fundTypesId, fundType)

Update fundType item with given {fundTypeId}

set_fundType(fundType)

Create a new fundType item.

delete_fundType(fundTypesId: str)

Delete fundType item with given {fundTypeId}

DELETE /finance/fund-types/{fundTypesId}

Parameters

fundTypesId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_fundType(fundTypesId: str)

Retrieve fundType item with given {fundTypeId}

GET /finance/fund-types/{fundTypesId}

Parameters

fundTypesId (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 fund types",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of fund type",
      "$ref": "../../common/schemas/uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "name": {
      "description": "Name of fund type",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
get_fundTypes(**kwargs)

Retrieve a list of fundType items.

GET /finance/fund-types

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”, “MEDGRANT”, “=”]

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 fund types",
  "type": "object",
  "properties": {
    "fundTypes": {
      "description": "The list of objects contained in this collection",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "fund_type.json"
      }
    },
    "totalRecords": {
      "description": "The number of object contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "fundTypes",
    "totalRecords"
  ]
}
modify_fundType(fundTypesId: str, fundType: dict)

Update fundType item with given {fundTypeId}

PUT /finance/fund-types/{fundTypesId}

Parameters
  • fundTypesId (str) –

  • fundType (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": "Simple controlled vocabulary for fund types",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of fund type",
      "$ref": "../../common/schemas/uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "name": {
      "description": "Name of fund type",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}
set_fundType(fundType: dict)

Create a new fundType item.

POST /finance/fund-types

Parameters

fundType (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created fundType item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Simple controlled vocabulary for fund types",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of fund type",
      "$ref": "../../common/schemas/uuid.json"
    },
    "_version": {
      "type": "integer",
      "description": "Record version for optimistic locking"
    },
    "name": {
      "description": "Name of fund type",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "name"
  ]
}