-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Simulations): narrow down simulation payload types (#52)
* feat(Simulations): narrow down simulation payload types * refactor(Simulations): rename event map * fix(Simulations): Include scenarios in union * refactor(Simulations): rename DiscriminatedEventResponse
- Loading branch information
1 parent
e3da97f
commit 9c01bb8
Showing
4 changed files
with
20 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 10 additions & 11 deletions
21
src/resources/simulations/operations/update-simulation-request-body.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<BaseUpdateSimulationRequestBody>; | ||
|
||
// Map all properties to be optional | ||
export type UpdateSimulationRequestBody = { | ||
[Key in keyof RawUpdateSimulationRequestBody]?: RawUpdateSimulationRequestBody[Key]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters