@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
67 lines (66 loc) • 1.77 kB
JavaScript
import { LeasingsAPIV4Api } from '../generated';
export class Leasings {
constructor(config) {
const api = new LeasingsAPIV4Api(config);
this.list = new LeasingsList(api);
this.create = new LeasingsCreate(api);
this.update = new LeasingsUpdate(api);
this.delete = new LeasingsDelete(api);
}
}
export class LeasingsList {
constructor(api) {
this.api = api;
}
/**
* one - get /v4/leasings/{leasingId}
*/
one(leasingId, options) {
return this.api.v4LeasingsControllerGetLeasingV4({ leasingId, ...options });
}
/**
* all - get /v4/leasings
*/
all(options) {
return this.api.v4LeasingsControllerGetLeasingsV4({ ...options });
}
/**
* withView - get /v4/leasings/viewId/{viewId}
*/
withView(viewId, options) {
return this.api.v4LeasingsControllerGetLeasingsInViewV4({ viewId, ...options });
}
}
export class LeasingsCreate {
constructor(api) {
this.api = api;
}
/**
* one - post /v4/leasings
*/
one(body) {
return this.api.v4LeasingsControllerCreateLeasingV4({ v4LeasingsCreateLeasingBodyDto: body });
}
}
export class LeasingsUpdate {
constructor(api) {
this.api = api;
}
/**
* one - patch /v4/leasings/{leasingId}
*/
one(leasingId, body) {
return this.api.v4LeasingsControllerUpdateLeasingV4({ leasingId, v4LeasingsUpdateLeasingBodyDto: { leasing: body } });
}
}
export class LeasingsDelete {
constructor(api) {
this.api = api;
}
/**
* one - delete /v4/leasings/{leasingId}
*/
one(leasingId, options) {
return this.api.v4LeasingsControllerDeleteLeasingV4({ leasingId, ...options });
}
}