foliolib.folio.api.consortia.Tenants

class foliolib.folio.api.consortia.Tenants(tenant: str)

Bases: foliolib.folio.FolioApi

Tenant integration API

Tenant integration API

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

createprimaryaffiliations(consortiumId, ...)

POST /consortia/{consortiumId}/tenants/{tenantId}/create-primary-affiliations

deletetenantbyid(consortiumId, tenantId)

DELETE /consortia/{consortiumId}/tenants/{tenantId}

gettenantdetailsbyid(consortiumId, tenantId)

GET /consortia/{consortiumId}/tenants/{tenantId}

gettenants(consortiumId, **kwargs)

GET /consortia/{consortiumId}/tenants

savetenant(consortiumId, tenant, **kwargs)

POST /consortia/{consortiumId}/tenants

syncprimaryaffiliations(consortiumId, ...)

POST /consortia/{consortiumId}/tenants/{tenantId}/sync-primary-affiliations

updatetenant(consortiumId, tenantId, tenant)

PUT /consortia/{consortiumId}/tenants/{tenantId}

createprimaryaffiliations(consortiumId, tenantId, syncPrimaryAffiliationBody, **kwargs)

POST /consortia/{consortiumId}/tenants/{tenantId}/create-primary-affiliations

Parameters
  • consortiumId (str) –

  • tenantId (str) – The ID of the tenant

  • syncPrimaryAffiliationBody (dict) – See Schema below.

Keyword Arguments

centralTenantId (str) – The ID of the central tenant

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Resource not found

  • OkapiRequestConflict – Validation errors

  • OkapiRequestUnprocessableEntity – Validation errors

  • OkapiRequestFatalError – Internal server error

Schema

{
    "description": "Primary affiliation DTO",
    "type": "object",
    "properties": {
        "tenantId": {
            "description": "Unique tenant id",
            "type": "string"
        },
        "users": {
            "description": "users",
            "type": "array",
            "items": {
                "description": "Users item",
                "type": "object",
                "properties": {
                    "id": {
                        "description": "User id",
                        "type": "string"
                    },
                    "username": {
                        "description": "The name of the user",
                        "type": "string"
                    },
                    "email": {
                        "description": "The email of the user",
                        "type": "string"
                    },
                    "mobilePhoneNumber": {
                        "description": "The mobile phone number of the user",
                        "type": "string"
                    },
                    "phoneNumber": {
                        "description": "The phone number of the user",
                        "type": "string"
                    },
                    "externalSystemId": {
                        "description": "External system id of user",
                        "type": "string"
                    },
                    "barcode": {
                        "description": "The user's barcode",
                        "type": "string"
                    }
                },
                "additionalProperties": false
            }
        }
    },
    "additionalProperties": false,
    "required": [
        "tenantId"
    ]
}
deletetenantbyid(consortiumId, tenantId)

DELETE /consortia/{consortiumId}/tenants/{tenantId}

Parameters
  • consortiumId (str) –

  • tenantId (str) – The ID of the tenant

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Resource not found

  • OkapiRequestFatalError – Internal server error

gettenantdetailsbyid(consortiumId, tenantId)

GET /consortia/{consortiumId}/tenants/{tenantId}

Parameters
  • consortiumId (str) –

  • tenantId (str) – The ID of the tenant

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Resource not found

  • OkapiRequestFatalError – Internal server error

Schema

{
    "allOf": [
        {
            "$ref": "tenant.yaml#/Tenant"
        },
        {
            "type": "object",
            "properties": {
                "setupStatus": {
                    "type": "string",
                    "enum": [
                        "IN_PROGRESS",
                        "COMPLETED",
                        "COMPLETED_WITH_ERRORS",
                        "FAILED"
                    ]
                }
            }
        }
    ]
}
gettenants(consortiumId, **kwargs)

GET /consortia/{consortiumId}/tenants

Parameters

consortiumId (str) –

Keyword Arguments
  • offset (int) – Skip over a number of elements by specifying an offset value for the query (default: 0, minimum: 0, maximum: 2147483647)

  • limit (int) – Limit the number of elements returned in the response (default: 10, minimum: 0, maximum: 2147483647)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Resource not found

  • OkapiRequestFatalError – Internal server error

Schema

{
    "type": "object",
    "properties": {
        "tenants": {
            "type": "array",
            "description": "Tenants",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "code": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 5,
                        "pattern": "^[a-zA-Z0-9]*$"
                    },
                    "name": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 150
                    },
                    "isCentral": {
                        "type": "boolean"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "code",
                    "name",
                    "isCentral"
                ]
            }
        },
        "totalRecords": {
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "tenants",
        "totalRecords"
    ]
}
savetenant(consortiumId, tenant, **kwargs)

POST /consortia/{consortiumId}/tenants

Parameters
  • consortiumId (str) –

  • tenant (dict) – See Schema below.

Keyword Arguments

adminUserId (str) –

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Resource not found

  • OkapiRequestConflict – Validation errors

  • OkapiRequestUnprocessableEntity – Validation errors

  • OkapiRequestFatalError – Internal server error

Schema

{
    "type": "object",
    "properties": {
        "id": {
            "type": "string"
        },
        "code": {
            "type": "string",
            "minLength": 2,
            "maxLength": 5,
            "pattern": "^[a-zA-Z0-9]*$"
        },
        "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 150
        },
        "isCentral": {
            "type": "boolean"
        }
    },
    "additionalProperties": false,
    "required": [
        "id",
        "code",
        "name",
        "isCentral"
    ]
}
syncprimaryaffiliations(consortiumId, tenantId, **kwargs)

POST /consortia/{consortiumId}/tenants/{tenantId}/sync-primary-affiliations

Parameters
  • consortiumId (str) –

  • tenantId (str) – The ID of the tenant

Keyword Arguments

centralTenantId (str) – The ID of the central tenant

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Resource not found

  • OkapiRequestConflict – Validation errors

  • OkapiRequestUnprocessableEntity – Validation errors

  • OkapiRequestFatalError – Internal server error

updatetenant(consortiumId, tenantId, tenant)

PUT /consortia/{consortiumId}/tenants/{tenantId}

Parameters
  • consortiumId (str) –

  • tenantId (str) – The ID of the tenant

  • tenant (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Resource not found

  • OkapiRequestFatalError – Internal server error

Schema

{
    "type": "object",
    "properties": {
        "id": {
            "type": "string"
        },
        "code": {
            "type": "string",
            "minLength": 2,
            "maxLength": 5,
            "pattern": "^[a-zA-Z0-9]*$"
        },
        "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 150
        },
        "isCentral": {
            "type": "boolean"
        }
    },
    "additionalProperties": false,
    "required": [
        "id",
        "code",
        "name",
        "isCentral"
    ]
}