foliolib.folio.api.ordersStorage.ExportHistory

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

Bases: foliolib.folio.FolioApi

Export history Logic API

API for managing export history

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_exportHistory(exportHistoryId)

Delete exportHistory item with given {exportHistoryId}

get_exportHistories(**kwargs)

Retrieve a list of exportHistory items.

get_exportHistory(exportHistoryId)

Retrieve exportHistory item with given {exportHistoryId}

modify_exportHistory(exportHistoryId, ...)

Update exportHistory item with given {exportHistoryId}

set_exportHistory(exportHistory)

Create export-history record

delete_exportHistory(exportHistoryId: str)

Delete exportHistory item with given {exportHistoryId}

DELETE /orders-storage/export-history/{exportHistoryId}

Parameters

exportHistoryId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_exportHistories(**kwargs)

Retrieve a list of exportHistory items.

GET /orders-storage/export-history

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • 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

  • 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.

    using CQL (indexes for export-history records)

    Example

    • (username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode

    • exportType==”EDIFACT_ORDERS_EXPORT”

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Collection of export histories",
  "type": "object",
  "properties": {
    "exportHistories": {
      "description": "Collection of export histories",
      "type": "array",
      "id": "export_history",
      "items": {
        "type": "object",
        "$ref": "export_history.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "exportHistories",
    "totalRecords"
  ]
}
get_exportHistory(exportHistoryId: str)

Retrieve exportHistory item with given {exportHistoryId}

GET /orders-storage/export-history/{exportHistoryId}

Parameters

exportHistoryId (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": "Export orders or order lines history",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this history record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "exportJobId": {
      "description": "UUID of the export Job",
      "$ref": "../../common/schemas/uuid.json"
    },
    "exportType": {
      "description": "Export type",
      "type": "string"
    },
    "jobStatus": {
      "description": "Job status",
      "type": "string"
    },
    "jobName": {
      "description": "Job name",
      "type": "string"
    },
    "exportMethod": {
      "description": "Export method name",
      "type": "string"
    },
    "exportFileName": {
      "description": "Export file name",
      "type": "string"
    },
    "vendorId": {
      "description": "UUID of vendor",
      "$ref": "../../common/schemas/uuid.json"
    },
    "vendorName": {
      "description": "Vendor name",
      "type": "string"
    },
    "exportDate": {
      "description": "Export date",
      "type": "string",
      "format": "date-time"
    },
    "exportedPoLineIds": {
      "description": "References the purchase order lines associated to the export",
      "id": "exportedPoLineIds",
      "type": "array",
      "items": {
        "description": "UUID of the purchase order line",
        "type": "string"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "exportType",
    "exportJobId",
    "exportDate"
  ]
}
modify_exportHistory(exportHistoryId: str, exportHistory: dict)

Update exportHistory item with given {exportHistoryId}

PUT /orders-storage/export-history/{exportHistoryId}

Parameters
  • exportHistoryId (str) –

  • exportHistory (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestConflict – Conflict

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Export orders or order lines history",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this history record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "exportJobId": {
      "description": "UUID of the export Job",
      "$ref": "../../common/schemas/uuid.json"
    },
    "exportType": {
      "description": "Export type",
      "type": "string"
    },
    "jobStatus": {
      "description": "Job status",
      "type": "string"
    },
    "jobName": {
      "description": "Job name",
      "type": "string"
    },
    "exportMethod": {
      "description": "Export method name",
      "type": "string"
    },
    "exportFileName": {
      "description": "Export file name",
      "type": "string"
    },
    "vendorId": {
      "description": "UUID of vendor",
      "$ref": "../../common/schemas/uuid.json"
    },
    "vendorName": {
      "description": "Vendor name",
      "type": "string"
    },
    "exportDate": {
      "description": "Export date",
      "type": "string",
      "format": "date-time"
    },
    "exportedPoLineIds": {
      "description": "References the purchase order lines associated to the export",
      "id": "exportedPoLineIds",
      "type": "array",
      "items": {
        "description": "UUID of the purchase order line",
        "type": "string"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "exportType",
    "exportJobId",
    "exportDate"
  ]
}
set_exportHistory(exportHistory: dict)

Create export-history record

POST /orders-storage/export-history

Parameters

exportHistory (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created exportHistory item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Export orders or order lines history",
  "type": "object",
  "properties": {
    "id": {
      "description": "UUID of this history record",
      "$ref": "../../common/schemas/uuid.json"
    },
    "exportJobId": {
      "description": "UUID of the export Job",
      "$ref": "../../common/schemas/uuid.json"
    },
    "exportType": {
      "description": "Export type",
      "type": "string"
    },
    "jobStatus": {
      "description": "Job status",
      "type": "string"
    },
    "jobName": {
      "description": "Job name",
      "type": "string"
    },
    "exportMethod": {
      "description": "Export method name",
      "type": "string"
    },
    "exportFileName": {
      "description": "Export file name",
      "type": "string"
    },
    "vendorId": {
      "description": "UUID of vendor",
      "$ref": "../../common/schemas/uuid.json"
    },
    "vendorName": {
      "description": "Vendor name",
      "type": "string"
    },
    "exportDate": {
      "description": "Export date",
      "type": "string",
      "format": "date-time"
    },
    "exportedPoLineIds": {
      "description": "References the purchase order lines associated to the export",
      "id": "exportedPoLineIds",
      "type": "array",
      "items": {
        "description": "UUID of the purchase order line",
        "type": "string"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "exportType",
    "exportJobId",
    "exportDate"
  ]
}