@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
61 lines (60 loc) • 1.65 kB
JavaScript
import { MarketsAPIV4Api } from '../generated';
export class Markets {
constructor(config) {
const api = new MarketsAPIV4Api(config);
this.list = new MarketsList(api);
this.update = new MarketsUpdate(api);
this.delete = new MarketsDelete(api);
}
}
export class MarketsList {
constructor(api) {
this.api = api;
}
/**
* one - get /v4/markets/{marketId}
*/
one(marketId, options) {
return this.api.v4MarketsControllerGetMarketV4({ marketId, ...options });
}
/**
* oneWithColumns - get /v4/markets/{marketId}/{columns}
*/
oneWithColumns(marketId, columns, options) {
return this.api.v4MarketsControllerGetMarketColumnsV4({ marketId, columns, ...options });
}
/**
* all - get /v4/markets
*/
all(options) {
return this.api.v4MarketsControllerGetMarketsV4({ ...options });
}
/**
* withView - get /v4/markets/viewId/{viewId}
*/
withView(viewId, options) {
return this.api.v4MarketsControllerGetMarketsInViewV4({ viewId, ...options });
}
}
export class MarketsUpdate {
constructor(api) {
this.api = api;
}
/**
* one - patch /v4/markets/{marketId}
*/
one(marketId, body) {
return this.api.v4MarketsControllerUpdateMarketV4({ marketId, v4MarketsUpdateMarketBodyDto: body });
}
}
export class MarketsDelete {
constructor(api) {
this.api = api;
}
/**
* one - delete /v4/markets/{marketId}
*/
one(marketId, options) {
return this.api.v4MarketsControllerDeleteMarketV4({ marketId, ...options });
}
}