foliolib.folio.api.kbEbscoJava.Packages

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

Bases: foliolib.folio.FolioApi

mod-kb-ebsco-java

Implements the eholdings interface using EBSCO KB as backend.

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_package(packageId)

Delete a specific custom package using packageId.

get_package(packageId, **kwargs)

Retrieve a specific package given packageId.

get_packages(**kwargs)

Retrieve a collection of packages based on the search query.

get_resources_by_package(packageId, **kwargs)

Include all resources belonging to a specific package

modify_package(packageId, package)

Update a managed or custom package using packageId Note that packageId is providerId-packageId

modify_tag(packageId, tag)

Update tags assigned to package

set_fetch(fetch)

POST /eholdings/packages/bulk/fetch

set_package(package)

Create a custom package

delete_package(packageId: str)

Delete a specific custom package using packageId. Note that packageId is providerId-packageId

DELETE /eholdings/packages/{packageId}

Parameters

packageId (str) –

Raises

OkapiRequestError – Bad Request

get_package(packageId: str, **kwargs)

Retrieve a specific package given packageId. Note that packageId is providerId-packageId

GET /eholdings/packages/{packageId}

Parameters
  • packageId (str) –

  • **kwargs (properties) – Keyword Arguments

Keyword Arguments

include (str) –

Include resources or provider in response Possible values are

  • resources

  • provider

Example

  • resources

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestNotFound – Not Found

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Package object schema",
  "description": "Package object schema",
  "javaType": "org.folio.rest.jaxrs.model.Package",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "description": "The Data Schema",
      "$ref": "packageCollectionItem.json"
    },
    "included": {
      "type": "array",
      "description": "List of included items",
      "items": {
        "type": "object",
        "javaType": "java.lang.Object"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "data",
    "jsonapi"
  ]
}
get_packages(**kwargs)

Retrieve a collection of packages based on the search query.

GET /eholdings/packages

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • filter[custom] (str) –

    Filter to get list of custom packages Possible values are

    • true

    Example

    • true

  • q (str) –

    String used to search to retrieve a collection

    Example

    • ABC-CLIO

  • filter[selected] (str) –

    Filter to narrow down results based on selection status. Possible values are all, true, false, ebsco.

    Example

    • all

  • filter[type] (str) –

    (default=all) Filter to narrow down results based on content type. Defaults to all. Possible values are all, aggregatedfulltext, abstractandindex, ebook, ejournal, print, unknown, streamingmedia, mixedcontent, onlinereference.

    Example

    • ebook

  • filter[tags] (list) – Filter to narrow down results based on assigned tags. Contains list of required tags.

  • filter[access-type] (list) – Filter to narrow down results based on assigned access type.

  • sort (str) – (default=relevance) Option by which results are sorted. Possible values are name, relevance.

  • page (int) –

    (default=1) Page number

    Example

    • 1

  • count (int) –

    (default=<<defaultCountValue>>) Page size

    Example

    • 100

Returns

See Schema below

Return type

dict

Raises

OkapiRequestError – Bad Request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Package Collection Schema",
  "description": "Package Collection Schema",
  "javaType": "org.folio.rest.jaxrs.model.PackageCollection",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "array",
      "description": "List of packages",
      "items": {
        "type": "object",
        "$ref": "packageCollectionItem.json"
      }
    },
    "meta": {
      "type": "object",
      "description": "metadata containing total results in packages collection",
      "$ref": "../metaTotalResults.json"
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "data",
    "jsonapi"
  ]
}
get_resources_by_package(packageId: str, **kwargs)

Include all resources belonging to a specific package

GET /eholdings/packages/{packageId}/resources

Parameters
  • packageId (str) –

  • **kwargs (properties) – Keyword Arguments

