@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
139 lines (138 loc) • 4.43 kB
JavaScript
import { PropertiesAPIV4Api } from '../generated';
export class Properties {
constructor(config) {
const api = new PropertiesAPIV4Api(config);
this.list = new PropertiesList(api);
this.create = new PropertiesCreate(api);
this.update = new PropertiesUpdate(api);
this.delete = new PropertiesDelete(api);
this.misc = new PropertiesMisc(api);
}
}
export class PropertiesList {
constructor(api) {
this.api = api;
}
/**
* uniqueValues - get /v4/properties/unique/{column}
*/
uniqueValues(column, options) {
return this.api.v4PropertiesControllerGetUniqueValuesV4({ column, ...options });
}
/**
* addressAutocomplete - get /v4/properties/address/autocomplete
*/
addressAutocomplete(input, options) {
return this.api.v4PropertiesControllerGetAddressAutocompleteV4({ input, ...options });
}
/**
* one - get /v4/properties/{propertyId}
*/
one(propertyId, options) {
return this.api.v4PropertiesControllerGetPropertyV4({ propertyId, ...options });
}
/**
* oneWithView - get /v4/properties/viewId/{viewId}
*/
oneWithView(viewId, options) {
return this.api.v4PropertiesControllerGetPropertiesInViewV4({ viewId, ...options });
}
/**
* oneWithColumns - get /v4/properties/{propertyId}/{columns}
*/
oneWithColumns(propertyId, columns, options) {
return this.api.v4PropertiesControllerGetPropertyColumnsV4({ propertyId, columns, ...options });
}
/**
* all - get /v4/properties
*/
all(options) {
return this.api.v4PropertiesControllerGetPropertiesV4({ ...options });
}
/**
* withView - get /v4/properties/viewId/{viewId}
*/
withView(viewId, options) {
return this.api.v4PropertiesControllerGetPropertiesInViewV4({ viewId, ...options });
}
/**
* withFilters - get /v4/properties/filteredBy/{column}/{value}
*/
withFilters(column, value, options) {
return this.api.v4PropertiesControllerGetPropertiesFilteredByV4({ column, value, ...options });
}
}
export class PropertiesCreate {
constructor(api) {
this.api = api;
}
/**
* one - post /v4/properties
*/
one(body) {
return this.api.v4PropertiesControllerCreatePropertyV4({ v4PropertiesCreatePropertyBodyDto: body });
}
}
export class PropertiesUpdate {
constructor(api) {
this.api = api;
}
/**
* one - patch /v4/properties/{propertyId}
*/
one(propertyId, body) {
return this.api.v4PropertiesControllerUpdatePropertyV4({ propertyId, v4PropertiesUpdatePropertyBodyDto: { property: body } });
}
}
export class PropertiesDelete {
constructor(api) {
this.api = api;
}
/**
* one - delete /v4/properties/{propertyId}
*/
one(propertyId, options) {
return this.api.v4PropertiesControllerDeletePropertyV4({ propertyId, ...options });
}
}
export class PropertiesMisc {
constructor(api) {
this.api = api;
}
/**
* refreshRentometer - post /v4/properties/{propertyId}/refresh-rentometer
*/
refreshRentometer(propertyId, body) {
return this.api.v4PropertiesControllerRefreshRentometerV4({ propertyId, ...body });
}
/**
* refreshTractTier - post /v4/properties/{propertyId}/refresh-tract-tier
*/
refreshTractTier(propertyId, body) {
return this.api.v4PropertiesControllerRefreshTractTierV4({ propertyId, ...body });
}
/**
* checkExisting - get /v4/properties/check-existing
*/
checkExisting(address, options) {
return this.api.v4PropertiesControllerCheckExistingV4({ address, ...options });
}
/**
* checkAirtable - get /v4/properties/{propertyId}/check-airtable
*/
checkAirtable(propertyId, options) {
return this.api.v4PropertiesControllerCheckAirtableV4({ propertyId, ...options });
}
/**
* addToAirtable - post /v4/properties/{propertyId}/add-to-airtable
*/
addToAirtable(propertyId, body) {
return this.api.v4PropertiesControllerAddToAirtableV4({ propertyId, ...body });
}
/**
* createOnePager - post /v4/properties/{propertyId}/create-one-pager
*/
createOnePager(propertyId, body) {
return this.api.v4PropertiesControllerCreateOnePagerV4({ propertyId, ...body });
}
}