@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
73 lines (72 loc) • 1.99 kB
JavaScript
import { CountiesAPIV4Api } from '../generated';
export class Counties {
constructor(config) {
const api = new CountiesAPIV4Api(config);
this.list = new CountiesList(api);
this.create = new CountiesCreate(api);
this.update = new CountiesUpdate(api);
this.delete = new CountiesDelete(api);
}
}
export class CountiesList {
constructor(api) {
this.api = api;
}
/**
* one - get /v4/counties/{countyId}
*/
one(countyId, options) {
return this.api.v4CountiesControllerGetCountyV4({ countyId, ...options });
}
/**
* oneWithColumns - get /v4/counties/{countyId}/{columns}
*/
oneWithColumns(countyId, columns, options) {
return this.api.v4CountiesControllerGetCountyColumnsV4({ countyId, columns, ...options });
}
/**
* all - get /v4/counties
*/
all(options) {
return this.api.v4CountiesControllerGetCountiesV4({ ...options });
}
/**
* withView - get /v4/counties/viewId/{viewId}
*/
withView(viewId, options) {
return this.api.v4CountiesControllerGetCountiesInViewV4({ viewId, ...options });
}
}
export class CountiesCreate {
constructor(api) {
this.api = api;
}
/**
* one - post /v4/counties
*/
one(body) {
return this.api.v4CountiesControllerCreateCountyV4({ v4CountiesCreateCountyBodyDto: { name: body } });
}
}
export class CountiesUpdate {
constructor(api) {
this.api = api;
}
/**
* one - patch /v4/counties/{countyId}
*/
one(countyId, body) {
return this.api.v4CountiesControllerUpdateCountyV4({ countyId, v4CountiesUpdateCountyBodyDto: body });
}
}
export class CountiesDelete {
constructor(api) {
this.api = api;
}
/**
* one - delete /v4/counties/{countyId}
*/
one(countyId, options) {
return this.api.v4CountiesControllerDeleteCountyV4({ countyId, ...options });
}
}