/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ConsumerMetadata, ConsumerMetadata$inboundSchema, ConsumerMetadata$Outbound, ConsumerMetadata$outboundSchema, } from "./consumermetadata.js"; export type UpdateConsumerRequest = { /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ metadata?: ConsumerMetadata | undefined; }; /** @internal */ export const UpdateConsumerRequest$inboundSchema: z.ZodType< UpdateConsumerRequest, z.ZodTypeDef, unknown > = z.object({ metadata: ConsumerMetadata$inboundSchema.optional(), }); /** @internal */ export type UpdateConsumerRequest$Outbound = { metadata?: ConsumerMetadata$Outbound | undefined; }; /** @internal */ export const UpdateConsumerRequest$outboundSchema: z.ZodType< UpdateConsumerRequest$Outbound, z.ZodTypeDef, UpdateConsumerRequest > = z.object({ metadata: ConsumerMetadata$outboundSchema.optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UpdateConsumerRequest$ { /** @deprecated use `UpdateConsumerRequest$inboundSchema` instead. */ export const inboundSchema = UpdateConsumerRequest$inboundSchema; /** @deprecated use `UpdateConsumerRequest$outboundSchema` instead. */ export const outboundSchema = UpdateConsumerRequest$outboundSchema; /** @deprecated use `UpdateConsumerRequest$Outbound` instead. */ export type Outbound = UpdateConsumerRequest$Outbound; } export function updateConsumerRequestToJSON( updateConsumerRequest: UpdateConsumerRequest, ): string { return JSON.stringify( UpdateConsumerRequest$outboundSchema.parse(updateConsumerRequest), ); } export function updateConsumerRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateConsumerRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateConsumerRequest' from JSON`, ); }