foliolib.folio.api.organizationsStorage.Address
- class foliolib.folio.api.organizationsStorage.Address(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiDeprecated. Addresses
- CRUD APIs used to manage addresses.
These APIs are not currently in use and may at some point be removed or resurrected
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
delete_address(addressesId)Delete address item with given {addressId}
get_address(addressesId)Retrieve address item with given {addressId}
get_addresses(**kwargs)Get list of addresses
modify_address(addressesId, address)Update address item with given {addressId}
set_address(address)Create a new address item.
- delete_address(addressesId: str)
Delete address item with given {addressId}
DELETE /organizations-storage/addresses/{addressesId}- Parameters
addressesId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
- get_address(addressesId: str)
Retrieve address item with given {addressId}
GET /organizations-storage/addresses/{addressesId}- Parameters
addressesId (str) –
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestNotFound – Not Found
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "An address record", "type": "object", "properties": { "id": { "description": "UUID", "$ref": "../../common/schemas/uuid.json" }, "addressLine1": { "description": "The first line of this address", "type": "string" }, "addressLine2": { "description": "The second line of this address", "type": "string" }, "city": { "description": "The city for this address", "type": "string" }, "stateRegion": { "description": "The state or region for this address", "type": "string" }, "zipCode": { "description": "The zip code for this address", "type": "string" }, "country": { "description": "The country for this address", "type": "string" }, "isPrimary": { "description": "Used to set this address as primary for the contact", "type": "boolean" }, "categories": { "id": "categories", "description": "The list of categories for this organization address", "type": "array", "items": { "type": "string" } }, "language": { "description": "The language for this organization address", "type": "string" }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false }
- get_addresses(**kwargs)
Get list of addresses
GET /organizations-storage/addresses- 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: for example code
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
[“code”, “MEDGRANT”, “=”]
totalRecords (str) –
(default=auto) How to calculate the totalRecords property. “exact” for the correct number, “estimated” for an estimation, “auto” to automatically select “exact” or “estimated”, “none” for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example
none
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#", "description": "Collection of address records", "type": "object", "properties": { "addresses": { "description": "The list of addresses in this collection", "type": "array", "id": "addresses", "items": { "type": "object", "$ref": "address.json" } }, "totalRecords": { "description": "The number of address records returned in this collection", "type": "integer" } }, "additionalProperties": false, "required": [ "addresses", "totalRecords" ] }
- modify_address(addressesId: str, address: dict)
Update address item with given {addressId}
PUT /organizations-storage/addresses/{addressesId}- Parameters
addressesId (str) –
address (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiRequestConflict – Conflict
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "An address record", "type": "object", "properties": { "id": { "description": "UUID", "$ref": "../../common/schemas/uuid.json" }, "addressLine1": { "description": "The first line of this address", "type": "string" }, "addressLine2": { "description": "The second line of this address", "type": "string" }, "city": { "description": "The city for this address", "type": "string" }, "stateRegion": { "description": "The state or region for this address", "type": "string" }, "zipCode": { "description": "The zip code for this address", "type": "string" }, "country": { "description": "The country for this address", "type": "string" }, "isPrimary": { "description": "Used to set this address as primary for the contact", "type": "boolean" }, "categories": { "id": "categories", "description": "The list of categories for this organization address", "type": "array", "items": { "type": "string" } }, "language": { "description": "The language for this organization address", "type": "string" }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false }
- set_address(address: dict)
Create a new address item.
POST /organizations-storage/addresses- Parameters
address (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
Headers
Location - URI to the created address item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "An address record", "type": "object", "properties": { "id": { "description": "UUID", "$ref": "../../common/schemas/uuid.json" }, "addressLine1": { "description": "The first line of this address", "type": "string" }, "addressLine2": { "description": "The second line of this address", "type": "string" }, "city": { "description": "The city for this address", "type": "string" }, "stateRegion": { "description": "The state or region for this address", "type": "string" }, "zipCode": { "description": "The zip code for this address", "type": "string" }, "country": { "description": "The country for this address", "type": "string" }, "isPrimary": { "description": "Used to set this address as primary for the contact", "type": "boolean" }, "categories": { "id": "categories", "description": "The list of categories for this organization address", "type": "array", "items": { "type": "string" } }, "language": { "description": "The language for this organization address", "type": "string" }, "metadata": { "type": "object", "$ref": "../../../raml-util/schemas/metadata.schema", "readonly": true } }, "additionalProperties": false }