/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type Memcached = { /** * Whether server responds to a handshake using the ASCII wire format of the protocol. */ asciiBindingProtocolEnabled?: boolean | undefined; /** * Whether server responds to a handshake using the binary wire format of the protocol. */ binaryBindingProtocolEnabled?: boolean | undefined; /** * Whether the server on the UDP port with the same number responds to a handshake using the ASCII wire format of the protocol. */ respondsToUdp?: boolean | undefined; /** * Server information returned in response to the stats command, as a set of key:value pairs. */ stats?: { [k: string]: string } | undefined; /** * The Memcached version indicated in the server's response. */ version?: string | undefined; }; /** @internal */ export const Memcached$inboundSchema: z.ZodType< Memcached, z.ZodTypeDef, unknown > = z.object({ ascii_binding_protocol_enabled: z.boolean().optional(), binary_binding_protocol_enabled: z.boolean().optional(), responds_to_udp: z.boolean().optional(), stats: z.record(z.string()).optional(), version: z.string().optional(), }).transform((v) => { return remap$(v, { "ascii_binding_protocol_enabled": "asciiBindingProtocolEnabled", "binary_binding_protocol_enabled": "binaryBindingProtocolEnabled", "responds_to_udp": "respondsToUdp", }); }); export function memcachedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Memcached$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Memcached' from JSON`, ); }