Interface RolesAPI

interface RolesAPI {
    clearCache: () => void;
    createRole: (
        body: CreateRole,
        options?: ApiCallOptions,
    ) => Promise<CreateRoleHttpResponse>;
    deleteRole: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<DeleteRoleHttpResponse>;
    getRole: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<GetRoleHttpResponse>;
    getRoles: (
        query: {
            filter?: string;
            limit?: number;
            next?: string;
            prev?: string;
            sort?: string;
            totalResults?: boolean;
        },
        options?: ApiCallOptions,
    ) => Promise<GetRolesHttpResponse>;
    patchRole: (
        id: string,
        body: PatchRoles,
        options?: ApiCallOptions,
    ) => Promise<PatchRoleHttpResponse>;
}
Index

Properties

clearCache: () => void

Clears the cache for roles api requests.

Type declaration

    • (): void
    • Clears the cache for roles api requests.

      Returns void

createRole: (
    body: CreateRole,
    options?: ApiCallOptions,
) => Promise<CreateRoleHttpResponse>

Creates a custom role. Role names must be unique, and there is a maximum of 500 custom roles per tenant. Requestor must be assigned the TenantAdmin role.

Type declaration

an object with the body content

CreateRoleHttpError

deleteRole: (
    id: string,
    options?: ApiCallOptions,
) => Promise<DeleteRoleHttpResponse>

Deletes the requested role. Role can only be deleted if it has been unassigned from all users and groups. Only applicable to roles of type custom. Requestor must be assigned the TenantAdmin role.

Type declaration

    • (id: string, options?: ApiCallOptions): Promise<DeleteRoleHttpResponse>
    • Deletes the requested role. Role can only be deleted if it has been unassigned from all users and groups. Only applicable to roles of type custom. Requestor must be assigned the TenantAdmin role.

      Parameters

      • id: string

        The unique identifier for the role.

      • Optionaloptions: ApiCallOptions

      Returns Promise<DeleteRoleHttpResponse>

      DeleteRoleHttpError

The unique identifier for the role.

DeleteRoleHttpError

getRole: (id: string, options?: ApiCallOptions) => Promise<GetRoleHttpResponse>

Returns the requested role.

Type declaration

The unique identifier for the role.

GetRoleHttpError

getRoles: (
    query: {
        filter?: string;
        limit?: number;
        next?: string;
        prev?: string;
        sort?: string;
        totalResults?: boolean;
    },
    options?: ApiCallOptions,
) => Promise<GetRolesHttpResponse>

Returns a list of roles using cursor-based pagination.

Type declaration

    • (
          query: {
              filter?: string;
              limit?: number;
              next?: string;
              prev?: string;
              sort?: string;
              totalResults?: boolean;
          },
          options?: ApiCallOptions,
      ): Promise<GetRolesHttpResponse>
    • Returns a list of roles using cursor-based pagination.

      Parameters

      • query: {
            filter?: string;
            limit?: number;
            next?: string;
            prev?: string;
            sort?: string;
            totalResults?: boolean;
        }

        an object with query parameters

        • Optionalfilter?: string

          The advanced filtering to use for the query. Refer to RFC 7644 for the syntax. All conditional statements within this query parameter are case insensitive.

        • Optionallimit?: number

          The number of roles to retrieve.

        • Optionalnext?: string

          The next page cursor.

        • Optionalprev?: string

          The previous page cursor.

        • Optionalsort?: string

          Optional resource field name to sort on, eg. name. Can be prefixed with +/- to determine order, defaults to (+) ascending.

        • OptionaltotalResults?: boolean

          Determines wether to return a count of the total records matched in the query. Defaults to false.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetRolesHttpResponse>

      GetRolesHttpError

an object with query parameters

GetRolesHttpError

patchRole: (
    id: string,
    body: PatchRoles,
    options?: ApiCallOptions,
) => Promise<PatchRoleHttpResponse>

Updates the requested role. Only applicable to roles of type custom. Requestor must be assigned the TenantAdmin role.

Type declaration

The unique identifier for the role.

an object with the body content

PatchRoleHttpError