Keyword Arguments
  • filter[tags] (list) – Filter to narrow down results based on assigned tags. Contains list of required tags.

  • filter[access-type] (list) – Filter to narrow down results based on assigned access type.

  • filter[selected] (str) –

    Filter to narrow down results based on selection status. Defaults to all. Possible values are all, true, false, ebsco.

    Example

    • ebsco

  • filter[type] (str) – Filter to narrow down results based on content type. Possible values are all, audiobook, book, bookseries, database, journal, newsletter, newspaper, proceedings, report, streamingaudio, streamingvideo,thesisdissertation, website, unspecified.

  • filter[name] (str) –

    String to search title name to get a collection of titles

    Example

    • War and Peace

  • filter[isxn] (str) –

    String to search ISSN and ISBN to get a collection of titles

    Example

    • 1050-3331

  • filter[subject] (str) –

    String to search subjects to get a collection of titles

    Example

    • history

  • filter[publisher] (str) –

    String to search publishers to get a collection of titles

    Example

    • academic

  • sort (str) – (default=relevance) Option by which results are sorted. Possible values are name, relevance.

  • page (int) –

    (default=1) Page number

    Example

    • 1

  • count (int) –

    (default=<<defaultCountValue>>) Page size

    Example

    • 100

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestNotFound – Not Found

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Resource Collection Schema",
  "description": "Resource Collection Schema",
  "javaType": "org.folio.rest.jaxrs.model.ResourceCollection",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "array",
      "description": "List of resources",
      "items": {
        "type": "object",
        "$ref": "resourceCollectionItem.json"
      }
    },
    "meta": {
      "type": "object",
      "description": "metadata containing total results in resources collection",
      "$ref": "../metaTotalResults.json"
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "data",
    "jsonapi"
  ]
}
modify_package(packageId: str, package: dict)

Update a managed or custom package using packageId Note that packageId is providerId-packageId

PUT /eholdings/packages/{packageId}

Parameters
  • packageId (str) –

  • package (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestNotFound – Not Found

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Package PUT Request Schema",
  "description": "Package PUT Request Schema using JSON API",
  "javaType": "org.folio.rest.jaxrs.model.PackagePutRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "description": "Data object of package put request",
      "type": "object",
      "$ref": "packagePutData.json"
    }
  },
  "required": [
    "data"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Package object schema",
  "description": "Package object schema",
  "javaType": "org.folio.rest.jaxrs.model.Package",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "description": "The Data Schema",
      "$ref": "packageCollectionItem.json"
    },
    "included": {
      "type": "array",
      "description": "List of included items",
      "items": {
        "type": "object",
        "javaType": "java.lang.Object"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "data",
    "jsonapi"
  ]
}
modify_tag(packageId: str, tag: dict)

Update tags assigned to package

PUT /eholdings/packages/{packageId}/tags

Parameters
  • packageId (str) –

  • tag (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises

OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Package Tags PUT Request Schema",
  "description": "Package Tags PUT Request Schema using JSON API",
  "javaType": "org.folio.rest.jaxrs.model.PackageTagsPutRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "description": "Data object of package tags put request",
      "type": "object",
      "$ref": "packageTagsPutData.json"
    }
  },
  "required": [
    "data"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Package Tags object schema",
  "description": "Package Tags object schema",
  "javaType": "org.folio.rest.jaxrs.model.PackageTags",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "description": "The Data Schema",
      "$ref": "packageTagsItem.json"
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "data",
    "jsonapi"
  ]
}
set_fetch(fetch: dict)

POST /eholdings/packages/bulk/fetch

Parameters

fetch (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises

OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Package Bulk Fetch object schema",
  "description": "Package Bulk Fetch object schema",
  "javaType": "org.folio.rest.jaxrs.model.PackagePostBulkFetchRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "packages": {
      "type": "array",
      "uniqueItems": true,
      "maxItems": 20,
      "description": "A list of package ids",
      "items": {
        "type": "string",
        "description": "Package id",
        "pattern": "\\d+-\\d+",
        "examples": [
          "123-12354",
          "12-34467879"
        ]
      }
    }
  },
  "required": [
    "packages"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Package Bulk Fetch object schema",
  "description": "Package Bulk Fetch object schema",
  "javaType": "org.folio.rest.jaxrs.model.PackageBulkFetchCollection",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "included": {
      "type": "array",
      "description": "List of included package items",
      "items": {
        "type": "object",
        "$ref": "packageBulkFetchCollectionItem.json"
      }
    },
    "meta": {
      "type": "object",
      "description": "Metadata of failed packages",
      "additionalProperties": false,
      "$ref": "packageFailedInformation.json"
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "included",
    "jsonapi"
  ]
}
set_package(package: dict)

Create a custom package

POST /eholdings/packages

Parameters

package (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Package POST Request Schema",
  "description": "Package Post Request Schema using JSON API",
  "javaType": "org.folio.rest.jaxrs.model.PackagePostRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "description": "Data object of package post request",
      "type": "object",
      "$ref": "packagePostData.json"
    }
  },
  "required": [
    "data"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Package object schema",
  "description": "Package object schema",
  "javaType": "org.folio.rest.jaxrs.model.Package",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "description": "The Data Schema",
      "$ref": "packageCollectionItem.json"
    },
    "included": {
      "type": "array",
      "description": "List of included items",
      "items": {
        "type": "object",
        "javaType": "java.lang.Object"
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "data",
    "jsonapi"
  ]
}