foliolib.folio.usersImpl.DepartmentsImpl

class foliolib.folio.usersImpl.DepartmentsImpl(tenant: str)

Bases: foliolib.folio.FolioAPIImpl

Implentations of departments related functions.

Parameters

tenant (str) – Tenant id

Methods

add_department(name, code, **kwargs)

Add a department.

delete_department(name_or_code_or_id)

Delete a department.

get_department(name_or_code_or_id)

Get department by given name, code or id.

get_departments([query])

Get list of departments.

modify_department(name, **kwargs)

Modify a department.

add_department(name: str, code: str, **kwargs)

Add a department.

Parameters
  • name (str) – Name of the department.

  • code (str) – Code of the department.

Keyword Arguments

uuid (str) – Id of the department.

Returns

Object of the department.

Return type

dict

delete_department(name_or_code_or_id: str)

Delete a department.

Parameters

name_or_code_or_id (str) – Department name, code or id.

get_department(name_or_code_or_id: str)

Get department by given name, code or id.

Parameters

name_or_code_or_id (str) – Department name, code or id.

Raises

DepartmentNotFound – Department not found

Returns

Department Object

Return type

dict

get_departments(query: str = None)

Get list of departments.

Parameters

query (str, optional) – CQL string. Default to None, all objects will be returned.

Returns

List of department Objects.

Return type

list

modify_department(name: str, **kwargs)

Modify a department.

In order to change the name of a department, the uuid or the code of the departemnt must be given.

Parameters

name (str) – Name of the department.

Keyword Arguments
  • uuid (str) – Id of the department.

  • code (str) – Code of the department.

Returns

Object of the department.

Return type

dict