foliolib.folio.api.users.AddressTypes
- class foliolib.folio.api.users.AddressTypes(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApimod-users Address Types API
This documents the API calls that can be made to query and manage user address types of the system
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
delete_addresstype(addresstypeId)Delete addresstype item with given {addresstypeId}
get_addresstype(addresstypeId)Retrieve addresstype item with given {addresstypeId}
get_addresstypes(**kwargs)Return a list of address types
modify_addresstype(addresstypeId, addresstype)Update addresstype item with given {addresstypeId}
set_addresstype(addresstype)Create an address type
- delete_addresstype(addresstypeId: str)
Delete addresstype item with given {addresstypeId}
DELETE /addresstypes/{addresstypeId}- Parameters
addresstypeId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
- get_addresstype(addresstypeId: str)
Retrieve addresstype item with given {addresstypeId}
GET /addresstypes/{addresstypeId}- Parameters
addresstypeId (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": "Address Type Schema", "description": "An address type", "type": "object", "properties": { "addressType": { "description": "A unique name for this address type", "type": "string" }, "desc": { "description": "An explanation of this address type", "type": "string" }, "id": { "description": "A UUID identifying this address type", "type": "string" }, "metadata": { "$ref": "raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "addressType" ] }
- get_addresstypes(**kwargs)
Return a list of address types
GET /addresstypes- 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.
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
addressType=primary
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 address types", "properties": { "addressTypes": { "description": "List of address type items", "type": "array", "id": "addressType", "items": { "type": "object", "$ref": "addresstype.json" } }, "totalRecords": { "type": "integer" } }, "required": [ "addressTypes", "totalRecords" ] }
- modify_addresstype(addresstypeId: str, addresstype: dict)
Update addresstype item with given {addresstypeId}
PUT /addresstypes/{addresstypeId}- Parameters
addresstypeId (str) –
addresstype (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Address Type Schema", "description": "An address type", "type": "object", "properties": { "addressType": { "description": "A unique name for this address type", "type": "string" }, "desc": { "description": "An explanation of this address type", "type": "string" }, "id": { "description": "A UUID identifying this address type", "type": "string" }, "metadata": { "$ref": "raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "addressType" ] }
- set_addresstype(addresstype: dict)
Create an address type
POST /addresstypes- Parameters
addresstype (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the created addresstype item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Address Type Schema", "description": "An address type", "type": "object", "properties": { "addressType": { "description": "A unique name for this address type", "type": "string" }, "desc": { "description": "An explanation of this address type", "type": "string" }, "id": { "description": "A UUID identifying this address type", "type": "string" }, "metadata": { "$ref": "raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false, "required": [ "addressType" ] }