@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
73 lines (72 loc) • 2.39 kB
JavaScript
import { PropertyManagersAPIV4Api } from '../generated';
export class PropertyManagers {
constructor(config) {
const api = new PropertyManagersAPIV4Api(config);
this.list = new PropertyManagersList(api);
this.create = new PropertyManagersCreate(api);
this.update = new PropertyManagersUpdate(api);
this.delete = new PropertyManagersDelete(api);
}
}
export class PropertyManagersList {
constructor(api) {
this.api = api;
}
/**
* one - get /v4/propertyManagers/{propertyManagerId}
*/
one(propertyManagerId, options) {
return this.api.v4PropertyManagersControllerGetPropertyManagerV4({ propertyManagerId, ...options });
}
/**
* oneWithColumns - get /v4/propertyManagers/{propertyManagerId}/{columns}
*/
oneWithColumns(propertyManagerId, columns, options) {
return this.api.v4PropertyManagersControllerGetPropertyManagerColumnsV4({ propertyManagerId, columns, ...options });
}
/**
* all - get /v4/propertyManagers
*/
all(options) {
return this.api.v4PropertyManagersControllerGetPropertyManagersV4({ ...options });
}
/**
* withView - get /v4/propertyManagers/viewId/{viewId}
*/
withView(viewId, options) {
return this.api.v4PropertyManagersControllerGetPropertyManagersInViewV4({ viewId, ...options });
}
}
export class PropertyManagersCreate {
constructor(api) {
this.api = api;
}
/**
* one - post /v4/propertyManagers
*/
one(body) {
return this.api.v4PropertyManagersControllerCreatePropertyManagerV4({ v4PropertyManagersCreatePropertyManagerBodyDto: { name: body } });
}
}
export class PropertyManagersUpdate {
constructor(api) {
this.api = api;
}
/**
* one - patch /v4/propertyManagers/{propertyManagerId}
*/
one(propertyManagerId, body) {
return this.api.v4PropertyManagersControllerUpdatePropertyManagerV4({ propertyManagerId, v4PropertyManagersUpdatePropertyManagerBodyDto: body });
}
}
export class PropertyManagersDelete {
constructor(api) {
this.api = api;
}
/**
* one - delete /v4/propertyManagers/{propertyManagerId}
*/
one(propertyManagerId, options) {
return this.api.v4PropertyManagersControllerDeletePropertyManagerV4({ propertyManagerId, ...options });
}
}