foliolib.folio.api.fincConfig.FincConfigFilters

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

Bases: foliolib.folio.FolioApi

mod-finc-config API

This documents the API calls that can be made to query filters of metadata collections for all tenants/isils

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_filter(filtersId)

Delete a filter identified by id

get_collections_by_filter(filtersId)

Get all metadata collections the current filter is assigned to

get_filter(filtersId)

Get one finc config filter identified by id

get_filters(**kwargs)

Get all filters

modify_collection(filtersId, collection)

Add collections to this filter

modify_filter(filtersId, filter)

Put a filter identified by id

set_filter(filter)

Post new filter

delete_filter(filtersId: str)

Delete a filter identified by id

DELETE /finc-config/filters/{filtersId}

Parameters

filtersId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_collections_by_filter(filtersId: str)

Get all metadata collections the current filter is assigned to

GET /finc-config/filters/{filtersId}/collections

Parameters

filtersId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Finc Select Filter Collections Schema",
  "description": "List of metadata collection IDs assigned to a filter in finc select",
  "type": "object",
  "properties": {
    "id": {
      "description": "ID of associated filter",
      "type": "string",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
    },
    "collectionIds": {
      "type": "array",
      "id": "collectionIds",
      "description": "List of ids of associated metadata collections",
      "items": {
        "type": "string",
        "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
      }
    },
    "collectionsCount": {
      "type": "integer",
      "description": "Number of collection ids."
    },
    "isil": {
      "type": "string",
      "description": "Isil of library using this filter"
    }
  },
  "required": [
    "collectionIds"
  ],
  "additionalProperties": false
}
get_filter(filtersId: str)

Get one finc config filter identified by id

GET /finc-config/filters/{filtersId}

Parameters

filtersId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Finc Select Filter Schema",
  "description": "Filter of a metadata collection in finc select",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "type": "string",
      "description": "A unique name for this filter"
    },
    "type": {
      "type": "string",
      "description": "The type of this filter",
      "enum": [
        "Whitelist",
        "Blacklist"
      ]
    },
    "filterFiles": {
      "type": "array",
      "id": "filterFiles",
      "description": "List of filter files associated with this filter",
      "items": {
        "type": "object",
        "$ref": "fincSelectFilterFile.json"
      }
    },
    "isil": {
      "type": "string",
      "description": "Isil of library using this filter"
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema"
    }
  },
  "required": [
    "label",
    "type"
  ],
  "additionalProperties": false
}
get_filters(**kwargs)

Get all filters

GET /finc-config/filters

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.

    Example

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

    • ((label=”test*”) and type=”Blacklist”) sortby label

  • orderBy (str) – Order by field: label, type

  • order (str (desc|asc) – ): (default=desc) Order

  • 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#",
  "type": "object",
  "description": "Collection of filters in finc select",
  "properties": {
    "fincSelectFilters": {
      "type": "array",
      "id": "fincSelectFilters",
      "description": "List of filters in finc select",
      "items": {
        "type": "object",
        "$ref": "fincSelectFilter.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "fincSelectFilters",
    "totalRecords"
  ]
}
modify_collection(filtersId: str, collection: dict)

Add collections to this filter

PUT /finc-config/filters/{filtersId}/collections

Parameters
  • filtersId (str) –

  • collection (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Finc Select Filter Collections Schema",
  "description": "List of metadata collection IDs assigned to a filter in finc select",
  "type": "object",
  "properties": {
    "id": {
      "description": "ID of associated filter",
      "type": "string",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
    },
    "collectionIds": {
      "type": "array",
      "id": "collectionIds",
      "description": "List of ids of associated metadata collections",
      "items": {
        "type": "string",
        "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
      }
    },
    "collectionsCount": {
      "type": "integer",
      "description": "Number of collection ids."
    },
    "isil": {
      "type": "string",
      "description": "Isil of library using this filter"
    }
  },
  "required": [
    "collectionIds"
  ],
  "additionalProperties": false
}
modify_filter(filtersId: str, filter: dict)

Put a filter identified by id

PUT /finc-config/filters/{filtersId}

Parameters
  • filtersId (str) –

  • filter (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Finc Select Filter Schema",
  "description": "Filter of a metadata collection in finc select",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "type": "string",
      "description": "A unique name for this filter"
    },
    "type": {
      "type": "string",
      "description": "The type of this filter",
      "enum": [
        "Whitelist",
        "Blacklist"
      ]
    },
    "filterFiles": {
      "type": "array",
      "id": "filterFiles",
      "description": "List of filter files associated with this filter",
      "items": {
        "type": "object",
        "$ref": "fincSelectFilterFile.json"
      }
    },
    "isil": {
      "type": "string",
      "description": "Isil of library using this filter"
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema"
    }
  },
  "required": [
    "label",
    "type"
  ],
  "additionalProperties": false
}
set_filter(filter: dict)

Post new filter

POST /finc-config/filters

Parameters

filter (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created filter item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Finc Select Filter Schema",
  "description": "Filter of a metadata collection in finc select",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "type": "string",
      "description": "A unique name for this filter"
    },
    "type": {
      "type": "string",
      "description": "The type of this filter",
      "enum": [
        "Whitelist",
        "Blacklist"
      ]
    },
    "filterFiles": {
      "type": "array",
      "id": "filterFiles",
      "description": "List of filter files associated with this filter",
      "items": {
        "type": "object",
        "$ref": "fincSelectFilterFile.json"
      }
    },
    "isil": {
      "type": "string",
      "description": "Isil of library using this filter"
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema"
    }
  },
  "required": [
    "label",
    "type"
  ],
  "additionalProperties": false
}