/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 839fdaaa372b */ 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 const ManagerManagementConfigsPlatformAws = { Aws: "aws", } as const; export type ManagerManagementConfigsPlatformAws = ClosedEnum< typeof ManagerManagementConfigsPlatformAws >; export type ManagerManagementConfigsAws = { /** * The managing AWS IAM role ARN that can assume cross-account roles */ managingRoleArn: string; platform: ManagerManagementConfigsPlatformAws; }; export const ManagerManagementConfigsPlatformGcp = { Gcp: "gcp", } as const; export type ManagerManagementConfigsPlatformGcp = ClosedEnum< typeof ManagerManagementConfigsPlatformGcp >; export type ManagerManagementConfigsGcp = { /** * Service account email for management roles */ serviceAccountEmail: string; platform: ManagerManagementConfigsPlatformGcp; }; export const ManagerManagementConfigsPlatformAzure = { Azure: "azure", } as const; export type ManagerManagementConfigsPlatformAzure = ClosedEnum< typeof ManagerManagementConfigsPlatformAzure >; export type ManagerManagementConfigsAzure = { /** * 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: ManagerManagementConfigsPlatformAzure; }; export const ManagerManagementConfigsPlatformKubernetes = { Kubernetes: "kubernetes", } as const; export type ManagerManagementConfigsPlatformKubernetes = ClosedEnum< typeof ManagerManagementConfigsPlatformKubernetes >; export type ManagerManagementConfigsKubernetes = { platform: ManagerManagementConfigsPlatformKubernetes; }; /** * Per-platform management configurations for cross-account access (self-reported via heartbeat) */ export type ManagerManagementConfigs = { aws?: ManagerManagementConfigsAws | undefined; gcp?: ManagerManagementConfigsGcp | undefined; azure?: ManagerManagementConfigsAzure | undefined; kubernetes?: ManagerManagementConfigsKubernetes | undefined; }; /** @internal */ export const ManagerManagementConfigsPlatformAws$inboundSchema: z.ZodEnum< typeof ManagerManagementConfigsPlatformAws > = z.enum(ManagerManagementConfigsPlatformAws); /** @internal */ export const ManagerManagementConfigsPlatformAws$outboundSchema: z.ZodEnum< typeof ManagerManagementConfigsPlatformAws > = ManagerManagementConfigsPlatformAws$inboundSchema; /** @internal */ export const ManagerManagementConfigsAws$inboundSchema: z.ZodType< ManagerManagementConfigsAws, unknown > = z.object({ managingRoleArn: z.string(), platform: ManagerManagementConfigsPlatformAws$inboundSchema, }); /** @internal */ export type ManagerManagementConfigsAws$Outbound = { managingRoleArn: string; platform: string; }; /** @internal */ export const ManagerManagementConfigsAws$outboundSchema: z.ZodType< ManagerManagementConfigsAws$Outbound, ManagerManagementConfigsAws > = z.object({ managingRoleArn: z.string(), platform: ManagerManagementConfigsPlatformAws$outboundSchema, }); export function managerManagementConfigsAwsToJSON( managerManagementConfigsAws: ManagerManagementConfigsAws, ): string { return JSON.stringify( ManagerManagementConfigsAws$outboundSchema.parse( managerManagementConfigsAws, ), ); } export function managerManagementConfigsAwsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ManagerManagementConfigsAws$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ManagerManagementConfigsAws' from JSON`, ); } /** @internal */ export const ManagerManagementConfigsPlatformGcp$inboundSchema: z.ZodEnum< typeof ManagerManagementConfigsPlatformGcp > = z.enum(ManagerManagementConfigsPlatformGcp); /** @internal */ export const ManagerManagementConfigsPlatformGcp$outboundSchema: z.ZodEnum< typeof ManagerManagementConfigsPlatformGcp > = ManagerManagementConfigsPlatformGcp$inboundSchema; /** @internal */ export const ManagerManagementConfigsGcp$inboundSchema: z.ZodType< ManagerManagementConfigsGcp, unknown > = z.object({ serviceAccountEmail: z.string(), platform: ManagerManagementConfigsPlatformGcp$inboundSchema, }); /** @internal */ export type ManagerManagementConfigsGcp$Outbound = { serviceAccountEmail: string; platform: string; }; /** @internal */ export const ManagerManagementConfigsGcp$outboundSchema: z.ZodType< ManagerManagementConfigsGcp$Outbound, ManagerManagementConfigsGcp > = z.object({ serviceAccountEmail: z.string(), platform: ManagerManagementConfigsPlatformGcp$outboundSchema, }); export function managerManagementConfigsGcpToJSON( managerManagementConfigsGcp: ManagerManagementConfigsGcp, ): string { return JSON.stringify( ManagerManagementConfigsGcp$outboundSchema.parse( managerManagementConfigsGcp, ), ); } export function managerManagementConfigsGcpFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ManagerManagementConfigsGcp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ManagerManagementConfigsGcp' from JSON`, ); } /** @internal */ export const ManagerManagementConfigsPlatformAzure$inboundSchema: z.ZodEnum< typeof ManagerManagementConfigsPlatformAzure > = z.enum(ManagerManagementConfigsPlatformAzure); /** @internal */ export const ManagerManagementConfigsPlatformAzure$outboundSchema: z.ZodEnum< typeof ManagerManagementConfigsPlatformAzure > = ManagerManagementConfigsPlatformAzure$inboundSchema; /** @internal */ export const ManagerManagementConfigsAzure$inboundSchema: z.ZodType< ManagerManagementConfigsAzure, unknown > = z.object({ managingTenantId: z.string(), oidcIssuer: z.string(), oidcSubject: z.string(), platform: ManagerManagementConfigsPlatformAzure$inboundSchema, }); /** @internal */ export type ManagerManagementConfigsAzure$Outbound = { managingTenantId: string; oidcIssuer: string; oidcSubject: string; platform: string; }; /** @internal */ export const ManagerManagementConfigsAzure$outboundSchema: z.ZodType< ManagerManagementConfigsAzure$Outbound, ManagerManagementConfigsAzure > = z.object({ managingTenantId: z.string(), oidcIssuer: z.string(), oidcSubject: z.string(), platform: ManagerManagementConfigsPlatformAzure$outboundSchema, }); export function managerManagementConfigsAzureToJSON( managerManagementConfigsAzure: ManagerManagementConfigsAzure, ): string { return JSON.stringify( ManagerManagementConfigsAzure$outboundSchema.parse( managerManagementConfigsAzure, ), ); } export function managerManagementConfigsAzureFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ManagerManagementConfigsAzure$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ManagerManagementConfigsAzure' from JSON`, ); } /** @internal */ export const ManagerManagementConfigsPlatformKubernetes$inboundSchema: z.ZodEnum = z.enum( ManagerManagementConfigsPlatformKubernetes, ); /** @internal */ export const ManagerManagementConfigsPlatformKubernetes$outboundSchema: z.ZodEnum = ManagerManagementConfigsPlatformKubernetes$inboundSchema; /** @internal */ export const ManagerManagementConfigsKubernetes$inboundSchema: z.ZodType< ManagerManagementConfigsKubernetes, unknown > = z.object({ platform: ManagerManagementConfigsPlatformKubernetes$inboundSchema, }); /** @internal */ export type ManagerManagementConfigsKubernetes$Outbound = { platform: string; }; /** @internal */ export const ManagerManagementConfigsKubernetes$outboundSchema: z.ZodType< ManagerManagementConfigsKubernetes$Outbound, ManagerManagementConfigsKubernetes > = z.object({ platform: ManagerManagementConfigsPlatformKubernetes$outboundSchema, }); export function managerManagementConfigsKubernetesToJSON( managerManagementConfigsKubernetes: ManagerManagementConfigsKubernetes, ): string { return JSON.stringify( ManagerManagementConfigsKubernetes$outboundSchema.parse( managerManagementConfigsKubernetes, ), ); } export function managerManagementConfigsKubernetesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ManagerManagementConfigsKubernetes$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ManagerManagementConfigsKubernetes' from JSON`, ); } /** @internal */ export const ManagerManagementConfigs$inboundSchema: z.ZodType< ManagerManagementConfigs, unknown > = z.object({ aws: z.lazy(() => ManagerManagementConfigsAws$inboundSchema).optional(), gcp: z.lazy(() => ManagerManagementConfigsGcp$inboundSchema).optional(), azure: z.lazy(() => ManagerManagementConfigsAzure$inboundSchema).optional(), kubernetes: z.lazy(() => ManagerManagementConfigsKubernetes$inboundSchema) .optional(), }); /** @internal */ export type ManagerManagementConfigs$Outbound = { aws?: ManagerManagementConfigsAws$Outbound | undefined; gcp?: ManagerManagementConfigsGcp$Outbound | undefined; azure?: ManagerManagementConfigsAzure$Outbound | undefined; kubernetes?: ManagerManagementConfigsKubernetes$Outbound | undefined; }; /** @internal */ export const ManagerManagementConfigs$outboundSchema: z.ZodType< ManagerManagementConfigs$Outbound, ManagerManagementConfigs > = z.object({ aws: z.lazy(() => ManagerManagementConfigsAws$outboundSchema).optional(), gcp: z.lazy(() => ManagerManagementConfigsGcp$outboundSchema).optional(), azure: z.lazy(() => ManagerManagementConfigsAzure$outboundSchema).optional(), kubernetes: z.lazy(() => ManagerManagementConfigsKubernetes$outboundSchema) .optional(), }); export function managerManagementConfigsToJSON( managerManagementConfigs: ManagerManagementConfigs, ): string { return JSON.stringify( ManagerManagementConfigs$outboundSchema.parse(managerManagementConfigs), ); } export function managerManagementConfigsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ManagerManagementConfigs$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ManagerManagementConfigs' from JSON`, ); }