/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type FileStorageFoldersDeleteGlobals = { /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; /** * The ID of your Unify application */ appId?: string | undefined; }; export type FileStorageFoldersDeleteRequest = { /** * ID of the record you are acting upon. */ id: string; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ serviceId?: string | undefined; /** * Include raw response. Mostly used for debugging purposes */ raw?: boolean | undefined; }; export type FileStorageFoldersDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Folders */ deleteFolderResponse?: components.DeleteFolderResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const FileStorageFoldersDeleteGlobals$inboundSchema: z.ZodType< FileStorageFoldersDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type FileStorageFoldersDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const FileStorageFoldersDeleteGlobals$outboundSchema: z.ZodType< FileStorageFoldersDeleteGlobals$Outbound, z.ZodTypeDef, FileStorageFoldersDeleteGlobals > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace FileStorageFoldersDeleteGlobals$ { /** @deprecated use `FileStorageFoldersDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = FileStorageFoldersDeleteGlobals$inboundSchema; /** @deprecated use `FileStorageFoldersDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = FileStorageFoldersDeleteGlobals$outboundSchema; /** @deprecated use `FileStorageFoldersDeleteGlobals$Outbound` instead. */ export type Outbound = FileStorageFoldersDeleteGlobals$Outbound; } export function fileStorageFoldersDeleteGlobalsToJSON( fileStorageFoldersDeleteGlobals: FileStorageFoldersDeleteGlobals, ): string { return JSON.stringify( FileStorageFoldersDeleteGlobals$outboundSchema.parse( fileStorageFoldersDeleteGlobals, ), ); } export function fileStorageFoldersDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageFoldersDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageFoldersDeleteGlobals' from JSON`, ); } /** @internal */ export const FileStorageFoldersDeleteRequest$inboundSchema: z.ZodType< FileStorageFoldersDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type FileStorageFoldersDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const FileStorageFoldersDeleteRequest$outboundSchema: z.ZodType< FileStorageFoldersDeleteRequest$Outbound, z.ZodTypeDef, FileStorageFoldersDeleteRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace FileStorageFoldersDeleteRequest$ { /** @deprecated use `FileStorageFoldersDeleteRequest$inboundSchema` instead. */ export const inboundSchema = FileStorageFoldersDeleteRequest$inboundSchema; /** @deprecated use `FileStorageFoldersDeleteRequest$outboundSchema` instead. */ export const outboundSchema = FileStorageFoldersDeleteRequest$outboundSchema; /** @deprecated use `FileStorageFoldersDeleteRequest$Outbound` instead. */ export type Outbound = FileStorageFoldersDeleteRequest$Outbound; } export function fileStorageFoldersDeleteRequestToJSON( fileStorageFoldersDeleteRequest: FileStorageFoldersDeleteRequest, ): string { return JSON.stringify( FileStorageFoldersDeleteRequest$outboundSchema.parse( fileStorageFoldersDeleteRequest, ), ); } export function fileStorageFoldersDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageFoldersDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageFoldersDeleteRequest' from JSON`, ); } /** @internal */ export const FileStorageFoldersDeleteResponse$inboundSchema: z.ZodType< FileStorageFoldersDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteFolderResponse: components.DeleteFolderResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteFolderResponse": "deleteFolderResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type FileStorageFoldersDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteFolderResponse?: components.DeleteFolderResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const FileStorageFoldersDeleteResponse$outboundSchema: z.ZodType< FileStorageFoldersDeleteResponse$Outbound, z.ZodTypeDef, FileStorageFoldersDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteFolderResponse: components.DeleteFolderResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteFolderResponse: "DeleteFolderResponse", unexpectedErrorResponse: "UnexpectedErrorResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace FileStorageFoldersDeleteResponse$ { /** @deprecated use `FileStorageFoldersDeleteResponse$inboundSchema` instead. */ export const inboundSchema = FileStorageFoldersDeleteResponse$inboundSchema; /** @deprecated use `FileStorageFoldersDeleteResponse$outboundSchema` instead. */ export const outboundSchema = FileStorageFoldersDeleteResponse$outboundSchema; /** @deprecated use `FileStorageFoldersDeleteResponse$Outbound` instead. */ export type Outbound = FileStorageFoldersDeleteResponse$Outbound; } export function fileStorageFoldersDeleteResponseToJSON( fileStorageFoldersDeleteResponse: FileStorageFoldersDeleteResponse, ): string { return JSON.stringify( FileStorageFoldersDeleteResponse$outboundSchema.parse( fileStorageFoldersDeleteResponse, ), ); } export function fileStorageFoldersDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageFoldersDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageFoldersDeleteResponse' from JSON`, ); }