foliolib.folio.api.tags.Tags

class foliolib.folio.api.tags.Tags(tenant: str)

Bases: foliolib.folio.FolioApi

Tags API

Base class of the Folio API

Parameters

tenant (str) – Tenant id

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. This neither checks whether other modules still use the tag label nor does it delete the tag from other modules. The client must ensure this.

DELETE /tags/{id}

Raises
  • OkapiRequestUnauthorized – Not authorized to perform requested action

  • OkapiRequestNotFound – Item with a given ID not found

  • OkapiRequestFatalError – 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

  • OkapiRequestFatalError – Unexpected error

Schema

{
    "type": "object",
    "title": "Tag",
    "description": "Tag that can be attached to various objects",
    "properties": {
        "id": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
            "example": "46669e09-8b45-4ede-afbd-ca73bb89cdb3"
        },
        "label": {
            "type": "string",
            "description": "The short label of this tag"
        },
        "description": {
            "type": "string",
            "description": "The description of this tag"
        },
        "metadata": {
            "type": "object",
            "title": "Metadata",
            "description": "Metadata about creation and changes to records",
            "properties": {
                "createdDate": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Date and time when the record was created"
                },
                "createdByUserId": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "example": "46669e09-8b45-4ede-afbd-ca73bb89cdb3"
                },
                "updatedDate": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Date and time when the record was last updated"
                },
                "updatedByUserId": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "example": "46669e09-8b45-4ede-afbd-ca73bb89cdb3"
                }
            },
            "required": [
                "createdDate"
            ]
        }
    },
    "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

  • OkapiRequestFatalError – Unexpected error

Schema

{
    "type": "object",
    "title": "Collection of tags",
    "description": "Tag that can be attached to various objects",
    "properties": {
        "tags": {
            "type": "array",
            "items": {
                "type": "object",
                "title": "Tag",
                "description": "Tag that can be attached to various objects",
                "properties": {
                    "id": {
                        "type": "string",
                        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                        "example": "46669e09-8b45-4ede-afbd-ca73bb89cdb3"
                    },
                    "label": {
                        "type": "string",
                        "description": "The short label of this tag"
                    },
                    "description": {
                        "type": "string",
                        "description": "The description of this tag"
                    },
                    "metadata": {
                        "type": "object",
                        "title": "Metadata",
                        "description": "Metadata about creation and changes to records",
                        "properties": {
                            "createdDate": {
                                "type": "string",
                                "format": "date-time",
                                "description": "Date and time when the record was created"
                            },
                            "createdByUserId": {
                                "type": "string",
                                "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                                "example": "46669e09-8b45-4ede-afbd-ca73bb89cdb3"
                            },
                            "updatedDate": {
                                "type": "string",
                                "format": "date-time",
                                "description": "Date and time when the record was last updated"
                            },
                            "updatedByUserId": {
                                "type": "string",
                                "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                                "example": "46669e09-8b45-4ede-afbd-ca73bb89cdb3"
                            }
                        },
                        "required": [
                            "createdDate"
                        ]
                    }
                },
                "required": [
                    "label"
                ],
                "example": {
                    "id": "118dbd8c-5ba0-47a9-a850-34bbb1dbf3b7",
                    "label": "important",
                    "description": "This is important stuff."
                }
            }
        },
        "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

  • OkapiRequestFatalError – Unexpected error

Schema

{
    "type": "object",
    "title": "Tag",
    "description": "Tag that can be attached to various objects",
    "properties": {
        "id": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
            "example": "46669e09-8b45-4ede-afbd-ca73bb89cdb3"
        },
        "label": {
            "type": "string",
            "description": "The short label of this tag"
        },
        "description": {
            "type": "string",
            "description": "The description of this tag"
        },
        "metadata": {
            "type": "object",
            "title": "Metadata",
            "description": "Metadata about creation and changes to records",
            "properties": {
                "createdDate": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Date and time when the record was created"
                },
                "createdByUserId": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "example": "46669e09-8b45-4ede-afbd-ca73bb89cdb3"
                },
                "updatedDate": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Date and time when the record was last updated"
                },
                "updatedByUserId": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "example": "46669e09-8b45-4ede-afbd-ca73bb89cdb3"
                }
            },
            "required": [
                "createdDate"
            ]
        }
    },
    "required": [
        "label"
    ],
    "example": {
        "id": "118dbd8c-5ba0-47a9-a850-34bbb1dbf3b7",
        "label": "important",
        "description": "This is important stuff."
    }
}
puttagbyid(tagDto, id_)

Update tag with given ID. When renaming the tag label mod-tags doesn’t update it in other modules, the client must ensure this.

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

  • OkapiRequestFatalError – Unexpected error

Schema

{
    "type": "object",
    "title": "Tag",
    "description": "Tag that can be attached to various objects",
    "properties": {
        "id": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
            "example": "46669e09-8b45-4ede-afbd-ca73bb89cdb3"
        },
        "label": {
            "type": "string",
            "description": "The short label of this tag"
        },
        "description": {
            "type": "string",
            "description": "The description of this tag"
        },
        "metadata": {
            "type": "object",
            "title": "Metadata",
            "description": "Metadata about creation and changes to records",
            "properties": {
                "createdDate": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Date and time when the record was created"
                },
                "createdByUserId": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "example": "46669e09-8b45-4ede-afbd-ca73bb89cdb3"
                },
                "updatedDate": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Date and time when the record was last updated"
                },
                "updatedByUserId": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
                    "example": "46669e09-8b45-4ede-afbd-ca73bb89cdb3"
                }
            },
            "required": [
                "createdDate"
            ]
        }
    },
    "required": [
        "label"
    ],
    "example": {
        "id": "118dbd8c-5ba0-47a9-a850-34bbb1dbf3b7",
        "label": "important",
        "description": "This is important stuff."
    }
}