import AvailabilityTimeSlotResponse from '../api/availability-reponse'; import SObject, { CustomSFSObject } from './s-object'; import { AvailabilityTimeSlot } from '../time-slots/availability-time-slot'; import Service from './service'; import ServiceTimeSlotResponse from '../api/service-availability-response'; /** * A Resource */ export default class Resource extends SObject { name: string; parentId: string | null; parent: Resource | null; children: Resource[]; services: Map; private timeSlots; constructor(parsedResource: SFResource); /** * @internal * Adds availability slot data for this resource to the resource. */ addAvailabilitySlotData(slotData: AvailabilityTimeSlotResponse): void; /** * @internal * Adds service availability slot data for this resource to the resource. */ addServiceData(serviceData: ServiceTimeSlotResponse): void; /** * @internal * Based on the availability data checks if the resource has any open slots */ isClosed(): boolean; /** * Gets the timeslots for this resource. Only available if withAvailableSlotsBetween was called. * @return The timeslots for this resource. */ getTimeSlots(): AvailabilityTimeSlot[]; /** * Gets the available service for this resource. Only available if withAvailableSlotsBetween, and includeServices were called. * @return The available services for this resource. */ getAvailableServices(): Service[]; /** * @param idOrName The id or name of the service * @returns The service or undefined if not found */ getService(idOrName: string): Service | undefined; } interface SFResource extends CustomSFSObject { B25__Api_Visible__c?: boolean | null; B25__Base_Price__c?: number | null; B25__Booker25_Id__c?: string | null; B25__Capacity__c?: number | null; B25__Context__c?: string | null; B25__Default_Price__c?: number | null; B25__Default_Price_Calculation__c?: string | null; B25__Description__c?: string | null; B25__Full_Path__c?: string | null; B25__Image_Url__c?: string | null; B25__Is_Active__c?: boolean | null; B25__IsVirtual__c?: boolean | null; B25__Materialized_Path__c?: string | null; B25__MaxCapacity__c?: number | null; B25__MaxLayoutCapacity__c?: number | null; B25__NumberOfActiveLayouts__c?: number | null; B25__Order__c?: number | null; B25__Parent__c?: string | null; B25__Resource_Type__c?: string | null; B25__Timezone__c?: string | null; } export { SFResource };