foliolib.folio.api.diConverterStorage.FieldProtectionSettings
- class foliolib.folio.api.diConverterStorage.FieldProtectionSettings(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiField Protection Settings API
API for managing field protection settings
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
delete_marc(marcId)Delete marc item with given {marcId}
get_marc(marcId)Retrieve marc item with given {marcId}
get_marcs(**kwargs)Retrieve a list of marc items.
modify_marc(marcId, marc)Update marc item with given {marcId}
set_marc(marc)Create a new marc item.
- delete_marc(marcId: str)
Delete marc item with given {marcId}
DELETE /field-protection-settings/marc/{marcId}- Parameters
marcId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
- get_marc(marcId: str)
Retrieve marc item with given {marcId}
GET /field-protection-settings/marc/{marcId}- Parameters
marcId (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": "MARC field protection setting schema", "type": "object", "javaType": "org.folio.rest.jaxrs.model.MarcFieldProtectionSetting", "additionalProperties": false, "properties": { "id": { "description": "MARC field protection setting id", "$ref": "../../../raml-util/schemas/uuid.schema" }, "field": { "description": "Field", "type": "string" }, "indicator1": { "description": "Indicator 1", "type": "string" }, "indicator2": { "description": "Indicator 2", "type": "string" }, "subfield": { "description": "Subfield", "type": "string" }, "data": { "description": "Data", "type": "string" }, "source": { "description": "Source", "type": "string", "enum": [ "SYSTEM", "USER" ] }, "override": { "description": "Indicates whether field can be overridden or not, always false for SYSTEM protection settings", "type": "boolean", "default": false }, "metadata": { "description": "Metadata provided by the server", "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "required": [ "field" ] }
- get_marcs(**kwargs)
Retrieve a list of marc items.
GET /field-protection-settings/marc- 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 source=SYSTEM
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
source=SYSTEM
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
OkapiRequestUnprocessableEntity – Unprocessable Entity
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Collection of MARC field protection settings", "type": "object", "additionalProperties": false, "properties": { "marcFieldProtectionSettings": { "description": "List of MARC field protection settings", "type": "array", "id": "marcFieldProtectionSettingsList", "items": { "type": "object", "$ref": "marcFieldProtectionSetting.json" } }, "totalRecords": { "description": "Total number of MARC field protection settings", "type": "integer" } }, "excludedFromEqualsAndHashCode": [ "totalRecords" ], "required": [ "marcFieldProtectionSettings", "totalRecords" ] }
- modify_marc(marcId: str, marc: dict)
Update marc item with given {marcId}
PUT /field-protection-settings/marc/{marcId}- Parameters
marcId (str) –
marc (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": "MARC field protection setting schema", "type": "object", "javaType": "org.folio.rest.jaxrs.model.MarcFieldProtectionSetting", "additionalProperties": false, "properties": { "id": { "description": "MARC field protection setting id", "$ref": "../../../raml-util/schemas/uuid.schema" }, "field": { "description": "Field", "type": "string" }, "indicator1": { "description": "Indicator 1", "type": "string" }, "indicator2": { "description": "Indicator 2", "type": "string" }, "subfield": { "description": "Subfield", "type": "string" }, "data": { "description": "Data", "type": "string" }, "source": { "description": "Source", "type": "string", "enum": [ "SYSTEM", "USER" ] }, "override": { "description": "Indicates whether field can be overridden or not, always false for SYSTEM protection settings", "type": "boolean", "default": false }, "metadata": { "description": "Metadata provided by the server", "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "required": [ "field" ] }
- set_marc(marc: dict)
Create a new marc item.
POST /field-protection-settings/marc- Parameters
marc (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the created marc item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "MARC field protection setting schema", "type": "object", "javaType": "org.folio.rest.jaxrs.model.MarcFieldProtectionSetting", "additionalProperties": false, "properties": { "id": { "description": "MARC field protection setting id", "$ref": "../../../raml-util/schemas/uuid.schema" }, "field": { "description": "Field", "type": "string" }, "indicator1": { "description": "Indicator 1", "type": "string" }, "indicator2": { "description": "Indicator 2", "type": "string" }, "subfield": { "description": "Subfield", "type": "string" }, "data": { "description": "Data", "type": "string" }, "source": { "description": "Source", "type": "string", "enum": [ "SYSTEM", "USER" ] }, "override": { "description": "Indicates whether field can be overridden or not, always false for SYSTEM protection settings", "type": "boolean", "default": false }, "metadata": { "description": "Metadata provided by the server", "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "required": [ "field" ] }