@c8y/client
Version:
Client application programming interface to access the Cumulocity IoT-Platform REST services.
105 lines • 2.88 kB
TypeScript
import { IIdentified, Service, IResult, IResultList } from '../core';
export declare class InventoryRoleService extends Service<IIdentified> {
protected baseUrl: string;
protected listUrl: string;
protected propertyName: string;
/**
* Gets the details of inventory role.
*
* @param {string|number|IIdentified} entityOrId Entity or Id of the entity.
*
* @returns Response wrapped in [[IResult]]
*
* **Example**
* ```typescript
*
* const inventoryRoleId: number = 1;
*
* (async () => {
* const {data, res} = await inventoryRoleService.detail(inventoryRoleId);
* })();
* ```
*/
detail(entityOrId: string | number | IIdentified): Promise<IResult<IIdentified>>;
/**
* Creates a new inventory role.
*
* @param {IIdentified} entity
*
* @returns Response wrapped in [[IResult]]
*
* **Example**
* ```typescript
*
* const newRole: IIdentified = {
* name: 'Custom role'
* };
*
* (async () => {
* const {data, res} = await inventoryRoleService.create(newRole);
* })();
* ```
*/
create(entity: IIdentified): Promise<IResult<IIdentified>>;
/**
* Updates inventory role data.
*
* @param {IIdentified} entity
*
* @returns Response wrapped in [[IResult]]
*
* **Example**
* ```typescript
*
* const updateObject: IIdentified = {
* id: 1,
* name: 'changed role'
* };
*
* (async () => {
* const {data, res} = await inventoryRoleService.update(updateObject);
* })();
* ```
*/
update(entity: IIdentified): Promise<IResult<IIdentified>>;
/**
* Gets the list of inventory roles filtered by parameters.
*
* @returns Response wrapped in [[IResultList]]
*
* @param {object} filter Object containing filters for querying alarms.
*
* **Example**
* ```typescript
*
* const filter: object = {
* pageSize: 100,
* withTotalPages: true
* };
*
* (async () => {
* const {data, res, paging} = await inventoryRoleService.list(filter);
* })();
* ```
*/
list(filter?: object): Promise<IResultList<IIdentified>>;
/**
* Removes an inventory role with given id.
*
* @returns Response wrapped in [[IResult]]
*
* @param {IExternalIdentity} identity Identity object with mandantory fragments.
*
* **Example**
* ```typescript
*
* const id: number = 1;
*
* (async () => {
* const {data, res} = await identityService.delete(id);
* })();
* ```
*/
delete(entityOrId: string | number | IIdentified): Promise<IResult<null>>;
}
//# sourceMappingURL=InventoryRoleService.d.ts.map