/* * 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 FileStorageDrivesDeleteGlobals = { /** * 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 FileStorageDrivesDeleteRequest = { /** * 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 FileStorageDrivesDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Drives */ deleteDriveResponse?: components.DeleteDriveResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const FileStorageDrivesDeleteGlobals$inboundSchema: z.ZodType< FileStorageDrivesDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type FileStorageDrivesDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const FileStorageDrivesDeleteGlobals$outboundSchema: z.ZodType< FileStorageDrivesDeleteGlobals$Outbound, z.ZodTypeDef, FileStorageDrivesDeleteGlobals > = 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 FileStorageDrivesDeleteGlobals$ { /** @deprecated use `FileStorageDrivesDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = FileStorageDrivesDeleteGlobals$inboundSchema; /** @deprecated use `FileStorageDrivesDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = FileStorageDrivesDeleteGlobals$outboundSchema; /** @deprecated use `FileStorageDrivesDeleteGlobals$Outbound` instead. */ export type Outbound = FileStorageDrivesDeleteGlobals$Outbound; } export function fileStorageDrivesDeleteGlobalsToJSON( fileStorageDrivesDeleteGlobals: FileStorageDrivesDeleteGlobals, ): string { return JSON.stringify( FileStorageDrivesDeleteGlobals$outboundSchema.parse( fileStorageDrivesDeleteGlobals, ), ); } export function fileStorageDrivesDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageDrivesDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageDrivesDeleteGlobals' from JSON`, ); } /** @internal */ export const FileStorageDrivesDeleteRequest$inboundSchema: z.ZodType< FileStorageDrivesDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type FileStorageDrivesDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const FileStorageDrivesDeleteRequest$outboundSchema: z.ZodType< FileStorageDrivesDeleteRequest$Outbound, z.ZodTypeDef, FileStorageDrivesDeleteRequest > = 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 FileStorageDrivesDeleteRequest$ { /** @deprecated use `FileStorageDrivesDeleteRequest$inboundSchema` instead. */ export const inboundSchema = FileStorageDrivesDeleteRequest$inboundSchema; /** @deprecated use `FileStorageDrivesDeleteRequest$outboundSchema` instead. */ export const outboundSchema = FileStorageDrivesDeleteRequest$outboundSchema; /** @deprecated use `FileStorageDrivesDeleteRequest$Outbound` instead. */ export type Outbound = FileStorageDrivesDeleteRequest$Outbound; } export function fileStorageDrivesDeleteRequestToJSON( fileStorageDrivesDeleteRequest: FileStorageDrivesDeleteRequest, ): string { return JSON.stringify( FileStorageDrivesDeleteRequest$outboundSchema.parse( fileStorageDrivesDeleteRequest, ), ); } export function fileStorageDrivesDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageDrivesDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageDrivesDeleteRequest' from JSON`, ); } /** @internal */ export const FileStorageDrivesDeleteResponse$inboundSchema: z.ZodType< FileStorageDrivesDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteDriveResponse: components.DeleteDriveResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteDriveResponse": "deleteDriveResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type FileStorageDrivesDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteDriveResponse?: components.DeleteDriveResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const FileStorageDrivesDeleteResponse$outboundSchema: z.ZodType< FileStorageDrivesDeleteResponse$Outbound, z.ZodTypeDef, FileStorageDrivesDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteDriveResponse: components.DeleteDriveResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteDriveResponse: "DeleteDriveResponse", 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 FileStorageDrivesDeleteResponse$ { /** @deprecated use `FileStorageDrivesDeleteResponse$inboundSchema` instead. */ export const inboundSchema = FileStorageDrivesDeleteResponse$inboundSchema; /** @deprecated use `FileStorageDrivesDeleteResponse$outboundSchema` instead. */ export const outboundSchema = FileStorageDrivesDeleteResponse$outboundSchema; /** @deprecated use `FileStorageDrivesDeleteResponse$Outbound` instead. */ export type Outbound = FileStorageDrivesDeleteResponse$Outbound; } export function fileStorageDrivesDeleteResponseToJSON( fileStorageDrivesDeleteResponse: FileStorageDrivesDeleteResponse, ): string { return JSON.stringify( FileStorageDrivesDeleteResponse$outboundSchema.parse( fileStorageDrivesDeleteResponse, ), ); } export function fileStorageDrivesDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageDrivesDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageDrivesDeleteResponse' from JSON`, ); }