/* * 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 FileStorageFilesUpdateGlobals = { /** * 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 FileStorageFilesUpdateRequest = { /** * 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; updateFileRequest: components.UpdateFileRequest; }; export type FileStorageFilesUpdateResponse = { httpMeta: components.HTTPMetadata; /** * Files */ updateFileResponse?: components.UpdateFileResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const FileStorageFilesUpdateGlobals$inboundSchema: z.ZodType< FileStorageFilesUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type FileStorageFilesUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const FileStorageFilesUpdateGlobals$outboundSchema: z.ZodType< FileStorageFilesUpdateGlobals$Outbound, z.ZodTypeDef, FileStorageFilesUpdateGlobals > = 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 FileStorageFilesUpdateGlobals$ { /** @deprecated use `FileStorageFilesUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = FileStorageFilesUpdateGlobals$inboundSchema; /** @deprecated use `FileStorageFilesUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = FileStorageFilesUpdateGlobals$outboundSchema; /** @deprecated use `FileStorageFilesUpdateGlobals$Outbound` instead. */ export type Outbound = FileStorageFilesUpdateGlobals$Outbound; } export function fileStorageFilesUpdateGlobalsToJSON( fileStorageFilesUpdateGlobals: FileStorageFilesUpdateGlobals, ): string { return JSON.stringify( FileStorageFilesUpdateGlobals$outboundSchema.parse( fileStorageFilesUpdateGlobals, ), ); } export function fileStorageFilesUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageFilesUpdateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageFilesUpdateGlobals' from JSON`, ); } /** @internal */ export const FileStorageFilesUpdateRequest$inboundSchema: z.ZodType< FileStorageFilesUpdateRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), UpdateFileRequest: components.UpdateFileRequest$inboundSchema, }).transform((v) => { return remap$(v, { "UpdateFileRequest": "updateFileRequest", }); }); /** @internal */ export type FileStorageFilesUpdateRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; UpdateFileRequest: components.UpdateFileRequest$Outbound; }; /** @internal */ export const FileStorageFilesUpdateRequest$outboundSchema: z.ZodType< FileStorageFilesUpdateRequest$Outbound, z.ZodTypeDef, FileStorageFilesUpdateRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), updateFileRequest: components.UpdateFileRequest$outboundSchema, }).transform((v) => { return remap$(v, { updateFileRequest: "UpdateFileRequest", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace FileStorageFilesUpdateRequest$ { /** @deprecated use `FileStorageFilesUpdateRequest$inboundSchema` instead. */ export const inboundSchema = FileStorageFilesUpdateRequest$inboundSchema; /** @deprecated use `FileStorageFilesUpdateRequest$outboundSchema` instead. */ export const outboundSchema = FileStorageFilesUpdateRequest$outboundSchema; /** @deprecated use `FileStorageFilesUpdateRequest$Outbound` instead. */ export type Outbound = FileStorageFilesUpdateRequest$Outbound; } export function fileStorageFilesUpdateRequestToJSON( fileStorageFilesUpdateRequest: FileStorageFilesUpdateRequest, ): string { return JSON.stringify( FileStorageFilesUpdateRequest$outboundSchema.parse( fileStorageFilesUpdateRequest, ), ); } export function fileStorageFilesUpdateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageFilesUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageFilesUpdateRequest' from JSON`, ); } /** @internal */ export const FileStorageFilesUpdateResponse$inboundSchema: z.ZodType< FileStorageFilesUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateFileResponse: components.UpdateFileResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateFileResponse": "updateFileResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type FileStorageFilesUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateFileResponse?: components.UpdateFileResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const FileStorageFilesUpdateResponse$outboundSchema: z.ZodType< FileStorageFilesUpdateResponse$Outbound, z.ZodTypeDef, FileStorageFilesUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateFileResponse: components.UpdateFileResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateFileResponse: "UpdateFileResponse", 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 FileStorageFilesUpdateResponse$ { /** @deprecated use `FileStorageFilesUpdateResponse$inboundSchema` instead. */ export const inboundSchema = FileStorageFilesUpdateResponse$inboundSchema; /** @deprecated use `FileStorageFilesUpdateResponse$outboundSchema` instead. */ export const outboundSchema = FileStorageFilesUpdateResponse$outboundSchema; /** @deprecated use `FileStorageFilesUpdateResponse$Outbound` instead. */ export type Outbound = FileStorageFilesUpdateResponse$Outbound; } export function fileStorageFilesUpdateResponseToJSON( fileStorageFilesUpdateResponse: FileStorageFilesUpdateResponse, ): string { return JSON.stringify( FileStorageFilesUpdateResponse$outboundSchema.parse( fileStorageFilesUpdateResponse, ), ); } export function fileStorageFilesUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageFilesUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageFilesUpdateResponse' from JSON`, ); }