UNPKG

@simplyhomes/sos-sdk

Version:

TypeScript SDK for Simply Homes SoS API v4

73 lines (72 loc) 2.23 kB
import { RentalListingsAPIV4Api } from '../generated'; export class RentalListings { constructor(config) { const api = new RentalListingsAPIV4Api(config); this.list = new RentalListingsList(api); this.create = new RentalListingsCreate(api); this.update = new RentalListingsUpdate(api); this.delete = new RentalListingsDelete(api); } } export class RentalListingsList { constructor(api) { this.api = api; } /** * uniqueValues - get /v4/rental-listings/unique/{column} */ uniqueValues(column, options) { return this.api.v4RentalListingsControllerGetUniqueValuesV4({ column, ...options }); } /** * one - get /v4/rental-listings/{rentalListingId} */ one(rentalListingId, options) { return this.api.v4RentalListingsControllerGetRentalListingV4({ rentalListingId, ...options }); } /** * all - get /v4/rental-listings */ all(options) { return this.api.v4RentalListingsControllerGetRentalListingsV4({ ...options }); } /** * withView - get /v4/rental-listings/viewId/{viewId} */ withView(viewId, options) { return this.api.v4RentalListingsControllerGetRentalListingsInViewV4({ viewId, ...options }); } } export class RentalListingsCreate { constructor(api) { this.api = api; } /** * one - post /v4/rental-listings */ one(body) { return this.api.v4RentalListingsControllerCreateRentalListingV4({ v4RentalListingsCreateRentalListingBodyDto: body }); } } export class RentalListingsUpdate { constructor(api) { this.api = api; } /** * one - patch /v4/rental-listings/{rentalListingId} */ one(rentalListingId, body) { return this.api.v4RentalListingsControllerUpdateRentalListingV4({ rentalListingId, v4RentalListingsUpdateRentalListingBodyDto: body }); } } export class RentalListingsDelete { constructor(api) { this.api = api; } /** * one - delete /v4/rental-listings/{rentalListingId} */ one(rentalListingId, options) { return this.api.v4RentalListingsControllerDeleteRentalListingV4({ rentalListingId, ...options }); } }