foliolib.folio.api.lists.List

class foliolib.folio.api.lists.List(tenant: str)

Bases: foliolib.folio.FolioApi

ListEntity API

ListEntity API description

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

cancelexport(exportId, id_)

Cancel the export.

cancelrefresh(id_)

Cancel refresh of the list.

createlist(listRequestDTO)

POST /lists

deletelist(id_)

delete the list with the specific id (if exists).

downloadlist(exportId, id_)

Download the exported file.

exportlist(id_)

Exports the list.

getalllists(**kwargs)

GET /lists

getexportdetails(exportId, id_)

Get details of an export request

getlistbyid(id_)

gets the specific list information (if exists).

getlistconfiguration()

Get list app configuration.

getlistcontents(id_, **kwargs)

gets the list contents (if exists).

getlistversion(versionNumber, id_)

Get a specific historic version of the specified list.

getlistversions(id_)

Get all the historic versions of the specified list.

performrefresh(id_)

Perform refresh of the list.

updatelist(listUpdateRequestDTO, id_)

PUT /lists/{id}

cancelexport(exportId, id_)

Cancel the export.

POST /lists/{id}/exports/{exportId}/cancel

Parameters

exportId (str) – exportId of the list (format: UUID)

cancelrefresh(id_)

Cancel refresh of the list.

DELETE /lists/{id}/refresh

createlist(listRequestDTO)

POST /lists

Parameters

