/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PassThroughBody, PassThroughBody$inboundSchema, PassThroughBody$Outbound, PassThroughBody$outboundSchema, } from "./passthroughbody.js"; export type FilesSearch = { /** * The query to search for. May match across multiple fields. */ query: string; /** * ID of the drive to filter on */ driveId?: string | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; /** @internal */ export const FilesSearch$inboundSchema: z.ZodType< FilesSearch, z.ZodTypeDef, unknown > = z.object({ query: z.string(), drive_id: z.string().optional(), pass_through: z.array(PassThroughBody$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "drive_id": "driveId", "pass_through": "passThrough", }); }); /** @internal */ export type FilesSearch$Outbound = { query: string; drive_id?: string | undefined; pass_through?: Array | undefined; }; /** @internal */ export const FilesSearch$outboundSchema: z.ZodType< FilesSearch$Outbound, z.ZodTypeDef, FilesSearch > = z.object({ query: z.string(), driveId: z.string().optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { driveId: "drive_id", passThrough: "pass_through", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace FilesSearch$ { /** @deprecated use `FilesSearch$inboundSchema` instead. */ export const inboundSchema = FilesSearch$inboundSchema; /** @deprecated use `FilesSearch$outboundSchema` instead. */ export const outboundSchema = FilesSearch$outboundSchema; /** @deprecated use `FilesSearch$Outbound` instead. */ export type Outbound = FilesSearch$Outbound; } export function filesSearchToJSON(filesSearch: FilesSearch): string { return JSON.stringify(FilesSearch$outboundSchema.parse(filesSearch)); } export function filesSearchFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FilesSearch$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FilesSearch' from JSON`, ); }