/* * 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 FileStorageDrivesUpdateGlobals = { /** * 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 FileStorageDrivesUpdateRequest = { /** * 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; drive: components.DriveInput; }; export type FileStorageDrivesUpdateResponse = { httpMeta: components.HTTPMetadata; /** * Drives */ updateDriveResponse?: components.UpdateDriveResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const FileStorageDrivesUpdateGlobals$inboundSchema: z.ZodType< FileStorageDrivesUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type FileStorageDrivesUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const FileStorageDrivesUpdateGlobals$outboundSchema: z.ZodType< FileStorageDrivesUpdateGlobals$Outbound, z.ZodTypeDef, FileStorageDrivesUpdateGlobals > = 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 FileStorageDrivesUpdateGlobals$ { /** @deprecated use `FileStorageDrivesUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = FileStorageDrivesUpdateGlobals$inboundSchema; /** @deprecated use `FileStorageDrivesUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = FileStorageDrivesUpdateGlobals$outboundSchema; /** @deprecated use `FileStorageDrivesUpdateGlobals$Outbound` instead. */ export type Outbound = FileStorageDrivesUpdateGlobals$Outbound; } export function fileStorageDrivesUpdateGlobalsToJSON( fileStorageDrivesUpdateGlobals: FileStorageDrivesUpdateGlobals, ): string { return JSON.stringify( FileStorageDrivesUpdateGlobals$outboundSchema.parse( fileStorageDrivesUpdateGlobals, ), ); } export function fileStorageDrivesUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageDrivesUpdateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageDrivesUpdateGlobals' from JSON`, ); } /** @internal */ export const FileStorageDrivesUpdateRequest$inboundSchema: z.ZodType< FileStorageDrivesUpdateRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), Drive: components.DriveInput$inboundSchema, }).transform((v) => { return remap$(v, { "Drive": "drive", }); }); /** @internal */ export type FileStorageDrivesUpdateRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; Drive: components.DriveInput$Outbound; }; /** @internal */ export const FileStorageDrivesUpdateRequest$outboundSchema: z.ZodType< FileStorageDrivesUpdateRequest$Outbound, z.ZodTypeDef, FileStorageDrivesUpdateRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), 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 FileStorageDrivesUpdateRequest$ { /** @deprecated use `FileStorageDrivesUpdateRequest$inboundSchema` instead. */ export const inboundSchema = FileStorageDrivesUpdateRequest$inboundSchema; /** @deprecated use `FileStorageDrivesUpdateRequest$outboundSchema` instead. */ export const outboundSchema = FileStorageDrivesUpdateRequest$outboundSchema; /** @deprecated use `FileStorageDrivesUpdateRequest$Outbound` instead. */ export type Outbound = FileStorageDrivesUpdateRequest$Outbound; } export function fileStorageDrivesUpdateRequestToJSON( fileStorageDrivesUpdateRequest: FileStorageDrivesUpdateRequest, ): string { return JSON.stringify( FileStorageDrivesUpdateRequest$outboundSchema.parse( fileStorageDrivesUpdateRequest, ), ); } export function fileStorageDrivesUpdateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageDrivesUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageDrivesUpdateRequest' from JSON`, ); } /** @internal */ export const FileStorageDrivesUpdateResponse$inboundSchema: z.ZodType< FileStorageDrivesUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateDriveResponse: components.UpdateDriveResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateDriveResponse": "updateDriveResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type FileStorageDrivesUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateDriveResponse?: components.UpdateDriveResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const FileStorageDrivesUpdateResponse$outboundSchema: z.ZodType< FileStorageDrivesUpdateResponse$Outbound, z.ZodTypeDef, FileStorageDrivesUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateDriveResponse: components.UpdateDriveResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateDriveResponse: "UpdateDriveResponse", 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 FileStorageDrivesUpdateResponse$ { /** @deprecated use `FileStorageDrivesUpdateResponse$inboundSchema` instead. */ export const inboundSchema = FileStorageDrivesUpdateResponse$inboundSchema; /** @deprecated use `FileStorageDrivesUpdateResponse$outboundSchema` instead. */ export const outboundSchema = FileStorageDrivesUpdateResponse$outboundSchema; /** @deprecated use `FileStorageDrivesUpdateResponse$Outbound` instead. */ export type Outbound = FileStorageDrivesUpdateResponse$Outbound; } export function fileStorageDrivesUpdateResponseToJSON( fileStorageDrivesUpdateResponse: FileStorageDrivesUpdateResponse, ): string { return JSON.stringify( FileStorageDrivesUpdateResponse$outboundSchema.parse( fileStorageDrivesUpdateResponse, ), ); } export function fileStorageDrivesUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageDrivesUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageDrivesUpdateResponse' from JSON`, ); }