/* * 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 UpdateFolderRequest = { /** * The name of the folder. */ name?: string | undefined; /** * Optional description of the folder. */ description?: string | undefined; /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ parentFolderId?: 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 UpdateFolderRequest$inboundSchema: z.ZodType< UpdateFolderRequest, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), description: z.string().optional(), parent_folder_id: z.string().optional(), pass_through: z.array(PassThroughBody$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "parent_folder_id": "parentFolderId", "pass_through": "passThrough", }); }); /** @internal */ export type UpdateFolderRequest$Outbound = { name?: string | undefined; description?: string | undefined; parent_folder_id?: string | undefined; pass_through?: Array | undefined; }; /** @internal */ export const UpdateFolderRequest$outboundSchema: z.ZodType< UpdateFolderRequest$Outbound, z.ZodTypeDef, UpdateFolderRequest > = z.object({ name: z.string().optional(), description: z.string().optional(), parentFolderId: z.string().optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { parentFolderId: "parent_folder_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 UpdateFolderRequest$ { /** @deprecated use `UpdateFolderRequest$inboundSchema` instead. */ export const inboundSchema = UpdateFolderRequest$inboundSchema; /** @deprecated use `UpdateFolderRequest$outboundSchema` instead. */ export const outboundSchema = UpdateFolderRequest$outboundSchema; /** @deprecated use `UpdateFolderRequest$Outbound` instead. */ export type Outbound = UpdateFolderRequest$Outbound; } export function updateFolderRequestToJSON( updateFolderRequest: UpdateFolderRequest, ): string { return JSON.stringify( UpdateFolderRequest$outboundSchema.parse(updateFolderRequest), ); } export function updateFolderRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateFolderRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateFolderRequest' from JSON`, ); }