/* * 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"; export type FilesFilter = { /** * ID of the drive to filter on */ driveId?: string | undefined; /** * ID of the folder to filter on. The root folder has an alias "root" */ folderId?: string | undefined; /** * Only return files and folders that are shared */ shared?: boolean | undefined; }; /** @internal */ export const FilesFilter$inboundSchema: z.ZodType< FilesFilter, z.ZodTypeDef, unknown > = z.object({ drive_id: z.string().optional(), folder_id: z.string().optional(), shared: z.boolean().optional(), }).transform((v) => { return remap$(v, { "drive_id": "driveId", "folder_id": "folderId", }); }); /** @internal */ export type FilesFilter$Outbound = { drive_id?: string | undefined; folder_id?: string | undefined; shared?: boolean | undefined; }; /** @internal */ export const FilesFilter$outboundSchema: z.ZodType< FilesFilter$Outbound, z.ZodTypeDef, FilesFilter > = z.object({ driveId: z.string().optional(), folderId: z.string().optional(), shared: z.boolean().optional(), }).transform((v) => { return remap$(v, { driveId: "drive_id", folderId: "folder_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace FilesFilter$ { /** @deprecated use `FilesFilter$inboundSchema` instead. */ export const inboundSchema = FilesFilter$inboundSchema; /** @deprecated use `FilesFilter$outboundSchema` instead. */ export const outboundSchema = FilesFilter$outboundSchema; /** @deprecated use `FilesFilter$Outbound` instead. */ export type Outbound = FilesFilter$Outbound; } export function filesFilterToJSON(filesFilter: FilesFilter): string { return JSON.stringify(FilesFilter$outboundSchema.parse(filesFilter)); } export function filesFilterFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FilesFilter$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FilesFilter' from JSON`, ); }