foliolib.folio.api.financeStorage.FiscalYear
- class foliolib.folio.api.financeStorage.FiscalYear(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApimod-finance-storage (Fiscal Year)
CRUD APIs used to manage fiscal years.
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
delete_fiscalYear(fiscalYearsId)Delete fiscalYear item with given {fiscalYearId}
get_fiscalYear(fiscalYearsId)Retrieve fiscalYear item with given {fiscalYearId}
get_fiscalYears(**kwargs)Get list of fiscal years
modify_fiscalYear(fiscalYearsId, fiscalYear)Update fiscalYear item with given {fiscalYearId}
set_fiscalYear(fiscalYear)Create a new fiscalYear item.
- delete_fiscalYear(fiscalYearsId: str)
Delete fiscalYear item with given {fiscalYearId}
DELETE /finance-storage/fiscal-years/{fiscalYearsId}- Parameters
fiscalYearsId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
- get_fiscalYear(fiscalYearsId: str)
Retrieve fiscalYear item with given {fiscalYearId}
GET /finance-storage/fiscal-years/{fiscalYearsId}- Parameters
fiscalYearsId (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 fiscal year record", "type": "object", "properties": { "id": { "description": "UUID of the fiscal year 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 fiscal year", "type": "array", "items": { "$ref": "../../common/schemas/uuid.json" } }, "name": { "description": "The name of the fiscal year", "type": "string" }, "code": { "description": "The code of the fiscal year", "type": "string" }, "currency": { "description": "Currency code which is recorded when the FY ends, otherwise the system currency can be assumed", "type": "string" }, "description": { "description": "The description of the fiscal year", "type": "string" }, "periodStart": { "description": "The start date of the fiscal year", "type": "string", "format": "date-time" }, "periodEnd": { "description": "The end date of the fiscal year", "type": "string", "format": "date-time" }, "series": { "description": "The fiscal year series", "type": "string" }, "financialSummary": { "description": "Includes Funding information and Financial activity", "$ref": "fiscal_year_financial_summary.json" }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "code", "name", "periodStart", "periodEnd" ] }
- get_fiscalYears(**kwargs)
Get list of fiscal years
GET /finance-storage/fiscal-years- 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": "A collection of fiscal years", "type": "object", "properties": { "fiscalYears": { "description": "The list of fiscal year objects in this collection", "type": "array", "id": "fiscal_years", "items": { "type": "object", "$ref": "fiscal_year.json" } }, "totalRecords": { "description": "The number of objects in this collection", "type": "integer" } }, "additionalProperties": false, "required": [ "fiscalYears", "totalRecords" ] }
- modify_fiscalYear(fiscalYearsId: str, fiscalYear: dict)
Update fiscalYear item with given {fiscalYearId}
PUT /finance-storage/fiscal-years/{fiscalYearsId}- Parameters
fiscalYearsId (str) –
fiscalYear (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 fiscal year record", "type": "object", "properties": { "id": { "description": "UUID of the fiscal year 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 fiscal year", "type": "array", "items": { "$ref": "../../common/schemas/uuid.json" } }, "name": { "description": "The name of the fiscal year", "type": "string" }, "code": { "description": "The code of the fiscal year", "type": "string" }, "currency": { "description": "Currency code which is recorded when the FY ends, otherwise the system currency can be assumed", "type": "string" }, "description": { "description": "The description of the fiscal year", "type": "string" }, "periodStart": { "description": "The start date of the fiscal year", "type": "string", "format": "date-time" }, "periodEnd": { "description": "The end date of the fiscal year", "type": "string", "format": "date-time" }, "series": { "description": "The fiscal year series", "type": "string" }, "financialSummary": { "description": "Includes Funding information and Financial activity", "$ref": "fiscal_year_financial_summary.json" }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "code", "name", "periodStart", "periodEnd" ] }
- set_fiscalYear(fiscalYear: dict)
Create a new fiscalYear item.
POST /finance-storage/fiscal-years- Parameters
fiscalYear (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
Headers
Location - URI to the created fiscalYear item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A fiscal year record", "type": "object", "properties": { "id": { "description": "UUID of the fiscal year 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 fiscal year", "type": "array", "items": { "$ref": "../../common/schemas/uuid.json" } }, "name": { "description": "The name of the fiscal year", "type": "string" }, "code": { "description": "The code of the fiscal year", "type": "string" }, "currency": { "description": "Currency code which is recorded when the FY ends, otherwise the system currency can be assumed", "type": "string" }, "description": { "description": "The description of the fiscal year", "type": "string" }, "periodStart": { "description": "The start date of the fiscal year", "type": "string", "format": "date-time" }, "periodEnd": { "description": "The end date of the fiscal year", "type": "string", "format": "date-time" }, "series": { "description": "The fiscal year series", "type": "string" }, "financialSummary": { "description": "Includes Funding information and Financial activity", "$ref": "fiscal_year_financial_summary.json" }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "code", "name", "periodStart", "periodEnd" ] }