/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ListConnectionsConnectionsGetRequest = { /** * An opaque cursor for pagination */ cursor?: string | null | undefined; /** * The number of items per page (must be greater than 0 and less than or equal to 100) */ pageSize?: number | undefined; /** * The metadata search filter. Returns only items which match the filter. The following filter operators are supported: $eq - Equal to (number, string, boolean), $ne - Not equal to (number, string, boolean), $gt - Greater than (number), $gte - Greater than or equal to (number), $lt - Less than (number), $lte - Less than or equal to (number), $in - In array (string or number), $nin - Not in array (string or number). The operators can be combined with AND and OR. Read [Metadata & Filters guide](https://docs.ragie.ai/docs/metadata-filters) for more details and examples. */ filter?: string | null | undefined; /** * An optional partition to scope the request to. If omitted, the request will be scoped to the default partition. */ partition?: string | null | undefined; }; export type ListConnectionsConnectionsGetResponse = { result: components.ConnectionList; }; /** @internal */ export const ListConnectionsConnectionsGetRequest$inboundSchema: z.ZodType< ListConnectionsConnectionsGetRequest, z.ZodTypeDef, unknown > = z.object({ cursor: z.nullable(z.string()).optional(), page_size: z.number().int().default(10), filter: z.nullable(z.string()).optional(), partition: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "page_size": "pageSize", }); }); /** @internal */ export type ListConnectionsConnectionsGetRequest$Outbound = { cursor?: string | null | undefined; page_size: number; filter?: string | null | undefined; partition?: string | null | undefined; }; /** @internal */ export const ListConnectionsConnectionsGetRequest$outboundSchema: z.ZodType< ListConnectionsConnectionsGetRequest$Outbound, z.ZodTypeDef, ListConnectionsConnectionsGetRequest > = z.object({ cursor: z.nullable(z.string()).optional(), pageSize: z.number().int().default(10), filter: z.nullable(z.string()).optional(), partition: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { pageSize: "page_size", }); }); export function listConnectionsConnectionsGetRequestToJSON( listConnectionsConnectionsGetRequest: ListConnectionsConnectionsGetRequest, ): string { return JSON.stringify( ListConnectionsConnectionsGetRequest$outboundSchema.parse( listConnectionsConnectionsGetRequest, ), ); } export function listConnectionsConnectionsGetRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListConnectionsConnectionsGetRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListConnectionsConnectionsGetRequest' from JSON`, ); } /** @internal */ export const ListConnectionsConnectionsGetResponse$inboundSchema: z.ZodType< ListConnectionsConnectionsGetResponse, z.ZodTypeDef, unknown > = z.object({ Result: components.ConnectionList$inboundSchema, }).transform((v) => { return remap$(v, { "Result": "result", }); }); /** @internal */ export type ListConnectionsConnectionsGetResponse$Outbound = { Result: components.ConnectionList$Outbound; }; /** @internal */ export const ListConnectionsConnectionsGetResponse$outboundSchema: z.ZodType< ListConnectionsConnectionsGetResponse$Outbound, z.ZodTypeDef, ListConnectionsConnectionsGetResponse > = z.object({ result: components.ConnectionList$outboundSchema, }).transform((v) => { return remap$(v, { result: "Result", }); }); export function listConnectionsConnectionsGetResponseToJSON( listConnectionsConnectionsGetResponse: ListConnectionsConnectionsGetResponse, ): string { return JSON.stringify( ListConnectionsConnectionsGetResponse$outboundSchema.parse( listConnectionsConnectionsGetResponse, ), ); } export function listConnectionsConnectionsGetResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListConnectionsConnectionsGetResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListConnectionsConnectionsGetResponse' from JSON`, ); }