/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: f49a5b2a8a97 */ 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 EventListItemResponseDataDeploymentDeletionRequested = { /** * ID of the deployment */ deploymentId: string; type: "DeploymentDeletionRequested"; }; /** * Type of authenticated principal that requested an event. */ export const EventListItemResponseKind4 = { User: "user", ServiceAccount: "serviceAccount", } as const; /** * Type of authenticated principal that requested an event. */ export type EventListItemResponseKind4 = ClosedEnum< typeof EventListItemResponseKind4 >; /** * Authenticated principal that requested a deployment intent event. */ export type EventListItemResponseActor4 = { /** * 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: EventListItemResponseKind4; }; export type EventListItemResponseActorUnion4 = | EventListItemResponseActor4 | any; export type EventListItemResponseDataDeploymentEnvironmentUpdated = { actor?: EventListItemResponseActor4 | 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 EventListItemResponseDataDeploymentReleaseUnpinned = { /** * ID of the deployment */ deploymentId: string; /** * ID of the release that was previously pinned */ previousPinnedReleaseId: string; type: "DeploymentReleaseUnpinned"; }; export type EventListItemResponseDataDeploymentReleasePinned = { /** * 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 EventListItemResponseDataDeploymentRedeployRequested = { /** * 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 EventListItemResponseKind3 = { User: "user", ServiceAccount: "serviceAccount", } as const; /** * Type of authenticated principal that requested an event. */ export type EventListItemResponseKind3 = ClosedEnum< typeof EventListItemResponseKind3 >; /** * Authenticated principal that requested a deployment intent event. */ export type EventListItemResponseActor3 = { /** * 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: EventListItemResponseKind3; }; export type EventListItemResponseActorUnion3 = | EventListItemResponseActor3 | 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 EventListItemResponsePreviousError = { /** * 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 EventListItemResponsePreviousErrorUnion = | EventListItemResponsePreviousError | any; export type EventListItemResponseDataDeploymentRetryRequested = { actor?: EventListItemResponseActor3 | 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?: EventListItemResponsePreviousError | any | null | undefined; type: "DeploymentRetryRequested"; }; /** * Type of authenticated principal that requested an event. */ export const EventListItemResponseKind2 = { User: "user", ServiceAccount: "serviceAccount", } as const; /** * Type of authenticated principal that requested an event. */ export type EventListItemResponseKind2 = ClosedEnum< typeof EventListItemResponseKind2 >; /** * Authenticated principal that requested a deployment intent event. */ export type EventListItemResponseActor2 = { /** * 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: EventListItemResponseKind2; }; export type EventListItemResponseActorUnion2 = | EventListItemResponseActor2 | any; export type EventListItemResponseDataDeploymentReleaseChannelChanged = { actor?: EventListItemResponseActor2 | 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 EventListItemResponseKind1 = { User: "user", ServiceAccount: "serviceAccount", } as const; /** * Type of authenticated principal that requested an event. */ export type EventListItemResponseKind1 = ClosedEnum< typeof EventListItemResponseKind1 >; /** * Authenticated principal that requested a deployment intent event. */ export type EventListItemResponseActor1 = { /** * 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: EventListItemResponseKind1; }; export type EventListItemResponseActorUnion1 = | EventListItemResponseActor1 | any; export type EventListItemResponseDataReleaseChannelUpdated = { actor?: EventListItemResponseActor1 | 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 EventListItemResponseDataDeploymentDeleted = { /** * ID of the deployment that was deleted */ deploymentId: string; type: "DeploymentDeleted"; }; export type EventListItemResponseDataDeploymentRecovered = { /** * 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 EventListItemResponseDataError2 = { /** * 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 EventListItemResponseDataDeploymentDegraded = { /** * 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: EventListItemResponseDataError2; 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 EventListItemResponseDataError1 = { /** * 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 EventListItemResponsePhase = { 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 EventListItemResponsePhase = ClosedEnum< typeof EventListItemResponsePhase >; export type EventListItemResponseDataDeploymentFailed = { /** * 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: EventListItemResponseDataError1; /** * 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: EventListItemResponsePhase; type: "DeploymentFailed"; }; export type EventListItemResponseDataDeploymentReleased = { /** * 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 EventListItemResponseDataDeploymentCreated = { /** * 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 EventListItemResponseDataEmptyingBuckets = { /** * Names of the S3 buckets being emptied */ bucketNames: Array; type: "EmptyingBuckets"; }; export type EventListItemResponseDataDeletingCloudFormationStack = { /** * Name of the CloudFormation stack */ cfnStackName: string; /** * Current stack status */ currentStatus: string; type: "DeletingCloudFormationStack"; }; export type EventListItemResponseDataImportingStackStateFromCloudFormation = { /** * Name of the CloudFormation stack */ cfnStackName: string; type: "ImportingStackStateFromCloudFormation"; }; export type EventListItemResponseDataAssumingRole = { /** * ARN of the role to assume */ roleArn: string; type: "AssumingRole"; }; export type EventListItemResponseDataDeployingCloudFormationStack = { /** * Name of the CloudFormation stack */ cfnStackName: string; /** * Current stack status */ currentStatus: string; type: "DeployingCloudFormationStack"; }; export type EventListItemResponseDataEnsuringDockerRepository = { /** * Name of the docker repository */ repositoryName: string; type: "EnsuringDockerRepository"; }; export type EventListItemResponseDataSettingUpPlatformContext = { /** * Name of the platform (e.g., "AWS", "GCP") */ platformName: string; type: "SettingUpPlatformContext"; }; export type EventListItemResponseDataCleaningUpEnvironment = { /** * Name of the stack being cleaned up */ stackName: string; /** * Name of the deployment strategy being used for cleanup */ strategyName: string; type: "CleaningUpEnvironment"; }; export type EventListItemResponseDataCleaningUpStack = { /** * Name of the stack being cleaned up */ stackName: string; /** * Name of the deployment strategy being used for cleanup */ strategyName: string; type: "CleaningUpStack"; }; export type EventListItemResponseDataRunningTestWorker = { /** * Name of the stack being tested */ stackName: string; type: "RunningTestWorker"; }; export type EventListItemResponseDataDeployingStack = { /** * Name of the stack being deployed */ stackName: string; type: "DeployingStack"; }; export type EventListItemResponseDataPreparingEnvironment = { /** * Name of the deployment strategy being used */ strategyName: string; type: "PreparingEnvironment"; }; export type EventListItemResponseDataDebuggingAgent = { /** * ID of the agent being debugged */ agentId: string; /** * ID of the debug session */ debugSessionId: string; type: "DebuggingAgent"; }; export type EventListItemResponseDataDeletingAgent = { /** * ID of the agent being deleted */ agentId: string; /** * ID of the release that was running on the agent */ releaseId: string; type: "DeletingAgent"; }; export type EventListItemResponseDataUpdatingAgent = { /** * ID of the agent being updated */ agentId: string; /** * ID of the new release being deployed to the agent */ releaseId: string; type: "UpdatingAgent"; }; export type EventListItemResponseDataProvisioningAgent = { /** * ID of the agent being provisioned */ agentId: string; /** * ID of the release being deployed to the agent */ releaseId: string; type: "ProvisioningAgent"; }; export type EventListItemResponseDataGeneratingTemplate = { /** * Platform for which the template is being generated */ platform: string; type: "GeneratingTemplate"; }; export type EventListItemResponseDataGeneratingCloudFormationTemplate = { type: "GeneratingCloudFormationTemplate"; }; /** * Represents the target cloud platform. */ export const EventListItemResponsePlatform = { Aws: "aws", Gcp: "gcp", Azure: "azure", Kubernetes: "kubernetes", Machines: "machines", Local: "local", Test: "test", } as const; /** * Represents the target cloud platform. */ export type EventListItemResponsePlatform = ClosedEnum< typeof EventListItemResponsePlatform >; /** * 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 EventListItemResponseConfig = { /** * 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 EventListItemResponseControllerPlatformEnum = { Aws: "aws", Gcp: "gcp", Azure: "azure", Kubernetes: "kubernetes", Machines: "machines", Local: "local", Test: "test", } as const; /** * Represents the target cloud platform. */ export type EventListItemResponseControllerPlatformEnum = ClosedEnum< typeof EventListItemResponseControllerPlatformEnum >; export type EventListItemResponseControllerPlatformUnion = | EventListItemResponseControllerPlatformEnum | any; /** * Reference to a resource by its stable id and resource type. */ export type EventListItemResponseDependency = { 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 EventListItemResponseErrorNextState = { /** * 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 EventListItemResponseNextStateErrorUnion = | EventListItemResponseErrorNextState | any; /** * Describes the lifecycle of a resource within a stack, determining how it's managed and deployed. */ export const EventListItemResponseLifecycleEnum = { Frozen: "frozen", Live: "live", } as const; /** * Describes the lifecycle of a resource within a stack, determining how it's managed and deployed. */ export type EventListItemResponseLifecycleEnum = ClosedEnum< typeof EventListItemResponseLifecycleEnum >; export type EventListItemResponseLifecycleUnion = | EventListItemResponseLifecycleEnum | 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 EventListItemResponseOutputs = { /** * 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 EventListItemResponseOutputsUnion = | EventListItemResponseOutputs | 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 EventListItemResponsePreviousConfig = { /** * 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 EventListItemResponsePreviousConfigUnion = | EventListItemResponsePreviousConfig | any; /** * Represents the high-level status of a resource during its lifecycle. */ export const EventListItemResponseStatus = { 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 EventListItemResponseStatus = ClosedEnum< typeof EventListItemResponseStatus >; /** * Represents the state of a single resource within the stack for a specific platform. */ export type EventListItemResponseResources = { /** * 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: EventListItemResponseConfig; controllerPlatform?: | EventListItemResponseControllerPlatformEnum | 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?: EventListItemResponseErrorNextState | 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?: EventListItemResponseLifecycleEnum | any | null | undefined; outputs?: EventListItemResponseOutputs | any | null | undefined; previousConfig?: EventListItemResponsePreviousConfig | 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: EventListItemResponseStatus; /** * 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 EventListItemResponseNextState = { /** * Represents the target cloud platform. */ platform: EventListItemResponsePlatform; /** * 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]: EventListItemResponseResources }; }; export type EventListItemResponseDataStackStep = { /** * Represents the collective state of all resources in a stack, including platform and pending actions. */ nextState: EventListItemResponseNextState; /** * An suggested duration to wait before executing the next step. */ suggestedDelayMs?: number | null | undefined; type: "StackStep"; }; export type EventListItemResponseDataCompilingCode = { /** * Language being compiled (rust, typescript, etc.) */ language: string; /** * Current progress/status line from the build output */ progress?: string | null | undefined; type: "CompilingCode"; }; export type EventListItemResponseDataCreatingRelease = { /** * Project name */ project: string; type: "CreatingRelease"; }; export type EventListItemResponseDataPushingResource = { /** * Name of the resource being pushed */ resourceName: string; /** * Type of the resource: "worker", "container" */ resourceType: string; type: "PushingResource"; }; export type EventListItemResponseDataPushingStack = { /** * 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 EventListItemResponseProgress = { /** * 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 EventListItemResponseProgressUnion = | EventListItemResponseProgress | any; export type EventListItemResponseDataPushingImage = { /** * Name of the image being pushed */ image: string; progress?: EventListItemResponseProgress | any | null | undefined; type: "PushingImage"; }; export type EventListItemResponseDataBuildingImage = { /** * Name of the image being built */ image: string; type: "BuildingImage"; }; export type EventListItemResponseDataBuildingResource = { /** * 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 EventListItemResponseDataDownloadingAlienRuntime = { /** * Target triple for the runtime */ targetTriple: string; type: "DownloadingAlienRuntime"; /** * URL being downloaded from */ url: string; }; export type EventListItemResponseDataRunningPreflights = { /** * Platform being targeted */ platform: string; /** * Name of the stack being checked */ stack: string; type: "RunningPreflights"; }; export type EventListItemResponseDataBuildingStack = { /** * Name of the stack being built */ stack: string; type: "BuildingStack"; }; export type EventListItemResponseDataFinished = { type: "Finished"; }; export type EventListItemResponseDataLoadingConfiguration = { type: "LoadingConfiguration"; }; export type EventListItemResponseDataUnion = | EventListItemResponseDataLoadingConfiguration | EventListItemResponseDataFinished | EventListItemResponseDataBuildingStack | EventListItemResponseDataRunningPreflights | EventListItemResponseDataDownloadingAlienRuntime | EventListItemResponseDataBuildingResource | EventListItemResponseDataBuildingImage | EventListItemResponseDataPushingImage | EventListItemResponseDataPushingStack | EventListItemResponseDataPushingResource | EventListItemResponseDataCreatingRelease | EventListItemResponseDataCompilingCode | EventListItemResponseDataStackStep | EventListItemResponseDataGeneratingCloudFormationTemplate | EventListItemResponseDataGeneratingTemplate | EventListItemResponseDataProvisioningAgent | EventListItemResponseDataUpdatingAgent | EventListItemResponseDataDeletingAgent | EventListItemResponseDataDebuggingAgent | EventListItemResponseDataPreparingEnvironment | EventListItemResponseDataDeployingStack | EventListItemResponseDataRunningTestWorker | EventListItemResponseDataCleaningUpStack | EventListItemResponseDataCleaningUpEnvironment | EventListItemResponseDataSettingUpPlatformContext | EventListItemResponseDataEnsuringDockerRepository | EventListItemResponseDataDeployingCloudFormationStack | EventListItemResponseDataAssumingRole | EventListItemResponseDataImportingStackStateFromCloudFormation | EventListItemResponseDataDeletingCloudFormationStack | EventListItemResponseDataEmptyingBuckets | EventListItemResponseDataDeploymentCreated | EventListItemResponseDataDeploymentReleased | EventListItemResponseDataDeploymentFailed | EventListItemResponseDataDeploymentDegraded | EventListItemResponseDataDeploymentRecovered | EventListItemResponseDataDeploymentDeleted | EventListItemResponseDataReleaseChannelUpdated | EventListItemResponseDataDeploymentReleaseChannelChanged | EventListItemResponseDataDeploymentRetryRequested | EventListItemResponseDataDeploymentRedeployRequested | EventListItemResponseDataDeploymentReleasePinned | EventListItemResponseDataDeploymentReleaseUnpinned | EventListItemResponseDataDeploymentEnvironmentUpdated | EventListItemResponseDataDeploymentDeletionRequested | DeploymentCredentialRotationEvent; export const EventListItemResponseStateSuccess = { Success: "success", } as const; export type EventListItemResponseStateSuccess = ClosedEnum< typeof EventListItemResponseStateSuccess >; export const EventListItemResponseStateStarted = { Started: "started", } as const; export type EventListItemResponseStateStarted = ClosedEnum< typeof EventListItemResponseStateStarted >; export const EventListItemResponseStateNone = { None: "none", } as const; export type EventListItemResponseStateNone = ClosedEnum< typeof EventListItemResponseStateNone >; /** * 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 EventListItemResponseStateError = { /** * 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 EventListItemResponseStateErrorUnion = | EventListItemResponseStateError | any; /** * Event failed with an error */ export type EventListItemResponseFailed = { error?: EventListItemResponseStateError | any | null | undefined; }; export type EventListItemResponseState = { /** * Event failed with an error */ failed: EventListItemResponseFailed; }; /** * Represents the state of an event */ export type EventListItemResponseStateUnion = | EventListItemResponseState | EventListItemResponseStateNone | EventListItemResponseStateStarted | EventListItemResponseStateSuccess; export type EventListItemResponse = { /** * 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: | EventListItemResponseDataLoadingConfiguration | EventListItemResponseDataFinished | EventListItemResponseDataBuildingStack | EventListItemResponseDataRunningPreflights | EventListItemResponseDataDownloadingAlienRuntime | EventListItemResponseDataBuildingResource | EventListItemResponseDataBuildingImage | EventListItemResponseDataPushingImage | EventListItemResponseDataPushingStack | EventListItemResponseDataPushingResource | EventListItemResponseDataCreatingRelease | EventListItemResponseDataCompilingCode | EventListItemResponseDataStackStep | EventListItemResponseDataGeneratingCloudFormationTemplate | EventListItemResponseDataGeneratingTemplate | EventListItemResponseDataProvisioningAgent | EventListItemResponseDataUpdatingAgent | EventListItemResponseDataDeletingAgent | EventListItemResponseDataDebuggingAgent | EventListItemResponseDataPreparingEnvironment | EventListItemResponseDataDeployingStack | EventListItemResponseDataRunningTestWorker | EventListItemResponseDataCleaningUpStack | EventListItemResponseDataCleaningUpEnvironment | EventListItemResponseDataSettingUpPlatformContext | EventListItemResponseDataEnsuringDockerRepository | EventListItemResponseDataDeployingCloudFormationStack | EventListItemResponseDataAssumingRole | EventListItemResponseDataImportingStackStateFromCloudFormation | EventListItemResponseDataDeletingCloudFormationStack | EventListItemResponseDataEmptyingBuckets | EventListItemResponseDataDeploymentCreated | EventListItemResponseDataDeploymentReleased | EventListItemResponseDataDeploymentFailed | EventListItemResponseDataDeploymentDegraded | EventListItemResponseDataDeploymentRecovered | EventListItemResponseDataDeploymentDeleted | EventListItemResponseDataReleaseChannelUpdated | EventListItemResponseDataDeploymentReleaseChannelChanged | EventListItemResponseDataDeploymentRetryRequested | EventListItemResponseDataDeploymentRedeployRequested | EventListItemResponseDataDeploymentReleasePinned | EventListItemResponseDataDeploymentReleaseUnpinned | EventListItemResponseDataDeploymentEnvironmentUpdated | EventListItemResponseDataDeploymentDeletionRequested | DeploymentCredentialRotationEvent; /** * Represents the state of an event */ state: | EventListItemResponseState | EventListItemResponseStateNone | EventListItemResponseStateStarted | EventListItemResponseStateSuccess; /** * Unique identifier for the project. */ projectId: string; createdAt: Date; /** * Unique identifier for the workspace. */ workspaceId: string; /** * createdAt of the event's referenced release, included when ?include=releaseCreatedAt is used */ releaseCreatedAt?: Date | null | undefined; }; /** @internal */ export const EventListItemResponseDataDeploymentDeletionRequested$inboundSchema: z.ZodType = z .object({ deploymentId: z.string(), type: z.literal("DeploymentDeletionRequested"), }); export function eventListItemResponseDataDeploymentDeletionRequestedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentDeletionRequested, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentDeletionRequested$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeploymentDeletionRequested' from JSON`, ); } /** @internal */ export const EventListItemResponseKind4$inboundSchema: z.ZodEnum< typeof EventListItemResponseKind4 > = z.enum(EventListItemResponseKind4); /** @internal */ export const EventListItemResponseActor4$inboundSchema: z.ZodType< EventListItemResponseActor4, unknown > = z.object({ email: z.nullable(z.string()).optional(), id: z.string(), kind: EventListItemResponseKind4$inboundSchema, }); export function eventListItemResponseActor4FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseActor4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseActor4' from JSON`, ); } /** @internal */ export const EventListItemResponseActorUnion4$inboundSchema: z.ZodType< EventListItemResponseActorUnion4, unknown > = z.union([z.lazy(() => EventListItemResponseActor4$inboundSchema), z.any()]); export function eventListItemResponseActorUnion4FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseActorUnion4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseActorUnion4' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeploymentEnvironmentUpdated$inboundSchema: z.ZodType = z .object({ actor: z.nullable( z.union([ z.lazy(() => EventListItemResponseActor4$inboundSchema), z.any(), ]), ).optional(), changedKeys: z.array(z.string()), deploymentId: z.string(), type: z.literal("DeploymentEnvironmentUpdated"), }); export function eventListItemResponseDataDeploymentEnvironmentUpdatedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentEnvironmentUpdated, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentEnvironmentUpdated$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeploymentEnvironmentUpdated' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeploymentReleaseUnpinned$inboundSchema: z.ZodType = z .object({ deploymentId: z.string(), previousPinnedReleaseId: z.string(), type: z.literal("DeploymentReleaseUnpinned"), }); export function eventListItemResponseDataDeploymentReleaseUnpinnedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentReleaseUnpinned, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentReleaseUnpinned$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeploymentReleaseUnpinned' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeploymentReleasePinned$inboundSchema: z.ZodType = z .object({ deploymentId: z.string(), pinnedReleaseId: z.string(), previousPinnedReleaseId: z.nullable(z.string()).optional(), type: z.literal("DeploymentReleasePinned"), }); export function eventListItemResponseDataDeploymentReleasePinnedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentReleasePinned, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentReleasePinned$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeploymentReleasePinned' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeploymentRedeployRequested$inboundSchema: z.ZodType = z .object({ deploymentId: z.string(), releaseId: z.string(), type: z.literal("DeploymentRedeployRequested"), }); export function eventListItemResponseDataDeploymentRedeployRequestedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentRedeployRequested, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentRedeployRequested$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeploymentRedeployRequested' from JSON`, ); } /** @internal */ export const EventListItemResponseKind3$inboundSchema: z.ZodEnum< typeof EventListItemResponseKind3 > = z.enum(EventListItemResponseKind3); /** @internal */ export const EventListItemResponseActor3$inboundSchema: z.ZodType< EventListItemResponseActor3, unknown > = z.object({ email: z.nullable(z.string()).optional(), id: z.string(), kind: EventListItemResponseKind3$inboundSchema, }); export function eventListItemResponseActor3FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseActor3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseActor3' from JSON`, ); } /** @internal */ export const EventListItemResponseActorUnion3$inboundSchema: z.ZodType< EventListItemResponseActorUnion3, unknown > = z.union([z.lazy(() => EventListItemResponseActor3$inboundSchema), z.any()]); export function eventListItemResponseActorUnion3FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseActorUnion3$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseActorUnion3' from JSON`, ); } /** @internal */ export const EventListItemResponsePreviousError$inboundSchema: z.ZodType< EventListItemResponsePreviousError, 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 eventListItemResponsePreviousErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponsePreviousError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponsePreviousError' from JSON`, ); } /** @internal */ export const EventListItemResponsePreviousErrorUnion$inboundSchema: z.ZodType< EventListItemResponsePreviousErrorUnion, unknown > = z.union([ z.lazy(() => EventListItemResponsePreviousError$inboundSchema), z.any(), ]); export function eventListItemResponsePreviousErrorUnionFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponsePreviousErrorUnion, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponsePreviousErrorUnion$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponsePreviousErrorUnion' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeploymentRetryRequested$inboundSchema: z.ZodType = z .object({ actor: z.nullable( z.union([ z.lazy(() => EventListItemResponseActor3$inboundSchema), z.any(), ]), ).optional(), attemptedReleaseId: z.nullable(z.string()).optional(), deploymentId: z.string(), previousError: z.nullable( z.union([ z.lazy(() => EventListItemResponsePreviousError$inboundSchema), z.any(), ]), ).optional(), type: z.literal("DeploymentRetryRequested"), }); export function eventListItemResponseDataDeploymentRetryRequestedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentRetryRequested, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentRetryRequested$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeploymentRetryRequested' from JSON`, ); } /** @internal */ export const EventListItemResponseKind2$inboundSchema: z.ZodEnum< typeof EventListItemResponseKind2 > = z.enum(EventListItemResponseKind2); /** @internal */ export const EventListItemResponseActor2$inboundSchema: z.ZodType< EventListItemResponseActor2, unknown > = z.object({ email: z.nullable(z.string()).optional(), id: z.string(), kind: EventListItemResponseKind2$inboundSchema, }); export function eventListItemResponseActor2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseActor2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseActor2' from JSON`, ); } /** @internal */ export const EventListItemResponseActorUnion2$inboundSchema: z.ZodType< EventListItemResponseActorUnion2, unknown > = z.union([z.lazy(() => EventListItemResponseActor2$inboundSchema), z.any()]); export function eventListItemResponseActorUnion2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseActorUnion2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseActorUnion2' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeploymentReleaseChannelChanged$inboundSchema: z.ZodType = z.object({ actor: z.nullable( z.union([ z.lazy(() => EventListItemResponseActor2$inboundSchema), z.any(), ]), ).optional(), channel: z.string(), deploymentId: z.string(), previousChannel: z.string(), type: z.literal("DeploymentReleaseChannelChanged"), }); export function eventListItemResponseDataDeploymentReleaseChannelChangedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentReleaseChannelChanged, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentReleaseChannelChanged$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataDeploymentReleaseChannelChanged' from JSON`, ); } /** @internal */ export const EventListItemResponseKind1$inboundSchema: z.ZodEnum< typeof EventListItemResponseKind1 > = z.enum(EventListItemResponseKind1); /** @internal */ export const EventListItemResponseActor1$inboundSchema: z.ZodType< EventListItemResponseActor1, unknown > = z.object({ email: z.nullable(z.string()).optional(), id: z.string(), kind: EventListItemResponseKind1$inboundSchema, }); export function eventListItemResponseActor1FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseActor1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseActor1' from JSON`, ); } /** @internal */ export const EventListItemResponseActorUnion1$inboundSchema: z.ZodType< EventListItemResponseActorUnion1, unknown > = z.union([z.lazy(() => EventListItemResponseActor1$inboundSchema), z.any()]); export function eventListItemResponseActorUnion1FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseActorUnion1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseActorUnion1' from JSON`, ); } /** @internal */ export const EventListItemResponseDataReleaseChannelUpdated$inboundSchema: z.ZodType = z.object( { actor: z.nullable(z.union([ z.lazy(() => EventListItemResponseActor1$inboundSchema), z.any(), ])).optional(), channel: z.string(), previousReleaseId: z.nullable(z.string()).optional(), releaseId: z.string(), type: z.literal("ReleaseChannelUpdated"), }, ); export function eventListItemResponseDataReleaseChannelUpdatedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataReleaseChannelUpdated, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataReleaseChannelUpdated$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataReleaseChannelUpdated' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeploymentDeleted$inboundSchema: z.ZodType = z.object({ deploymentId: z.string(), type: z.literal("DeploymentDeleted"), }); export function eventListItemResponseDataDeploymentDeletedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentDeleted, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentDeleted$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeploymentDeleted' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeploymentRecovered$inboundSchema: z.ZodType = z.object({ deploymentId: z.string(), releaseId: z.string(), type: z.literal("DeploymentRecovered"), }); export function eventListItemResponseDataDeploymentRecoveredFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentRecovered, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentRecovered$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeploymentRecovered' from JSON`, ); } /** @internal */ export const EventListItemResponseDataError2$inboundSchema: z.ZodType< EventListItemResponseDataError2, 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 eventListItemResponseDataError2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataError2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataError2' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeploymentDegraded$inboundSchema: z.ZodType = z.object({ deploymentId: z.string(), error: z.lazy(() => EventListItemResponseDataError2$inboundSchema), type: z.literal("DeploymentDegraded"), }); export function eventListItemResponseDataDeploymentDegradedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentDegraded, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentDegraded$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeploymentDegraded' from JSON`, ); } /** @internal */ export const EventListItemResponseDataError1$inboundSchema: z.ZodType< EventListItemResponseDataError1, 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 eventListItemResponseDataError1FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataError1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataError1' from JSON`, ); } /** @internal */ export const EventListItemResponsePhase$inboundSchema: z.ZodEnum< typeof EventListItemResponsePhase > = z.enum(EventListItemResponsePhase); /** @internal */ export const EventListItemResponseDataDeploymentFailed$inboundSchema: z.ZodType< EventListItemResponseDataDeploymentFailed, unknown > = z.object({ attemptedReleaseId: z.nullable(z.string()).optional(), deploymentId: z.string(), error: z.lazy(() => EventListItemResponseDataError1$inboundSchema), phase: EventListItemResponsePhase$inboundSchema, type: z.literal("DeploymentFailed"), }); export function eventListItemResponseDataDeploymentFailedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentFailed, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentFailed$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeploymentFailed' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeploymentReleased$inboundSchema: z.ZodType = z.object({ deploymentId: z.string(), previousReleaseId: z.nullable(z.string()).optional(), releaseId: z.string(), type: z.literal("DeploymentReleased"), }); export function eventListItemResponseDataDeploymentReleasedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentReleased, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentReleased$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeploymentReleased' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeploymentCreated$inboundSchema: z.ZodType = z.object({ deploymentGroupId: z.string(), deploymentId: z.string(), releaseId: z.nullable(z.string()).optional(), type: z.literal("DeploymentCreated"), }); export function eventListItemResponseDataDeploymentCreatedFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeploymentCreated, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeploymentCreated$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeploymentCreated' from JSON`, ); } /** @internal */ export const EventListItemResponseDataEmptyingBuckets$inboundSchema: z.ZodType< EventListItemResponseDataEmptyingBuckets, unknown > = z.object({ bucketNames: z.array(z.string()), type: z.literal("EmptyingBuckets"), }); export function eventListItemResponseDataEmptyingBucketsFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataEmptyingBuckets, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataEmptyingBuckets$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataEmptyingBuckets' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeletingCloudFormationStack$inboundSchema: z.ZodType = z .object({ cfnStackName: z.string(), currentStatus: z.string(), type: z.literal("DeletingCloudFormationStack"), }); export function eventListItemResponseDataDeletingCloudFormationStackFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeletingCloudFormationStack, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeletingCloudFormationStack$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeletingCloudFormationStack' from JSON`, ); } /** @internal */ export const EventListItemResponseDataImportingStackStateFromCloudFormation$inboundSchema: z.ZodType< EventListItemResponseDataImportingStackStateFromCloudFormation, unknown > = z.object({ cfnStackName: z.string(), type: z.literal("ImportingStackStateFromCloudFormation"), }); export function eventListItemResponseDataImportingStackStateFromCloudFormationFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataImportingStackStateFromCloudFormation, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataImportingStackStateFromCloudFormation$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataImportingStackStateFromCloudFormation' from JSON`, ); } /** @internal */ export const EventListItemResponseDataAssumingRole$inboundSchema: z.ZodType< EventListItemResponseDataAssumingRole, unknown > = z.object({ roleArn: z.string(), type: z.literal("AssumingRole"), }); export function eventListItemResponseDataAssumingRoleFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataAssumingRole$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataAssumingRole' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeployingCloudFormationStack$inboundSchema: z.ZodType = z .object({ cfnStackName: z.string(), currentStatus: z.string(), type: z.literal("DeployingCloudFormationStack"), }); export function eventListItemResponseDataDeployingCloudFormationStackFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeployingCloudFormationStack, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeployingCloudFormationStack$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeployingCloudFormationStack' from JSON`, ); } /** @internal */ export const EventListItemResponseDataEnsuringDockerRepository$inboundSchema: z.ZodType = z .object({ repositoryName: z.string(), type: z.literal("EnsuringDockerRepository"), }); export function eventListItemResponseDataEnsuringDockerRepositoryFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataEnsuringDockerRepository, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataEnsuringDockerRepository$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataEnsuringDockerRepository' from JSON`, ); } /** @internal */ export const EventListItemResponseDataSettingUpPlatformContext$inboundSchema: z.ZodType = z .object({ platformName: z.string(), type: z.literal("SettingUpPlatformContext"), }); export function eventListItemResponseDataSettingUpPlatformContextFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataSettingUpPlatformContext, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataSettingUpPlatformContext$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataSettingUpPlatformContext' from JSON`, ); } /** @internal */ export const EventListItemResponseDataCleaningUpEnvironment$inboundSchema: z.ZodType = z.object( { stackName: z.string(), strategyName: z.string(), type: z.literal("CleaningUpEnvironment"), }, ); export function eventListItemResponseDataCleaningUpEnvironmentFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataCleaningUpEnvironment, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataCleaningUpEnvironment$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataCleaningUpEnvironment' from JSON`, ); } /** @internal */ export const EventListItemResponseDataCleaningUpStack$inboundSchema: z.ZodType< EventListItemResponseDataCleaningUpStack, unknown > = z.object({ stackName: z.string(), strategyName: z.string(), type: z.literal("CleaningUpStack"), }); export function eventListItemResponseDataCleaningUpStackFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataCleaningUpStack, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataCleaningUpStack$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataCleaningUpStack' from JSON`, ); } /** @internal */ export const EventListItemResponseDataRunningTestWorker$inboundSchema: z.ZodType = z.object({ stackName: z.string(), type: z.literal("RunningTestWorker"), }); export function eventListItemResponseDataRunningTestWorkerFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataRunningTestWorker, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataRunningTestWorker$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataRunningTestWorker' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeployingStack$inboundSchema: z.ZodType< EventListItemResponseDataDeployingStack, unknown > = z.object({ stackName: z.string(), type: z.literal("DeployingStack"), }); export function eventListItemResponseDataDeployingStackFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDeployingStack, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDeployingStack$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDeployingStack' from JSON`, ); } /** @internal */ export const EventListItemResponseDataPreparingEnvironment$inboundSchema: z.ZodType = z.object({ strategyName: z.string(), type: z.literal("PreparingEnvironment"), }); export function eventListItemResponseDataPreparingEnvironmentFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataPreparingEnvironment, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataPreparingEnvironment$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataPreparingEnvironment' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDebuggingAgent$inboundSchema: z.ZodType< EventListItemResponseDataDebuggingAgent, unknown > = z.object({ agentId: z.string(), debugSessionId: z.string(), type: z.literal("DebuggingAgent"), }); export function eventListItemResponseDataDebuggingAgentFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDebuggingAgent, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDebuggingAgent$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDebuggingAgent' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDeletingAgent$inboundSchema: z.ZodType< EventListItemResponseDataDeletingAgent, unknown > = z.object({ agentId: z.string(), releaseId: z.string(), type: z.literal("DeletingAgent"), }); export function eventListItemResponseDataDeletingAgentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataDeletingAgent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataDeletingAgent' from JSON`, ); } /** @internal */ export const EventListItemResponseDataUpdatingAgent$inboundSchema: z.ZodType< EventListItemResponseDataUpdatingAgent, unknown > = z.object({ agentId: z.string(), releaseId: z.string(), type: z.literal("UpdatingAgent"), }); export function eventListItemResponseDataUpdatingAgentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataUpdatingAgent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataUpdatingAgent' from JSON`, ); } /** @internal */ export const EventListItemResponseDataProvisioningAgent$inboundSchema: z.ZodType = z.object({ agentId: z.string(), releaseId: z.string(), type: z.literal("ProvisioningAgent"), }); export function eventListItemResponseDataProvisioningAgentFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataProvisioningAgent, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataProvisioningAgent$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataProvisioningAgent' from JSON`, ); } /** @internal */ export const EventListItemResponseDataGeneratingTemplate$inboundSchema: z.ZodType = z.object({ platform: z.string(), type: z.literal("GeneratingTemplate"), }); export function eventListItemResponseDataGeneratingTemplateFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataGeneratingTemplate, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataGeneratingTemplate$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataGeneratingTemplate' from JSON`, ); } /** @internal */ export const EventListItemResponseDataGeneratingCloudFormationTemplate$inboundSchema: z.ZodType< EventListItemResponseDataGeneratingCloudFormationTemplate, unknown > = z.object({ type: z.literal("GeneratingCloudFormationTemplate"), }); export function eventListItemResponseDataGeneratingCloudFormationTemplateFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataGeneratingCloudFormationTemplate, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataGeneratingCloudFormationTemplate$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataGeneratingCloudFormationTemplate' from JSON`, ); } /** @internal */ export const EventListItemResponsePlatform$inboundSchema: z.ZodEnum< typeof EventListItemResponsePlatform > = z.enum(EventListItemResponsePlatform); /** @internal */ export const EventListItemResponseConfig$inboundSchema: z.ZodType< EventListItemResponseConfig, unknown > = collectExtraKeys$( z.object({ id: z.string(), type: z.string(), }).catchall(z.any()), "additionalProperties", true, ); export function eventListItemResponseConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseConfig' from JSON`, ); } /** @internal */ export const EventListItemResponseControllerPlatformEnum$inboundSchema: z.ZodEnum = z.enum( EventListItemResponseControllerPlatformEnum, ); /** @internal */ export const EventListItemResponseControllerPlatformUnion$inboundSchema: z.ZodType = z.union([ EventListItemResponseControllerPlatformEnum$inboundSchema, z.any(), ]); export function eventListItemResponseControllerPlatformUnionFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseControllerPlatformUnion, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseControllerPlatformUnion$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseControllerPlatformUnion' from JSON`, ); } /** @internal */ export const EventListItemResponseDependency$inboundSchema: z.ZodType< EventListItemResponseDependency, unknown > = z.object({ id: z.string(), type: z.string(), }); export function eventListItemResponseDependencyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDependency$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDependency' from JSON`, ); } /** @internal */ export const EventListItemResponseErrorNextState$inboundSchema: z.ZodType< EventListItemResponseErrorNextState, 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 eventListItemResponseErrorNextStateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseErrorNextState$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseErrorNextState' from JSON`, ); } /** @internal */ export const EventListItemResponseNextStateErrorUnion$inboundSchema: z.ZodType< EventListItemResponseNextStateErrorUnion, unknown > = z.union([ z.lazy(() => EventListItemResponseErrorNextState$inboundSchema), z.any(), ]); export function eventListItemResponseNextStateErrorUnionFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseNextStateErrorUnion, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseNextStateErrorUnion$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseNextStateErrorUnion' from JSON`, ); } /** @internal */ export const EventListItemResponseLifecycleEnum$inboundSchema: z.ZodEnum< typeof EventListItemResponseLifecycleEnum > = z.enum(EventListItemResponseLifecycleEnum); /** @internal */ export const EventListItemResponseLifecycleUnion$inboundSchema: z.ZodType< EventListItemResponseLifecycleUnion, unknown > = z.union([EventListItemResponseLifecycleEnum$inboundSchema, z.any()]); export function eventListItemResponseLifecycleUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseLifecycleUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseLifecycleUnion' from JSON`, ); } /** @internal */ export const EventListItemResponseOutputs$inboundSchema: z.ZodType< EventListItemResponseOutputs, unknown > = collectExtraKeys$( z.object({ type: z.string(), }).catchall(z.any()), "additionalProperties", true, ); export function eventListItemResponseOutputsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseOutputs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseOutputs' from JSON`, ); } /** @internal */ export const EventListItemResponseOutputsUnion$inboundSchema: z.ZodType< EventListItemResponseOutputsUnion, unknown > = z.union([ z.lazy(() => EventListItemResponseOutputs$inboundSchema), z.any(), ]); export function eventListItemResponseOutputsUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseOutputsUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseOutputsUnion' from JSON`, ); } /** @internal */ export const EventListItemResponsePreviousConfig$inboundSchema: z.ZodType< EventListItemResponsePreviousConfig, unknown > = collectExtraKeys$( z.object({ id: z.string(), type: z.string(), }).catchall(z.any()), "additionalProperties", true, ); export function eventListItemResponsePreviousConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponsePreviousConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponsePreviousConfig' from JSON`, ); } /** @internal */ export const EventListItemResponsePreviousConfigUnion$inboundSchema: z.ZodType< EventListItemResponsePreviousConfigUnion, unknown > = z.union([ z.lazy(() => EventListItemResponsePreviousConfig$inboundSchema), z.any(), ]); export function eventListItemResponsePreviousConfigUnionFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponsePreviousConfigUnion, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponsePreviousConfigUnion$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponsePreviousConfigUnion' from JSON`, ); } /** @internal */ export const EventListItemResponseStatus$inboundSchema: z.ZodEnum< typeof EventListItemResponseStatus > = z.enum(EventListItemResponseStatus); /** @internal */ export const EventListItemResponseResources$inboundSchema: z.ZodType< EventListItemResponseResources, unknown > = z.object({ _internal: z.nullable(z.any()).optional(), config: z.lazy(() => EventListItemResponseConfig$inboundSchema), controllerPlatform: z.nullable( z.union([ EventListItemResponseControllerPlatformEnum$inboundSchema, z.any(), ]), ).optional(), dependencies: z.array( z.lazy(() => EventListItemResponseDependency$inboundSchema), ).optional(), error: z.nullable( z.union([ z.lazy(() => EventListItemResponseErrorNextState$inboundSchema), z.any(), ]), ).optional(), lastFailedState: z.nullable(z.any()).optional(), lifecycle: z.nullable( z.union([EventListItemResponseLifecycleEnum$inboundSchema, z.any()]), ).optional(), outputs: z.nullable( z.union([ z.lazy(() => EventListItemResponseOutputs$inboundSchema), z.any(), ]), ).optional(), previousConfig: z.nullable( z.union([ z.lazy(() => EventListItemResponsePreviousConfig$inboundSchema), z.any(), ]), ).optional(), remoteBindingParams: z.nullable(z.any()).optional(), retryAttempt: z.int().optional(), status: EventListItemResponseStatus$inboundSchema, type: z.string(), }).transform((v) => { return remap$(v, { "_internal": "internal", }); }); export function eventListItemResponseResourcesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseResources$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseResources' from JSON`, ); } /** @internal */ export const EventListItemResponseNextState$inboundSchema: z.ZodType< EventListItemResponseNextState, unknown > = z.object({ platform: EventListItemResponsePlatform$inboundSchema, resourcePrefix: z.string(), resources: z.record( z.string(), z.lazy(() => EventListItemResponseResources$inboundSchema), ), }); export function eventListItemResponseNextStateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseNextState$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseNextState' from JSON`, ); } /** @internal */ export const EventListItemResponseDataStackStep$inboundSchema: z.ZodType< EventListItemResponseDataStackStep, unknown > = z.object({ nextState: z.lazy(() => EventListItemResponseNextState$inboundSchema), suggestedDelayMs: z.nullable(z.int()).optional(), type: z.literal("StackStep"), }); export function eventListItemResponseDataStackStepFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataStackStep$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataStackStep' from JSON`, ); } /** @internal */ export const EventListItemResponseDataCompilingCode$inboundSchema: z.ZodType< EventListItemResponseDataCompilingCode, unknown > = z.object({ language: z.string(), progress: z.nullable(z.string()).optional(), type: z.literal("CompilingCode"), }); export function eventListItemResponseDataCompilingCodeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataCompilingCode$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataCompilingCode' from JSON`, ); } /** @internal */ export const EventListItemResponseDataCreatingRelease$inboundSchema: z.ZodType< EventListItemResponseDataCreatingRelease, unknown > = z.object({ project: z.string(), type: z.literal("CreatingRelease"), }); export function eventListItemResponseDataCreatingReleaseFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataCreatingRelease, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataCreatingRelease$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataCreatingRelease' from JSON`, ); } /** @internal */ export const EventListItemResponseDataPushingResource$inboundSchema: z.ZodType< EventListItemResponseDataPushingResource, unknown > = z.object({ resourceName: z.string(), resourceType: z.string(), type: z.literal("PushingResource"), }); export function eventListItemResponseDataPushingResourceFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataPushingResource, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataPushingResource$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataPushingResource' from JSON`, ); } /** @internal */ export const EventListItemResponseDataPushingStack$inboundSchema: z.ZodType< EventListItemResponseDataPushingStack, unknown > = z.object({ destination: z.nullable(z.string()).optional(), platform: z.string(), stack: z.string(), type: z.literal("PushingStack"), }); export function eventListItemResponseDataPushingStackFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataPushingStack$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataPushingStack' from JSON`, ); } /** @internal */ export const EventListItemResponseProgress$inboundSchema: z.ZodType< EventListItemResponseProgress, unknown > = z.object({ bytesUploaded: z.int(), layersUploaded: z.int(), operation: z.string(), totalBytes: z.int(), totalLayers: z.int(), }); export function eventListItemResponseProgressFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseProgress$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseProgress' from JSON`, ); } /** @internal */ export const EventListItemResponseProgressUnion$inboundSchema: z.ZodType< EventListItemResponseProgressUnion, unknown > = z.union([ z.lazy(() => EventListItemResponseProgress$inboundSchema), z.any(), ]); export function eventListItemResponseProgressUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseProgressUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseProgressUnion' from JSON`, ); } /** @internal */ export const EventListItemResponseDataPushingImage$inboundSchema: z.ZodType< EventListItemResponseDataPushingImage, unknown > = z.object({ image: z.string(), progress: z.nullable( z.union([ z.lazy(() => EventListItemResponseProgress$inboundSchema), z.any(), ]), ).optional(), type: z.literal("PushingImage"), }); export function eventListItemResponseDataPushingImageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataPushingImage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataPushingImage' from JSON`, ); } /** @internal */ export const EventListItemResponseDataBuildingImage$inboundSchema: z.ZodType< EventListItemResponseDataBuildingImage, unknown > = z.object({ image: z.string(), type: z.literal("BuildingImage"), }); export function eventListItemResponseDataBuildingImageFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataBuildingImage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataBuildingImage' from JSON`, ); } /** @internal */ export const EventListItemResponseDataBuildingResource$inboundSchema: z.ZodType< EventListItemResponseDataBuildingResource, unknown > = z.object({ relatedResources: z.array(z.string()).optional(), resourceName: z.string(), resourceType: z.string(), type: z.literal("BuildingResource"), }); export function eventListItemResponseDataBuildingResourceFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataBuildingResource, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataBuildingResource$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataBuildingResource' from JSON`, ); } /** @internal */ export const EventListItemResponseDataDownloadingAlienRuntime$inboundSchema: z.ZodType = z .object({ targetTriple: z.string(), type: z.literal("DownloadingAlienRuntime"), url: z.string(), }); export function eventListItemResponseDataDownloadingAlienRuntimeFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataDownloadingAlienRuntime, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataDownloadingAlienRuntime$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataDownloadingAlienRuntime' from JSON`, ); } /** @internal */ export const EventListItemResponseDataRunningPreflights$inboundSchema: z.ZodType = z.object({ platform: z.string(), stack: z.string(), type: z.literal("RunningPreflights"), }); export function eventListItemResponseDataRunningPreflightsFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataRunningPreflights, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataRunningPreflights$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataRunningPreflights' from JSON`, ); } /** @internal */ export const EventListItemResponseDataBuildingStack$inboundSchema: z.ZodType< EventListItemResponseDataBuildingStack, unknown > = z.object({ stack: z.string(), type: z.literal("BuildingStack"), }); export function eventListItemResponseDataBuildingStackFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataBuildingStack$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataBuildingStack' from JSON`, ); } /** @internal */ export const EventListItemResponseDataFinished$inboundSchema: z.ZodType< EventListItemResponseDataFinished, unknown > = z.object({ type: z.literal("Finished"), }); export function eventListItemResponseDataFinishedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataFinished$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataFinished' from JSON`, ); } /** @internal */ export const EventListItemResponseDataLoadingConfiguration$inboundSchema: z.ZodType = z.object({ type: z.literal("LoadingConfiguration"), }); export function eventListItemResponseDataLoadingConfigurationFromJSON( jsonString: string, ): SafeParseResult< EventListItemResponseDataLoadingConfiguration, SDKValidationError > { return safeParse( jsonString, (x) => EventListItemResponseDataLoadingConfiguration$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EventListItemResponseDataLoadingConfiguration' from JSON`, ); } /** @internal */ export const EventListItemResponseDataUnion$inboundSchema: z.ZodType< EventListItemResponseDataUnion, unknown > = z.union([ z.lazy(() => EventListItemResponseDataLoadingConfiguration$inboundSchema), z.lazy(() => EventListItemResponseDataFinished$inboundSchema), z.lazy(() => EventListItemResponseDataBuildingStack$inboundSchema), z.lazy(() => EventListItemResponseDataRunningPreflights$inboundSchema), z.lazy(() => EventListItemResponseDataDownloadingAlienRuntime$inboundSchema), z.lazy(() => EventListItemResponseDataBuildingResource$inboundSchema), z.lazy(() => EventListItemResponseDataBuildingImage$inboundSchema), z.lazy(() => EventListItemResponseDataPushingImage$inboundSchema), z.lazy(() => EventListItemResponseDataPushingStack$inboundSchema), z.lazy(() => EventListItemResponseDataPushingResource$inboundSchema), z.lazy(() => EventListItemResponseDataCreatingRelease$inboundSchema), z.lazy(() => EventListItemResponseDataCompilingCode$inboundSchema), z.lazy(() => EventListItemResponseDataStackStep$inboundSchema), z.lazy(() => EventListItemResponseDataGeneratingCloudFormationTemplate$inboundSchema ), z.lazy(() => EventListItemResponseDataGeneratingTemplate$inboundSchema), z.lazy(() => EventListItemResponseDataProvisioningAgent$inboundSchema), z.lazy(() => EventListItemResponseDataUpdatingAgent$inboundSchema), z.lazy(() => EventListItemResponseDataDeletingAgent$inboundSchema), z.lazy(() => EventListItemResponseDataDebuggingAgent$inboundSchema), z.lazy(() => EventListItemResponseDataPreparingEnvironment$inboundSchema), z.lazy(() => EventListItemResponseDataDeployingStack$inboundSchema), z.lazy(() => EventListItemResponseDataRunningTestWorker$inboundSchema), z.lazy(() => EventListItemResponseDataCleaningUpStack$inboundSchema), z.lazy(() => EventListItemResponseDataCleaningUpEnvironment$inboundSchema), z.lazy(() => EventListItemResponseDataSettingUpPlatformContext$inboundSchema), z.lazy(() => EventListItemResponseDataEnsuringDockerRepository$inboundSchema), z.lazy(() => EventListItemResponseDataDeployingCloudFormationStack$inboundSchema ), z.lazy(() => EventListItemResponseDataAssumingRole$inboundSchema), z.lazy(() => EventListItemResponseDataImportingStackStateFromCloudFormation$inboundSchema ), z.lazy(() => EventListItemResponseDataDeletingCloudFormationStack$inboundSchema ), z.lazy(() => EventListItemResponseDataEmptyingBuckets$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentCreated$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentReleased$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentFailed$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentDegraded$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentRecovered$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentDeleted$inboundSchema), z.lazy(() => EventListItemResponseDataReleaseChannelUpdated$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentReleaseChannelChanged$inboundSchema ), z.lazy(() => EventListItemResponseDataDeploymentRetryRequested$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentRedeployRequested$inboundSchema ), z.lazy(() => EventListItemResponseDataDeploymentReleasePinned$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentReleaseUnpinned$inboundSchema ), z.lazy(() => EventListItemResponseDataDeploymentEnvironmentUpdated$inboundSchema ), z.lazy(() => EventListItemResponseDataDeploymentDeletionRequested$inboundSchema ), DeploymentCredentialRotationEvent$inboundSchema, ]); export function eventListItemResponseDataUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseDataUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseDataUnion' from JSON`, ); } /** @internal */ export const EventListItemResponseStateSuccess$inboundSchema: z.ZodEnum< typeof EventListItemResponseStateSuccess > = z.enum(EventListItemResponseStateSuccess); /** @internal */ export const EventListItemResponseStateStarted$inboundSchema: z.ZodEnum< typeof EventListItemResponseStateStarted > = z.enum(EventListItemResponseStateStarted); /** @internal */ export const EventListItemResponseStateNone$inboundSchema: z.ZodEnum< typeof EventListItemResponseStateNone > = z.enum(EventListItemResponseStateNone); /** @internal */ export const EventListItemResponseStateError$inboundSchema: z.ZodType< EventListItemResponseStateError, 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 eventListItemResponseStateErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseStateError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseStateError' from JSON`, ); } /** @internal */ export const EventListItemResponseStateErrorUnion$inboundSchema: z.ZodType< EventListItemResponseStateErrorUnion, unknown > = z.union([ z.lazy(() => EventListItemResponseStateError$inboundSchema), z.any(), ]); export function eventListItemResponseStateErrorUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseStateErrorUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseStateErrorUnion' from JSON`, ); } /** @internal */ export const EventListItemResponseFailed$inboundSchema: z.ZodType< EventListItemResponseFailed, unknown > = z.object({ error: z.nullable( z.union([ z.lazy(() => EventListItemResponseStateError$inboundSchema), z.any(), ]), ).optional(), }); export function eventListItemResponseFailedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseFailed$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseFailed' from JSON`, ); } /** @internal */ export const EventListItemResponseState$inboundSchema: z.ZodType< EventListItemResponseState, unknown > = z.object({ failed: z.lazy(() => EventListItemResponseFailed$inboundSchema), }); export function eventListItemResponseStateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseState$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseState' from JSON`, ); } /** @internal */ export const EventListItemResponseStateUnion$inboundSchema: z.ZodType< EventListItemResponseStateUnion, unknown > = z.union([ z.lazy(() => EventListItemResponseState$inboundSchema), EventListItemResponseStateNone$inboundSchema, EventListItemResponseStateStarted$inboundSchema, EventListItemResponseStateSuccess$inboundSchema, ]); export function eventListItemResponseStateUnionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponseStateUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponseStateUnion' from JSON`, ); } /** @internal */ export const EventListItemResponse$inboundSchema: z.ZodType< EventListItemResponse, unknown > = 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(() => EventListItemResponseDataLoadingConfiguration$inboundSchema), z.lazy(() => EventListItemResponseDataFinished$inboundSchema), z.lazy(() => EventListItemResponseDataBuildingStack$inboundSchema), z.lazy(() => EventListItemResponseDataRunningPreflights$inboundSchema), z.lazy(() => EventListItemResponseDataDownloadingAlienRuntime$inboundSchema ), z.lazy(() => EventListItemResponseDataBuildingResource$inboundSchema), z.lazy(() => EventListItemResponseDataBuildingImage$inboundSchema), z.lazy(() => EventListItemResponseDataPushingImage$inboundSchema), z.lazy(() => EventListItemResponseDataPushingStack$inboundSchema), z.lazy(() => EventListItemResponseDataPushingResource$inboundSchema), z.lazy(() => EventListItemResponseDataCreatingRelease$inboundSchema), z.lazy(() => EventListItemResponseDataCompilingCode$inboundSchema), z.lazy(() => EventListItemResponseDataStackStep$inboundSchema), z.lazy(() => EventListItemResponseDataGeneratingCloudFormationTemplate$inboundSchema ), z.lazy(() => EventListItemResponseDataGeneratingTemplate$inboundSchema), z.lazy(() => EventListItemResponseDataProvisioningAgent$inboundSchema), z.lazy(() => EventListItemResponseDataUpdatingAgent$inboundSchema), z.lazy(() => EventListItemResponseDataDeletingAgent$inboundSchema), z.lazy(() => EventListItemResponseDataDebuggingAgent$inboundSchema), z.lazy(() => EventListItemResponseDataPreparingEnvironment$inboundSchema), z.lazy(() => EventListItemResponseDataDeployingStack$inboundSchema), z.lazy(() => EventListItemResponseDataRunningTestWorker$inboundSchema), z.lazy(() => EventListItemResponseDataCleaningUpStack$inboundSchema), z.lazy(() => EventListItemResponseDataCleaningUpEnvironment$inboundSchema), z.lazy(() => EventListItemResponseDataSettingUpPlatformContext$inboundSchema ), z.lazy(() => EventListItemResponseDataEnsuringDockerRepository$inboundSchema ), z.lazy(() => EventListItemResponseDataDeployingCloudFormationStack$inboundSchema ), z.lazy(() => EventListItemResponseDataAssumingRole$inboundSchema), z.lazy(() => EventListItemResponseDataImportingStackStateFromCloudFormation$inboundSchema ), z.lazy(() => EventListItemResponseDataDeletingCloudFormationStack$inboundSchema ), z.lazy(() => EventListItemResponseDataEmptyingBuckets$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentCreated$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentReleased$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentFailed$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentDegraded$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentRecovered$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentDeleted$inboundSchema), z.lazy(() => EventListItemResponseDataReleaseChannelUpdated$inboundSchema), z.lazy(() => EventListItemResponseDataDeploymentReleaseChannelChanged$inboundSchema ), z.lazy(() => EventListItemResponseDataDeploymentRetryRequested$inboundSchema ), z.lazy(() => EventListItemResponseDataDeploymentRedeployRequested$inboundSchema ), z.lazy(() => EventListItemResponseDataDeploymentReleasePinned$inboundSchema ), z.lazy(() => EventListItemResponseDataDeploymentReleaseUnpinned$inboundSchema ), z.lazy(() => EventListItemResponseDataDeploymentEnvironmentUpdated$inboundSchema ), z.lazy(() => EventListItemResponseDataDeploymentDeletionRequested$inboundSchema ), DeploymentCredentialRotationEvent$inboundSchema, ]), state: z.union([ z.lazy(() => EventListItemResponseState$inboundSchema), EventListItemResponseStateNone$inboundSchema, EventListItemResponseStateStarted$inboundSchema, EventListItemResponseStateSuccess$inboundSchema, ]), projectId: z.string(), createdAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)), workspaceId: z.string(), releaseCreatedAt: z.nullable( z.iso.datetime({ offset: true }).transform(v => new Date(v)), ).optional(), }); export function eventListItemResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventListItemResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventListItemResponse' from JSON`, ); }