/* * 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 FileStorageFilesOneGlobals = { /** * 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 FileStorageFilesOneRequest = { /** * 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; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ fields?: string | null | undefined; }; export type FileStorageFilesOneResponse = { httpMeta: components.HTTPMetadata; /** * File */ getFileResponse?: components.GetFileResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const FileStorageFilesOneGlobals$inboundSchema: z.ZodType< FileStorageFilesOneGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type FileStorageFilesOneGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const FileStorageFilesOneGlobals$outboundSchema: z.ZodType< FileStorageFilesOneGlobals$Outbound, z.ZodTypeDef, FileStorageFilesOneGlobals > = 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 FileStorageFilesOneGlobals$ { /** @deprecated use `FileStorageFilesOneGlobals$inboundSchema` instead. */ export const inboundSchema = FileStorageFilesOneGlobals$inboundSchema; /** @deprecated use `FileStorageFilesOneGlobals$outboundSchema` instead. */ export const outboundSchema = FileStorageFilesOneGlobals$outboundSchema; /** @deprecated use `FileStorageFilesOneGlobals$Outbound` instead. */ export type Outbound = FileStorageFilesOneGlobals$Outbound; } export function fileStorageFilesOneGlobalsToJSON( fileStorageFilesOneGlobals: FileStorageFilesOneGlobals, ): string { return JSON.stringify( FileStorageFilesOneGlobals$outboundSchema.parse(fileStorageFilesOneGlobals), ); } export function fileStorageFilesOneGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageFilesOneGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageFilesOneGlobals' from JSON`, ); } /** @internal */ export const FileStorageFilesOneRequest$inboundSchema: z.ZodType< FileStorageFilesOneRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), fields: z.nullable(z.string()).optional(), }); /** @internal */ export type FileStorageFilesOneRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; fields?: string | null | undefined; }; /** @internal */ export const FileStorageFilesOneRequest$outboundSchema: z.ZodType< FileStorageFilesOneRequest$Outbound, z.ZodTypeDef, FileStorageFilesOneRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), fields: z.nullable(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 FileStorageFilesOneRequest$ { /** @deprecated use `FileStorageFilesOneRequest$inboundSchema` instead. */ export const inboundSchema = FileStorageFilesOneRequest$inboundSchema; /** @deprecated use `FileStorageFilesOneRequest$outboundSchema` instead. */ export const outboundSchema = FileStorageFilesOneRequest$outboundSchema; /** @deprecated use `FileStorageFilesOneRequest$Outbound` instead. */ export type Outbound = FileStorageFilesOneRequest$Outbound; } export function fileStorageFilesOneRequestToJSON( fileStorageFilesOneRequest: FileStorageFilesOneRequest, ): string { return JSON.stringify( FileStorageFilesOneRequest$outboundSchema.parse(fileStorageFilesOneRequest), ); } export function fileStorageFilesOneRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageFilesOneRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageFilesOneRequest' from JSON`, ); } /** @internal */ export const FileStorageFilesOneResponse$inboundSchema: z.ZodType< FileStorageFilesOneResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetFileResponse: components.GetFileResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetFileResponse": "getFileResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type FileStorageFilesOneResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetFileResponse?: components.GetFileResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const FileStorageFilesOneResponse$outboundSchema: z.ZodType< FileStorageFilesOneResponse$Outbound, z.ZodTypeDef, FileStorageFilesOneResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getFileResponse: components.GetFileResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getFileResponse: "GetFileResponse", 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 FileStorageFilesOneResponse$ { /** @deprecated use `FileStorageFilesOneResponse$inboundSchema` instead. */ export const inboundSchema = FileStorageFilesOneResponse$inboundSchema; /** @deprecated use `FileStorageFilesOneResponse$outboundSchema` instead. */ export const outboundSchema = FileStorageFilesOneResponse$outboundSchema; /** @deprecated use `FileStorageFilesOneResponse$Outbound` instead. */ export type Outbound = FileStorageFilesOneResponse$Outbound; } export function fileStorageFilesOneResponseToJSON( fileStorageFilesOneResponse: FileStorageFilesOneResponse, ): string { return JSON.stringify( FileStorageFilesOneResponse$outboundSchema.parse( fileStorageFilesOneResponse, ), ); } export function fileStorageFilesOneResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageFilesOneResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageFilesOneResponse' from JSON`, ); }