/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: cdbd42dd1b39 */ import * as z from "zod/v4"; import { ClosedEnum } from "../types/enums.js"; import { DeploymentSetupConfigInput, DeploymentSetupConfigInput$Outbound, DeploymentSetupConfigInput$outboundSchema, } from "./deploymentsetupconfiginput.js"; import { DeploymentSetupItemSelection, DeploymentSetupItemSelection$Outbound, DeploymentSetupItemSelection$outboundSchema, } from "./deploymentsetupitemselection.js"; import { SetupLinkEntryPoint, SetupLinkEntryPoint$Outbound, SetupLinkEntryPoint$outboundSchema, } from "./setuplinkentrypoint.js"; import { StackInputValueRequest, StackInputValueRequest$Outbound, StackInputValueRequest$outboundSchema, } from "./stackinputvaluerequest.js"; export const CreateSetupLinkRequestSetupItemsEnum = { All: "all", } as const; export type CreateSetupLinkRequestSetupItemsEnum = ClosedEnum< typeof CreateSetupLinkRequestSetupItemsEnum >; /** * Setup to include. Use 'all' for every capability enabled for the Project. Omit to preserve the standard deployment-link behavior. */ export type CreateSetupLinkRequestSetupItemsUnion = | CreateSetupLinkRequestSetupItemsEnum | Array; export type CreateSetupLinkRequest = { /** * Case-sensitive, URL- and header-safe identifier from the integrating application. */ externalId: string; /** * Deployment group name. */ name: string; /** * Project ID or name this deployment group belongs to */ project: string; /** * Maximum number of deployments for newly created groups */ maxDeployments?: number | undefined; /** * Description for the API key */ description?: string | undefined; /** * Optional expiration date for the API key */ expiresAt?: Date | null | undefined; deploymentSetupConfig?: DeploymentSetupConfigInput | undefined; /** * Setup to include. Use 'all' for every capability enabled for the Project. Omit to preserve the standard deployment-link behavior. */ setupItems?: | CreateSetupLinkRequestSetupItemsEnum | Array | undefined; /** * Portal destination to open first. This controls navigation, not authorization. */ entryPoint?: SetupLinkEntryPoint | undefined; inputValues?: { [k: string]: StackInputValueRequest } | undefined; /** * Recover Remote Operator bootstrap values for this exact existing group only if it has no deployments. Serialized with registration; never creates or rebinds a group. */ recoveryDeploymentGroupId?: string | undefined; }; /** @internal */ export const CreateSetupLinkRequestSetupItemsEnum$outboundSchema: z.ZodEnum< typeof CreateSetupLinkRequestSetupItemsEnum > = z.enum(CreateSetupLinkRequestSetupItemsEnum); /** @internal */ export type CreateSetupLinkRequestSetupItemsUnion$Outbound = | string | Array; /** @internal */ export const CreateSetupLinkRequestSetupItemsUnion$outboundSchema: z.ZodType< CreateSetupLinkRequestSetupItemsUnion$Outbound, CreateSetupLinkRequestSetupItemsUnion > = z.union([ CreateSetupLinkRequestSetupItemsEnum$outboundSchema, z.array(DeploymentSetupItemSelection$outboundSchema), ]); export function createSetupLinkRequestSetupItemsUnionToJSON( createSetupLinkRequestSetupItemsUnion: CreateSetupLinkRequestSetupItemsUnion, ): string { return JSON.stringify( CreateSetupLinkRequestSetupItemsUnion$outboundSchema.parse( createSetupLinkRequestSetupItemsUnion, ), ); } /** @internal */ export type CreateSetupLinkRequest$Outbound = { externalId: string; name: string; project: string; maxDeployments: number; description?: string | undefined; expiresAt?: string | null | undefined; deploymentSetupConfig?: DeploymentSetupConfigInput$Outbound | undefined; setupItems?: | string | Array | undefined; entryPoint?: SetupLinkEntryPoint$Outbound | undefined; inputValues?: { [k: string]: StackInputValueRequest$Outbound } | undefined; recoveryDeploymentGroupId?: string | undefined; }; /** @internal */ export const CreateSetupLinkRequest$outboundSchema: z.ZodType< CreateSetupLinkRequest$Outbound, CreateSetupLinkRequest > = z.object({ externalId: z.string(), name: z.string(), project: z.string(), maxDeployments: z.int().default(100), description: z.string().optional(), expiresAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), deploymentSetupConfig: DeploymentSetupConfigInput$outboundSchema.optional(), setupItems: z.union([ CreateSetupLinkRequestSetupItemsEnum$outboundSchema, z.array(DeploymentSetupItemSelection$outboundSchema), ]).optional(), entryPoint: SetupLinkEntryPoint$outboundSchema.optional(), inputValues: z.record(z.string(), StackInputValueRequest$outboundSchema) .optional(), recoveryDeploymentGroupId: z.string().optional(), }); export function createSetupLinkRequestToJSON( createSetupLinkRequest: CreateSetupLinkRequest, ): string { return JSON.stringify( CreateSetupLinkRequest$outboundSchema.parse(createSetupLinkRequest), ); }