/*
* 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 FileStorageDriveGroupsOneGlobals = {
/**
* 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 FileStorageDriveGroupsOneRequest = {
/**
* 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 FileStorageDriveGroupsOneResponse = {
httpMeta: components.HTTPMetadata;
/**
* DriveGroups
*/
getDriveGroupResponse?: components.GetDriveGroupResponse | undefined;
/**
* Unexpected error
*/
unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined;
};
/** @internal */
export const FileStorageDriveGroupsOneGlobals$inboundSchema: z.ZodType<
FileStorageDriveGroupsOneGlobals,
z.ZodTypeDef,
unknown
> = z.object({
consumerId: z.string().optional(),
appId: z.string().optional(),
});
/** @internal */
export type FileStorageDriveGroupsOneGlobals$Outbound = {
consumerId?: string | undefined;
appId?: string | undefined;
};
/** @internal */
export const FileStorageDriveGroupsOneGlobals$outboundSchema: z.ZodType<
FileStorageDriveGroupsOneGlobals$Outbound,
z.ZodTypeDef,
FileStorageDriveGroupsOneGlobals
> = 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 FileStorageDriveGroupsOneGlobals$ {
/** @deprecated use `FileStorageDriveGroupsOneGlobals$inboundSchema` instead. */
export const inboundSchema = FileStorageDriveGroupsOneGlobals$inboundSchema;
/** @deprecated use `FileStorageDriveGroupsOneGlobals$outboundSchema` instead. */
export const outboundSchema = FileStorageDriveGroupsOneGlobals$outboundSchema;
/** @deprecated use `FileStorageDriveGroupsOneGlobals$Outbound` instead. */
export type Outbound = FileStorageDriveGroupsOneGlobals$Outbound;
}
export function fileStorageDriveGroupsOneGlobalsToJSON(
fileStorageDriveGroupsOneGlobals: FileStorageDriveGroupsOneGlobals,
): string {
return JSON.stringify(
FileStorageDriveGroupsOneGlobals$outboundSchema.parse(
fileStorageDriveGroupsOneGlobals,
),
);
}
export function fileStorageDriveGroupsOneGlobalsFromJSON(
jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => FileStorageDriveGroupsOneGlobals$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'FileStorageDriveGroupsOneGlobals' from JSON`,
);
}
/** @internal */
export const FileStorageDriveGroupsOneRequest$inboundSchema: z.ZodType<
FileStorageDriveGroupsOneRequest,
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 FileStorageDriveGroupsOneRequest$Outbound = {
id: string;
serviceId?: string | undefined;
raw: boolean;
fields?: string | null | undefined;
};
/** @internal */
export const FileStorageDriveGroupsOneRequest$outboundSchema: z.ZodType<
FileStorageDriveGroupsOneRequest$Outbound,
z.ZodTypeDef,
FileStorageDriveGroupsOneRequest
> = 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 FileStorageDriveGroupsOneRequest$ {
/** @deprecated use `FileStorageDriveGroupsOneRequest$inboundSchema` instead. */
export const inboundSchema = FileStorageDriveGroupsOneRequest$inboundSchema;
/** @deprecated use `FileStorageDriveGroupsOneRequest$outboundSchema` instead. */
export const outboundSchema = FileStorageDriveGroupsOneRequest$outboundSchema;
/** @deprecated use `FileStorageDriveGroupsOneRequest$Outbound` instead. */
export type Outbound = FileStorageDriveGroupsOneRequest$Outbound;
}
export function fileStorageDriveGroupsOneRequestToJSON(
fileStorageDriveGroupsOneRequest: FileStorageDriveGroupsOneRequest,
): string {
return JSON.stringify(
FileStorageDriveGroupsOneRequest$outboundSchema.parse(
fileStorageDriveGroupsOneRequest,
),
);
}
export function fileStorageDriveGroupsOneRequestFromJSON(
jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => FileStorageDriveGroupsOneRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'FileStorageDriveGroupsOneRequest' from JSON`,
);
}
/** @internal */
export const FileStorageDriveGroupsOneResponse$inboundSchema: z.ZodType<
FileStorageDriveGroupsOneResponse,
z.ZodTypeDef,
unknown
> = z.object({
HttpMeta: components.HTTPMetadata$inboundSchema,
GetDriveGroupResponse: components.GetDriveGroupResponse$inboundSchema
.optional(),
UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema
.optional(),
}).transform((v) => {
return remap$(v, {
"HttpMeta": "httpMeta",
"GetDriveGroupResponse": "getDriveGroupResponse",
"UnexpectedErrorResponse": "unexpectedErrorResponse",
});
});
/** @internal */
export type FileStorageDriveGroupsOneResponse$Outbound = {
HttpMeta: components.HTTPMetadata$Outbound;
GetDriveGroupResponse?: components.GetDriveGroupResponse$Outbound | undefined;
UnexpectedErrorResponse?:
| components.UnexpectedErrorResponse$Outbound
| undefined;
};
/** @internal */
export const FileStorageDriveGroupsOneResponse$outboundSchema: z.ZodType<
FileStorageDriveGroupsOneResponse$Outbound,
z.ZodTypeDef,
FileStorageDriveGroupsOneResponse
> = z.object({
httpMeta: components.HTTPMetadata$outboundSchema,
getDriveGroupResponse: components.GetDriveGroupResponse$outboundSchema
.optional(),
unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema
.optional(),
}).transform((v) => {
return remap$(v, {
httpMeta: "HttpMeta",
getDriveGroupResponse: "GetDriveGroupResponse",
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 FileStorageDriveGroupsOneResponse$ {
/** @deprecated use `FileStorageDriveGroupsOneResponse$inboundSchema` instead. */
export const inboundSchema = FileStorageDriveGroupsOneResponse$inboundSchema;
/** @deprecated use `FileStorageDriveGroupsOneResponse$outboundSchema` instead. */
export const outboundSchema =
FileStorageDriveGroupsOneResponse$outboundSchema;
/** @deprecated use `FileStorageDriveGroupsOneResponse$Outbound` instead. */
export type Outbound = FileStorageDriveGroupsOneResponse$Outbound;
}
export function fileStorageDriveGroupsOneResponseToJSON(
fileStorageDriveGroupsOneResponse: FileStorageDriveGroupsOneResponse,
): string {
return JSON.stringify(
FileStorageDriveGroupsOneResponse$outboundSchema.parse(
fileStorageDriveGroupsOneResponse,
),
);
}
export function fileStorageDriveGroupsOneResponseFromJSON(
jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => FileStorageDriveGroupsOneResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'FileStorageDriveGroupsOneResponse' from JSON`,
);
}