foliolib.folio.api.tags.Tags
- class foliolib.folio.api.tags.Tags(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiTags API
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
deletetagbyid(id_)Delete tag with given ID
gettagbyid(id_)Retrieve tag with given ID
gettagcollection(**kwargs)Retrieve a list of tag items.
posttag(tagDto)Create a new tag.
puttagbyid(tagDto, id_)Update tag with given ID
- deletetagbyid(id_)
Delete tag with given ID
DELETE /tags/{id}- Raises
OkapiRequestUnauthorized – Not authorized to perform requested action
OkapiRequestNotFound – Item with a given ID not found
OkapiFatalError – Unexpected error
- gettagbyid(id_)
Retrieve tag with given ID
GET /tags/{id}- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestUnauthorized – Not authorized to perform requested action
OkapiRequestNotFound – Item with a given ID not found
OkapiRequestUnprocessableEntity – Validation errors
OkapiFatalError – Unexpected error
Schema
{ "type": "object", "title": "Tag", "description": "Tag that can be attached to various objects", "properties": { "id": { "$ref": "#/components/schemas/uuid", "description": "The UUID of this tag" }, "label": { "type": "string", "description": "The short label of this tag" }, "description": { "type": "string", "description": "The description of this tag" }, "metadata": { "$ref": "#/components/schemas/metadata", "readOnly": true, "description": "The metadata of this tag" } }, "required": [ "label" ], "example": { "id": "118dbd8c-5ba0-47a9-a850-34bbb1dbf3b7", "label": "important", "description": "This is important stuff." } }
- gettagcollection(**kwargs)
Retrieve a list of tag items.
GET /tags- Keyword Arguments
query (str) – A query expressed as a CQL string (default: cql.allRecords=1)
offset (int) – Skip over a number of elements by specifying an offset value for the query (default: 0, minimum: 0, maximum: 2147483647)
limit (int) – Limit the number of elements returned in the response (default: 1000, minimum: 1, maximum: 2147483647)
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestUnauthorized – Not authorized to perform requested action
OkapiRequestUnprocessableEntity – Validation errors
OkapiFatalError – Unexpected error
Schema
{ "type": "object", "title": "Collection of tags", "description": "Tag that can be attached to various objects", "properties": { "tags": { "type": "array", "items": { "$ref": "#/components/schemas/tagDto" } }, "totalRecords": { "type": "integer", "readOnly": true, "description": "Total amount of tags" } }, "required": [ "tags" ], "example": { "tags": [ { "id": "118dbd8c-5ba0-47a9-a850-34bbb1dbf3b7", "label": "important", "description": "This is important stuff." }, { "id": "46669e09-8b45-4ede-afbd-ca73bb89cdb3", "label": "urgent", "description": "This is urgent stuff." } ], "totalRecords": 2 } }
- posttag(tagDto)
Create a new tag.
POST /tags- Parameters
tagDto (dict) – See Schema below.
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestUnauthorized – Not authorized to perform requested action
OkapiRequestUnprocessableEntity – Validation errors
OkapiFatalError – Unexpected error
Schema
{ "type": "object", "title": "Tag", "description": "Tag that can be attached to various objects", "properties": { "id": { "$ref": "#/components/schemas/uuid", "description": "The UUID of this tag" }, "label": { "type": "string", "description": "The short label of this tag" }, "description": { "type": "string", "description": "The description of this tag" }, "metadata": { "$ref": "#/components/schemas/metadata", "readOnly": true, "description": "The metadata of this tag" } }, "required": [ "label" ], "example": { "id": "118dbd8c-5ba0-47a9-a850-34bbb1dbf3b7", "label": "important", "description": "This is important stuff." } }
- puttagbyid(tagDto, id_)
Update tag with given ID
PUT /tags/{id}- Parameters
tagDto (dict) – See Schema below.
- Raises
OkapiRequestUnauthorized – Not authorized to perform requested action
OkapiRequestNotFound – Item with a given ID not found
OkapiFatalError – Unexpected error
Schema
{ "type": "object", "title": "Tag", "description": "Tag that can be attached to various objects", "properties": { "id": { "$ref": "#/components/schemas/uuid", "description": "The UUID of this tag" }, "label": { "type": "string", "description": "The short label of this tag" }, "description": { "type": "string", "description": "The description of this tag" }, "metadata": { "$ref": "#/components/schemas/metadata", "readOnly": true, "description": "The metadata of this tag" } }, "required": [ "label" ], "example": { "id": "118dbd8c-5ba0-47a9-a850-34bbb1dbf3b7", "label": "important", "description": "This is important stuff." } }