/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type EnvironmentsControllerDiffEnvironmentRequest = { /** * Target environment ID (MongoDB ObjectId) to compare against */ targetEnvironmentId: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; /** * Diff request configuration */ diffEnvironmentRequestDto: components.DiffEnvironmentRequestDto; }; export type EnvironmentsControllerDiffEnvironmentResponse = { headers: { [k: string]: Array }; result: components.DiffEnvironmentResponseDto; }; /** @internal */ export type EnvironmentsControllerDiffEnvironmentRequest$Outbound = { targetEnvironmentId: string; "idempotency-key"?: string | undefined; DiffEnvironmentRequestDto: components.DiffEnvironmentRequestDto$Outbound; }; /** @internal */ export const EnvironmentsControllerDiffEnvironmentRequest$outboundSchema: z.ZodType< EnvironmentsControllerDiffEnvironmentRequest$Outbound, z.ZodTypeDef, EnvironmentsControllerDiffEnvironmentRequest > = z.object({ targetEnvironmentId: z.string(), idempotencyKey: z.string().optional(), diffEnvironmentRequestDto: components.DiffEnvironmentRequestDto$outboundSchema, }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", diffEnvironmentRequestDto: "DiffEnvironmentRequestDto", }); }); export function environmentsControllerDiffEnvironmentRequestToJSON( environmentsControllerDiffEnvironmentRequest: EnvironmentsControllerDiffEnvironmentRequest, ): string { return JSON.stringify( EnvironmentsControllerDiffEnvironmentRequest$outboundSchema.parse( environmentsControllerDiffEnvironmentRequest, ), ); } /** @internal */ export const EnvironmentsControllerDiffEnvironmentResponse$inboundSchema: z.ZodType< EnvironmentsControllerDiffEnvironmentResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.DiffEnvironmentResponseDto$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function environmentsControllerDiffEnvironmentResponseFromJSON( jsonString: string, ): SafeParseResult< EnvironmentsControllerDiffEnvironmentResponse, SDKValidationError > { return safeParse( jsonString, (x) => EnvironmentsControllerDiffEnvironmentResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EnvironmentsControllerDiffEnvironmentResponse' from JSON`, ); }