foliolib.folio.api.kbEbscoJava.AssignedUsers

class foliolib.folio.api.kbEbscoJava.AssignedUsers(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_user(kbCredentialsId, userId)

Remove association between user and KB Credentials

get_users_by_kbCredential(kbCredentialsId)

Retrieve users information assigned to a specific KB credentials.

set_user(kbCredentialsId, user)

Assign user to a specific KB credentials.

delete_user(kbCredentialsId: str, userId: str)

Remove association between user and KB Credentials

DELETE /eholdings/kb-credentials/{kbCredentialsId}/users/{userId}

Parameters
  • kbCredentialsId (str) –

  • userId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

get_users_by_kbCredential(kbCredentialsId: str)

Retrieve users information assigned to a specific KB credentials.

GET /eholdings/kb-credentials/{kbCredentialsId}/users

Parameters

kbCredentialsId (str) –

Returns

See Schema below

Return type

dict

Raises

OkapiRequestError – Bad Request

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Assigned Users Collection Schema",
  "description": "Assigned Users Collection Schema",
  "javaType": "org.folio.rest.jaxrs.model.AssignedUserCollection",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "description": "Collection of assigned users to KB Credentials",
      "items": {
        "type": "object",
        "$ref": "assignedUser.json"
      }
    },
    "meta": {
      "type": "object",
      "description": "Metadata containing total size of collection",
      "$ref": "../metaTotalResults.json",
      "readonly": true
    },
    "jsonapi": {
      "type": "object",
      "description": "Version of JSON API",
      "$ref": "../jsonapi.json"
    }
  },
  "required": [
    "data",
    "meta",
    "jsonapi"
  ]
}
set_user(kbCredentialsId: str, user: dict)

Assign user to a specific KB credentials.

POST /eholdings/kb-credentials/{kbCredentialsId}/users

Parameters
  • kbCredentialsId (str) –

  • user (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": "POST Request To Assigned Users Id Collection Schema",
  "description": "POST Request To Assigned Users Collection Schema",
  "javaType": "org.folio.rest.jaxrs.model.AssignedUserPostRequest",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "description": "Assigned user Id",
      "$ref": "assignedUserId.json"
    }
  },
  "required": [
    "data"
  ]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Assigned Users Id Collection Item Schema",
  "description": "Assigned Users Collection Item Schema",
  "javaType": "org.folio.rest.jaxrs.model.AssignedUserId",
  "additionalProperties": false,
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The UUID of a user",
      "$ref": "../../raml-util/schemas/uuid.schema",
      "examples": "1f8f660e-7dc9-4f6f-828f-96284c68a25"
    },
    "credentialsId": {
      "type": "string",
      "description": "UUID of KB Credentials tied to",
      "$ref": "../../raml-util/schemas/uuid.schema",
      "examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f"
    }
  },
  "required": [
    "id"
  ]
}