listRequestDTO (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Schema

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "List Request DTO",
    "type": "object",
    "properties": {
        "name": {
            "description": "List name",
            "type": "string",
            "minLength": 1
        },
        "description": {
            "description": "List description",
            "type": "string"
        },
        "entityTypeId": {
            "description": "ID of the entity Type",
            "type": "string",
            "format": "UUID"
        },
        "fqlQuery": {
            "description": "FQL Query",
            "type": "string"
        },
        "fields": {
            "description": "Fields to be included in list contents",
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "isActive": {
            "description": "Indicates a List is Active or not",
            "type": "boolean"
        },
        "isPrivate": {
            "description": "Indicates a List is Private or not",
            "type": "boolean"
        },
        "queryId": {
            "description": "Optional id of query to create list from",
            "type": "string",
            "format": "uuid"
        }
    },
    "additionalProperties": false,
    "required": [
        "name",
        "entityTypeId",
        "isActive",
        "isPrivate"
    ]
}
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "List Entity DTO",
    "type": "object",
    "properties": {
        "id": {
            "description": "List id",
            "type": "string",
            "format": "UUID"
        },
        "name": {
            "description": "List name",
            "type": "string"
        },
        "description": {
            "description": "List description",
            "type": "string"
        },
        "entityTypeId": {
            "description": "ID of the entity Type",
            "type": "string",
            "format": "UUID"
        },
        "entityTypeName": {
            "description": "Name of the entity Type",
            "type": "string"
        },
        "userFriendlyQuery": {
            "description": "User Friendly Query",
            "type": "string"
        },
        "fqlQuery": {
            "description": "FQL Query",
            "type": "string"
        },
        "fields": {
            "description": "Fields to be included in list contents",
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "createdBy": {
            "description": "ID of the user who created the record (when available)",
            "type": "string",
            "format": "UUID"
        },
        "createdByUsername": {
            "description": "Created By Username",
            "type": "string"
        },
        "createdDate": {
            "description": "Date and time when the record was created",
            "type": "string",
            "format": "date-time"
        },
        "isActive": {
            "description": "Indicates a List is Active or not",
            "type": "boolean"
        },
        "isPrivate": {
            "description": "Indicates a List is Private or not",
            "type": "boolean"
        },
        "isCanned": {
            "description": "Indicates if a List is canned or not",
            "type": "boolean"
        },
        "isDeleted": {
            "description": "Indicates if a List has been deleted",
            "type": "boolean"
        },
        "updatedBy": {
            "description": "ID of the user who last updated the record (when available)",
            "type": "string",
            "format": "UUID"
        },
        "updatedByUsername": {
            "description": "Username of the user who last updated the record (when available)",
            "type": "string"
        },
        "updatedDate": {
            "description": "Date and time when the record was last updated",
            "type": "string",
            "format": "date-time"
        },
        "successRefresh": {
            "description": "List Refresh Information",
            "$ref": "ListRefreshDTO.json"
        },
        "inProgressRefresh": {
            "description": "List In-Progress Refresh Information",
            "$ref": "ListRefreshDTO.json"
        },
        "failedRefresh": {
            "description": "List Failed Refresh Information",
            "$ref": "ListRefreshDTO.json"
        },
        "version": {
            "description": "Number of version",
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "id",
        "name",
        "version"
    ]
}
deletelist(id_)

delete the list with the specific id (if exists).

DELETE /lists/{id}

Raises

OkapiRequestNotFound – List with id not found

downloadlist(exportId, id_)

Download the exported file.

GET /lists/{id}/exports/{exportId}/download

Parameters

exportId (str) – exportId of the list (format: UUID)

exportlist(id_)

Exports the list.

POST /lists/{id}/exports

Returns

See Schema below.

Return type

dict

Schema

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "List Export DTO",
    "type": "object",
    "properties": {
        "exportId": {
            "description": "List Export id",
            "type": "string",
            "format": "UUID"
        },
        "listId": {
            "description": "List Id",
            "type": "string",
            "format": "UUID"
        },
        "status": {
            "description": "Status of the export",
            "type": "string",
            "enum": [
                "IN_PROGRESS",
                "SUCCESS",
                "FAILED",
                "CANCELLED"
            ]
        },
        "startDate": {
            "description": "Date and time when the export request was submitted",
            "type": "string",
            "format": "date-time"
        },
        "endDate": {
            "description": "Date and time when the export was completed",
            "type": "string",
            "format": "date-time"
        },
        "createdBy": {
            "description": "ID of the user who wants to export the list",
            "type": "string",
            "format": "UUID"
        }
    },
    "additionalProperties": false,
    "required": [
        "exportId",
        "listId",
        "status",
        "startDate",
        "createdBy"
    ]
}
getalllists(**kwargs)

GET /lists

Keyword Arguments
  • ids (list) – List of ids to retrieve information for (items: (type: string, format: UUID))

  • entityTypeIds (list) – List of entityTypeIds to retrieve information for (items: (type: string, format: UUID))

  • offset (int) – Offset to start retrieving list information for (format: int32, default: 0)

  • size (int) – how many item to return (format: int32, default: 100)

  • active (bool) – Indicates whether list should be active or not

  • private (bool) – Indicates whether list should be private or not

  • includeDeleted (bool) – Indicates if deleted lists should be included in the results (default false)

  • updatedAsOf (str) – Indicates the minimum create/update timestamp to filter lists by (format: offset-date-time)

Returns

See Schema below.

Return type

dict

Schema

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "List summary results DTO",
    "type": "object",
    "properties": {
        "content": {
            "description": "array of content",
            "type": "array",
            "items": {
                "$ref": "#/ListSummaryDTO"
            }
        },
        "totalRecords": {
            "description": "Total number of records",
            "type": "integer",
            "format": "int64"
        },
        "totalPages": {
            "description": "Total number of pages",
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "content",
        "totalRecords",
        "totalPages"
    ],
    "ListSummaryDTO": {
        "description": "List Summary DTO",
        "type": "object",
        "properties": {
            "id": {
                "description": "List id",
                "type": "string",
                "format": "UUID"
            },
            "name": {
                "description": "List name",
                "type": "string"
            },
            "entityTypeId": {
                "description": "ID of the entity Type",
                "type": "string",
                "format": "UUID"
            },
            "entityTypeName": {
                "description": "Name of the entity Type",
                "type": "string"
            },
            "createdByUsername": {
                "description": "Created By Username",
                "type": "string"
            },
            "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
            },
            "isActive": {
                "description": "Indicates if a List is Active or not",
                "type": "boolean"
            },
            "isPrivate": {
                "description": "Indicate if a List is Private or not",
                "type": "boolean"
            },
            "isCanned": {
                "description": "Indicates if a List is canned or not",
                "type": "boolean"
            },
            "isDeleted": {
                "description": "Indicates if a List has been deleted",
                "type": "boolean"
            },
            "updatedBy": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "format": "UUID"
            },
            "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
            },
            "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
            },
            "recordsCount": {
                "description": "record count for refresh",
                "type": "number"
            },
            "refreshedDate": {
                "description": "End date for successful refresh",
                "type": "string",
                "format": "date-time"
            },
            "refreshedByUsername": {
                "description": "Username who did the refresh",
                "type": "string"
            },
            "isRefreshing": {
                "description": "Indicates if list refresh is in progress",
                "type": "boolean"
            },
            "latestRefreshFailed": {
                "description": "Indicates if the most recent list refresh failed",
                "type": "boolean"
            }
        },
        "additionalProperties": false,
        "required": [
            "id",
            "name",
            "entityTypeId",
            "entityTypeName"
        ]
    }
}
getexportdetails(exportId, id_)

