/* * 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 { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type VaultConsumersAllGlobals = { /** * The ID of your Unify application */ appId?: string | undefined; }; export type VaultConsumersAllRequest = { /** * The ID of your Unify application */ appId?: string | undefined; /** * Filter results */ filter?: components.ConsumersFilter | undefined; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ cursor?: string | null | undefined; /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ limit?: number | undefined; }; export type VaultConsumersAllResponse = { httpMeta: components.HTTPMetadata; /** * Consumers */ getConsumersResponse?: components.GetConsumersResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export type VaultConsumersAllRequest$Outbound = { appId?: string | undefined; filter?: components.ConsumersFilter$Outbound | undefined; cursor?: string | null | undefined; limit: number; }; /** @internal */ export const VaultConsumersAllRequest$outboundSchema: z.ZodType< VaultConsumersAllRequest$Outbound, z.ZodTypeDef, VaultConsumersAllRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ appId: z.string().optional(), filter: components.ConsumersFilter$outboundSchema.optional(), cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), }) ); export function vaultConsumersAllRequestToJSON( vaultConsumersAllRequest: VaultConsumersAllRequest, ): string { return JSON.stringify( VaultConsumersAllRequest$outboundSchema.parse(vaultConsumersAllRequest), ); } /** @internal */ export const VaultConsumersAllResponse$inboundSchema: z.ZodType< VaultConsumersAllResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetConsumersResponse: types.optional( components.GetConsumersResponse$inboundSchema, ), UnexpectedErrorResponse: types.optional( components.UnexpectedErrorResponse$inboundSchema, ), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetConsumersResponse": "getConsumersResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }) ); export function vaultConsumersAllResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultConsumersAllResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultConsumersAllResponse' from JSON`, ); }