/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PassThroughBody, PassThroughBody$inboundSchema, PassThroughBody$Outbound, PassThroughBody$outboundSchema, } from "./passthroughbody.js"; export type DriveGroupInput = { /** * The name of the drive group */ name: string; /** * The display name of the drive group */ displayName?: string | null | undefined; /** * A description of the object. */ description?: string | null | undefined; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ passThrough?: Array | undefined; }; /** @internal */ export const DriveGroupInput$inboundSchema: z.ZodType< DriveGroupInput, z.ZodTypeDef, unknown > = z.object({ name: z.string(), display_name: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), pass_through: z.array(PassThroughBody$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "display_name": "displayName", "pass_through": "passThrough", }); }); /** @internal */ export type DriveGroupInput$Outbound = { name: string; display_name?: string | null | undefined; description?: string | null | undefined; pass_through?: Array | undefined; }; /** @internal */ export const DriveGroupInput$outboundSchema: z.ZodType< DriveGroupInput$Outbound, z.ZodTypeDef, DriveGroupInput > = z.object({ name: z.string(), displayName: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), passThrough: z.array(PassThroughBody$outboundSchema).optional(), }).transform((v) => { return remap$(v, { displayName: "display_name", passThrough: "pass_through", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DriveGroupInput$ { /** @deprecated use `DriveGroupInput$inboundSchema` instead. */ export const inboundSchema = DriveGroupInput$inboundSchema; /** @deprecated use `DriveGroupInput$outboundSchema` instead. */ export const outboundSchema = DriveGroupInput$outboundSchema; /** @deprecated use `DriveGroupInput$Outbound` instead. */ export type Outbound = DriveGroupInput$Outbound; } export function driveGroupInputToJSON( driveGroupInput: DriveGroupInput, ): string { return JSON.stringify(DriveGroupInput$outboundSchema.parse(driveGroupInput)); } export function driveGroupInputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DriveGroupInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DriveGroupInput' from JSON`, ); }