foliolib.folio.api.gobi.GobiCustomMappings

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

Bases: foliolib.folio.FolioApi

GOBI® (Global Online Bibliographic Information) Integration

GOBI® (Global Online Bibliographic Information) is the leading web-based

acquisitions tool for finding, ordering and managing e-books and print books for libraries. This module allows GOBI initiated orders to be fulfilled by FOLIO.

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_customMapping(orderType)

Delete customMapping item with given {customMappingId}

get_customMapping(orderType)

Retrieve customMapping item with given {customMappingId}

get_customMappings(**kwargs)

Get list of acquisition methods

modify_customMapping(orderType, customMapping)

Update customMapping item with given {customMappingId}

set_customMapping(customMapping)

Create a new customMapping item.

delete_customMapping(orderType: str)

Delete customMapping item with given {customMappingId}

DELETE /gobi/orders/custom-mappings/{orderType}

Parameters

orderType (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_customMapping(orderType: str)

Retrieve customMapping item with given {customMappingId}

GET /gobi/orders/custom-mappings/{orderType}

Parameters

orderType (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 of order mappings",
  "type": "object",
  "properties": {
    "orderType": {
      "type": "string",
      "description": "The type of the GOBI order",
      "enum": [
        "ListedElectronicMonograph",
        "ListedElectronicSerial",
        "ListedPrintMonograph",
        "ListedPrintSerial",
        "UnlistedPrintMonograph",
        "UnlistedPrintSerial"
      ]
    },
    "mappings": {
      "description": "Collection of the order mappings",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "mapping.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "orderType",
    "mappings"
  ]
}
get_customMappings(**kwargs)

Get list of acquisition methods

GET /gobi/orders/custom-mappings

Parameters

**kwargs (properties) – Keyword Arguments

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

    with valid searchable fields: for example code

    Example

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

    • [“value”, “Purchase At Vendor System”, “=”]

  • 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

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 the order mapping view",
  "type": "object",
  "properties": {
    "orderMappingsViews": {
      "description": "Collection of the order mapping view",
      "type": "array",
      "id": "orderMappingsViews",
      "items": {
        "type": "object",
        "$ref": "order_mappings_view.json"
      }
    },
    "totalRecords": {
      "description": "The number of objects contained in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "orderMappingsViews",
    "totalRecords"
  ]
}
modify_customMapping(orderType: str, customMapping: dict)

Update customMapping item with given {customMappingId}

PUT /gobi/orders/custom-mappings/{orderType}

Parameters
  • orderType (str) –

  • customMapping (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": "Set of order mappings",
  "type": "object",
  "properties": {
    "orderType": {
      "type": "string",
      "description": "The type of the GOBI order",
      "enum": [
        "ListedElectronicMonograph",
        "ListedElectronicSerial",
        "ListedPrintMonograph",
        "ListedPrintSerial",
        "UnlistedPrintMonograph",
        "UnlistedPrintSerial"
      ]
    },
    "mappings": {
      "description": "Collection of the order mappings",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "mapping.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "orderType",
    "mappings"
  ]
}
set_customMapping(customMapping: dict)

Create a new customMapping item.

POST /gobi/orders/custom-mappings

Parameters

customMapping (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

Headers

  • Location - URI to the created customMapping item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Set of order mappings",
  "type": "object",
  "properties": {
    "orderType": {
      "type": "string",
      "description": "The type of the GOBI order",
      "enum": [
        "ListedElectronicMonograph",
        "ListedElectronicSerial",
        "ListedPrintMonograph",
        "ListedPrintSerial",
        "UnlistedPrintMonograph",
        "UnlistedPrintSerial"
      ]
    },
    "mappings": {
      "description": "Collection of the order mappings",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "mapping.json"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "orderType",
    "mappings"
  ]
}