foliolib.folio.api.kbEbscoJava.Resources

class foliolib.folio.api.kbEbscoJava.Resources(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_resource(resourceId)

Delete the association between a custom/managed title and a custom package using resourceId.

get_resource(resourceId, **kwargs)

Retrieve a specific resource given resourceId.

modify_resource(resourceId, resource)

Update a managed or custom resource using resourceId Note that resourceId is providerId-packageId-titleId

modify_tag(resourceId, tag)

Update tags assigned to resource

set_fetch(fetch)

POST /eholdings/resources/bulk/fetch

set_resource(resource)

Create a relation between an existing custom package and an existing custom/managed title.

delete_resource(resourceId: str)

Delete the association between a custom/managed title and a custom package using resourceId. Note that resourceId is providerId-packageId-titleId If the title is custom and is not associated with any other package, then the title will be deleted from the knowledge base.

DELETE /eholdings/resources/{resourceId}

Parameters

resourceId (str) –

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestNotFound – Not Found

get_resource(resourceId: str, **kwargs)

Retrieve a specific resource given resourceId. Note that a resource is a managed/custom title associated with a managed/custom package. resourceId is providerId-packageId-titleId

GET /eholdings/resources/{resourceId}

Parameters
  • resourceId (str) –

  • **kwargs (properties) – Keyword Arguments

Keyword Arguments

include (str) –

Include provider, package or title in response Possible values are

  • provider

  • package

  • title

Example

  • provider

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 object schema",
  "description": "Resource object schema",
  "javaType": "org.folio.rest.jaxrs.model.Resource",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "description": "The Data Schema",
      "$ref": "resourceCollectionItem.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_resource(resourceId: str, resource: dict)

Update a managed or custom resource using resourceId Note that resourceId is providerId-packageId-titleId

PUT /eholdings/resources/{resourceId}

Parameters
  • resourceId (str) –

  • resource (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": "Resource PUT Request Schema",
  "description": "Resource Put Request Schema using JSON API",
  "javaType": "org.folio.rest.jaxrs.model.ResourcePutRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "description": "Data object of resource put request",
      "type": "object",
      "$ref": "resourcePutData.json"
    }
  },
  "required": [
    "data"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Resource object schema",
  "description": "Resource object schema",
  "javaType": "org.folio.rest.jaxrs.model.Resource",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "description": "The Data Schema",
      "$ref": "resourceCollectionItem.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(resourceId: str, tag: dict)

Update tags assigned to resource

PUT /eholdings/resources/{resourceId}/tags

Parameters
  • resourceId (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": "Resource Tags PUT Request Schema",
  "description": "Resource Tags PUT Request Schema using JSON API",
  "javaType": "org.folio.rest.jaxrs.model.ResourceTagsPutRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "description": "Data object of resource tags put request",
      "type": "object",
      "$ref": "resourceTagsPutData.json"
    }
  },
  "required": [
    "data"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Resource Tags object schema",
  "description": "Resource Tags object schema",
  "javaType": "org.folio.rest.jaxrs.model.ResourceTags",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "description": "The Data Schema",
      "$ref": "resourceTagsItem.json"
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "data",
    "jsonapi"
  ]
}
set_fetch(fetch: dict)

POST /eholdings/resources/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": "Resource Bulk Fetch object schema",
  "description": "Resource Bulk Fetch object schema",
  "javaType": "org.folio.rest.jaxrs.model.ResourcePostBulkFetchRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "resources": {
      "type": "array",
      "uniqueItems": true,
      "maxItems": 20,
      "description": "A list of resource ids",
      "items": {
        "type": "string",
        "description": "A resource id.",
        "pattern": "\\d+-\\d+-\\d+",
        "examples": [
          "123-122-12354",
          "12-3446-67879"
        ]
      }
    }
  },
  "required": [
    "resources"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Resource Bulk Fetch object schema",
  "description": "Resource Bulk Fetch object schema",
  "javaType": "org.folio.rest.jaxrs.model.ResourceBulkFetchCollection",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "included": {
      "type": "array",
      "description": "List of included resource items",
      "items": {
        "type": "object",
        "$ref": "resourceBulkFetchCollectionItem.json"
      }
    },
    "meta": {
      "type": "object",
      "description": "Metadata of failed resources",
      "additionalProperties": false,
      "$ref": "resourceFailedInformation.json"
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "included",
    "jsonapi"
  ]
}
set_resource(resource: dict)

Create a relation between an existing custom package and an existing custom/managed title.

POST /eholdings/resources

Parameters

resource (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": "Resource POST Request Schema",
  "description": "Resource Post Request Schema using JSON API",
  "javaType": "org.folio.rest.jaxrs.model.ResourcePostRequest",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "description": "Data object of resource post request",
      "type": "object",
      "$ref": "resourcePostData.json"
    }
  },
  "required": [
    "data"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Resource object schema",
  "description": "Resource object schema",
  "javaType": "org.folio.rest.jaxrs.model.Resource",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "description": "The Data Schema",
      "$ref": "resourceCollectionItem.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"
  ]
}