/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 774afc194e0f */ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; import { collectExtraKeys as collectExtraKeys$, safeParse, } from "../lib/schemas.js"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { DeploymentCredentialRotationEvent, DeploymentCredentialRotationEvent$inboundSchema, } from "./deploymentcredentialrotationevent.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type EventDataDeploymentDeletionRequested = { /** * ID of the deployment */ deploymentId: string; type: "DeploymentDeletionRequested"; }; /** * Type of authenticated principal that requested an event. */ export const EventKind4 = { User: "user", ServiceAccount: "serviceAccount", } as const; /** * Type of authenticated principal that requested an event. */ export type EventKind4 = ClosedEnum; /** * Authenticated principal that requested a deployment intent event. */ export type EventActor4 = { /** * User email when the principal is a user. */ email?: string | null | undefined; /** * Stable user or service-account identifier. */ id: string; /** * Type of authenticated principal that requested an event. */ kind: EventKind4; }; export type EventActorUnion4 = EventActor4 | any; export type EventDataDeploymentEnvironmentUpdated = { actor?: EventActor4 | any | null | undefined; /** * Names of the environment variables that changed (added, removed, or modified) */ changedKeys: Array; /** * ID of the deployment */ deploymentId: string; type: "DeploymentEnvironmentUpdated"; }; export type EventDataDeploymentReleaseUnpinned = { /** * ID of the deployment */ deploymentId: string; /** * ID of the release that was previously pinned */ previousPinnedReleaseId: string; type: "DeploymentReleaseUnpinned"; }; export type EventDataDeploymentReleasePinned = { /** * ID of the deployment */ deploymentId: string; /** * ID of the release that is now pinned */ pinnedReleaseId: string; /** * ID of the previously pinned release, if any */ previousPinnedReleaseId?: string | null | undefined; type: "DeploymentReleasePinned"; }; export type EventDataDeploymentRedeployRequested = { /** * ID of the deployment */ deploymentId: string; /** * ID of the release being redeployed */ releaseId: string; type: "DeploymentRedeployRequested"; }; /** * Type of authenticated principal that requested an event. */ export const EventKind3 = { User: "user", ServiceAccount: "serviceAccount", } as const; /** * Type of authenticated principal that requested an event. */ export type EventKind3 = ClosedEnum; /** * Authenticated principal that requested a deployment intent event. */ export type EventActor3 = { /** * User email when the principal is a user. */ email?: string | null | undefined; /** * Stable user or service-account identifier. */ id: string; /** * Type of authenticated principal that requested an event. */ kind: EventKind3; }; export type EventActorUnion3 = EventActor3 | any; /** * Canonical error container that provides a structured way to represent errors * * @remarks * with rich metadata including error codes, human-readable messages, context, * and chaining capabilities for error propagation. * * This struct is designed to be both machine-readable and user-friendly, * supporting serialization for API responses and detailed error reporting * in distributed systems. */ export type EventPreviousError = { /** * A unique identifier for the type of error. * * @remarks * * This should be a short, machine-readable string that can be used * by clients to programmatically handle different error types. * Examples: "NOT_FOUND", "VALIDATION_ERROR", "TIMEOUT" */ code: string; /** * Additional diagnostic information about the error context. * * @remarks * * This optional field can contain structured data providing more details * about the error, such as validation errors, request parameters that * caused the issue, or other relevant context information. */ context?: any | null | undefined; /** * Optional human-facing remediation hint. */ hint?: string | null | undefined; /** * HTTP status code for this error. * * @remarks * * Used when converting the error to an HTTP response. If None, falls back to * the error type's default status code or 500. */ httpStatusCode?: number | null | undefined; /** * Indicates if this is an internal error that should not be exposed to users. * * @remarks * * When `true`, this error contains sensitive information or implementation * details that should not be shown to end-users. Such errors should be * logged for debugging but replaced with generic error messages in responses. */ internal: boolean; /** * Human-readable error message. * * @remarks * * This message should be clear and actionable for developers or end-users, * providing context about what went wrong and potentially how to fix it. */ message: string; /** * Indicates whether the operation that caused the error should be retried. * * @remarks * * When `true`, the error is transient and the operation might succeed * if attempted again. When `false`, retrying the same operation is * unlikely to succeed without changes. */ retryable: boolean; /** * The underlying error that caused this error, creating an error chain. * * @remarks * * This allows for proper error propagation and debugging by maintaining * the full context of how an error occurred through multiple layers * of an application. */ source?: any | null | undefined; }; export type EventPreviousErrorUnion = EventPreviousError | any; export type EventDataDeploymentRetryRequested = { actor?: EventActor3 | any | null | undefined; /** * ID of the release that the failed attempt was targeting, if known */ attemptedReleaseId?: string | null | undefined; /** * ID of the deployment */ deploymentId: string; previousError?: EventPreviousError | any | null | undefined; type: "DeploymentRetryRequested"; }; /** * Type of authenticated principal that requested an event. */ export const EventKind2 = { User: "user", ServiceAccount: "serviceAccount", } as const; /** * Type of authenticated principal that requested an event. */ export type EventKind2 = ClosedEnum; /** * Authenticated principal that requested a deployment intent event. */ export type EventActor2 = { /** * User email when the principal is a user. */ email?: string | null | undefined; /** * Stable user or service-account identifier. */ id: string; /** * Type of authenticated principal that requested an event. */ kind: EventKind2; }; export type EventActorUnion2 = EventActor2 | any; export type EventDataDeploymentReleaseChannelChanged = { actor?: EventActor2 | any | null | undefined; /** * Newly followed channel */ channel: string; /** * ID of the deployment */ deploymentId: string; /** * Previously followed channel */ previousChannel: string; type: "DeploymentReleaseChannelChanged"; }; /** * Type of authenticated principal that requested an event. */ export const EventKind1 = { User: "user", ServiceAccount: "serviceAccount", } as const; /** * Type of authenticated principal that requested an event. */ export type EventKind1 = ClosedEnum; /** * Authenticated principal that requested a deployment intent event. */ export type EventActor1 = { /** * User email when the principal is a user. */ email?: string | null | undefined; /** * Stable user or service-account identifier. */ id: string; /** * Type of authenticated principal that requested an event. */ kind: EventKind1; }; export type EventActorUnion1 = EventActor1 | any; export type EventDataReleaseChannelUpdated = { actor?: EventActor1 | any | null | undefined; /** * Name of the channel that moved */ channel: string; /** * ID of the release that was previously current, if any */ previousReleaseId?: string | null | undefined; /** * ID of the release that is now current */ releaseId: string; type: "ReleaseChannelUpdated"; }; export type EventDataDeploymentDeleted = { /** * ID of the deployment that was deleted */ deploymentId: string; type: "DeploymentDeleted"; }; export type EventDataDeploymentRecovered = { /** * ID of the deployment */ deploymentId: string; /** * ID of the release that is now live */ releaseId: string; type: "DeploymentRecovered"; }; /** * Canonical error container that provides a structured way to represent errors * * @remarks * with rich metadata including error codes, human-readable messages, context, * and chaining capabilities for error propagation. * * This struct is designed to be both machine-readable and user-friendly, * supporting serialization for API responses and detailed error reporting * in distributed systems. */ export type EventDataError2 = { /** * A unique identifier for the type of error. * * @remarks * * This should be a short, machine-readable string that can be used * by clients to programmatically handle different error types. * Examples: "NOT_FOUND", "VALIDATION_ERROR", "TIMEOUT" */ code: string; /** * Additional diagnostic information about the error context. * * @remarks * * This optional field can contain structured data providing more details * about the error, such as validation errors, request parameters that * caused the issue, or other relevant context information. */ context?: any | null | undefined; /** * Optional human-facing remediation hint. */ hint?: string | null | undefined; /** * HTTP status code for this error. * * @remarks * * Used when converting the error to an HTTP response. If None, falls back to * the error type's default status code or 500. */ httpStatusCode?: number | null | undefined; /** * Indicates if this is an internal error that should not be exposed to users. * * @remarks * * When `true`, this error contains sensitive information or implementation * details that should not be shown to end-users. Such errors should be * logged for debugging but replaced with generic error messages in responses. */ internal: boolean; /** * Human-readable error message. * * @remarks * * This message should be clear and actionable for developers or end-users, * providing context about what went wrong and potentially how to fix it. */ message: string; /** * Indicates whether the operation that caused the error should be retried. * * @remarks * * When `true`, the error is transient and the operation might succeed * if attempted again. When `false`, retrying the same operation is * unlikely to succeed without changes. */ retryable: boolean; /** * The underlying error that caused this error, creating an error chain. * * @remarks * * This allows for proper error propagation and debugging by maintaining * the full context of how an error occurred through multiple layers * of an application. */ source?: any | null | undefined; }; export type EventDataDeploymentDegraded = { /** * ID of the deployment */ deploymentId: string; /** * Canonical error container that provides a structured way to represent errors * * @remarks * with rich metadata including error codes, human-readable messages, context, * and chaining capabilities for error propagation. * * This struct is designed to be both machine-readable and user-friendly, * supporting serialization for API responses and detailed error reporting * in distributed systems. */ error: EventDataError2; type: "DeploymentDegraded"; }; /** * Canonical error container that provides a structured way to represent errors * * @remarks * with rich metadata including error codes, human-readable messages, context, * and chaining capabilities for error propagation. * * This struct is designed to be both machine-readable and user-friendly, * supporting serialization for API responses and detailed error reporting * in distributed systems. */ export type EventDataError1 = { /** * A unique identifier for the type of error. * * @remarks * * This should be a short, machine-readable string that can be used * by clients to programmatically handle different error types. * Examples: "NOT_FOUND", "VALIDATION_ERROR", "TIMEOUT" */ code: string; /** * Additional diagnostic information about the error context. * * @remarks * * This optional field can contain structured data providing more details * about the error, such as validation errors, request parameters that * caused the issue, or other relevant context information. */ context?: any | null | undefined; /** * Optional human-facing remediation hint. */ hint?: string | null | undefined; /** * HTTP status code for this error. * * @remarks * * Used when converting the error to an HTTP response. If None, falls back to * the error type's default status code or 500. */ httpStatusCode?: number | null | undefined; /** * Indicates if this is an internal error that should not be exposed to users. * * @remarks * * When `true`, this error contains sensitive information or implementation * details that should not be shown to end-users. Such errors should be * logged for debugging but replaced with generic error messages in responses. */ internal: boolean; /** * Human-readable error message. * * @remarks * * This message should be clear and actionable for developers or end-users, * providing context about what went wrong and potentially how to fix it. */ message: string; /** * Indicates whether the operation that caused the error should be retried. * * @remarks * * When `true`, the error is transient and the operation might succeed * if attempted again. When `false`, retrying the same operation is * unlikely to succeed without changes. */ retryable: boolean; /** * The underlying error that caused this error, creating an error chain. * * @remarks * * This allows for proper error propagation and debugging by maintaining * the full context of how an error occurred through multiple layers * of an application. */ source?: any | null | undefined; }; /** * Phase of a deployment at which a failure occurred. * * @remarks * * Derived from the source deployment status: `preflights-failed` → * `Preflights`, `provisioning-failed` → `Provisioning`, `update-failed` → * `Updating`, `delete-failed` → `Deleting`. * `refresh-failed` is modelled separately via `DeploymentDegraded`. */ export const EventPhase = { Preflights: "preflights", Provisioning: "provisioning", Updating: "updating", Deleting: "deleting", } as const; /** * Phase of a deployment at which a failure occurred. * * @remarks * * Derived from the source deployment status: `preflights-failed` → * `Preflights`, `provisioning-failed` → `Provisioning`, `update-failed` → * `Updating`, `delete-failed` → `Deleting`. * `refresh-failed` is modelled separately via `DeploymentDegraded`. */ export type EventPhase = ClosedEnum; export type EventDataDeploymentFailed = { /** * ID of the release the platform was trying to deploy, if known */ attemptedReleaseId?: string | null | undefined; /** * ID of the deployment */ deploymentId: string; /** * Canonical error container that provides a structured way to represent errors * * @remarks * with rich metadata including error codes, human-readable messages, context, * and chaining capabilities for error propagation. * * This struct is designed to be both machine-readable and user-friendly, * supporting serialization for API responses and detailed error reporting * in distributed systems. */ error: EventDataError1; /** * Phase of a deployment at which a failure occurred. * * @remarks * * Derived from the source deployment status: `preflights-failed` → * `Preflights`, `provisioning-failed` → `Provisioning`, `update-failed` → * `Updating`, `delete-failed` → `Deleting`. * `refresh-failed` is modelled separately via `DeploymentDegraded`. */ phase: EventPhase; type: "DeploymentFailed"; }; export type EventDataDeploymentReleased = { /** * ID of the deployment */ deploymentId: string; /** * ID of the release that was previously live, if any */ previousReleaseId?: string | null | undefined; /** * ID of the release that is now live */ releaseId: string; type: "DeploymentReleased"; }; export type EventDataDeploymentCreated = { /** * ID of the deployment group this slot belongs to */ deploymentGroupId: string; /** * ID of the deployment that was created */ deploymentId: string; /** * Initial release the slot was created with, if any */ releaseId?: string | null | undefined; type: "DeploymentCreated"; }; export type EventDataEmptyingBuckets = { /** * Names of the S3 buckets being emptied */ bucketNames: Array; type: "EmptyingBuckets"; }; export type EventDataDeletingCloudFormationStack = { /** * Name of the CloudFormation stack */ cfnStackName: string; /** * Current stack status */ currentStatus: string; type: "DeletingCloudFormationStack"; }; export type EventDataImportingStackStateFromCloudFormation = { /** * Name of the CloudFormation stack */ cfnStackName: string; type: "ImportingStackStateFromCloudFormation"; }; export type EventDataAssumingRole = { /** * ARN of the role to assume */ roleArn: string; type: "AssumingRole"; }; export type EventDataDeployingCloudFormationStack = { /** * Name of the CloudFormation stack */ cfnStackName: string; /** * Current stack status */ currentStatus: string; type: "DeployingCloudFormationStack"; }; export type EventDataEnsuringDockerRepository = { /** * Name of the docker repository */ repositoryName: string; type: "EnsuringDockerRepository"; }; export type EventDataSettingUpPlatformContext = { /** * Name of the platform (e.g., "AWS", "GCP") */ platformName: string; type: "SettingUpPlatformContext"; }; export type EventDataCleaningUpEnvironment = { /** * Name of the stack being cleaned up */ stackName: string; /** * Name of the deployment strategy being used for cleanup */ strategyName: string; type: "CleaningUpEnvironment"; }; export type EventDataCleaningUpStack = { /** * Name of the stack being cleaned up */ stackName: string; /** * Name of the deployment strategy being used for cleanup */ strategyName: string; type: "CleaningUpStack"; }; export type EventDataRunningTestWorker = { /** * Name of the stack being tested */ stackName: string; type: "RunningTestWorker"; }; export type EventDataDeployingStack = { /** * Name of the stack being deployed */ stackName: string; type: "DeployingStack"; }; export type EventDataPreparingEnvironment = { /** * Name of the deployment strategy being used */ strategyName: string; type: "PreparingEnvironment"; }; export type EventDataDebuggingAgent = { /** * ID of the agent being debugged */ agentId: string; /** * ID of the debug session */ debugSessionId: string; type: "DebuggingAgent"; }; export type EventDataDeletingAgent = { /** * ID of the agent being deleted */ agentId: string; /** * ID of the release that was running on the agent */ releaseId: string; type: "DeletingAgent"; }; export type EventDataUpdatingAgent = { /** * ID of the agent being updated */ agentId: string; /** * ID of the new release being deployed to the agent */ releaseId: string; type: "UpdatingAgent"; }; export type EventDataProvisioningAgent = { /** * ID of the agent being provisioned */ agentId: string; /** * ID of the release being deployed to the agent */ releaseId: string; type: "ProvisioningAgent"; }; export type EventDataGeneratingTemplate = { /** * Platform for which the template is being generated */ platform: string; type: "GeneratingTemplate"; }; export type EventDataGeneratingCloudFormationTemplate = { type: "GeneratingCloudFormationTemplate"; }; /** * Represents the target cloud platform. */ export const EventPlatform = { Aws: "aws", Gcp: "gcp", Azure: "azure", Kubernetes: "kubernetes", Machines: "machines", Local: "local", Test: "test", } as const; /** * Represents the target cloud platform. */ export type EventPlatform = ClosedEnum; /** * Resource that can hold any resource type in the Alien system. All resources share common 'type' and 'id' fields with additional type-specific properties. */ export type EventConfig = { /** * The unique identifier for this specific resource instance. Must contain only alphanumeric characters, hyphens, and underscores ([A-Za-z0-9-_]). Maximum 64 characters. */ id: string; /** * Resource type identifier that determines the specific kind of resource. This field is used for polymorphic deserialization and resource-specific behavior. */ type: string; additionalProperties?: { [k: string]: any | null } | undefined; }; /** * Represents the target cloud platform. */ export const EventControllerPlatformEnum = { Aws: "aws", Gcp: "gcp", Azure: "azure", Kubernetes: "kubernetes", Machines: "machines", Local: "local", Test: "test", } as const; /** * Represents the target cloud platform. */ export type EventControllerPlatformEnum = ClosedEnum< typeof EventControllerPlatformEnum >; export type EventControllerPlatformUnion = EventControllerPlatformEnum | any; /** * Reference to a resource by its stable id and resource type. */ export type EventDependency = { id: string; /** * Resource type identifier that determines the specific kind of resource. This field is used for polymorphic deserialization and resource-specific behavior. */ type: string; }; /** * Canonical error container that provides a structured way to represent errors * * @remarks * with rich metadata including error codes, human-readable messages, context, * and chaining capabilities for error propagation. * * This struct is designed to be both machine-readable and user-friendly, * supporting serialization for API responses and detailed error reporting * in distributed systems. */ export type EventErrorNextState = { /** * A unique identifier for the type of error. * * @remarks * * This should be a short, machine-readable string that can be used * by clients to programmatically handle different error types. * Examples: "NOT_FOUND", "VALIDATION_ERROR", "TIMEOUT" */ code: string; /** * Additional diagnostic information about the error context. * * @remarks * * This optional field can contain structured data providing more details * about the error, such as validation errors, request parameters that * caused the issue, or other relevant context information. */ context?: any | null | undefined; /** * Optional human-facing remediation hint. */ hint?: string | null | undefined; /** * HTTP status code for this error. * * @remarks * * Used when converting the error to an HTTP response. If None, falls back to * the error type's default status code or 500. */ httpStatusCode?: number | null | undefined; /** * Indicates if this is an internal error that should not be exposed to users. * * @remarks * * When `true`, this error contains sensitive information or implementation * details that should not be shown to end-users. Such errors should be * logged for debugging but replaced with generic error messages in responses. */ internal: boolean; /** * Human-readable error message. * * @remarks * * This message should be clear and actionable for developers or end-users, * providing context about what went wrong and potentially how to fix it. */ message: string; /** * Indicates whether the operation that caused the error should be retried. * * @remarks * * When `true`, the error is transient and the operation might succeed * if attempted again. When `false`, retrying the same operation is * unlikely to succeed without changes. */ retryable: boolean; /** * The underlying error that caused this error, creating an error chain. * * @remarks * * This allows for proper error propagation and debugging by maintaining * the full context of how an error occurred through multiple layers * of an application. */ source?: any | null | undefined; }; export type EventNextStateErrorUnion = EventErrorNextState | any; /** * Describes the lifecycle of a resource within a stack, determining how it's managed and deployed. */ export const EventLifecycleEnum = { Frozen: "frozen", Live: "live", } as const; /** * Describes the lifecycle of a resource within a stack, determining how it's managed and deployed. */ export type EventLifecycleEnum = ClosedEnum; export type EventLifecycleUnion = EventLifecycleEnum | any; /** * Resource outputs that can hold output data for any resource type in the Alien system. All resource outputs share a common 'type' field with additional type-specific output properties. */ export type EventOutputs = { /** * Resource type identifier that determines the specific kind of resource. This field is used for polymorphic deserialization and resource-specific behavior. */ type: string; additionalProperties?: { [k: string]: any | null } | undefined; }; export type EventOutputsUnion = EventOutputs | any; /** * Resource that can hold any resource type in the Alien system. All resources share common 'type' and 'id' fields with additional type-specific properties. */ export type EventPreviousConfig = { /** * The unique identifier for this specific resource instance. Must contain only alphanumeric characters, hyphens, and underscores ([A-Za-z0-9-_]). Maximum 64 characters. */ id: string; /** * Resource type identifier that determines the specific kind of resource. This field is used for polymorphic deserialization and resource-specific behavior. */ type: string; additionalProperties?: { [k: string]: any | null } | undefined; }; export type EventPreviousConfigUnion = EventPreviousConfig | any; /** * Represents the high-level status of a resource during its lifecycle. */ export const EventStatus = { Pending: "pending", Provisioning: "provisioning", ProvisionFailed: "provision-failed", Running: "running", Updating: "updating", UpdateFailed: "update-failed", Deleting: "deleting", DeleteFailed: "delete-failed", TeardownRequired: "teardown-required", Deleted: "deleted", RefreshFailed: "refresh-failed", } as const; /** * Represents the high-level status of a resource during its lifecycle. */ export type EventStatus = ClosedEnum; /** * Represents the state of a single resource within the stack for a specific platform. */ export type EventResources = { /** * The platform-specific resource controller that manages this resource's lifecycle. * * @remarks * This is None when the resource status is Pending. * Stored as JSON to make the struct serializable and movable to alien-core. */ internal?: any | null | undefined; /** * Resource that can hold any resource type in the Alien system. All resources share common 'type' and 'id' fields with additional type-specific properties. */ config: EventConfig; controllerPlatform?: EventControllerPlatformEnum | any | null | undefined; /** * Complete list of dependencies for this resource, including infrastructure dependencies. * * @remarks * This preserves the full dependency information from the stack definition. */ dependencies?: Array | undefined; error?: EventErrorNextState | any | null | undefined; /** * Stores the controller state that failed, used for manual retry operations. * * @remarks * This allows resuming from the exact point where the failure occurred. * Stored as JSON to make the struct serializable and movable to alien-core. */ lastFailedState?: any | null | undefined; lifecycle?: EventLifecycleEnum | any | null | undefined; outputs?: EventOutputs | any | null | undefined; previousConfig?: EventPreviousConfig | any | null | undefined; /** * Binding parameters for remote access. * * @remarks * Only populated when the resource has `remote_access: true` in its ResourceEntry. * This is the JSON serialization of the binding configuration (e.g., StorageBinding, VaultBinding). * Populated by controllers during provisioning using get_binding_params(). */ remoteBindingParams?: any | null | undefined; /** * Tracks consecutive retry attempts for the current state transition. */ retryAttempt?: number | undefined; /** * Represents the high-level status of a resource during its lifecycle. */ status: EventStatus; /** * The high-level type of the resource (e.g., Worker::RESOURCE_TYPE, Storage::RESOURCE_TYPE). */ type: string; }; /** * Represents the collective state of all resources in a stack, including platform and pending actions. */ export type EventNextState = { /** * Represents the target cloud platform. */ platform: EventPlatform; /** * A prefix used for resource naming to ensure uniqueness across deployments. */ resourcePrefix: string; /** * The state of individual resources, keyed by resource ID. */ resources: { [k: string]: EventResources }; }; export type EventDataStackStep = { /** * Represents the collective state of all resources in a stack, including platform and pending actions. */ nextState: EventNextState; /** * An suggested duration to wait before executing the next step. */ suggestedDelayMs?: number | null | undefined; type: "StackStep"; }; export type EventDataCompilingCode = { /** * Language being compiled (rust, typescript, etc.) */ language: string; /** * Current progress/status line from the build output */ progress?: string | null | undefined; type: "CompilingCode"; }; export type EventDataCreatingRelease = { /** * Project name */ project: string; type: "CreatingRelease"; }; export type EventDataPushingResource = { /** * Name of the resource being pushed */ resourceName: string; /** * Type of the resource: "worker", "container" */ resourceType: string; type: "PushingResource"; }; export type EventDataPushingStack = { /** * Human-readable destination for pushed images */ destination?: string | null | undefined; /** * Target platform */ platform: string; /** * Name of the stack being pushed */ stack: string; type: "PushingStack"; }; /** * Progress information for image push operations */ export type EventProgress = { /** * Bytes uploaded so far */ bytesUploaded: number; /** * Number of layers uploaded so far */ layersUploaded: number; /** * Current operation being performed */ operation: string; /** * Total bytes to upload */ totalBytes: number; /** * Total number of layers to upload */ totalLayers: number; }; export type EventProgressUnion = EventProgress | any; export type EventDataPushingImage = { /** * Name of the image being pushed */ image: string; progress?: EventProgress | any | null | undefined; type: "PushingImage"; }; export type EventDataBuildingImage = { /** * Name of the image being built */ image: string; type: "BuildingImage"; }; export type EventDataBuildingResource = { /** * All resource names sharing this build (for deduped container groups) */ relatedResources?: Array | undefined; /** * Name of the resource being built */ resourceName: string; /** * Type of the resource: "worker", "container" */ resourceType: string; type: "BuildingResource"; }; export type EventDataDownloadingAlienRuntime = { /** * Target triple for the runtime */ targetTriple: string; type: "DownloadingAlienRuntime"; /** * URL being downloaded from */ url: string; }; export type EventDataRunningPreflights = { /** * Platform being targeted */ platform: string; /** * Name of the stack being checked */ stack: string; type: "RunningPreflights"; }; export type EventDataBuildingStack = { /** * Name of the stack being built */ stack: string; type: "BuildingStack"; }; export type EventDataFinished = { type: "Finished"; }; export type EventDataLoadingConfiguration = { type: "LoadingConfiguration"; }; export type EventDataUnion = | EventDataLoadingConfiguration | EventDataFinished | EventDataBuildingStack | EventDataRunningPreflights | EventDataDownloadingAlienRuntime | EventDataBuildingResource | EventDataBuildingImage | EventDataPushingImage | EventDataPushingStack | EventDataPushingResource | EventDataCreatingRelease | EventDataCompilingCode | EventDataStackStep | EventDataGeneratingCloudFormationTemplate | EventDataGeneratingTemplate | EventDataProvisioningAgent | EventDataUpdatingAgent | EventDataDeletingAgent | EventDataDebuggingAgent | EventDataPreparingEnvironment | EventDataDeployingStack | EventDataRunningTestWorker | EventDataCleaningUpStack | EventDataCleaningUpEnvironment | EventDataSettingUpPlatformContext | EventDataEnsuringDockerRepository | EventDataDeployingCloudFormationStack | EventDataAssumingRole | EventDataImportingStackStateFromCloudFormation | EventDataDeletingCloudFormationStack | EventDataEmptyingBuckets | EventDataDeploymentCreated | EventDataDeploymentReleased | EventDataDeploymentFailed | EventDataDeploymentDegraded | EventDataDeploymentRecovered | EventDataDeploymentDeleted | EventDataReleaseChannelUpdated | EventDataDeploymentReleaseChannelChanged | EventDataDeploymentRetryRequested | EventDataDeploymentRedeployRequested | EventDataDeploymentReleasePinned | EventDataDeploymentReleaseUnpinned | EventDataDeploymentEnvironmentUpdated | EventDataDeploymentDeletionRequested | DeploymentCredentialRotationEvent; export const EventStateSuccess = { Success: "success", } as const; export type EventStateSuccess = ClosedEnum; export const EventStateStarted = { Started: "started", } as const; export type EventStateStarted = ClosedEnum; export const EventStateNone = { None: "none", } as const; export type EventStateNone = ClosedEnum; /** * Canonical error container that provides a structured way to represent errors * * @remarks * with rich metadata including error codes, human-readable messages, context, * and chaining capabilities for error propagation. * * This struct is designed to be both machine-readable and user-friendly, * supporting serialization for API responses and detailed error reporting * in distributed systems. */ export type EventStateError = { /** * A unique identifier for the type of error. * * @remarks * * This should be a short, machine-readable string that can be used * by clients to programmatically handle different error types. * Examples: "NOT_FOUND", "VALIDATION_ERROR", "TIMEOUT" */ code: string; /** * Additional diagnostic information about the error context. * * @remarks * * This optional field can contain structured data providing more details * about the error, such as validation errors, request parameters that * caused the issue, or other relevant context information. */ context?: any | null | undefined; /** * Optional human-facing remediation hint. */ hint?: string | null | undefined; /** * HTTP status code for this error. * * @remarks * * Used when converting the error to an HTTP response. If None, falls back to * the error type's default status code or 500. */ httpStatusCode?: number | null | undefined; /** * Indicates if this is an internal error that should not be exposed to users. * * @remarks * * When `true`, this error contains sensitive information or implementation * details that should not be shown to end-users. Such errors should be * logged for debugging but replaced with generic error messages in responses. */ internal: boolean; /** * Human-readable error message. * * @remarks * * This message should be clear and actionable for developers or end-users, * providing context about what went wrong and potentially how to fix it. */ message: string; /** * Indicates whether the operation that caused the error should be retried. * * @remarks * * When `true`, the error is transient and the operation might succeed * if attempted again. When `false`, retrying the same operation is * unlikely to succeed without changes. */ retryable: boolean; /** * The underlying error that caused this error, creating an error chain. * * @remarks * * This allows for proper error propagation and debugging by maintaining * the full context of how an error occurred through multiple layers * of an application. */ source?: any | null | undefined; }; export type EventStateErrorUnion = EventStateError | any; /** * Event failed with an error */ export type EventFailed = { error?: EventStateError | any | null | undefined; }; export type EventState = { /** * Event failed with an error */ failed: EventFailed; }; /** * Represents the state of an event */ export type EventStateUnion = | EventState | EventStateNone | EventStateStarted | EventStateSuccess; export type Event = { /** * Unique identifier for the event. */ id: string; /** * Unique identifier for the deployment. */ deploymentId?: string | null | undefined; /** * Unique identifier for the release. */ releaseId?: string | null | undefined; /** * Unique identifier for the debug session. */ debugSessionId?: string | null | undefined; data: | EventDataLoadingConfiguration | EventDataFinished | EventDataBuildingStack | EventDataRunningPreflights | EventDataDownloadingAlienRuntime | EventDataBuildingResource | EventDataBuildingImage | EventDataPushingImage | EventDataPushingStack | EventDataPushingResource | EventDataCreatingRelease | EventDataCompilingCode | EventDataStackStep | EventDataGeneratingCloudFormationTemplate | EventDataGeneratingTemplate | EventDataProvisioningAgent | EventDataUpdatingAgent | EventDataDeletingAgent | EventDataDebuggingAgent | EventDataPreparingEnvironment | EventDataDeployingStack | EventDataRunningTestWorker | EventDataCleaningUpStack | EventDataCleaningUpEnvironment | EventDataSettingUpPlatformContext | EventDataEnsuringDockerRepository | EventDataDeployingCloudFormationStack | EventDataAssumingRole | EventDataImportingStackStateFromCloudFormation | EventDataDeletingCloudFormationStack | EventDataEmptyingBuckets | EventDataDeploymentCreated | EventDataDeploymentReleased | EventDataDeploymentFailed | EventDataDeploymentDegraded | EventDataDeploymentRecovered | EventDataDeploymentDeleted | EventDataReleaseChannelUpdated | EventDataDeploymentReleaseChannelChanged | EventDataDeploymentRetryRequested | EventDataDeploymentRedeployRequested | EventDataDeploymentReleasePinned | EventDataDeploymentReleaseUnpinned | EventDataDeploymentEnvironmentUpdated | EventDataDeploymentDeletionRequested | DeploymentCredentialRotationEvent; /** * Represents the state of an event */ state: EventState | EventStateNone | EventStateStarted | EventStateSuccess; /** * Unique identifier for the project. */ projectId: string; createdAt: Date; /** * Unique identifier for the workspace. */ workspaceId: string; }; /** @internal */ export const EventDataDeploymentDeletionRequested$inboundSchema: z.ZodType< EventDataDeploymentDeletionRequested, unknown > = z.object({ deploymentId: z.string(), type: z.literal("DeploymentDeletionRequested"), }); export function eventDataDeploymentDeletionRequestedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeploymentDeletionRequested$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeploymentDeletionRequested' from JSON`, ); } /** @internal */ export const EventKind4$inboundSchema: z.ZodEnum = z.enum( EventKind4, ); /** @internal */ export const EventActor4$inboundSchema: z.ZodType = z .object({ email: z.nullable(z.string()).optional(), id: z.string(), kind: EventKind4$inboundSchema, }); export function eventActor4FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventActor4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventActor4' from JSON`, ); } /** @internal */ export const EventActorUnion4$inboundSchema: z.ZodType< EventActorUnion4, unknown > = z.union([z.lazy(() => EventActor4$inboundSchema), z.any()]); export function eventActorUnion4FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventActorUnion4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventActorUnion4' from JSON`, ); } /** @internal */ export const EventDataDeploymentEnvironmentUpdated$inboundSchema: z.ZodType< EventDataDeploymentEnvironmentUpdated, unknown > = z.object({ actor: z.nullable(z.union([z.lazy(() => EventActor4$inboundSchema), z.any()])) .optional(), changedKeys: z.array(z.string()), deploymentId: z.string(), type: z.literal("DeploymentEnvironmentUpdated"), }); export function eventDataDeploymentEnvironmentUpdatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeploymentEnvironmentUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeploymentEnvironmentUpdated' from JSON`, ); } /** @internal */ export const EventDataDeploymentReleaseUnpinned$inboundSchema: z.ZodType< EventDataDeploymentReleaseUnpinned, unknown > = z.object({ deploymentId: z.string(), previousPinnedReleaseId: z.string(), type: z.literal("DeploymentReleaseUnpinned"), }); export function eventDataDeploymentReleaseUnpinnedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeploymentReleaseUnpinned$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeploymentReleaseUnpinned' from JSON`, ); } /** @internal */ export const EventDataDeploymentReleasePinned$inboundSchema: z.ZodType< EventDataDeploymentReleasePinned, unknown > = z.object({ deploymentId: z.string(), pinnedReleaseId: z.string(), previousPinnedReleaseId: z.nullable(z.string()).optional(), type: z.literal("DeploymentReleasePinned"), }); export function eventDataDeploymentReleasePinnedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeploymentReleasePinned$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeploymentReleasePinned' from JSON`, ); } /** @internal */ export const EventDataDeploymentRedeployRequested$inboundSchema: z.ZodType< EventDataDeploymentRedeployRequested, unknown > = z.object({ deploymentId: z.string(), releaseId: z.string(), type: z.literal("DeploymentRedeployRequested"), }); export function eventDataDeploymentRedeployRequestedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeploymentRedeployRequested$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeploymentRedeployRequested' from JSON`, ); } /** @internal */ export const EventKind3$inboundSchema: z.ZodEnum = z.enum( EventKind3, ); /** @internal */ export const EventActor3$inboundSchema: z.ZodType = z .object({ email: z.nullable(z.string()).optional(), id: z.string(), kind: EventKind3$inboundSchema, }); export function eventActor3FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventActor3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventActor3' from JSON`, ); } /** @internal */ export const EventActorUnion3$inboundSchema: z.ZodType< EventActorUnion3, unknown > = z.union([z.lazy(() => EventActor3$inboundSchema), z.any()]); export function eventActorUnion3FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventActorUnion3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventActorUnion3' from JSON`, ); } /** @internal */ export const EventPreviousError$inboundSchema: z.ZodType< EventPreviousError, unknown > = z.object({ code: z.string(), context: z.nullable(z.any()).optional(), hint: z.nullable(z.string()).optional(), httpStatusCode: z.nullable(z.int()).optional(), internal: z.boolean(), message: z.string(), retryable: z.boolean().default(false), source: z.nullable(z.any()).optional(), }); export function eventPreviousErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventPreviousError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventPreviousError' from JSON`, ); } /** @internal */ export const EventPreviousErrorUnion$inboundSchema: z.ZodType< EventPreviousErrorUnion, unknown > = z.union([z.lazy(() => EventPreviousError$inboundSchema), z.any()]); export function eventPreviousErrorUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventPreviousErrorUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventPreviousErrorUnion' from JSON`, ); } /** @internal */ export const EventDataDeploymentRetryRequested$inboundSchema: z.ZodType< EventDataDeploymentRetryRequested, unknown > = z.object({ actor: z.nullable(z.union([z.lazy(() => EventActor3$inboundSchema), z.any()])) .optional(), attemptedReleaseId: z.nullable(z.string()).optional(), deploymentId: z.string(), previousError: z.nullable( z.union([z.lazy(() => EventPreviousError$inboundSchema), z.any()]), ).optional(), type: z.literal("DeploymentRetryRequested"), }); export function eventDataDeploymentRetryRequestedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeploymentRetryRequested$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeploymentRetryRequested' from JSON`, ); } /** @internal */ export const EventKind2$inboundSchema: z.ZodEnum = z.enum( EventKind2, ); /** @internal */ export const EventActor2$inboundSchema: z.ZodType = z .object({ email: z.nullable(z.string()).optional(), id: z.string(), kind: EventKind2$inboundSchema, }); export function eventActor2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventActor2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventActor2' from JSON`, ); } /** @internal */ export const EventActorUnion2$inboundSchema: z.ZodType< EventActorUnion2, unknown > = z.union([z.lazy(() => EventActor2$inboundSchema), z.any()]); export function eventActorUnion2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventActorUnion2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventActorUnion2' from JSON`, ); } /** @internal */ export const EventDataDeploymentReleaseChannelChanged$inboundSchema: z.ZodType< EventDataDeploymentReleaseChannelChanged, unknown > = z.object({ actor: z.nullable(z.union([z.lazy(() => EventActor2$inboundSchema), z.any()])) .optional(), channel: z.string(), deploymentId: z.string(), previousChannel: z.string(), type: z.literal("DeploymentReleaseChannelChanged"), }); export function eventDataDeploymentReleaseChannelChangedFromJSON( jsonString: string, ): SafeParseResult< EventDataDeploymentReleaseChannelChanged, SDKValidationError > { return safeParse( jsonString, (x) => EventDataDeploymentReleaseChannelChanged$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventDataDeploymentReleaseChannelChanged' from JSON`, ); } /** @internal */ export const EventKind1$inboundSchema: z.ZodEnum = z.enum( EventKind1, ); /** @internal */ export const EventActor1$inboundSchema: z.ZodType = z .object({ email: z.nullable(z.string()).optional(), id: z.string(), kind: EventKind1$inboundSchema, }); export function eventActor1FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventActor1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventActor1' from JSON`, ); } /** @internal */ export const EventActorUnion1$inboundSchema: z.ZodType< EventActorUnion1, unknown > = z.union([z.lazy(() => EventActor1$inboundSchema), z.any()]); export function eventActorUnion1FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventActorUnion1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventActorUnion1' from JSON`, ); } /** @internal */ export const EventDataReleaseChannelUpdated$inboundSchema: z.ZodType< EventDataReleaseChannelUpdated, unknown > = z.object({ actor: z.nullable(z.union([z.lazy(() => EventActor1$inboundSchema), z.any()])) .optional(), channel: z.string(), previousReleaseId: z.nullable(z.string()).optional(), releaseId: z.string(), type: z.literal("ReleaseChannelUpdated"), }); export function eventDataReleaseChannelUpdatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataReleaseChannelUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataReleaseChannelUpdated' from JSON`, ); } /** @internal */ export const EventDataDeploymentDeleted$inboundSchema: z.ZodType< EventDataDeploymentDeleted, unknown > = z.object({ deploymentId: z.string(), type: z.literal("DeploymentDeleted"), }); export function eventDataDeploymentDeletedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeploymentDeleted$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeploymentDeleted' from JSON`, ); } /** @internal */ export const EventDataDeploymentRecovered$inboundSchema: z.ZodType< EventDataDeploymentRecovered, unknown > = z.object({ deploymentId: z.string(), releaseId: z.string(), type: z.literal("DeploymentRecovered"), }); export function eventDataDeploymentRecoveredFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeploymentRecovered$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeploymentRecovered' from JSON`, ); } /** @internal */ export const EventDataError2$inboundSchema: z.ZodType< EventDataError2, unknown > = z.object({ code: z.string(), context: z.nullable(z.any()).optional(), hint: z.nullable(z.string()).optional(), httpStatusCode: z.nullable(z.int()).optional(), internal: z.boolean(), message: z.string(), retryable: z.boolean().default(false), source: z.nullable(z.any()).optional(), }); export function eventDataError2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataError2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataError2' from JSON`, ); } /** @internal */ export const EventDataDeploymentDegraded$inboundSchema: z.ZodType< EventDataDeploymentDegraded, unknown > = z.object({ deploymentId: z.string(), error: z.lazy(() => EventDataError2$inboundSchema), type: z.literal("DeploymentDegraded"), }); export function eventDataDeploymentDegradedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeploymentDegraded$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeploymentDegraded' from JSON`, ); } /** @internal */ export const EventDataError1$inboundSchema: z.ZodType< EventDataError1, unknown > = z.object({ code: z.string(), context: z.nullable(z.any()).optional(), hint: z.nullable(z.string()).optional(), httpStatusCode: z.nullable(z.int()).optional(), internal: z.boolean(), message: z.string(), retryable: z.boolean().default(false), source: z.nullable(z.any()).optional(), }); export function eventDataError1FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataError1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataError1' from JSON`, ); } /** @internal */ export const EventPhase$inboundSchema: z.ZodEnum = z.enum( EventPhase, ); /** @internal */ export const EventDataDeploymentFailed$inboundSchema: z.ZodType< EventDataDeploymentFailed, unknown > = z.object({ attemptedReleaseId: z.nullable(z.string()).optional(), deploymentId: z.string(), error: z.lazy(() => EventDataError1$inboundSchema), phase: EventPhase$inboundSchema, type: z.literal("DeploymentFailed"), }); export function eventDataDeploymentFailedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeploymentFailed$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeploymentFailed' from JSON`, ); } /** @internal */ export const EventDataDeploymentReleased$inboundSchema: z.ZodType< EventDataDeploymentReleased, unknown > = z.object({ deploymentId: z.string(), previousReleaseId: z.nullable(z.string()).optional(), releaseId: z.string(), type: z.literal("DeploymentReleased"), }); export function eventDataDeploymentReleasedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeploymentReleased$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeploymentReleased' from JSON`, ); } /** @internal */ export const EventDataDeploymentCreated$inboundSchema: z.ZodType< EventDataDeploymentCreated, unknown > = z.object({ deploymentGroupId: z.string(), deploymentId: z.string(), releaseId: z.nullable(z.string()).optional(), type: z.literal("DeploymentCreated"), }); export function eventDataDeploymentCreatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeploymentCreated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeploymentCreated' from JSON`, ); } /** @internal */ export const EventDataEmptyingBuckets$inboundSchema: z.ZodType< EventDataEmptyingBuckets, unknown > = z.object({ bucketNames: z.array(z.string()), type: z.literal("EmptyingBuckets"), }); export function eventDataEmptyingBucketsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataEmptyingBuckets$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataEmptyingBuckets' from JSON`, ); } /** @internal */ export const EventDataDeletingCloudFormationStack$inboundSchema: z.ZodType< EventDataDeletingCloudFormationStack, unknown > = z.object({ cfnStackName: z.string(), currentStatus: z.string(), type: z.literal("DeletingCloudFormationStack"), }); export function eventDataDeletingCloudFormationStackFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeletingCloudFormationStack$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeletingCloudFormationStack' from JSON`, ); } /** @internal */ export const EventDataImportingStackStateFromCloudFormation$inboundSchema: z.ZodType = z.object( { cfnStackName: z.string(), type: z.literal("ImportingStackStateFromCloudFormation"), }, ); export function eventDataImportingStackStateFromCloudFormationFromJSON( jsonString: string, ): SafeParseResult< EventDataImportingStackStateFromCloudFormation, SDKValidationError > { return safeParse( jsonString, (x) => EventDataImportingStackStateFromCloudFormation$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventDataImportingStackStateFromCloudFormation' from JSON`, ); } /** @internal */ export const EventDataAssumingRole$inboundSchema: z.ZodType< EventDataAssumingRole, unknown > = z.object({ roleArn: z.string(), type: z.literal("AssumingRole"), }); export function eventDataAssumingRoleFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataAssumingRole$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataAssumingRole' from JSON`, ); } /** @internal */ export const EventDataDeployingCloudFormationStack$inboundSchema: z.ZodType< EventDataDeployingCloudFormationStack, unknown > = z.object({ cfnStackName: z.string(), currentStatus: z.string(), type: z.literal("DeployingCloudFormationStack"), }); export function eventDataDeployingCloudFormationStackFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeployingCloudFormationStack$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeployingCloudFormationStack' from JSON`, ); } /** @internal */ export const EventDataEnsuringDockerRepository$inboundSchema: z.ZodType< EventDataEnsuringDockerRepository, unknown > = z.object({ repositoryName: z.string(), type: z.literal("EnsuringDockerRepository"), }); export function eventDataEnsuringDockerRepositoryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataEnsuringDockerRepository$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataEnsuringDockerRepository' from JSON`, ); } /** @internal */ export const EventDataSettingUpPlatformContext$inboundSchema: z.ZodType< EventDataSettingUpPlatformContext, unknown > = z.object({ platformName: z.string(), type: z.literal("SettingUpPlatformContext"), }); export function eventDataSettingUpPlatformContextFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataSettingUpPlatformContext$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataSettingUpPlatformContext' from JSON`, ); } /** @internal */ export const EventDataCleaningUpEnvironment$inboundSchema: z.ZodType< EventDataCleaningUpEnvironment, unknown > = z.object({ stackName: z.string(), strategyName: z.string(), type: z.literal("CleaningUpEnvironment"), }); export function eventDataCleaningUpEnvironmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataCleaningUpEnvironment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataCleaningUpEnvironment' from JSON`, ); } /** @internal */ export const EventDataCleaningUpStack$inboundSchema: z.ZodType< EventDataCleaningUpStack, unknown > = z.object({ stackName: z.string(), strategyName: z.string(), type: z.literal("CleaningUpStack"), }); export function eventDataCleaningUpStackFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataCleaningUpStack$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataCleaningUpStack' from JSON`, ); } /** @internal */ export const EventDataRunningTestWorker$inboundSchema: z.ZodType< EventDataRunningTestWorker, unknown > = z.object({ stackName: z.string(), type: z.literal("RunningTestWorker"), }); export function eventDataRunningTestWorkerFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataRunningTestWorker$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataRunningTestWorker' from JSON`, ); } /** @internal */ export const EventDataDeployingStack$inboundSchema: z.ZodType< EventDataDeployingStack, unknown > = z.object({ stackName: z.string(), type: z.literal("DeployingStack"), }); export function eventDataDeployingStackFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeployingStack$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeployingStack' from JSON`, ); } /** @internal */ export const EventDataPreparingEnvironment$inboundSchema: z.ZodType< EventDataPreparingEnvironment, unknown > = z.object({ strategyName: z.string(), type: z.literal("PreparingEnvironment"), }); export function eventDataPreparingEnvironmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataPreparingEnvironment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataPreparingEnvironment' from JSON`, ); } /** @internal */ export const EventDataDebuggingAgent$inboundSchema: z.ZodType< EventDataDebuggingAgent, unknown > = z.object({ agentId: z.string(), debugSessionId: z.string(), type: z.literal("DebuggingAgent"), }); export function eventDataDebuggingAgentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDebuggingAgent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDebuggingAgent' from JSON`, ); } /** @internal */ export const EventDataDeletingAgent$inboundSchema: z.ZodType< EventDataDeletingAgent, unknown > = z.object({ agentId: z.string(), releaseId: z.string(), type: z.literal("DeletingAgent"), }); export function eventDataDeletingAgentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDeletingAgent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDeletingAgent' from JSON`, ); } /** @internal */ export const EventDataUpdatingAgent$inboundSchema: z.ZodType< EventDataUpdatingAgent, unknown > = z.object({ agentId: z.string(), releaseId: z.string(), type: z.literal("UpdatingAgent"), }); export function eventDataUpdatingAgentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataUpdatingAgent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataUpdatingAgent' from JSON`, ); } /** @internal */ export const EventDataProvisioningAgent$inboundSchema: z.ZodType< EventDataProvisioningAgent, unknown > = z.object({ agentId: z.string(), releaseId: z.string(), type: z.literal("ProvisioningAgent"), }); export function eventDataProvisioningAgentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataProvisioningAgent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataProvisioningAgent' from JSON`, ); } /** @internal */ export const EventDataGeneratingTemplate$inboundSchema: z.ZodType< EventDataGeneratingTemplate, unknown > = z.object({ platform: z.string(), type: z.literal("GeneratingTemplate"), }); export function eventDataGeneratingTemplateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataGeneratingTemplate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataGeneratingTemplate' from JSON`, ); } /** @internal */ export const EventDataGeneratingCloudFormationTemplate$inboundSchema: z.ZodType< EventDataGeneratingCloudFormationTemplate, unknown > = z.object({ type: z.literal("GeneratingCloudFormationTemplate"), }); export function eventDataGeneratingCloudFormationTemplateFromJSON( jsonString: string, ): SafeParseResult< EventDataGeneratingCloudFormationTemplate, SDKValidationError > { return safeParse( jsonString, (x) => EventDataGeneratingCloudFormationTemplate$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventDataGeneratingCloudFormationTemplate' from JSON`, ); } /** @internal */ export const EventPlatform$inboundSchema: z.ZodEnum = z .enum(EventPlatform); /** @internal */ export const EventConfig$inboundSchema: z.ZodType = collectExtraKeys$( z.object({ id: z.string(), type: z.string(), }).catchall(z.any()), "additionalProperties", true, ); export function eventConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventConfig' from JSON`, ); } /** @internal */ export const EventControllerPlatformEnum$inboundSchema: z.ZodEnum< typeof EventControllerPlatformEnum > = z.enum(EventControllerPlatformEnum); /** @internal */ export const EventControllerPlatformUnion$inboundSchema: z.ZodType< EventControllerPlatformUnion, unknown > = z.union([EventControllerPlatformEnum$inboundSchema, z.any()]); export function eventControllerPlatformUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventControllerPlatformUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventControllerPlatformUnion' from JSON`, ); } /** @internal */ export const EventDependency$inboundSchema: z.ZodType< EventDependency, unknown > = z.object({ id: z.string(), type: z.string(), }); export function eventDependencyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDependency$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDependency' from JSON`, ); } /** @internal */ export const EventErrorNextState$inboundSchema: z.ZodType< EventErrorNextState, unknown > = z.object({ code: z.string(), context: z.nullable(z.any()).optional(), hint: z.nullable(z.string()).optional(), httpStatusCode: z.nullable(z.int()).optional(), internal: z.boolean(), message: z.string(), retryable: z.boolean().default(false), source: z.nullable(z.any()).optional(), }); export function eventErrorNextStateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventErrorNextState$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventErrorNextState' from JSON`, ); } /** @internal */ export const EventNextStateErrorUnion$inboundSchema: z.ZodType< EventNextStateErrorUnion, unknown > = z.union([z.lazy(() => EventErrorNextState$inboundSchema), z.any()]); export function eventNextStateErrorUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventNextStateErrorUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventNextStateErrorUnion' from JSON`, ); } /** @internal */ export const EventLifecycleEnum$inboundSchema: z.ZodEnum< typeof EventLifecycleEnum > = z.enum(EventLifecycleEnum); /** @internal */ export const EventLifecycleUnion$inboundSchema: z.ZodType< EventLifecycleUnion, unknown > = z.union([EventLifecycleEnum$inboundSchema, z.any()]); export function eventLifecycleUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventLifecycleUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventLifecycleUnion' from JSON`, ); } /** @internal */ export const EventOutputs$inboundSchema: z.ZodType = collectExtraKeys$( z.object({ type: z.string(), }).catchall(z.any()), "additionalProperties", true, ); export function eventOutputsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventOutputs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventOutputs' from JSON`, ); } /** @internal */ export const EventOutputsUnion$inboundSchema: z.ZodType< EventOutputsUnion, unknown > = z.union([z.lazy(() => EventOutputs$inboundSchema), z.any()]); export function eventOutputsUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventOutputsUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventOutputsUnion' from JSON`, ); } /** @internal */ export const EventPreviousConfig$inboundSchema: z.ZodType< EventPreviousConfig, unknown > = collectExtraKeys$( z.object({ id: z.string(), type: z.string(), }).catchall(z.any()), "additionalProperties", true, ); export function eventPreviousConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventPreviousConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventPreviousConfig' from JSON`, ); } /** @internal */ export const EventPreviousConfigUnion$inboundSchema: z.ZodType< EventPreviousConfigUnion, unknown > = z.union([z.lazy(() => EventPreviousConfig$inboundSchema), z.any()]); export function eventPreviousConfigUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventPreviousConfigUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventPreviousConfigUnion' from JSON`, ); } /** @internal */ export const EventStatus$inboundSchema: z.ZodEnum = z.enum( EventStatus, ); /** @internal */ export const EventResources$inboundSchema: z.ZodType = z.object({ _internal: z.nullable(z.any()).optional(), config: z.lazy(() => EventConfig$inboundSchema), controllerPlatform: z.nullable( z.union([EventControllerPlatformEnum$inboundSchema, z.any()]), ).optional(), dependencies: z.array(z.lazy(() => EventDependency$inboundSchema)) .optional(), error: z.nullable( z.union([z.lazy(() => EventErrorNextState$inboundSchema), z.any()]), ).optional(), lastFailedState: z.nullable(z.any()).optional(), lifecycle: z.nullable(z.union([EventLifecycleEnum$inboundSchema, z.any()])) .optional(), outputs: z.nullable( z.union([z.lazy(() => EventOutputs$inboundSchema), z.any()]), ).optional(), previousConfig: z.nullable( z.union([z.lazy(() => EventPreviousConfig$inboundSchema), z.any()]), ).optional(), remoteBindingParams: z.nullable(z.any()).optional(), retryAttempt: z.int().optional(), status: EventStatus$inboundSchema, type: z.string(), }).transform((v) => { return remap$(v, { "_internal": "internal", }); }); export function eventResourcesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventResources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventResources' from JSON`, ); } /** @internal */ export const EventNextState$inboundSchema: z.ZodType = z.object({ platform: EventPlatform$inboundSchema, resourcePrefix: z.string(), resources: z.record(z.string(), z.lazy(() => EventResources$inboundSchema)), }); export function eventNextStateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventNextState$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventNextState' from JSON`, ); } /** @internal */ export const EventDataStackStep$inboundSchema: z.ZodType< EventDataStackStep, unknown > = z.object({ nextState: z.lazy(() => EventNextState$inboundSchema), suggestedDelayMs: z.nullable(z.int()).optional(), type: z.literal("StackStep"), }); export function eventDataStackStepFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataStackStep$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataStackStep' from JSON`, ); } /** @internal */ export const EventDataCompilingCode$inboundSchema: z.ZodType< EventDataCompilingCode, unknown > = z.object({ language: z.string(), progress: z.nullable(z.string()).optional(), type: z.literal("CompilingCode"), }); export function eventDataCompilingCodeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataCompilingCode$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataCompilingCode' from JSON`, ); } /** @internal */ export const EventDataCreatingRelease$inboundSchema: z.ZodType< EventDataCreatingRelease, unknown > = z.object({ project: z.string(), type: z.literal("CreatingRelease"), }); export function eventDataCreatingReleaseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataCreatingRelease$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataCreatingRelease' from JSON`, ); } /** @internal */ export const EventDataPushingResource$inboundSchema: z.ZodType< EventDataPushingResource, unknown > = z.object({ resourceName: z.string(), resourceType: z.string(), type: z.literal("PushingResource"), }); export function eventDataPushingResourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataPushingResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataPushingResource' from JSON`, ); } /** @internal */ export const EventDataPushingStack$inboundSchema: z.ZodType< EventDataPushingStack, unknown > = z.object({ destination: z.nullable(z.string()).optional(), platform: z.string(), stack: z.string(), type: z.literal("PushingStack"), }); export function eventDataPushingStackFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataPushingStack$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataPushingStack' from JSON`, ); } /** @internal */ export const EventProgress$inboundSchema: z.ZodType = z .object({ bytesUploaded: z.int(), layersUploaded: z.int(), operation: z.string(), totalBytes: z.int(), totalLayers: z.int(), }); export function eventProgressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventProgress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventProgress' from JSON`, ); } /** @internal */ export const EventProgressUnion$inboundSchema: z.ZodType< EventProgressUnion, unknown > = z.union([z.lazy(() => EventProgress$inboundSchema), z.any()]); export function eventProgressUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventProgressUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventProgressUnion' from JSON`, ); } /** @internal */ export const EventDataPushingImage$inboundSchema: z.ZodType< EventDataPushingImage, unknown > = z.object({ image: z.string(), progress: z.nullable( z.union([z.lazy(() => EventProgress$inboundSchema), z.any()]), ).optional(), type: z.literal("PushingImage"), }); export function eventDataPushingImageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataPushingImage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataPushingImage' from JSON`, ); } /** @internal */ export const EventDataBuildingImage$inboundSchema: z.ZodType< EventDataBuildingImage, unknown > = z.object({ image: z.string(), type: z.literal("BuildingImage"), }); export function eventDataBuildingImageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataBuildingImage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataBuildingImage' from JSON`, ); } /** @internal */ export const EventDataBuildingResource$inboundSchema: z.ZodType< EventDataBuildingResource, unknown > = z.object({ relatedResources: z.array(z.string()).optional(), resourceName: z.string(), resourceType: z.string(), type: z.literal("BuildingResource"), }); export function eventDataBuildingResourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataBuildingResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataBuildingResource' from JSON`, ); } /** @internal */ export const EventDataDownloadingAlienRuntime$inboundSchema: z.ZodType< EventDataDownloadingAlienRuntime, unknown > = z.object({ targetTriple: z.string(), type: z.literal("DownloadingAlienRuntime"), url: z.string(), }); export function eventDataDownloadingAlienRuntimeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataDownloadingAlienRuntime$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataDownloadingAlienRuntime' from JSON`, ); } /** @internal */ export const EventDataRunningPreflights$inboundSchema: z.ZodType< EventDataRunningPreflights, unknown > = z.object({ platform: z.string(), stack: z.string(), type: z.literal("RunningPreflights"), }); export function eventDataRunningPreflightsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataRunningPreflights$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataRunningPreflights' from JSON`, ); } /** @internal */ export const EventDataBuildingStack$inboundSchema: z.ZodType< EventDataBuildingStack, unknown > = z.object({ stack: z.string(), type: z.literal("BuildingStack"), }); export function eventDataBuildingStackFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataBuildingStack$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataBuildingStack' from JSON`, ); } /** @internal */ export const EventDataFinished$inboundSchema: z.ZodType< EventDataFinished, unknown > = z.object({ type: z.literal("Finished"), }); export function eventDataFinishedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataFinished$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataFinished' from JSON`, ); } /** @internal */ export const EventDataLoadingConfiguration$inboundSchema: z.ZodType< EventDataLoadingConfiguration, unknown > = z.object({ type: z.literal("LoadingConfiguration"), }); export function eventDataLoadingConfigurationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataLoadingConfiguration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataLoadingConfiguration' from JSON`, ); } /** @internal */ export const EventDataUnion$inboundSchema: z.ZodType = z.union([ z.lazy(() => EventDataLoadingConfiguration$inboundSchema), z.lazy(() => EventDataFinished$inboundSchema), z.lazy(() => EventDataBuildingStack$inboundSchema), z.lazy(() => EventDataRunningPreflights$inboundSchema), z.lazy(() => EventDataDownloadingAlienRuntime$inboundSchema), z.lazy(() => EventDataBuildingResource$inboundSchema), z.lazy(() => EventDataBuildingImage$inboundSchema), z.lazy(() => EventDataPushingImage$inboundSchema), z.lazy(() => EventDataPushingStack$inboundSchema), z.lazy(() => EventDataPushingResource$inboundSchema), z.lazy(() => EventDataCreatingRelease$inboundSchema), z.lazy(() => EventDataCompilingCode$inboundSchema), z.lazy(() => EventDataStackStep$inboundSchema), z.lazy(() => EventDataGeneratingCloudFormationTemplate$inboundSchema), z.lazy(() => EventDataGeneratingTemplate$inboundSchema), z.lazy(() => EventDataProvisioningAgent$inboundSchema), z.lazy(() => EventDataUpdatingAgent$inboundSchema), z.lazy(() => EventDataDeletingAgent$inboundSchema), z.lazy(() => EventDataDebuggingAgent$inboundSchema), z.lazy(() => EventDataPreparingEnvironment$inboundSchema), z.lazy(() => EventDataDeployingStack$inboundSchema), z.lazy(() => EventDataRunningTestWorker$inboundSchema), z.lazy(() => EventDataCleaningUpStack$inboundSchema), z.lazy(() => EventDataCleaningUpEnvironment$inboundSchema), z.lazy(() => EventDataSettingUpPlatformContext$inboundSchema), z.lazy(() => EventDataEnsuringDockerRepository$inboundSchema), z.lazy(() => EventDataDeployingCloudFormationStack$inboundSchema), z.lazy(() => EventDataAssumingRole$inboundSchema), z.lazy(() => EventDataImportingStackStateFromCloudFormation$inboundSchema), z.lazy(() => EventDataDeletingCloudFormationStack$inboundSchema), z.lazy(() => EventDataEmptyingBuckets$inboundSchema), z.lazy(() => EventDataDeploymentCreated$inboundSchema), z.lazy(() => EventDataDeploymentReleased$inboundSchema), z.lazy(() => EventDataDeploymentFailed$inboundSchema), z.lazy(() => EventDataDeploymentDegraded$inboundSchema), z.lazy(() => EventDataDeploymentRecovered$inboundSchema), z.lazy(() => EventDataDeploymentDeleted$inboundSchema), z.lazy(() => EventDataReleaseChannelUpdated$inboundSchema), z.lazy(() => EventDataDeploymentReleaseChannelChanged$inboundSchema), z.lazy(() => EventDataDeploymentRetryRequested$inboundSchema), z.lazy(() => EventDataDeploymentRedeployRequested$inboundSchema), z.lazy(() => EventDataDeploymentReleasePinned$inboundSchema), z.lazy(() => EventDataDeploymentReleaseUnpinned$inboundSchema), z.lazy(() => EventDataDeploymentEnvironmentUpdated$inboundSchema), z.lazy(() => EventDataDeploymentDeletionRequested$inboundSchema), DeploymentCredentialRotationEvent$inboundSchema, ]); export function eventDataUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventDataUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventDataUnion' from JSON`, ); } /** @internal */ export const EventStateSuccess$inboundSchema: z.ZodEnum< typeof EventStateSuccess > = z.enum(EventStateSuccess); /** @internal */ export const EventStateStarted$inboundSchema: z.ZodEnum< typeof EventStateStarted > = z.enum(EventStateStarted); /** @internal */ export const EventStateNone$inboundSchema: z.ZodEnum = z .enum(EventStateNone); /** @internal */ export const EventStateError$inboundSchema: z.ZodType< EventStateError, unknown > = z.object({ code: z.string(), context: z.nullable(z.any()).optional(), hint: z.nullable(z.string()).optional(), httpStatusCode: z.nullable(z.int()).optional(), internal: z.boolean(), message: z.string(), retryable: z.boolean().default(false), source: z.nullable(z.any()).optional(), }); export function eventStateErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventStateError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventStateError' from JSON`, ); } /** @internal */ export const EventStateErrorUnion$inboundSchema: z.ZodType< EventStateErrorUnion, unknown > = z.union([z.lazy(() => EventStateError$inboundSchema), z.any()]); export function eventStateErrorUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventStateErrorUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventStateErrorUnion' from JSON`, ); } /** @internal */ export const EventFailed$inboundSchema: z.ZodType = z .object({ error: z.nullable( z.union([z.lazy(() => EventStateError$inboundSchema), z.any()]), ).optional(), }); export function eventFailedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventFailed$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventFailed' from JSON`, ); } /** @internal */ export const EventState$inboundSchema: z.ZodType = z .object({ failed: z.lazy(() => EventFailed$inboundSchema), }); export function eventStateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventState$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventState' from JSON`, ); } /** @internal */ export const EventStateUnion$inboundSchema: z.ZodType< EventStateUnion, unknown > = z.union([ z.lazy(() => EventState$inboundSchema), EventStateNone$inboundSchema, EventStateStarted$inboundSchema, EventStateSuccess$inboundSchema, ]); export function eventStateUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventStateUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventStateUnion' from JSON`, ); } /** @internal */ export const Event$inboundSchema: z.ZodType = z.object({ id: z.string(), deploymentId: z.nullable(z.string()).optional(), releaseId: z.nullable(z.string()).optional(), debugSessionId: z.nullable(z.string()).optional(), data: z.union([ z.lazy(() => EventDataLoadingConfiguration$inboundSchema), z.lazy(() => EventDataFinished$inboundSchema), z.lazy(() => EventDataBuildingStack$inboundSchema), z.lazy(() => EventDataRunningPreflights$inboundSchema), z.lazy(() => EventDataDownloadingAlienRuntime$inboundSchema), z.lazy(() => EventDataBuildingResource$inboundSchema), z.lazy(() => EventDataBuildingImage$inboundSchema), z.lazy(() => EventDataPushingImage$inboundSchema), z.lazy(() => EventDataPushingStack$inboundSchema), z.lazy(() => EventDataPushingResource$inboundSchema), z.lazy(() => EventDataCreatingRelease$inboundSchema), z.lazy(() => EventDataCompilingCode$inboundSchema), z.lazy(() => EventDataStackStep$inboundSchema), z.lazy(() => EventDataGeneratingCloudFormationTemplate$inboundSchema), z.lazy(() => EventDataGeneratingTemplate$inboundSchema), z.lazy(() => EventDataProvisioningAgent$inboundSchema), z.lazy(() => EventDataUpdatingAgent$inboundSchema), z.lazy(() => EventDataDeletingAgent$inboundSchema), z.lazy(() => EventDataDebuggingAgent$inboundSchema), z.lazy(() => EventDataPreparingEnvironment$inboundSchema), z.lazy(() => EventDataDeployingStack$inboundSchema), z.lazy(() => EventDataRunningTestWorker$inboundSchema), z.lazy(() => EventDataCleaningUpStack$inboundSchema), z.lazy(() => EventDataCleaningUpEnvironment$inboundSchema), z.lazy(() => EventDataSettingUpPlatformContext$inboundSchema), z.lazy(() => EventDataEnsuringDockerRepository$inboundSchema), z.lazy(() => EventDataDeployingCloudFormationStack$inboundSchema), z.lazy(() => EventDataAssumingRole$inboundSchema), z.lazy(() => EventDataImportingStackStateFromCloudFormation$inboundSchema), z.lazy(() => EventDataDeletingCloudFormationStack$inboundSchema), z.lazy(() => EventDataEmptyingBuckets$inboundSchema), z.lazy(() => EventDataDeploymentCreated$inboundSchema), z.lazy(() => EventDataDeploymentReleased$inboundSchema), z.lazy(() => EventDataDeploymentFailed$inboundSchema), z.lazy(() => EventDataDeploymentDegraded$inboundSchema), z.lazy(() => EventDataDeploymentRecovered$inboundSchema), z.lazy(() => EventDataDeploymentDeleted$inboundSchema), z.lazy(() => EventDataReleaseChannelUpdated$inboundSchema), z.lazy(() => EventDataDeploymentReleaseChannelChanged$inboundSchema), z.lazy(() => EventDataDeploymentRetryRequested$inboundSchema), z.lazy(() => EventDataDeploymentRedeployRequested$inboundSchema), z.lazy(() => EventDataDeploymentReleasePinned$inboundSchema), z.lazy(() => EventDataDeploymentReleaseUnpinned$inboundSchema), z.lazy(() => EventDataDeploymentEnvironmentUpdated$inboundSchema), z.lazy(() => EventDataDeploymentDeletionRequested$inboundSchema), DeploymentCredentialRotationEvent$inboundSchema, ]), state: z.union([ z.lazy(() => EventState$inboundSchema), EventStateNone$inboundSchema, EventStateStarted$inboundSchema, EventStateSuccess$inboundSchema, ]), projectId: z.string(), createdAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)), workspaceId: z.string(), }); export function eventFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Event$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Event' from JSON`, ); }