/* * 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 FileStorageUploadSessionsDeleteGlobals = { /** * 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 FileStorageUploadSessionsDeleteRequest = { /** * 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 FileStorageUploadSessionsDeleteResponse = { httpMeta: components.HTTPMetadata; /** * UploadSessions */ deleteUploadSessionResponse?: | components.DeleteUploadSessionResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const FileStorageUploadSessionsDeleteGlobals$inboundSchema: z.ZodType< FileStorageUploadSessionsDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type FileStorageUploadSessionsDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const FileStorageUploadSessionsDeleteGlobals$outboundSchema: z.ZodType< FileStorageUploadSessionsDeleteGlobals$Outbound, z.ZodTypeDef, FileStorageUploadSessionsDeleteGlobals > = 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 FileStorageUploadSessionsDeleteGlobals$ { /** @deprecated use `FileStorageUploadSessionsDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = FileStorageUploadSessionsDeleteGlobals$inboundSchema; /** @deprecated use `FileStorageUploadSessionsDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = FileStorageUploadSessionsDeleteGlobals$outboundSchema; /** @deprecated use `FileStorageUploadSessionsDeleteGlobals$Outbound` instead. */ export type Outbound = FileStorageUploadSessionsDeleteGlobals$Outbound; } export function fileStorageUploadSessionsDeleteGlobalsToJSON( fileStorageUploadSessionsDeleteGlobals: FileStorageUploadSessionsDeleteGlobals, ): string { return JSON.stringify( FileStorageUploadSessionsDeleteGlobals$outboundSchema.parse( fileStorageUploadSessionsDeleteGlobals, ), ); } export function fileStorageUploadSessionsDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageUploadSessionsDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageUploadSessionsDeleteGlobals' from JSON`, ); } /** @internal */ export const FileStorageUploadSessionsDeleteRequest$inboundSchema: z.ZodType< FileStorageUploadSessionsDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type FileStorageUploadSessionsDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const FileStorageUploadSessionsDeleteRequest$outboundSchema: z.ZodType< FileStorageUploadSessionsDeleteRequest$Outbound, z.ZodTypeDef, FileStorageUploadSessionsDeleteRequest > = 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 FileStorageUploadSessionsDeleteRequest$ { /** @deprecated use `FileStorageUploadSessionsDeleteRequest$inboundSchema` instead. */ export const inboundSchema = FileStorageUploadSessionsDeleteRequest$inboundSchema; /** @deprecated use `FileStorageUploadSessionsDeleteRequest$outboundSchema` instead. */ export const outboundSchema = FileStorageUploadSessionsDeleteRequest$outboundSchema; /** @deprecated use `FileStorageUploadSessionsDeleteRequest$Outbound` instead. */ export type Outbound = FileStorageUploadSessionsDeleteRequest$Outbound; } export function fileStorageUploadSessionsDeleteRequestToJSON( fileStorageUploadSessionsDeleteRequest: FileStorageUploadSessionsDeleteRequest, ): string { return JSON.stringify( FileStorageUploadSessionsDeleteRequest$outboundSchema.parse( fileStorageUploadSessionsDeleteRequest, ), ); } export function fileStorageUploadSessionsDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageUploadSessionsDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageUploadSessionsDeleteRequest' from JSON`, ); } /** @internal */ export const FileStorageUploadSessionsDeleteResponse$inboundSchema: z.ZodType< FileStorageUploadSessionsDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteUploadSessionResponse: components .DeleteUploadSessionResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteUploadSessionResponse": "deleteUploadSessionResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type FileStorageUploadSessionsDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteUploadSessionResponse?: | components.DeleteUploadSessionResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const FileStorageUploadSessionsDeleteResponse$outboundSchema: z.ZodType< FileStorageUploadSessionsDeleteResponse$Outbound, z.ZodTypeDef, FileStorageUploadSessionsDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteUploadSessionResponse: components .DeleteUploadSessionResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteUploadSessionResponse: "DeleteUploadSessionResponse", 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 FileStorageUploadSessionsDeleteResponse$ { /** @deprecated use `FileStorageUploadSessionsDeleteResponse$inboundSchema` instead. */ export const inboundSchema = FileStorageUploadSessionsDeleteResponse$inboundSchema; /** @deprecated use `FileStorageUploadSessionsDeleteResponse$outboundSchema` instead. */ export const outboundSchema = FileStorageUploadSessionsDeleteResponse$outboundSchema; /** @deprecated use `FileStorageUploadSessionsDeleteResponse$Outbound` instead. */ export type Outbound = FileStorageUploadSessionsDeleteResponse$Outbound; } export function fileStorageUploadSessionsDeleteResponseToJSON( fileStorageUploadSessionsDeleteResponse: FileStorageUploadSessionsDeleteResponse, ): string { return JSON.stringify( FileStorageUploadSessionsDeleteResponse$outboundSchema.parse( fileStorageUploadSessionsDeleteResponse, ), ); } export function fileStorageUploadSessionsDeleteResponseFromJSON( jsonString: string, ): SafeParseResult< FileStorageUploadSessionsDeleteResponse, SDKValidationError > { return safeParse( jsonString, (x) => FileStorageUploadSessionsDeleteResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'FileStorageUploadSessionsDeleteResponse' from JSON`, ); }