foliolib.folio.api.quickMarc.Recordseditor

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

Bases: foliolib.folio.FolioApi

quickMARC Record Editor

Parameters
  • tenant (str) – Tenant id

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

Methods

getrecordbyexternalid(**kwargs)

Get MARC record by externalId

getrecordcreationstatus(**kwargs)

Get status of MARC bibliographic record creation

records(quickMarcCreate)

POST /records-editor/records

suggestion(quickMarcView)

POST /records-editor/links/suggestion

getrecordbyexternalid(**kwargs)

Get MARC record by externalId

GET /records-editor/records

Keyword Arguments
  • externalId (str) – UUID of the external that is related to the MARC record

  • lang (str) – Requested language. Optional. [lang=en] (pattern: [a-zA-Z]{2}, default: en)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

  • OkapiRequestNotFound – MARC record with a given ID not found

  • OkapiFatalError – Internal server error, e.g. due to misconfiguration

Schema

{
    "allOf": [
        {
            "$ref": "#/baseMarcRecord"
        },
        {
            "type": "object",
            "properties": {
                "parsedRecordId": {
                    "description": "MARC record Id",
                    "$ref": "#/uuid"
                },
                "parsedRecordDtoId": {
                    "description": "ParsedRecordDto identifier",
                    "$ref": "#/uuid"
                },
                "externalId": {
                    "description": "Identifier of external entity",
                    "$ref": "#/uuid"
                },
                "externalHrid": {
                    "description": "HRID of external entity",
                    "type": "string"
                },
                "updateInfo": {
                    "$ref": "#/updateInfo"
                }
            }
        }
    ]
}
getrecordcreationstatus(**kwargs)

Get status of MARC bibliographic record creation

GET /records-editor/records/status

Keyword Arguments

qmRecordId (str) – UUID of ParsedRecord to be created

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

  • OkapiRequestNotFound – MARC record with a given ID not found

  • OkapiFatalError – Internal server error, e.g. due to misconfiguration

Schema

{
    "description": "Status of MARC bibliographic record creation",
    "type": "object",
    "properties": {
        "qmRecordId": {
            "description": "ID of ParsedRecord to be created",
            "type": "string",
            "format": "uuid",
            "example": "c9db5d7a-e1d4-11e8-9f32-f2801f1b9fd1"
        },
        "externalId": {
            "description": "ID of created external record",
            "type": "string",
            "format": "uuid",
            "example": "c56b70ce-4ef6-47ef-8bc3-c470bafa0b8c"
        },
        "marcId": {
            "description": "ID of created MARC record",
            "type": "string",
            "format": "uuid",
            "example": "55a76b7b-841d-45b9-9e64-d0827b9e2480"
        },
        "jobExecutionId": {
            "description": "ID of job",
            "type": "string",
            "format": "uuid",
            "example": "c56b70ce-4ef6-47ef-8bc3-c470bafa0b8c"
        },
        "status": {
            "type": "string",
            "description": "Status of creation",
            "example": "CREATED",
            "enum": [
                "NEW",
                "IN_PROGRESS",
                "CREATED",
                "ERROR"
            ]
        },
        "errorMessage": {
            "type": "string",
            "description": "Error message for 'ERROR' status",
            "example": "Failed to create instance"
        },
        "metadata": {
            "type": "object",
            "properties": {
                "createdAt": {
                    "description": "Date and time of creation of the status",
                    "type": "string",
                    "format": "date-time",
                    "example": "2020-07-14T12:20:10.000"
                },
                "updatedAt": {
                    "description": "Date and time of last successful update of the status",
                    "type": "string",
                    "format": "date-time",
                    "example": "2020-07-14T12:20:10.000"
                }
            }
        }
    }
}
records(quickMarcCreate)

POST /records-editor/records

Parameters

quickMarcCreate (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiFatalError – Internal server error, e.g. due to misconfiguration

Schema

{
    "allOf": [
        {
            "$ref": "#/baseMarcRecord"
        },
        {
            "type": "object"
        }
    ]
}
{
    "description": "Status of MARC bibliographic record creation",
    "type": "object",
    "properties": {
        "qmRecordId": {
            "description": "ID of ParsedRecord to be created",
            "type": "string",
            "format": "uuid",
            "example": "c9db5d7a-e1d4-11e8-9f32-f2801f1b9fd1"
        },
        "externalId": {
            "description": "ID of created external record",
            "type": "string",
            "format": "uuid",
            "example": "c56b70ce-4ef6-47ef-8bc3-c470bafa0b8c"
        },
        "marcId": {
            "description": "ID of created MARC record",
            "type": "string",
            "format": "uuid",
            "example": "55a76b7b-841d-45b9-9e64-d0827b9e2480"
        },
        "jobExecutionId": {
            "description": "ID of job",
            "type": "string",
            "format": "uuid",
            "example": "c56b70ce-4ef6-47ef-8bc3-c470bafa0b8c"
        },
        "status": {
            "type": "string",
            "description": "Status of creation",
            "example": "CREATED",
            "enum": [
                "NEW",
                "IN_PROGRESS",
                "CREATED",
                "ERROR"
            ]
        },
        "errorMessage": {
            "type": "string",
            "description": "Error message for 'ERROR' status",
            "example": "Failed to create instance"
        },
        "metadata": {
            "type": "object",
            "properties": {
                "createdAt": {
                    "description": "Date and time of creation of the status",
                    "type": "string",
                    "format": "date-time",
                    "example": "2020-07-14T12:20:10.000"
                },
                "updatedAt": {
                    "description": "Date and time of last successful update of the status",
                    "type": "string",
                    "format": "date-time",
                    "example": "2020-07-14T12:20:10.000"
                }
            }
        }
    }
}
suggestion(quickMarcView)

POST /records-editor/links/suggestion

Parameters

quickMarcView (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiFatalError – Internal server error, e.g. due to misconfiguration

Schema

{
    "allOf": [
        {
            "$ref": "#/baseMarcRecord"
        },
        {
            "type": "object",
            "properties": {
                "parsedRecordId": {
                    "description": "MARC record Id",
                    "$ref": "#/uuid"
                },
                "parsedRecordDtoId": {
                    "description": "ParsedRecordDto identifier",
                    "$ref": "#/uuid"
                },
                "externalId": {
                    "description": "Identifier of external entity",
                    "$ref": "#/uuid"
                },
                "externalHrid": {
                    "description": "HRID of external entity",
                    "type": "string"
                },
                "updateInfo": {
                    "$ref": "#/updateInfo"
                }
            }
        }
    ]
}