UNPKG

@c8y/client

Version:

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

101 lines 3.64 kB
import { IFetchClient, IIdentified, Service } from '../core/index.js'; import { IUserInventoryRole } from './IUserInventoryRole.js'; /** * @description * This service allows for managing current user's inventory roles. */ export declare class UserInventoryRoleService extends Service<IUserInventoryRole> { protected baseUrl: any; protected listUrl: string; protected currenUserUrl: string; protected propertyName: string; constructor(userUrl: string, client: IFetchClient); /** * Get a representation of a concrete current user's inventory role. * * @param {string|number|IUserInventoryRole} entityOrId inventory role id or inventory role object. * * @returns Returns promise object that is resolved with the IUserInventoryRole wrapped by IResult. * * **Example** * ```typescript * * const inventoryRoleId: number = 1; * * (async () => { * const {data, res} = await userInventoryRoleService.detail(inventoryRoleId); * })(); * ``` * * Required role: ROLE_TENANT_MANAGEMENT_READ<br><br> * User password is never returned in GET response. Authentication mechanism is provided by another interface. */ detail(entityOrId: string | number | IUserInventoryRole): Promise<import("../core/IResult.js").IResult<IUserInventoryRole>>; /** * Assign inventory role to current user. * * @param {IUserInventoryRole} entity Inventory Role object. * * @returns Returns promise object that is resolved with the details of newly assigned inventory role. * * **Example** * ```typescript * * const inventoryRoleObject: IUserInventoryRole = { * ... * }; * * (async () => { * const {data, res} = await userInventoryRoleService.create(inventoryRoleObject); * })(); * ``` */ create(entity: IUserInventoryRole): Promise<import("../core/IResult.js").IResult<IUserInventoryRole>>; /** * Updates an inventory role. * * @param {Partial<IUserInventoryRole>} entity Inventory Role object. */ update(entity: Partial<IUserInventoryRole>): Promise<import("../core/IResult.js").IResult<IUserInventoryRole>>; /** * Gets the list the inventory roles applied to a current user. * * @param {object} filter Object containing filters for querying inventory roles. * * @returns Returns promise object that is resolved with the IUserInventoryRole wrapped by IResultList. * * **Example** * ```typescript * * const filter: object = { * severity: Severity.MAJOR, * pageSize: 100, * withTotalPages: true * }; * * (async () => { * const {data, res, paging} = await userInventoryRoleService.list(filter); * })(); * ``` */ list(filter?: object): Promise<import("../core/IResultList.js").IResultList<IUserInventoryRole>>; /** * Unassign inventory role from current user * * @param {string|number|IIdentified} entityOrId Inventory Role id or Inventory Role object. * * @returns Returns promise object that is resolved with the IResult. * * **Example** * ```typescript * * const inventoryRoleId: number = 1; * * (async () => { * const {data, res} = await userInventoryRoleService.delete(inventoryRoleId); * })(); * ``` */ delete(entityOrId: string | number | IIdentified): Promise<import("../core/IResult.js").IResult<null>>; } //# sourceMappingURL=UserInventoryRoleService.d.ts.map