/* * 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 FileStorageDrivesAddGlobals = { /** * 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 FileStorageDrivesAddRequest = { /** * Include raw response. Mostly used for debugging purposes */ raw?: boolean | undefined; /** * 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; drive: components.DriveInput; }; export type FileStorageDrivesAddResponse = { httpMeta: components.HTTPMetadata; /** * Drives */ createDriveResponse?: components.CreateDriveResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const FileStorageDrivesAddGlobals$inboundSchema: z.ZodType< FileStorageDrivesAddGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type FileStorageDrivesAddGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const FileStorageDrivesAddGlobals$outboundSchema: z.ZodType< FileStorageDrivesAddGlobals$Outbound, z.ZodTypeDef, FileStorageDrivesAddGlobals > = 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 FileStorageDrivesAddGlobals$ { /** @deprecated use `FileStorageDrivesAddGlobals$inboundSchema` instead. */ export const inboundSchema = FileStorageDrivesAddGlobals$inboundSchema; /** @deprecated use `FileStorageDrivesAddGlobals$outboundSchema` instead. */ export const outboundSchema = FileStorageDrivesAddGlobals$outboundSchema; /** @deprecated use `FileStorageDrivesAddGlobals$Outbound` instead. */ export type Outbound = FileStorageDrivesAddGlobals$Outbound; } export function fileStorageDrivesAddGlobalsToJSON( fileStorageDrivesAddGlobals: FileStorageDrivesAddGlobals, ): string { return JSON.stringify( FileStorageDrivesAddGlobals$outboundSchema.parse( fileStorageDrivesAddGlobals, ), ); } export function fileStorageDrivesAddGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageDrivesAddGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageDrivesAddGlobals' from JSON`, ); } /** @internal */ export const FileStorageDrivesAddRequest$inboundSchema: z.ZodType< FileStorageDrivesAddRequest, z.ZodTypeDef, unknown > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), Drive: components.DriveInput$inboundSchema, }).transform((v) => { return remap$(v, { "Drive": "drive", }); }); /** @internal */ export type FileStorageDrivesAddRequest$Outbound = { raw: boolean; serviceId?: string | undefined; Drive: components.DriveInput$Outbound; }; /** @internal */ export const FileStorageDrivesAddRequest$outboundSchema: z.ZodType< FileStorageDrivesAddRequest$Outbound, z.ZodTypeDef, FileStorageDrivesAddRequest > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), drive: components.DriveInput$outboundSchema, }).transform((v) => { return remap$(v, { drive: "Drive", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace FileStorageDrivesAddRequest$ { /** @deprecated use `FileStorageDrivesAddRequest$inboundSchema` instead. */ export const inboundSchema = FileStorageDrivesAddRequest$inboundSchema; /** @deprecated use `FileStorageDrivesAddRequest$outboundSchema` instead. */ export const outboundSchema = FileStorageDrivesAddRequest$outboundSchema; /** @deprecated use `FileStorageDrivesAddRequest$Outbound` instead. */ export type Outbound = FileStorageDrivesAddRequest$Outbound; } export function fileStorageDrivesAddRequestToJSON( fileStorageDrivesAddRequest: FileStorageDrivesAddRequest, ): string { return JSON.stringify( FileStorageDrivesAddRequest$outboundSchema.parse( fileStorageDrivesAddRequest, ), ); } export function fileStorageDrivesAddRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageDrivesAddRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageDrivesAddRequest' from JSON`, ); } /** @internal */ export const FileStorageDrivesAddResponse$inboundSchema: z.ZodType< FileStorageDrivesAddResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, CreateDriveResponse: components.CreateDriveResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "CreateDriveResponse": "createDriveResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type FileStorageDrivesAddResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; CreateDriveResponse?: components.CreateDriveResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const FileStorageDrivesAddResponse$outboundSchema: z.ZodType< FileStorageDrivesAddResponse$Outbound, z.ZodTypeDef, FileStorageDrivesAddResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, createDriveResponse: components.CreateDriveResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", createDriveResponse: "CreateDriveResponse", 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 FileStorageDrivesAddResponse$ { /** @deprecated use `FileStorageDrivesAddResponse$inboundSchema` instead. */ export const inboundSchema = FileStorageDrivesAddResponse$inboundSchema; /** @deprecated use `FileStorageDrivesAddResponse$outboundSchema` instead. */ export const outboundSchema = FileStorageDrivesAddResponse$outboundSchema; /** @deprecated use `FileStorageDrivesAddResponse$Outbound` instead. */ export type Outbound = FileStorageDrivesAddResponse$Outbound; } export function fileStorageDrivesAddResponseToJSON( fileStorageDrivesAddResponse: FileStorageDrivesAddResponse, ): string { return JSON.stringify( FileStorageDrivesAddResponse$outboundSchema.parse( fileStorageDrivesAddResponse, ), ); } export function fileStorageDrivesAddResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageDrivesAddResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageDrivesAddResponse' from JSON`, ); }