/* * 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 DomainsControllerStartDomainAutoConfigureRequest = { domain: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; createDomainConnectApplyUrlDto: components.CreateDomainConnectApplyUrlDto; }; export type DomainsControllerStartDomainAutoConfigureResponse = { headers: { [k: string]: Array }; result: components.DomainConnectApplyUrlResponseDto; }; /** @internal */ export type DomainsControllerStartDomainAutoConfigureRequest$Outbound = { domain: string; "idempotency-key"?: string | undefined; CreateDomainConnectApplyUrlDto: components.CreateDomainConnectApplyUrlDto$Outbound; }; /** @internal */ export const DomainsControllerStartDomainAutoConfigureRequest$outboundSchema: z.ZodType< DomainsControllerStartDomainAutoConfigureRequest$Outbound, z.ZodTypeDef, DomainsControllerStartDomainAutoConfigureRequest > = z.object({ domain: z.string(), idempotencyKey: z.string().optional(), createDomainConnectApplyUrlDto: components.CreateDomainConnectApplyUrlDto$outboundSchema, }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", createDomainConnectApplyUrlDto: "CreateDomainConnectApplyUrlDto", }); }); export function domainsControllerStartDomainAutoConfigureRequestToJSON( domainsControllerStartDomainAutoConfigureRequest: DomainsControllerStartDomainAutoConfigureRequest, ): string { return JSON.stringify( DomainsControllerStartDomainAutoConfigureRequest$outboundSchema.parse( domainsControllerStartDomainAutoConfigureRequest, ), ); } /** @internal */ export const DomainsControllerStartDomainAutoConfigureResponse$inboundSchema: z.ZodType< DomainsControllerStartDomainAutoConfigureResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.DomainConnectApplyUrlResponseDto$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function domainsControllerStartDomainAutoConfigureResponseFromJSON( jsonString: string, ): SafeParseResult< DomainsControllerStartDomainAutoConfigureResponse, SDKValidationError > { return safeParse( jsonString, (x) => DomainsControllerStartDomainAutoConfigureResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'DomainsControllerStartDomainAutoConfigureResponse' from JSON`, ); }