diff --git a/src/resources/simulations/operations/create-simulation-request-body.ts b/src/resources/simulations/operations/create-simulation-request-body.ts index 3d74e70..3d8736f 100644 --- a/src/resources/simulations/operations/create-simulation-request-body.ts +++ b/src/resources/simulations/operations/create-simulation-request-body.ts @@ -6,10 +6,11 @@ import type { SimulationScenarioType } from '../../../enums/index.js'; import type { IEventName } from '../../../notifications/index.js'; - -export interface CreateSimulationRequestBody { +import type { DiscriminatedSimulationEventResponse } from '../../../types/index.js'; +interface BaseCreateSimulationRequestBody { notificationSettingId: string; - type: IEventName | SimulationScenarioType; name: string; - payload?: any; + type: IEventName | SimulationScenarioType; } + +export type CreateSimulationRequestBody = DiscriminatedSimulationEventResponse; diff --git a/src/resources/simulations/operations/update-simulation-request-body.ts b/src/resources/simulations/operations/update-simulation-request-body.ts index 6c77b94..c7dae48 100644 --- a/src/resources/simulations/operations/update-simulation-request-body.ts +++ b/src/resources/simulations/operations/update-simulation-request-body.ts @@ -1,16 +1,15 @@ -/** - * ! Autogenerated code ! - * Do not make changes to this file. - * Changes may be overwritten as part of auto-generation. - */ +import type { DiscriminatedSimulationEventResponse } from '../../../types/index.js'; +import type { Status } from '../../../enums/index.js'; -import type { SimulationScenarioType, Status } from '../../../enums/index.js'; -import type { IEventName } from '../../../notifications/index.js'; - -export interface UpdateSimulationRequestBody { +interface BaseUpdateSimulationRequestBody { notificationSettingId?: string; name?: string; status?: Status; - type?: IEventName | SimulationScenarioType; - payload?: any; } + +type RawUpdateSimulationRequestBody = DiscriminatedSimulationEventResponse; + +// Map all properties to be optional +export type UpdateSimulationRequestBody = { + [Key in keyof RawUpdateSimulationRequestBody]?: RawUpdateSimulationRequestBody[Key]; +}; diff --git a/src/types/shared/index.ts b/src/types/shared/index.ts index f797f16..e232edf 100644 --- a/src/types/shared/index.ts +++ b/src/types/shared/index.ts @@ -35,3 +35,4 @@ export * from './custom-data.js'; export * from './import-meta-response.js'; export * from './simulation-event-request.js'; export * from './simulation-event-response.js'; +export * from './simulation-payload.js'; diff --git a/src/types/simulation/simulation-response.ts b/src/types/simulation/simulation-response.ts index 2d2eb31..2b84a4a 100644 --- a/src/types/simulation/simulation-response.ts +++ b/src/types/simulation/simulation-response.ts @@ -1,19 +1,13 @@ -/** - * ! Autogenerated code ! - * Do not make changes to this file. - * Changes may be overwritten as part of auto-generation. - */ +import type { Status } from '../../enums/index.js'; +import type { DiscriminatedSimulationEventResponse } from '../shared/simulation-payload.js'; -import type { SimulationScenarioType, Status } from '../../enums/index.js'; -import type { IEventName } from '../../notifications/index.js'; +export type ISimulationResponse = DiscriminatedSimulationEventResponse; -export interface ISimulationResponse { +interface BaseSimulationResponse { id: string; status: Status; notification_setting_id: string; name: string; - type: IEventName | SimulationScenarioType; - payload?: any; last_run_at?: string | null; created_at: string; updated_at: string;