UNPKG

@simplyhomes/sos-sdk

Version:

TypeScript SDK for Simply Homes SoS API v4

73 lines (72 loc) 1.95 kB
import { ThreadsAPIV4Api } from '../generated'; export class Threads { constructor(config) { const api = new ThreadsAPIV4Api(config); this.list = new ThreadsList(api); this.create = new ThreadsCreate(api); this.update = new ThreadsUpdate(api); this.delete = new ThreadsDelete(api); } } export class ThreadsList { constructor(api) { this.api = api; } /** * one - get /v4/threads/{threadId} */ one(threadId, options) { return this.api.v4ThreadsControllerGetThreadV4({ threadId, ...options }); } /** * oneWithColumns - get /v4/threads/{threadId}/{columns} */ oneWithColumns(threadId, columns, options) { return this.api.v4ThreadsControllerGetThreadColumnsV4({ threadId, columns, ...options }); } /** * all - get /v4/threads */ all(options) { return this.api.v4ThreadsControllerGetThreadsV4({ ...options }); } /** * withView - get /v4/threads/viewId/{viewId} */ withView(viewId, options) { return this.api.v4ThreadsControllerGetThreadsInViewV4({ viewId, ...options }); } } export class ThreadsCreate { constructor(api) { this.api = api; } /** * one - post /v4/threads */ one(body) { return this.api.v4ThreadsControllerCreateThreadV4({ v4ThreadsCreateThreadBodyDto: body }); } } export class ThreadsUpdate { constructor(api) { this.api = api; } /** * one - patch /v4/threads/{threadId} */ one(threadId, body) { return this.api.v4ThreadsControllerUpdateThreadV4({ threadId, v4ThreadsUpdateThreadBodyDto: body }); } } export class ThreadsDelete { constructor(api) { this.api = api; } /** * one - delete /v4/threads/{threadId} */ one(threadId, options) { return this.api.v4ThreadsControllerDeleteThreadV4({ threadId, ...options }); } }