Get details of an export request

GET /lists/{id}/exports/{exportId}

Parameters

exportId (str) – exportId of the list (format: UUID)

Returns

See Schema below.

Return type

dict

Schema

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "List Export DTO",
    "type": "object",
    "properties": {
        "exportId": {
            "description": "List Export id",
            "type": "string",
            "format": "UUID"
        },
        "listId": {
            "description": "List Id",
            "type": "string",
            "format": "UUID"
        },
        "status": {
            "description": "Status of the export",
            "type": "string",
            "enum": [
                "IN_PROGRESS",
                "SUCCESS",
                "FAILED",
                "CANCELLED"
            ]
        },
        "startDate": {
            "description": "Date and time when the export request was submitted",
            "type": "string",
            "format": "date-time"
        },
        "endDate": {
            "description": "Date and time when the export was completed",
            "type": "string",
            "format": "date-time"
        },
        "createdBy": {
            "description": "ID of the user who wants to export the list",
            "type": "string",
            "format": "UUID"
        }
    },
    "additionalProperties": false,
    "required": [
        "exportId",
        "listId",
        "status",
        "startDate",
        "createdBy"
    ]
}
getlistbyid(id_)

gets the specific list information (if exists).

GET /lists/{id}

Returns

See Schema below.

Return type

dict

