foliolib.folio.api.users.ProxiesFor

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

Bases: foliolib.folio.FolioApi

mod-users Proxy For API

This documents the API calls that can be made to query and manage proxy relationships for users

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_proxiesfor(proxiesforId)

Delete proxiesfor item with given {proxiesforId}

get_proxiesfor(proxiesforId)

Retrieve proxiesfor item with given {proxiesforId}

get_proxiesfors(**kwargs)

Return a list of all proxy relationships

modify_proxiesfor(proxiesforId, proxiesfor)

Update proxiesfor item with given {proxiesforId}

set_proxiesfor(proxiesfor)

Create a proxyFor relationship

delete_proxiesfor(proxiesforId: str)

Delete proxiesfor item with given {proxiesforId}

DELETE /proxiesfor/{proxiesforId}

Parameters

proxiesforId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_proxiesfor(proxiesforId: str)

Retrieve proxiesfor item with given {proxiesforId}

GET /proxiesfor/{proxiesforId}

Parameters

proxiesforId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "ProxyFor Schema",
  "description": "A proxy for a user",
  "type": "object",
  "properties": {
    "userId": {
      "description": "The id of the user for whom this proxy pertains",
      "type": "string"
    },
    "proxyUserId": {
      "description": "The id of the user acting as the proxy",
      "type": "string"
    },
    "id": {
      "description": "A UUID identifying this proxy relationship",
      "type": "string"
    },
    "requestForSponsor": {
      "description": "Can the user request a sponsor (yes/no)",
      "type": "string"
    },
    "createdDate": {
      "description": "Deprecated",
      "type": "string",
      "format": "date-time"
    },
    "notificationsTo": {
      "description": "Where notifications are sent",
      "type": "string"
    },
    "accrueTo": {
      "description": "Where fees and fines accrue",
      "type": "string"
    },
    "status": {
      "description": "Active or Inactive",
      "type": "string"
    },
    "expirationDate": {
      "description": "The date this proxy relationship expires",
      "type": "string",
      "format": "date-time"
    },
    "metadata": {
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false
}
get_proxiesfors(**kwargs)

Return a list of all proxy relationships

GET /proxiesfor

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

    Example

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

    • name=aaa

  • 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#",
  "type": "object",
  "description": "Collection of user proxies",
  "properties": {
    "proxiesFor": {
      "description": "List of user proxy items",
      "type": "array",
      "id": "proxyFor",
      "items": {
        "type": "object",
        "$ref": "proxyfor.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "proxiesFor",
    "totalRecords"
  ]
}
modify_proxiesfor(proxiesforId: str, proxiesfor: dict)

Update proxiesfor item with given {proxiesforId}

PUT /proxiesfor/{proxiesforId}

Parameters
  • proxiesforId (str) –

  • proxiesfor (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "ProxyFor Schema",
  "description": "A proxy for a user",
  "type": "object",
  "properties": {
    "userId": {
      "description": "The id of the user for whom this proxy pertains",
      "type": "string"
    },
    "proxyUserId": {
      "description": "The id of the user acting as the proxy",
      "type": "string"
    },
    "id": {
      "description": "A UUID identifying this proxy relationship",
      "type": "string"
    },
    "requestForSponsor": {
      "description": "Can the user request a sponsor (yes/no)",
      "type": "string"
    },
    "createdDate": {
      "description": "Deprecated",
      "type": "string",
      "format": "date-time"
    },
    "notificationsTo": {
      "description": "Where notifications are sent",
      "type": "string"
    },
    "accrueTo": {
      "description": "Where fees and fines accrue",
      "type": "string"
    },
    "status": {
      "description": "Active or Inactive",
      "type": "string"
    },
    "expirationDate": {
      "description": "The date this proxy relationship expires",
      "type": "string",
      "format": "date-time"
    },
    "metadata": {
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false
}
set_proxiesfor(proxiesfor: dict)

Create a proxyFor relationship

POST /proxiesfor

Parameters

proxiesfor (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created proxiesfor item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "ProxyFor Schema",
  "description": "A proxy for a user",
  "type": "object",
  "properties": {
    "userId": {
      "description": "The id of the user for whom this proxy pertains",
      "type": "string"
    },
    "proxyUserId": {
      "description": "The id of the user acting as the proxy",
      "type": "string"
    },
    "id": {
      "description": "A UUID identifying this proxy relationship",
      "type": "string"
    },
    "requestForSponsor": {
      "description": "Can the user request a sponsor (yes/no)",
      "type": "string"
    },
    "createdDate": {
      "description": "Deprecated",
      "type": "string",
      "format": "date-time"
    },
    "notificationsTo": {
      "description": "Where notifications are sent",
      "type": "string"
    },
    "accrueTo": {
      "description": "Where fees and fines accrue",
      "type": "string"
    },
    "status": {
      "description": "Active or Inactive",
      "type": "string"
    },
    "expirationDate": {
      "description": "The date this proxy relationship expires",
      "type": "string",
      "format": "date-time"
    },
    "metadata": {
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false
}