@allthings/sdk
Version:
Allthings Node/Javascript SDK
48 lines (47 loc) • 2.21 kB
TypeScript
import { EntityResultList, EnumCountryCode, IAllthingsRestClient } from '../types';
export interface IGroup {
readonly address: Partial<{
readonly city: string | null;
readonly country: EnumCountryCode | null;
readonly houseNumber: string | null;
readonly latitude: number | null;
readonly longitude: number | null;
readonly postalCode: string | null;
readonly street: string | null;
readonly type: string | null;
}>;
readonly billingPeriodEndDate: string;
readonly billingPeriodStartDate: string;
readonly dataSource?: string;
readonly description?: string;
readonly externalId?: string;
readonly id: string;
readonly name: string;
readonly propertyManagerId: string;
readonly propertyOwner: string;
readonly readOnly: boolean;
readonly stats: {
readonly inhabitedUnits: number | null;
readonly invitationCount: number | null;
readonly occupancy: number | null;
readonly tenantCount: number | null;
readonly unitCount: number | null;
};
}
export type PartialGroup = Partial<IGroup>;
export type GroupResult = Promise<IGroup>;
export type GroupResultList = EntityResultList<IGroup>;
export type MethodGroupCreate = (propertyId: string, data: PartialGroup & {
readonly name: string;
readonly propertyManagerId: string;
}) => GroupResult;
export declare function groupCreate(client: IAllthingsRestClient, propertyId: string, data: PartialGroup & {
readonly name: string;
readonly propertyManagerId: string;
}): GroupResult;
export type MethodGroupGetById = (id: string) => GroupResult;
export declare function groupGetById(client: IAllthingsRestClient, groupId: string): GroupResult;
export type MethodGroupUpdateById = (groupId: string, data: PartialGroup) => GroupResult;
export declare function groupUpdateById(client: IAllthingsRestClient, groupId: string, data: PartialGroup): GroupResult;
export type MethodGetGroups = (page?: number, limit?: number, filter?: Record<string, any>) => GroupResultList;
export declare function getGroups(client: IAllthingsRestClient, page?: number, limit?: number, filter?: {}): GroupResultList;