/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { CustomMapping, CustomMapping$inboundSchema, CustomMapping$Outbound, CustomMapping$outboundSchema, } from "./custommapping.js"; /** * Custom mapping */ export type GetCustomMappingsResponse = { /** * HTTP Response Status Code */ statusCode: number; /** * HTTP Response Status */ status: string; data: Array; }; /** @internal */ export const GetCustomMappingsResponse$inboundSchema: z.ZodType< GetCustomMappingsResponse, z.ZodTypeDef, unknown > = z.object({ status_code: z.number().int(), status: z.string(), data: z.array(CustomMapping$inboundSchema), }).transform((v) => { return remap$(v, { "status_code": "statusCode", }); }); /** @internal */ export type GetCustomMappingsResponse$Outbound = { status_code: number; status: string; data: Array; }; /** @internal */ export const GetCustomMappingsResponse$outboundSchema: z.ZodType< GetCustomMappingsResponse$Outbound, z.ZodTypeDef, GetCustomMappingsResponse > = z.object({ statusCode: z.number().int(), status: z.string(), data: z.array(CustomMapping$outboundSchema), }).transform((v) => { return remap$(v, { statusCode: "status_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetCustomMappingsResponse$ { /** @deprecated use `GetCustomMappingsResponse$inboundSchema` instead. */ export const inboundSchema = GetCustomMappingsResponse$inboundSchema; /** @deprecated use `GetCustomMappingsResponse$outboundSchema` instead. */ export const outboundSchema = GetCustomMappingsResponse$outboundSchema; /** @deprecated use `GetCustomMappingsResponse$Outbound` instead. */ export type Outbound = GetCustomMappingsResponse$Outbound; } export function getCustomMappingsResponseToJSON( getCustomMappingsResponse: GetCustomMappingsResponse, ): string { return JSON.stringify( GetCustomMappingsResponse$outboundSchema.parse(getCustomMappingsResponse), ); } export function getCustomMappingsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetCustomMappingsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetCustomMappingsResponse' from JSON`, ); }