@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
73 lines (72 loc) • 2.74 kB
JavaScript
import { SourcePropertyRelationsAPIV4Api } from '../generated';
export class RelationsSourceProperty {
constructor(config) {
const api = new SourcePropertyRelationsAPIV4Api(config);
this.list = new RelationsSourcePropertyList(api);
this.create = new RelationsSourcePropertyCreate(api);
this.update = new RelationsSourcePropertyUpdate(api);
this.delete = new RelationsSourcePropertyDelete(api);
}
}
export class RelationsSourcePropertyList {
constructor(api) {
this.api = api;
}
/**
* one - get /v4/relations-source-property/sources/{sourceId}/properties/{propertyId}
*/
one(sourceId, propertyId, options) {
return this.api.v4SourcePropertyRelationsControllerGetRelationV4({ sourceId, propertyId, ...options });
}
/**
* oneWithColumns - get /v4/relations-source-property/sources/{sourceId}/properties/{propertyId}/{columns}
*/
oneWithColumns(sourceId, propertyId, columns, options) {
return this.api.v4SourcePropertyRelationsControllerGetRelationColumnsV4({ sourceId, propertyId, columns, ...options });
}
/**
* all - get /v4/relations-source-property
*/
all(options) {
return this.api.v4SourcePropertyRelationsControllerGetRelationsV4({ ...options });
}
/**
* withView - get /v4/relations-source-property/viewId/{viewId}
*/
withView(viewId, options) {
return this.api.v4SourcePropertyRelationsControllerGetRelationsInViewV4({ viewId, ...options });
}
}
export class RelationsSourcePropertyCreate {
constructor(api) {
this.api = api;
}
/**
* one - post /v4/relations-source-property/sources/{sourceId}/properties/{propertyId}
*/
one(sourceId, propertyId, body) {
return this.api.v4SourcePropertyRelationsControllerCreateRelationV4({ sourceId, propertyId, v4SourcePropertyRelationsCreateRelationBodyDto: body });
}
}
export class RelationsSourcePropertyUpdate {
constructor(api) {
this.api = api;
}
/**
* one - patch /v4/relations-source-property/sources/{sourceId}/properties/{propertyId}
*/
one(sourceId, propertyId, body) {
return this.api.v4SourcePropertyRelationsControllerUpdateRelationV4({ sourceId, propertyId, v4SourcePropertyRelationsUpdateRelationBodyDto: { relation: body } });
}
}
export class RelationsSourcePropertyDelete {
constructor(api) {
this.api = api;
}
/**
* one - delete /v4/relations-source-property/sources/{sourceId}/properties/{propertyId}
*/
one(sourceId, propertyId, options) {
return this.api.v4SourcePropertyRelationsControllerDeleteRelationV4({ sourceId, propertyId, ...options });
}
}