/* * 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 FileStorageSharedLinksDeleteGlobals = { /** * 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 FileStorageSharedLinksDeleteRequest = { /** * 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 FileStorageSharedLinksDeleteResponse = { httpMeta: components.HTTPMetadata; /** * Shared Links */ deleteSharedLinkResponse?: components.DeleteSharedLinkResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const FileStorageSharedLinksDeleteGlobals$inboundSchema: z.ZodType< FileStorageSharedLinksDeleteGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type FileStorageSharedLinksDeleteGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const FileStorageSharedLinksDeleteGlobals$outboundSchema: z.ZodType< FileStorageSharedLinksDeleteGlobals$Outbound, z.ZodTypeDef, FileStorageSharedLinksDeleteGlobals > = 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 FileStorageSharedLinksDeleteGlobals$ { /** @deprecated use `FileStorageSharedLinksDeleteGlobals$inboundSchema` instead. */ export const inboundSchema = FileStorageSharedLinksDeleteGlobals$inboundSchema; /** @deprecated use `FileStorageSharedLinksDeleteGlobals$outboundSchema` instead. */ export const outboundSchema = FileStorageSharedLinksDeleteGlobals$outboundSchema; /** @deprecated use `FileStorageSharedLinksDeleteGlobals$Outbound` instead. */ export type Outbound = FileStorageSharedLinksDeleteGlobals$Outbound; } export function fileStorageSharedLinksDeleteGlobalsToJSON( fileStorageSharedLinksDeleteGlobals: FileStorageSharedLinksDeleteGlobals, ): string { return JSON.stringify( FileStorageSharedLinksDeleteGlobals$outboundSchema.parse( fileStorageSharedLinksDeleteGlobals, ), ); } export function fileStorageSharedLinksDeleteGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageSharedLinksDeleteGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageSharedLinksDeleteGlobals' from JSON`, ); } /** @internal */ export const FileStorageSharedLinksDeleteRequest$inboundSchema: z.ZodType< FileStorageSharedLinksDeleteRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), }); /** @internal */ export type FileStorageSharedLinksDeleteRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; }; /** @internal */ export const FileStorageSharedLinksDeleteRequest$outboundSchema: z.ZodType< FileStorageSharedLinksDeleteRequest$Outbound, z.ZodTypeDef, FileStorageSharedLinksDeleteRequest > = 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 FileStorageSharedLinksDeleteRequest$ { /** @deprecated use `FileStorageSharedLinksDeleteRequest$inboundSchema` instead. */ export const inboundSchema = FileStorageSharedLinksDeleteRequest$inboundSchema; /** @deprecated use `FileStorageSharedLinksDeleteRequest$outboundSchema` instead. */ export const outboundSchema = FileStorageSharedLinksDeleteRequest$outboundSchema; /** @deprecated use `FileStorageSharedLinksDeleteRequest$Outbound` instead. */ export type Outbound = FileStorageSharedLinksDeleteRequest$Outbound; } export function fileStorageSharedLinksDeleteRequestToJSON( fileStorageSharedLinksDeleteRequest: FileStorageSharedLinksDeleteRequest, ): string { return JSON.stringify( FileStorageSharedLinksDeleteRequest$outboundSchema.parse( fileStorageSharedLinksDeleteRequest, ), ); } export function fileStorageSharedLinksDeleteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageSharedLinksDeleteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageSharedLinksDeleteRequest' from JSON`, ); } /** @internal */ export const FileStorageSharedLinksDeleteResponse$inboundSchema: z.ZodType< FileStorageSharedLinksDeleteResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, DeleteSharedLinkResponse: components.DeleteSharedLinkResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "DeleteSharedLinkResponse": "deleteSharedLinkResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type FileStorageSharedLinksDeleteResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; DeleteSharedLinkResponse?: | components.DeleteSharedLinkResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const FileStorageSharedLinksDeleteResponse$outboundSchema: z.ZodType< FileStorageSharedLinksDeleteResponse$Outbound, z.ZodTypeDef, FileStorageSharedLinksDeleteResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, deleteSharedLinkResponse: components.DeleteSharedLinkResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", deleteSharedLinkResponse: "DeleteSharedLinkResponse", 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 FileStorageSharedLinksDeleteResponse$ { /** @deprecated use `FileStorageSharedLinksDeleteResponse$inboundSchema` instead. */ export const inboundSchema = FileStorageSharedLinksDeleteResponse$inboundSchema; /** @deprecated use `FileStorageSharedLinksDeleteResponse$outboundSchema` instead. */ export const outboundSchema = FileStorageSharedLinksDeleteResponse$outboundSchema; /** @deprecated use `FileStorageSharedLinksDeleteResponse$Outbound` instead. */ export type Outbound = FileStorageSharedLinksDeleteResponse$Outbound; } export function fileStorageSharedLinksDeleteResponseToJSON( fileStorageSharedLinksDeleteResponse: FileStorageSharedLinksDeleteResponse, ): string { return JSON.stringify( FileStorageSharedLinksDeleteResponse$outboundSchema.parse( fileStorageSharedLinksDeleteResponse, ), ); } export function fileStorageSharedLinksDeleteResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageSharedLinksDeleteResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageSharedLinksDeleteResponse' from JSON`, ); }