/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type RabbitMQCredentials = { /** * RabbitMQ username. */ username: string; /** * RabbitMQ password. */ password: string; }; /** @internal */ export const RabbitMQCredentials$inboundSchema: z.ZodType< RabbitMQCredentials, z.ZodTypeDef, unknown > = z.object({ username: z.string(), password: z.string(), }); /** @internal */ export type RabbitMQCredentials$Outbound = { username: string; password: string; }; /** @internal */ export const RabbitMQCredentials$outboundSchema: z.ZodType< RabbitMQCredentials$Outbound, z.ZodTypeDef, RabbitMQCredentials > = z.object({ username: z.string(), password: z.string(), }); export function rabbitMQCredentialsToJSON( rabbitMQCredentials: RabbitMQCredentials, ): string { return JSON.stringify( RabbitMQCredentials$outboundSchema.parse(rabbitMQCredentials), ); } export function rabbitMQCredentialsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RabbitMQCredentials$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RabbitMQCredentials' from JSON`, ); }