UNPKG

@simplyhomes/sos-client

Version:

Client SDK for SimplyHomes SOS API

37 lines (36 loc) 1.44 kB
import { SDK_Context } from 'sdk/client/client'; import { SDK_Base } from '../../base'; import { SDK_CreateUnit_Body_Dto, SDK_CreateUnit_Response_Dto } from './types'; export declare class SDK_Units_Create extends SDK_Base { private payload; constructor(ctx: SDK_Context, payload?: SDK_CreateUnit_Body_Dto); /** * Sets the property ID for the new unit * @param propertyId - The ID of the property this unit belongs to * @returns The current instance for method chaining */ withPropertyId(propertyId: string): this; /** * Sets the number of bedrooms for the new unit * @param bedrooms - The number of bedrooms in the unit * @returns The current instance for method chaining */ withBedrooms(bedrooms: number): this; /** * Sets the number of bathrooms for the new unit * @param bathrooms - The number of bathrooms in the unit * @returns The current instance for method chaining */ withBathrooms(bathrooms: number): this; /** * Executes the unit creation request * @returns A promise that resolves with the created unit data * @remarks This method will: * 1. Save the current payload state * 2. Reset the payload to default values * 3. Send the POST request to create the unit */ execute(): Promise<SDK_CreateUnit_Response_Dto>; private clonePayload; private resetPayload; }