/* * 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 FileStorageDriveGroupsUpdateGlobals = { /** * 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 FileStorageDriveGroupsUpdateRequest = { /** * 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; driveGroup: components.DriveGroupInput; }; export type FileStorageDriveGroupsUpdateResponse = { httpMeta: components.HTTPMetadata; /** * DriveGroups */ updateDriveGroupResponse?: components.UpdateDriveGroupResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const FileStorageDriveGroupsUpdateGlobals$inboundSchema: z.ZodType< FileStorageDriveGroupsUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type FileStorageDriveGroupsUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const FileStorageDriveGroupsUpdateGlobals$outboundSchema: z.ZodType< FileStorageDriveGroupsUpdateGlobals$Outbound, z.ZodTypeDef, FileStorageDriveGroupsUpdateGlobals > = 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 FileStorageDriveGroupsUpdateGlobals$ { /** @deprecated use `FileStorageDriveGroupsUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = FileStorageDriveGroupsUpdateGlobals$inboundSchema; /** @deprecated use `FileStorageDriveGroupsUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = FileStorageDriveGroupsUpdateGlobals$outboundSchema; /** @deprecated use `FileStorageDriveGroupsUpdateGlobals$Outbound` instead. */ export type Outbound = FileStorageDriveGroupsUpdateGlobals$Outbound; } export function fileStorageDriveGroupsUpdateGlobalsToJSON( fileStorageDriveGroupsUpdateGlobals: FileStorageDriveGroupsUpdateGlobals, ): string { return JSON.stringify( FileStorageDriveGroupsUpdateGlobals$outboundSchema.parse( fileStorageDriveGroupsUpdateGlobals, ), ); } export function fileStorageDriveGroupsUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageDriveGroupsUpdateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageDriveGroupsUpdateGlobals' from JSON`, ); } /** @internal */ export const FileStorageDriveGroupsUpdateRequest$inboundSchema: z.ZodType< FileStorageDriveGroupsUpdateRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), DriveGroup: components.DriveGroupInput$inboundSchema, }).transform((v) => { return remap$(v, { "DriveGroup": "driveGroup", }); }); /** @internal */ export type FileStorageDriveGroupsUpdateRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; DriveGroup: components.DriveGroupInput$Outbound; }; /** @internal */ export const FileStorageDriveGroupsUpdateRequest$outboundSchema: z.ZodType< FileStorageDriveGroupsUpdateRequest$Outbound, z.ZodTypeDef, FileStorageDriveGroupsUpdateRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), driveGroup: components.DriveGroupInput$outboundSchema, }).transform((v) => { return remap$(v, { driveGroup: "DriveGroup", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace FileStorageDriveGroupsUpdateRequest$ { /** @deprecated use `FileStorageDriveGroupsUpdateRequest$inboundSchema` instead. */ export const inboundSchema = FileStorageDriveGroupsUpdateRequest$inboundSchema; /** @deprecated use `FileStorageDriveGroupsUpdateRequest$outboundSchema` instead. */ export const outboundSchema = FileStorageDriveGroupsUpdateRequest$outboundSchema; /** @deprecated use `FileStorageDriveGroupsUpdateRequest$Outbound` instead. */ export type Outbound = FileStorageDriveGroupsUpdateRequest$Outbound; } export function fileStorageDriveGroupsUpdateRequestToJSON( fileStorageDriveGroupsUpdateRequest: FileStorageDriveGroupsUpdateRequest, ): string { return JSON.stringify( FileStorageDriveGroupsUpdateRequest$outboundSchema.parse( fileStorageDriveGroupsUpdateRequest, ), ); } export function fileStorageDriveGroupsUpdateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageDriveGroupsUpdateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageDriveGroupsUpdateRequest' from JSON`, ); } /** @internal */ export const FileStorageDriveGroupsUpdateResponse$inboundSchema: z.ZodType< FileStorageDriveGroupsUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateDriveGroupResponse: components.UpdateDriveGroupResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateDriveGroupResponse": "updateDriveGroupResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type FileStorageDriveGroupsUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateDriveGroupResponse?: | components.UpdateDriveGroupResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const FileStorageDriveGroupsUpdateResponse$outboundSchema: z.ZodType< FileStorageDriveGroupsUpdateResponse$Outbound, z.ZodTypeDef, FileStorageDriveGroupsUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateDriveGroupResponse: components.UpdateDriveGroupResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateDriveGroupResponse: "UpdateDriveGroupResponse", 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 FileStorageDriveGroupsUpdateResponse$ { /** @deprecated use `FileStorageDriveGroupsUpdateResponse$inboundSchema` instead. */ export const inboundSchema = FileStorageDriveGroupsUpdateResponse$inboundSchema; /** @deprecated use `FileStorageDriveGroupsUpdateResponse$outboundSchema` instead. */ export const outboundSchema = FileStorageDriveGroupsUpdateResponse$outboundSchema; /** @deprecated use `FileStorageDriveGroupsUpdateResponse$Outbound` instead. */ export type Outbound = FileStorageDriveGroupsUpdateResponse$Outbound; } export function fileStorageDriveGroupsUpdateResponseToJSON( fileStorageDriveGroupsUpdateResponse: FileStorageDriveGroupsUpdateResponse, ): string { return JSON.stringify( FileStorageDriveGroupsUpdateResponse$outboundSchema.parse( fileStorageDriveGroupsUpdateResponse, ), ); } export function fileStorageDriveGroupsUpdateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileStorageDriveGroupsUpdateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileStorageDriveGroupsUpdateResponse' from JSON`, ); }