UNPKG

@simplyhomes/sos-client

Version:

Client SDK for SimplyHomes SOS API

72 lines (71 loc) 3.06 kB
import { SDK_Base } from '../../base'; import { SDK_Context } from 'sdk/client/client'; import { SDK_Execution } from 'sdk/interfaces/sdk-execution'; import { SDK_CreateProperty_Body_Contact, SDK_CreateProperty_Body_Dto, SDK_CreateProperty_Body_Dto_Property_Unit, SDK_CreateProperty_Response_Dto } from './types'; export declare class SDK_Properties_Create extends SDK_Base implements SDK_Execution { private payload; constructor(context: SDK_Context, payload?: SDK_CreateProperty_Body_Dto); /** * Sets the property units for the property being created * @param units Array of unit objects for the property * @returns Current instance for method chaining */ withUnits(units: SDK_CreateProperty_Body_Dto_Property_Unit[]): this; /** * Sets the source contacts for the property creation * @param contacts Array of contact objects related to the source * @returns Current instance for method chaining */ withSourceContacts(contacts: SDK_CreateProperty_Body_Contact[]): this; /** * Sets the source contact IDs for the property creation * @param contactIds Array of contact IDs related to the source * @returns Current instance for method chaining */ withSourceContactIds(contactIds: number[]): this; /** * Sets the property-level contacts for the property * @param contacts Array of contact objects related to the property * @returns Current instance for method chaining */ withPropertyContacts(contacts: SDK_CreateProperty_Body_Contact[]): this; /** * Sets the property-level contact IDs for the property * @param contactIds Array of contact IDs related to the property * @returns Current instance for method chaining */ withPropertyContactIds(contactIds: number[]): this; /** * Sets the address for the property * @param address Address string of the property * @returns Current instance for method chaining */ withAddress(address: string): this; /** * Sets the price for the property * @param price Numeric price of the property * @returns Current instance for method chaining */ withPrice(price: number): this; /** * Sets the type for the property (e.g., ['HomeSmart/OneHome.com', 'Wholesaler', DTS', 'MLS', 'Airtable', 'Generic']). * @param type Type string of the property * @returns Current instance for method chaining * @default 'Generic' */ withType(type: string): this; /** * Applies a bulk update to the payload with arbitrary data * @param data Partial property payload to merge into current state * @returns Current instance for method chaining */ withData(data: Partial<SDK_CreateProperty_Body_Dto>): this; /** * Executes the create property request to the API * @returns API response with newly created property id */ execute(): Promise<SDK_CreateProperty_Response_Dto>; private updatePropertyPayload; private clonePayload; private resetPayload; }