/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 4ab16cb56a1c */ 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 GetManagerManagementConfigGlobals = { /** * Workspace name. Platform API keys already select a workspace; other authentication methods can configure it once on the SDK client. */ workspace?: string | undefined; }; /** * Represents the target cloud platform. */ export const GetManagerManagementConfigQueryParamPlatform = { Aws: "aws", Gcp: "gcp", Azure: "azure", Kubernetes: "kubernetes", Machines: "machines", Local: "local", Test: "test", } as const; /** * Represents the target cloud platform. */ export type GetManagerManagementConfigQueryParamPlatform = ClosedEnum< typeof GetManagerManagementConfigQueryParamPlatform >; export type GetManagerManagementConfigRequest = { /** * Unique identifier for a manager. */ id: string; /** * Represents the target cloud platform. */ platform: GetManagerManagementConfigQueryParamPlatform; }; export type GetManagerManagementConfigKubernetes = { platform: "kubernetes"; }; /** * Azure management configuration extracted from stack settings */ export type GetManagerManagementConfigAzure = { /** * The managing Azure Tenant ID for cross-tenant access */ managingTenantId: string; /** * OIDC issuer URL trusted by the target-side managed identity. */ oidcIssuer: string; /** * OIDC subject claim trusted by the target-side managed identity. */ oidcSubject: string; platform: "azure"; }; /** * GCP management configuration extracted from stack settings */ export type GetManagerManagementConfigGcp = { /** * Service account email for management roles */ serviceAccountEmail: string; platform: "gcp"; }; /** * AWS management configuration extracted from stack settings */ export type GetManagerManagementConfigAws = { /** * The managing AWS IAM role ARN that can assume cross-account roles */ managingRoleArn: string; platform: "aws"; }; /** * Management configuration for different cloud platforms. * * @remarks * * Platform-derived configuration for cross-account/cross-tenant access. * This is NOT user-specified - it's derived from the Manager's ServiceAccount. */ export type GetManagerManagementConfigResponse = | GetManagerManagementConfigAws | GetManagerManagementConfigGcp | GetManagerManagementConfigAzure | GetManagerManagementConfigKubernetes; /** @internal */ export const GetManagerManagementConfigQueryParamPlatform$outboundSchema: z.ZodEnum = z.enum( GetManagerManagementConfigQueryParamPlatform, ); /** @internal */ export type GetManagerManagementConfigRequest$Outbound = { id: string; platform: string; }; /** @internal */ export const GetManagerManagementConfigRequest$outboundSchema: z.ZodType< GetManagerManagementConfigRequest$Outbound, GetManagerManagementConfigRequest > = z.object({ id: z.string(), platform: GetManagerManagementConfigQueryParamPlatform$outboundSchema, }); export function getManagerManagementConfigRequestToJSON( getManagerManagementConfigRequest: GetManagerManagementConfigRequest, ): string { return JSON.stringify( GetManagerManagementConfigRequest$outboundSchema.parse( getManagerManagementConfigRequest, ), ); } /** @internal */ export const GetManagerManagementConfigKubernetes$inboundSchema: z.ZodType< GetManagerManagementConfigKubernetes, unknown > = z.object({ platform: z.literal("kubernetes"), }); export function getManagerManagementConfigKubernetesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetManagerManagementConfigKubernetes$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetManagerManagementConfigKubernetes' from JSON`, ); } /** @internal */ export const GetManagerManagementConfigAzure$inboundSchema: z.ZodType< GetManagerManagementConfigAzure, unknown > = z.object({ managingTenantId: z.string(), oidcIssuer: z.string(), oidcSubject: z.string(), platform: z.literal("azure"), }); export function getManagerManagementConfigAzureFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetManagerManagementConfigAzure$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetManagerManagementConfigAzure' from JSON`, ); } /** @internal */ export const GetManagerManagementConfigGcp$inboundSchema: z.ZodType< GetManagerManagementConfigGcp, unknown > = z.object({ serviceAccountEmail: z.string(), platform: z.literal("gcp"), }); export function getManagerManagementConfigGcpFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetManagerManagementConfigGcp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetManagerManagementConfigGcp' from JSON`, ); } /** @internal */ export const GetManagerManagementConfigAws$inboundSchema: z.ZodType< GetManagerManagementConfigAws, unknown > = z.object({ managingRoleArn: z.string(), platform: z.literal("aws"), }); export function getManagerManagementConfigAwsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetManagerManagementConfigAws$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetManagerManagementConfigAws' from JSON`, ); } /** @internal */ export const GetManagerManagementConfigResponse$inboundSchema: z.ZodType< GetManagerManagementConfigResponse, unknown > = z.union([ z.lazy(() => GetManagerManagementConfigAws$inboundSchema), z.lazy(() => GetManagerManagementConfigGcp$inboundSchema), z.lazy(() => GetManagerManagementConfigAzure$inboundSchema), z.lazy(() => GetManagerManagementConfigKubernetes$inboundSchema), ]); export function getManagerManagementConfigResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetManagerManagementConfigResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetManagerManagementConfigResponse' from JSON`, ); }