foliolib.folio.api.oaiPmh.FolioSet
- class foliolib.folio.api.oaiPmh.FolioSet(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiSet API
API for managing sets and filtering conditions that is used as part of metadata harvesting protocol implementation
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
delete_set(setsId)Delete set item with given {setId}
get_set(setsId)Retrieve set item with given {setId}
get_sets(**kwargs)Retrieve a list of set items.
modify_set(setsId, set)Update set item with given {setId}
set_set(set)Create a new set item.
- delete_set(setsId: str)
Delete set item with given {setId}
DELETE /oai-pmh/sets/{setsId}- Parameters
setsId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
- get_set(setsId: str)
Retrieve set item with given {setId}
GET /oai-pmh/sets/{setsId}- Parameters
setsId (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": "Set DTO Schema", "type": "object", "additionalProperties": false, "javaType": "org.folio.rest.jaxrs.model.FolioSet", "properties": { "id": { "description": "UUID", "$ref": "../common/uuid.json" }, "name": { "description": "set name", "type": "string" }, "description": { "description": "set description", "type": "string" }, "setSpec": { "description": "set 'set spec' value based on included filtering-conditions", "type": "string" }, "filteringConditions": { "description": "list of filtering conditions", "type": "array", "items": { "type": "object", "$ref": "filteringCondition.json" }, "ref": "filteringConditionCollection.json" }, "createdDate": { "description": "Date and time when the set was created", "type": "string", "format": "date-time" }, "createdByUserId": { "description": "ID of the user who set the record", "$ref": "../common/uuid.json" }, "updatedDate": { "description": "Date and time when the set was last updated", "type": "string", "format": "date-time" }, "updatedByUserId": { "description": "ID of the user who last updated the set", "$ref": "../common/uuid.json" } }, "required": [ "name", "setSpec" ] }
- get_sets(**kwargs)
Retrieve a list of set items.
GET /oai-pmh/sets- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
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": "Filtering condition DTO Schema", "type": "object", "additionalProperties": false, "properties": { "sets": { "description": "list of folio sets", "type": "array", "id": "folioSetList", "items": { "javaType": "org.folio.rest.jaxrs.model.FolioSet", "type": "object", "$ref": "folioSet.json" } }, "totalRecords": { "type": "integer", "description": "Total number of records" } }, "required": [ "precedingSucceedingTitles", "totalRecords" ] }
- modify_set(setsId: str, set: dict)
Update set item with given {setId}
PUT /oai-pmh/sets/{setsId}- Parameters
setsId (str) –
set (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Set DTO Schema", "type": "object", "additionalProperties": false, "javaType": "org.folio.rest.jaxrs.model.FolioSet", "properties": { "id": { "description": "UUID", "$ref": "../common/uuid.json" }, "name": { "description": "set name", "type": "string" }, "description": { "description": "set description", "type": "string" }, "setSpec": { "description": "set 'set spec' value based on included filtering-conditions", "type": "string" }, "filteringConditions": { "description": "list of filtering conditions", "type": "array", "items": { "type": "object", "$ref": "filteringCondition.json" }, "ref": "filteringConditionCollection.json" }, "createdDate": { "description": "Date and time when the set was created", "type": "string", "format": "date-time" }, "createdByUserId": { "description": "ID of the user who set the record", "$ref": "../common/uuid.json" }, "updatedDate": { "description": "Date and time when the set was last updated", "type": "string", "format": "date-time" }, "updatedByUserId": { "description": "ID of the user who last updated the set", "$ref": "../common/uuid.json" } }, "required": [ "name", "setSpec" ] }
- set_set(set: dict)
Create a new set item.
POST /oai-pmh/sets- Parameters
set (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the created set item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Set DTO Schema", "type": "object", "additionalProperties": false, "javaType": "org.folio.rest.jaxrs.model.FolioSet", "properties": { "id": { "description": "UUID", "$ref": "../common/uuid.json" }, "name": { "description": "set name", "type": "string" }, "description": { "description": "set description", "type": "string" }, "setSpec": { "description": "set 'set spec' value based on included filtering-conditions", "type": "string" }, "filteringConditions": { "description": "list of filtering conditions", "type": "array", "items": { "type": "object", "$ref": "filteringCondition.json" }, "ref": "filteringConditionCollection.json" }, "createdDate": { "description": "Date and time when the set was created", "type": "string", "format": "date-time" }, "createdByUserId": { "description": "ID of the user who set the record", "$ref": "../common/uuid.json" }, "updatedDate": { "description": "Date and time when the set was last updated", "type": "string", "format": "date-time" }, "updatedByUserId": { "description": "ID of the user who last updated the set", "$ref": "../common/uuid.json" } }, "required": [ "name", "setSpec" ] }