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