/* * 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 VaultLogsAllGlobals = { /** * The ID of your Unify application */ appId?: string | undefined; /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; }; export type VaultLogsAllRequest = { /** * The ID of your Unify application */ appId?: string | undefined; /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; /** * Filter results */ filter?: components.LogsFilter | 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 VaultLogsAllResponse = { httpMeta: components.HTTPMetadata; /** * Logs */ getLogsResponse?: components.GetLogsResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export type VaultLogsAllRequest$Outbound = { appId?: string | undefined; consumerId?: string | undefined; filter?: components.LogsFilter$Outbound | undefined; cursor?: string | null | undefined; limit: number; }; /** @internal */ export const VaultLogsAllRequest$outboundSchema: z.ZodType< VaultLogsAllRequest$Outbound, z.ZodTypeDef, VaultLogsAllRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ appId: z.string().optional(), consumerId: z.string().optional(), filter: components.LogsFilter$outboundSchema.optional(), cursor: z.nullable(z.string()).optional(), limit: z.number().int().default(20), }) ); export function vaultLogsAllRequestToJSON( vaultLogsAllRequest: VaultLogsAllRequest, ): string { return JSON.stringify( VaultLogsAllRequest$outboundSchema.parse(vaultLogsAllRequest), ); } /** @internal */ export const VaultLogsAllResponse$inboundSchema: z.ZodType< VaultLogsAllResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetLogsResponse: types.optional(components.GetLogsResponse$inboundSchema), UnexpectedErrorResponse: types.optional( components.UnexpectedErrorResponse$inboundSchema, ), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetLogsResponse": "getLogsResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }) ); export function vaultLogsAllResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultLogsAllResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultLogsAllResponse' from JSON`, ); }