Schema

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "List Entity DTO",
    "type": "object",
    "properties": {
        "id": {
            "description": "List id",
            "type": "string",
            "format": "UUID"
        },
        "name": {
            "description": "List name",
            "type": "string"
        },
        "description": {
            "description": "List description",
            "type": "string"
        },
        "entityTypeId": {
            "description": "ID of the entity Type",
            "type": "string",
            "format": "UUID"
        },
        "entityTypeName": {
            "description": "Name of the entity Type",
            "type": "string"
        },
        "userFriendlyQuery": {
            "description": "User Friendly Query",
            "type": "string"
        },
        "fqlQuery": {
            "description": "FQL Query",
            "type": "string"
        },
        "fields": {
            "description": "Fields to be included in list contents",
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "createdBy": {
            "description": "ID of the user who created the record (when available)",
            "type": "string",
            "format": "UUID"
        },
        "createdByUsername": {
            "description": "Created By Username",
            "type": "string"
        },
        "createdDate": {
            "description": "Date and time when the record was created",
            "type": "string",
            "format": "date-time"
        },
        "isActive": {
            "description": "Indicates a List is Active or not",
            "type": "boolean"
        },
        "isPrivate": {
            "description": "Indicates a List is Private or not",
            "type": "boolean"
        },
        "isCanned": {
            "description": "Indicates if a List is canned or not",
            "type": "boolean"
        },
        "isDeleted": {
            "description": "Indicates if a List has been deleted",
            "type": "boolean"
        },
        "updatedBy": {
            "description": "ID of the user who last updated the record (when available)",
            "type": "string",
            "format": "UUID"
        },
        "updatedByUsername": {
            "description": "Username of the user who last updated the record (when available)",
            "type": "string"
        },
        "updatedDate": {
            "description": "Date and time when the record was last updated",
            "type": "string",
            "format": "date-time"
        },
        "successRefresh": {
            "description": "List Refresh Information",
            "$ref": "ListRefreshDTO.json"
        },
        "inProgressRefresh": {
            "description": "List In-Progress Refresh Information",
            "$ref": "ListRefreshDTO.json"
        },
        "failedRefresh": {
            "description": "List Failed Refresh Information",
            "$ref": "ListRefreshDTO.json"
        },
        "version": {
            "description": "Number of version",
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "id",
        "name",
        "version"
    ]
}
getlistconfiguration()

Get list app configuration.

GET /lists/configuration

Returns

See Schema below.

Return type

dict

Schema

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "List Configuration Data",
    "type": "object",
    "properties": {
        "maxListSize": {
            "description": "Maximum allowable size of a list",
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "maxListSize"
    ]
}
getlistcontents(id_, **kwargs)

gets the list contents (if exists).

GET /lists/{id}/contents

Keyword Arguments
  • offset (int) – Offset to start retrieving items from (format: int32, default: 0)

  • size (int) – How many items to return (format: int32, default: 100)

Returns

See Schema below.

Return type

dict

Schema

{
    "type": "object"
}
getlistversion(versionNumber, id_)

Get a specific historic version of the specified list.

GET /lists/{id}/versions/{versionNumber}

Parameters

versionNumber (int) – Integer number of the requested version (minimum: 1)

Returns

See Schema below.

Return type

dict

Raises

OkapiRequestNotFound – List or version not found

Schema

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "List Version DTO",
    "type": "object",
    "properties": {
        "id": {
            "description": "Version id",
            "type": "string",
            "format": "UUID"
        },
        "name": {
            "description": "List name",
            "type": "string"
        },
        "description": {
            "description": "List description",
            "type": "string"
        },
        "userFriendlyQuery": {
            "description": "User Friendly Query",
            "type": "string"
        },
        "fqlQuery": {
            "description": "FQL Query",
            "type": "string"
        },
        "fields": {
            "description": "Fields to be included in list contents",
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "isActive": {
            "description": "Indicates a List is Active or not",
            "type": "boolean"
        },
        "isPrivate": {
            "description": "Indicates a List is Private or not",
            "type": "boolean"
        },
        "updatedBy": {
            "description": "ID of the user who last updated the record (when available)",
            "type": "string",
            "format": "UUID"
        },
        "updatedByUsername": {
            "description": "Username of the user who last updated the record (when available)",
            "type": "string"
        },
        "updatedDate": {
            "description": "Date and time when the record was last updated",
            "type": "string",
            "format": "date-time"
        },
        "listId": {
            "description": "list id",
            "type": "string",
            "format": "UUID"
        },
        "version": {
            "description": "Number of version",
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "id",
        "name",
        "version"
    ]
}
getlistversions(id_)

Get all the historic versions of the specified list.

GET /lists/{id}/versions

performrefresh(id_)

Perform refresh of the list.

POST /lists/{id}/refresh

Returns

See Schema below.

Return type

dict

Schema

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "List Refresh Details DTO",
    "type": "object",
    "properties": {
        "id": {
            "description": "List Refresh id",
            "type": "string",
            "format": "UUID"
        },
        "listId": {
            "description": "List id",
            "type": "string",
            "format": "UUID"
        },
        "status": {
            "description": "Status of the refresh",
            "type": "string",
            "enum": [
                "IN_PROGRESS",
                "SUCCESS",
                "FAILED",
                "CANCELLED"
            ]
        },
        "refreshStartDate": {
            "description": "Date and time when the list refresh was started",
            "type": "string",
            "format": "date-time"
        },
        "refreshEndDate": {
            "description": "Date and time when the list refresh was completed",
            "type": "string",
            "format": "date-time"
        },
        "refreshedBy": {
            "description": "ID of the user who refreshed the list",
            "type": "string",
            "format": "UUID"
        },
        "refreshedByUsername": {
            "description": "Username of the user who refreshed the list",
            "type": "string"
        },
        "recordsCount": {
            "description": "Number of the records found",
            "type": "integer"
        },
        "contentVersion": {
            "description": "Number of times list has been refreshed",
            "type": "integer"
        },
        "error": {
            "description": "Error encountered during list refresh",
            "$ref": "ListAppError.json"
        },
        "listVersion": {
            "description": "Contains the version of the list",
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "id",
        "listId",
        "status",
        "refreshStartDate",
        "refreshedBy",
        "refreshedByUsername"
    ]
}
updatelist(listUpdateRequestDTO, id_)

PUT /lists/{id}

Parameters

listUpdateRequestDTO (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Schema

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "List Update Request DTO",
    "type": "object",
    "properties": {
        "name": {
            "description": "List name",
            "type": "string",
            "minLength": 1
        },
        "description": {
            "description": "List description",
            "type": "string"
        },
        "fqlQuery": {
            "description": "FQL Query",
            "type": "string"
        },
        "fields": {
            "description": "Fields to be included in list contents",
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "isActive": {
            "description": "Indicates a List is Active or not",
            "type": "boolean"
        },
        "isPrivate": {
            "description": "Indicates a List is Private or not",
            "type": "boolean"
        },
        "version": {
            "description": "Number of version",
            "type": "integer"
        },
        "queryId": {
            "description": "Query ID",
            "type": "string",
            "format": "UUID"
        }
    },
    "additionalProperties": false,
    "required": [
        "name",
        "isActive",
        "isPrivate",
        "version"
    ]
}
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "description": "List Entity DTO",
    "type": "object",
    "properties": {
        "id": {
            "description": "List id",
            "type": "string",
            "format": "UUID"
        },
        "name": {
            "description": "List name",
            "type": "string"
        },
        "description": {
            "description": "List description",
            "type": "string"
        },
        "entityTypeId": {
            "description": "ID of the entity Type",
            "type": "string",
            "format": "UUID"
        },
        "entityTypeName": {
            "description": "Name of the entity Type",
            "type": "string"
        },
        "userFriendlyQuery": {
            "description": "User Friendly Query",
            "type": "string"
        },
        "fqlQuery": {
            "description": "FQL Query",
            "type": "string"
        },
        "fields": {
            "description": "Fields to be included in list contents",
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "createdBy": {
            "description": "ID of the user who created the record (when available)",
            "type": "string",
            "format": "UUID"
        },
        "createdByUsername": {
            "description": "Created By Username",
            "type": "string"
        },
        "createdDate": {
            "description": "Date and time when the record was created",
            "type": "string",
            "format": "date-time"
        },
        "isActive": {
            "description": "Indicates a List is Active or not",
            "type": "boolean"
        },
        "isPrivate": {
            "description": "Indicates a List is Private or not",
            "type": "boolean"
        },
        "isCanned": {
            "description": "Indicates if a List is canned or not",
            "type": "boolean"
        },
        "isDeleted": {
            "description": "Indicates if a List has been deleted",
            "type": "boolean"
        },
        "updatedBy": {
            "description": "ID of the user who last updated the record (when available)",
            "type": "string",
            "format": "UUID"
        },
        "updatedByUsername": {
            "description": "Username of the user who last updated the record (when available)",
            "type": "string"
        },
        "updatedDate": {
            "description": "Date and time when the record was last updated",
            "type": "string",
            "format": "date-time"
        },
        "successRefresh": {
            "description": "List Refresh Information",
            "$ref": "ListRefreshDTO.json"
        },
        "inProgressRefresh": {
            "description": "List In-Progress Refresh Information",
            "$ref": "ListRefreshDTO.json"
        },
        "failedRefresh": {
            "description": "List Failed Refresh Information",
            "$ref": "ListRefreshDTO.json"
        },
        "version": {
            "description": "Number of version",
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "id",
        "name",
        "version"
    ]
}