UNPKG

@c8y/client

Version:

Client application programming interface to access the Cumulocity IoT-Platform REST services.

52 lines 1.59 kB
import { Service } from '../core/index.js'; import { IRole } from './IRole.js'; /** * @description * This service allows for fetch user roles. */ export declare class UserRoleService extends Service<IRole> { protected baseUrl: string; protected listUrl: string; protected propertyName: string; /** * Gets the details of given role. * * @param {string|number|IRole} entityOrId Roles's id or role object. * * @returns Returns promise object that is resolved with the IRole wrapped by IResult. * * **Example** * ```typescript * * const roleId: number = 1; * * (async () => { * const {data, res} = await userRoleService.detail(roleId); * })(); * ``` */ detail(entityOrId: string | number | IRole): Promise<import("../core/IResult.js").IResult<IRole>>; /** * Gets the list of user roles filtered by parameters. * * @param {object} filter Object containing filters for querying roles. * * @returns Returns promise object that is resolved with the IRole wrapped by IResultList. * * **Example** * ```typescript * * const filter: object = { * severity: Severity.MAJOR, * pageSize: 100, * withTotalPages: true * }; * * (async () => { * const {data, res, paging} = await userRoleService.list(filter); * })(); * ``` */ list(filter?: object): Promise<import("../core/IResultList.js").IResultList<IRole>>; } //# sourceMappingURL=UserRoleService.d.ts.map