/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 3902e516ffe6 */ import * as z from "zod/v4"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetDeploymentGroupGlobals = { /** * Workspace name. Platform API keys already select a workspace; other authentication methods can configure it once on the SDK client. */ workspace?: string | undefined; }; export const GetDeploymentGroupInclude = { Project: "project", } as const; export type GetDeploymentGroupInclude = ClosedEnum< typeof GetDeploymentGroupInclude >; export type GetDeploymentGroupRequest = { /** * Unique identifier for the deployment group. */ id: string; /** * Optional fields to include: project */ include?: Array | undefined; }; /** * Project info, included when ?include=project is used */ export type GetDeploymentGroupProject = { /** * Project ID */ id: string; /** * Project name */ name: string; }; /** * Deployment group details */ export type GetDeploymentGroupResponse = { /** * Unique identifier for the deployment group. */ id: string; /** * Deployment group name. */ name: string; /** * Case-sensitive, URL- and header-safe identifier from the integrating application. */ externalId: string | null; /** * Unique identifier for the project. */ projectId: string; /** * Unique identifier for the workspace. */ workspaceId: string; /** * Maximum number of deployments allowed in this deployment group */ maxDeployments: number; createdAt: Date; /** * Project info, included when ?include=project is used */ project?: GetDeploymentGroupProject | null | undefined; /** * Current number of deployments in this deployment group */ deploymentCount: number; }; /** @internal */ export const GetDeploymentGroupInclude$outboundSchema: z.ZodEnum< typeof GetDeploymentGroupInclude > = z.enum(GetDeploymentGroupInclude); /** @internal */ export type GetDeploymentGroupRequest$Outbound = { id: string; include?: Array | undefined; }; /** @internal */ export const GetDeploymentGroupRequest$outboundSchema: z.ZodType< GetDeploymentGroupRequest$Outbound, GetDeploymentGroupRequest > = z.object({ id: z.string(), include: z.array(GetDeploymentGroupInclude$outboundSchema).optional(), }); export function getDeploymentGroupRequestToJSON( getDeploymentGroupRequest: GetDeploymentGroupRequest, ): string { return JSON.stringify( GetDeploymentGroupRequest$outboundSchema.parse(getDeploymentGroupRequest), ); } /** @internal */ export const GetDeploymentGroupProject$inboundSchema: z.ZodType< GetDeploymentGroupProject, unknown > = z.object({ id: z.string(), name: z.string(), }); export function getDeploymentGroupProjectFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetDeploymentGroupProject$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDeploymentGroupProject' from JSON`, ); } /** @internal */ export const GetDeploymentGroupResponse$inboundSchema: z.ZodType< GetDeploymentGroupResponse, unknown > = z.object({ id: z.string(), name: z.string(), externalId: z.nullable(z.string()), projectId: z.string(), workspaceId: z.string(), maxDeployments: z.int().default(100), createdAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)), project: z.nullable(z.lazy(() => GetDeploymentGroupProject$inboundSchema)) .optional(), deploymentCount: z.int(), }); export function getDeploymentGroupResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetDeploymentGroupResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDeploymentGroupResponse' from JSON`, ); }