foliolib.folio.api.consortia.UserTenants

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

Bases: foliolib.folio.FolioApi

User Tenant Association integration API

User Tenant Association integration API

Parameters
  • tenant (str) – Tenant id

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

Methods

deleteusertenant(consortiumId, **kwargs)

Delete User Tenant Associations for particular user id and tenant id

getusertenantbyassociationid(consortiumId, ...)

GET /consortia/{consortiumId}/user-tenants/{associationId}

getusertenants(consortiumId, **kwargs)

User Tenant Associations

postusertenants(consortiumId, userTenant)

User Tenant Associations

deleteusertenant(consortiumId, **kwargs)

Delete User Tenant Associations for particular user id and tenant id

DELETE /consortia/{consortiumId}/user-tenants

Parameters

consortiumId (str) –

Keyword Arguments
  • userId (str) –

  • tenantId (str) – The ID of the tenant

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Resource not found

  • OkapiFatalError – Internal server error

getusertenantbyassociationid(consortiumId, associationId)

GET /consortia/{consortiumId}/user-tenants/{associationId}

Parameters
  • consortiumId (str) –

  • associationId (str) –

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Resource not found

  • OkapiFatalError – Internal server error

Schema

{
    "description": "A JSON schema for the User Tenant",
    "type": "object",
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid"
        },
        "userId": {
            "type": "string",
            "format": "uuid"
        },
        "username": {
            "type": "string"
        },
        "tenantId": {
            "type": "string"
        },
        "tenantName": {
            "type": "string"
        },
        "isPrimary": {
            "type": "boolean"
        }
    },
    "additionalProperties": false,
    "required": [
        "userId",
        "tenantId"
    ]
}
getusertenants(consortiumId, **kwargs)

User Tenant Associations

GET /consortia/{consortiumId}/user-tenants

Parameters

consortiumId (str) –

Keyword Arguments
  • userId (str) –

  • username (str) – (description: The username of the user)

  • tenantId (str) – The ID of the tenant

  • 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

  • OkapiFatalError – Internal server error

Schema

{
    "description": "A JSON schema for the User Tenants Collection",
    "type": "object",
    "properties": {
        "userTenants": {
            "type": "array",
            "description": "The list of user tenants",
            "items": {
                "type": "object",
                "$ref": "userTenant.yaml#/UserTenant"
            }
        },
        "totalRecords": {
            "type": "integer"
        }
    },
    "additionalProperties": false,
    "required": [
        "userTenants",
        "totalRecords"
    ]
}
postusertenants(consortiumId, userTenant)

User Tenant Associations

POST /consortia/{consortiumId}/user-tenants

Parameters
  • consortiumId (str) –

  • userTenant (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Resource not found

  • OkapiFatalError – Internal server error

Schema

{
    "description": "A JSON schema for the User Tenant",
    "type": "object",
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid"
        },
        "userId": {
            "type": "string",
            "format": "uuid"
        },
        "username": {
            "type": "string"
        },
        "tenantId": {
            "type": "string"
        },
        "tenantName": {
            "type": "string"
        },
        "isPrimary": {
            "type": "boolean"
        }
    },
    "additionalProperties": false,
    "required": [
        "userId",
        "tenantId"
    ]
}