import {z} from 'zod' export type GoogleCloudAiplatformV1EncryptionSpec = {kmsKeyName?: string | undefined}; export type GoogleRpcStatus = {code?: number | undefined, details?: Array<{[key: string]: unknown}> | undefined, message?: string | undefined}; export type GoogleCloudAiplatformV1StudySpecConvexAutomatedStoppingSpec = {learningRateParameterName?: string | undefined, maxStepCount?: unknown | undefined, minMeasurementCount?: unknown | undefined, minStepCount?: unknown | undefined, updateAllStoppedTrials?: boolean | undefined, useElapsedDuration?: boolean | undefined}; export type GoogleCloudAiplatformV1StudySpecDecayCurveAutomatedStoppingSpec = {useElapsedDuration?: boolean | undefined}; export type GoogleCloudAiplatformV1StudySpecMedianAutomatedStoppingSpec = {useElapsedDuration?: boolean | undefined}; export type GoogleCloudAiplatformV1StudySpecMetricSpecSafetyMetricConfig = {desiredMinSafeTrialsFraction?: number | undefined, safetyThreshold?: number | undefined}; export type GoogleCloudAiplatformV1StudySpecMetricSpec = {goal?: ('GOAL_TYPE_UNSPECIFIED' | 'MAXIMIZE' | 'MINIMIZE') | undefined, metricId?: string | undefined, safetyConfig?: GoogleCloudAiplatformV1StudySpecMetricSpecSafetyMetricConfig | undefined}; export type GoogleCloudAiplatformV1StudySpecParameterSpecCategoricalValueSpec = {defaultValue?: string | undefined, values?: Array | undefined}; export type GoogleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpecCategoricalValueCondition = {values?: Array | undefined}; export type GoogleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpecDiscreteValueCondition = {values?: Array | undefined}; export type GoogleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpecIntValueCondition = {values?: Array | undefined}; export type GoogleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpec = {parameterSpec?: GoogleCloudAiplatformV1StudySpecParameterSpec | undefined, parentCategoricalValues?: GoogleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpecCategoricalValueCondition | undefined, parentDiscreteValues?: GoogleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpecDiscreteValueCondition | undefined, parentIntValues?: GoogleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpecIntValueCondition | undefined}; export type GoogleCloudAiplatformV1StudySpecParameterSpecDiscreteValueSpec = {defaultValue?: number | undefined, values?: Array | undefined}; export type GoogleCloudAiplatformV1StudySpecParameterSpecDoubleValueSpec = {defaultValue?: number | undefined, maxValue?: number | undefined, minValue?: number | undefined}; export type GoogleCloudAiplatformV1StudySpecParameterSpecIntegerValueSpec = {defaultValue?: unknown | undefined, maxValue?: unknown | undefined, minValue?: unknown | undefined}; export type GoogleCloudAiplatformV1StudySpecParameterSpec = {categoricalValueSpec?: GoogleCloudAiplatformV1StudySpecParameterSpecCategoricalValueSpec | undefined, conditionalParameterSpecs?: Array | undefined, discreteValueSpec?: GoogleCloudAiplatformV1StudySpecParameterSpecDiscreteValueSpec | undefined, doubleValueSpec?: GoogleCloudAiplatformV1StudySpecParameterSpecDoubleValueSpec | undefined, integerValueSpec?: GoogleCloudAiplatformV1StudySpecParameterSpecIntegerValueSpec | undefined, parameterId?: string | undefined, scaleType?: ('SCALE_TYPE_UNSPECIFIED' | 'UNIT_LINEAR_SCALE' | 'UNIT_LOG_SCALE' | 'UNIT_REVERSE_LOG_SCALE') | undefined}; export type GoogleCloudAiplatformV1StudyTimeConstraint = {endTime?: unknown | undefined, maxDuration?: unknown | undefined}; export type GoogleCloudAiplatformV1StudySpecStudyStoppingConfig = {maxDurationNoProgress?: unknown | undefined, maxNumTrials?: number | undefined, maxNumTrialsNoProgress?: number | undefined, maximumRuntimeConstraint?: GoogleCloudAiplatformV1StudyTimeConstraint | undefined, minNumTrials?: number | undefined, minimumRuntimeConstraint?: GoogleCloudAiplatformV1StudyTimeConstraint | undefined, shouldStopAsap?: boolean | undefined}; export type GoogleCloudAiplatformV1StudySpec = {algorithm?: ('ALGORITHM_UNSPECIFIED' | 'GRID_SEARCH' | 'RANDOM_SEARCH') | undefined, convexAutomatedStoppingSpec?: GoogleCloudAiplatformV1StudySpecConvexAutomatedStoppingSpec | undefined, decayCurveStoppingSpec?: GoogleCloudAiplatformV1StudySpecDecayCurveAutomatedStoppingSpec | undefined, measurementSelectionType?: ('MEASUREMENT_SELECTION_TYPE_UNSPECIFIED' | 'LAST_MEASUREMENT' | 'BEST_MEASUREMENT') | undefined, medianAutomatedStoppingSpec?: GoogleCloudAiplatformV1StudySpecMedianAutomatedStoppingSpec | undefined, metrics?: Array | undefined, observationNoise?: ('OBSERVATION_NOISE_UNSPECIFIED' | 'LOW' | 'HIGH') | undefined, parameters?: Array | undefined, studyStoppingConfig?: GoogleCloudAiplatformV1StudySpecStudyStoppingConfig | undefined}; export type GoogleCloudAiplatformV1GcsDestination = {outputUriPrefix?: string | undefined}; export type GoogleCloudAiplatformV1DnsPeeringConfig = {domain?: string | undefined, targetNetwork?: string | undefined, targetProject?: string | undefined}; export type GoogleCloudAiplatformV1PscInterfaceConfig = {dnsPeeringConfigs?: Array | undefined, networkAttachment?: string | undefined}; export type GoogleCloudAiplatformV1Scheduling = {disableRetries?: boolean | undefined, maxWaitDuration?: unknown | undefined, restartJobOnWorkerRestart?: boolean | undefined, strategy?: ('STRATEGY_UNSPECIFIED' | 'ON_DEMAND' | 'LOW_COST' | 'STANDARD' | 'SPOT' | 'FLEX_START') | undefined, timeout?: unknown | undefined}; export type GoogleCloudAiplatformV1EnvVar = {name?: string | undefined, value?: string | undefined}; export type GoogleCloudAiplatformV1ContainerSpec = {args?: Array | undefined, command?: Array | undefined, env?: Array | undefined, imageUri?: string | undefined}; export type GoogleCloudAiplatformV1DiskSpec = {bootDiskSizeGb?: number | undefined, bootDiskType?: string | undefined}; export type GoogleCloudAiplatformV1LustreMount = {filesystem?: string | undefined, instanceIp?: string | undefined, mountPoint?: string | undefined, volumeHandle?: string | undefined}; export type GoogleCloudAiplatformV1ReservationAffinity = {key?: string | undefined, reservationAffinityType?: ('TYPE_UNSPECIFIED' | 'NO_RESERVATION' | 'ANY_RESERVATION' | 'SPECIFIC_RESERVATION') | undefined, values?: Array | undefined}; export type GoogleCloudAiplatformV1MachineSpec = {acceleratorCount?: number | undefined, acceleratorType?: ('ACCELERATOR_TYPE_UNSPECIFIED' | 'NVIDIA_TESLA_K80' | 'NVIDIA_TESLA_P100' | 'NVIDIA_TESLA_V100' | 'NVIDIA_TESLA_P4' | 'NVIDIA_TESLA_T4' | 'NVIDIA_TESLA_A100' | 'NVIDIA_A100_80GB' | 'NVIDIA_L4' | 'NVIDIA_H100_80GB' | 'NVIDIA_H100_MEGA_80GB' | 'NVIDIA_H200_141GB' | 'NVIDIA_B200' | 'NVIDIA_GB200' | 'NVIDIA_RTX_PRO_6000' | 'TPU_V2' | 'TPU_V3' | 'TPU_V4_POD' | 'TPU_V5_LITEPOD') | undefined, gpuPartitionSize?: string | undefined, machineType?: string | undefined, reservationAffinity?: GoogleCloudAiplatformV1ReservationAffinity | undefined, tpuTopology?: string | undefined}; export type GoogleCloudAiplatformV1NfsMount = {mountPoint?: string | undefined, path?: string | undefined, server?: string | undefined}; export type GoogleCloudAiplatformV1PythonPackageSpec = {args?: Array | undefined, env?: Array | undefined, executorImageUri?: string | undefined, packageUris?: Array | undefined, pythonModule?: string | undefined}; export type GoogleCloudAiplatformV1WorkerPoolSpec = {containerSpec?: GoogleCloudAiplatformV1ContainerSpec | undefined, diskSpec?: GoogleCloudAiplatformV1DiskSpec | undefined, lustreMounts?: Array | undefined, machineSpec?: GoogleCloudAiplatformV1MachineSpec | undefined, nfsMounts?: Array | undefined, pythonPackageSpec?: GoogleCloudAiplatformV1PythonPackageSpec | undefined, replicaCount?: unknown | undefined}; export type GoogleCloudAiplatformV1CustomJobSpec = {baseOutputDirectory?: GoogleCloudAiplatformV1GcsDestination | undefined, enableDashboardAccess?: boolean | undefined, enableWebAccess?: boolean | undefined, experiment?: string | undefined, experimentRun?: string | undefined, models?: Array | undefined, network?: string | undefined, persistentResourceId?: string | undefined, protectedArtifactLocationId?: string | undefined, pscInterfaceConfig?: GoogleCloudAiplatformV1PscInterfaceConfig | undefined, reservedIpRanges?: Array | undefined, scheduling?: GoogleCloudAiplatformV1Scheduling | undefined, serviceAccount?: string | undefined, tensorboard?: string | undefined, workerPoolSpecs?: Array | undefined}; export type GoogleCloudAiplatformV1MeasurementMetric = {metricId?: string | undefined, value?: number | undefined}; export type GoogleCloudAiplatformV1Measurement = {elapsedDuration?: unknown | undefined, metrics?: Array | undefined, stepCount?: unknown | undefined}; export type GoogleCloudAiplatformV1TrialParameter = {parameterId?: string | undefined, value: unknown}; export type GoogleCloudAiplatformV1Trial = {clientId?: string | undefined, customJob?: string | undefined, endTime?: unknown | undefined, finalMeasurement?: GoogleCloudAiplatformV1Measurement | undefined, id?: string | undefined, infeasibleReason?: string | undefined, measurements?: Array | undefined, name?: string | undefined, parameters?: Array | undefined, startTime?: unknown | undefined, state?: ('STATE_UNSPECIFIED' | 'REQUESTED' | 'ACTIVE' | 'STOPPING' | 'SUCCEEDED' | 'INFEASIBLE') | undefined, webAccessUris?: {[key: string]: string} | undefined}; export type GoogleCloudAiplatformV1HyperparameterTuningJob = {createTime?: unknown | undefined, displayName?: string | undefined, encryptionSpec?: GoogleCloudAiplatformV1EncryptionSpec | undefined, endTime?: unknown | undefined, error?: GoogleRpcStatus | undefined, labels?: {[key: string]: string} | undefined, maxFailedTrialCount?: number | undefined, maxTrialCount?: number | undefined, name?: string | undefined, parallelTrialCount?: number | undefined, satisfiesPzi?: boolean | undefined, satisfiesPzs?: boolean | undefined, startTime?: unknown | undefined, state?: ('JOB_STATE_UNSPECIFIED' | 'JOB_STATE_QUEUED' | 'JOB_STATE_PENDING' | 'JOB_STATE_RUNNING' | 'JOB_STATE_SUCCEEDED' | 'JOB_STATE_FAILED' | 'JOB_STATE_CANCELLING' | 'JOB_STATE_CANCELLED' | 'JOB_STATE_PAUSED' | 'JOB_STATE_EXPIRED' | 'JOB_STATE_UPDATING' | 'JOB_STATE_PARTIALLY_SUCCEEDED') | undefined, studySpec?: GoogleCloudAiplatformV1StudySpec | undefined, trialJobSpec?: GoogleCloudAiplatformV1CustomJobSpec | undefined, trials?: Array | undefined, updateTime?: unknown | undefined}; export type CreateApiV1ProjectsProjectsIdLocationsLocationsIdHyperparameterTuningJobsArgs = {projectsId: string, locationsId: string, body: GoogleCloudAiplatformV1HyperparameterTuningJob}; export type CreateApiV1ProjectsProjectsIdLocationsLocationsIdHyperparameterTuningJobsOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; export const googleCloudAiplatformV1EncryptionSpec = z.object({kmsKeyName: z.string().optional()}); export const googleRpcStatus = z.object({code: z.number().int().optional(), details: z.array(z.record(z.string(), z.unknown())).optional(), message: z.string().optional()}); export const googleCloudAiplatformV1StudySpecConvexAutomatedStoppingSpec = z.object({learningRateParameterName: z.string().optional(), maxStepCount: z.string().optional(), minMeasurementCount: z.string().optional(), minStepCount: z.string().optional(), updateAllStoppedTrials: z.boolean().optional(), useElapsedDuration: z.boolean().optional()}); export const googleCloudAiplatformV1StudySpecDecayCurveAutomatedStoppingSpec = z.object({useElapsedDuration: z.boolean().optional()}); export const googleCloudAiplatformV1StudySpecMedianAutomatedStoppingSpec = z.object({useElapsedDuration: z.boolean().optional()}); export const googleCloudAiplatformV1StudySpecMetricSpecSafetyMetricConfig = z.object({desiredMinSafeTrialsFraction: z.number().optional(), safetyThreshold: z.number().optional()}); export const googleCloudAiplatformV1StudySpecMetricSpec = z.object({goal: z.enum(["GOAL_TYPE_UNSPECIFIED", "MAXIMIZE", "MINIMIZE"]).optional(), metricId: z.string().optional(), safetyConfig: googleCloudAiplatformV1StudySpecMetricSpecSafetyMetricConfig.optional()}); export const googleCloudAiplatformV1StudySpecParameterSpecCategoricalValueSpec = z.object({defaultValue: z.string().optional(), values: z.array(z.string()).optional()}); export const googleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpecCategoricalValueCondition = z.object({values: z.array(z.string()).optional()}); export const googleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpecDiscreteValueCondition = z.object({values: z.array(z.number()).optional()}); export const googleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpecIntValueCondition = z.object({values: z.array(z.string()).optional()}); export const googleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpec = z.object({parameterSpec: z.lazy(() => googleCloudAiplatformV1StudySpecParameterSpec.optional()), parentCategoricalValues: googleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpecCategoricalValueCondition.optional(), parentDiscreteValues: googleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpecDiscreteValueCondition.optional(), parentIntValues: googleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpecIntValueCondition.optional()}); export const googleCloudAiplatformV1StudySpecParameterSpecDiscreteValueSpec = z.object({defaultValue: z.number().optional(), values: z.array(z.number()).optional()}); export const googleCloudAiplatformV1StudySpecParameterSpecDoubleValueSpec = z.object({defaultValue: z.number().optional(), maxValue: z.number().optional(), minValue: z.number().optional()}); export const googleCloudAiplatformV1StudySpecParameterSpecIntegerValueSpec = z.object({defaultValue: z.string().optional(), maxValue: z.string().optional(), minValue: z.string().optional()}); export const googleCloudAiplatformV1StudySpecParameterSpec: z.ZodType = z.object({categoricalValueSpec: googleCloudAiplatformV1StudySpecParameterSpecCategoricalValueSpec.optional(), conditionalParameterSpecs: z.array(googleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpec).optional(), discreteValueSpec: googleCloudAiplatformV1StudySpecParameterSpecDiscreteValueSpec.optional(), doubleValueSpec: googleCloudAiplatformV1StudySpecParameterSpecDoubleValueSpec.optional(), integerValueSpec: googleCloudAiplatformV1StudySpecParameterSpecIntegerValueSpec.optional(), parameterId: z.string().optional(), scaleType: z.enum(["SCALE_TYPE_UNSPECIFIED", "UNIT_LINEAR_SCALE", "UNIT_LOG_SCALE", "UNIT_REVERSE_LOG_SCALE"]).optional()}); export const googleCloudAiplatformV1StudyTimeConstraint = z.object({endTime: z.string().optional(), maxDuration: z.string().optional()}); export const googleCloudAiplatformV1StudySpecStudyStoppingConfig = z.object({maxDurationNoProgress: z.string().optional(), maxNumTrials: z.number().int().optional(), maxNumTrialsNoProgress: z.number().int().optional(), maximumRuntimeConstraint: googleCloudAiplatformV1StudyTimeConstraint.optional(), minNumTrials: z.number().int().optional(), minimumRuntimeConstraint: googleCloudAiplatformV1StudyTimeConstraint.optional(), shouldStopAsap: z.boolean().optional()}); export const googleCloudAiplatformV1StudySpec = z.object({algorithm: z.enum(["ALGORITHM_UNSPECIFIED", "GRID_SEARCH", "RANDOM_SEARCH"]).optional(), convexAutomatedStoppingSpec: googleCloudAiplatformV1StudySpecConvexAutomatedStoppingSpec.optional(), decayCurveStoppingSpec: googleCloudAiplatformV1StudySpecDecayCurveAutomatedStoppingSpec.optional(), measurementSelectionType: z.enum(["MEASUREMENT_SELECTION_TYPE_UNSPECIFIED", "LAST_MEASUREMENT", "BEST_MEASUREMENT"]).optional(), medianAutomatedStoppingSpec: googleCloudAiplatformV1StudySpecMedianAutomatedStoppingSpec.optional(), metrics: z.array(googleCloudAiplatformV1StudySpecMetricSpec).optional(), observationNoise: z.enum(["OBSERVATION_NOISE_UNSPECIFIED", "LOW", "HIGH"]).optional(), parameters: z.array(googleCloudAiplatformV1StudySpecParameterSpec).optional(), studyStoppingConfig: googleCloudAiplatformV1StudySpecStudyStoppingConfig.optional()}); export const googleCloudAiplatformV1GcsDestination = z.object({outputUriPrefix: z.string().optional()}); export const googleCloudAiplatformV1DnsPeeringConfig = z.object({domain: z.string().optional(), targetNetwork: z.string().optional(), targetProject: z.string().optional()}); export const googleCloudAiplatformV1PscInterfaceConfig = z.object({dnsPeeringConfigs: z.array(googleCloudAiplatformV1DnsPeeringConfig).optional(), networkAttachment: z.string().optional()}); export const googleCloudAiplatformV1Scheduling = z.object({disableRetries: z.boolean().optional(), maxWaitDuration: z.string().optional(), restartJobOnWorkerRestart: z.boolean().optional(), strategy: z.enum(["STRATEGY_UNSPECIFIED", "ON_DEMAND", "LOW_COST", "STANDARD", "SPOT", "FLEX_START"]).optional(), timeout: z.string().optional()}); export const googleCloudAiplatformV1EnvVar = z.object({name: z.string().optional(), value: z.string().optional()}); export const googleCloudAiplatformV1ContainerSpec = z.object({args: z.array(z.string()).optional(), command: z.array(z.string()).optional(), env: z.array(googleCloudAiplatformV1EnvVar).optional(), imageUri: z.string().optional()}); export const googleCloudAiplatformV1DiskSpec = z.object({bootDiskSizeGb: z.number().int().optional(), bootDiskType: z.string().optional()}); export const googleCloudAiplatformV1LustreMount = z.object({filesystem: z.string().optional(), instanceIp: z.string().optional(), mountPoint: z.string().optional(), volumeHandle: z.string().optional()}); export const googleCloudAiplatformV1ReservationAffinity = z.object({key: z.string().optional(), reservationAffinityType: z.enum(["TYPE_UNSPECIFIED", "NO_RESERVATION", "ANY_RESERVATION", "SPECIFIC_RESERVATION"]).optional(), values: z.array(z.string()).optional()}); export const googleCloudAiplatformV1MachineSpec = z.object({acceleratorCount: z.number().int().optional(), acceleratorType: z.enum(["ACCELERATOR_TYPE_UNSPECIFIED", "NVIDIA_TESLA_K80", "NVIDIA_TESLA_P100", "NVIDIA_TESLA_V100", "NVIDIA_TESLA_P4", "NVIDIA_TESLA_T4", "NVIDIA_TESLA_A100", "NVIDIA_A100_80GB", "NVIDIA_L4", "NVIDIA_H100_80GB", "NVIDIA_H100_MEGA_80GB", "NVIDIA_H200_141GB", "NVIDIA_B200", "NVIDIA_GB200", "NVIDIA_RTX_PRO_6000", "TPU_V2", "TPU_V3", "TPU_V4_POD", "TPU_V5_LITEPOD"]).optional(), gpuPartitionSize: z.string().optional(), machineType: z.string().optional(), reservationAffinity: googleCloudAiplatformV1ReservationAffinity.optional(), tpuTopology: z.string().optional()}); export const googleCloudAiplatformV1NfsMount = z.object({mountPoint: z.string().optional(), path: z.string().optional(), server: z.string().optional()}); export const googleCloudAiplatformV1PythonPackageSpec = z.object({args: z.array(z.string()).optional(), env: z.array(googleCloudAiplatformV1EnvVar).optional(), executorImageUri: z.string().optional(), packageUris: z.array(z.string()).optional(), pythonModule: z.string().optional()}); export const googleCloudAiplatformV1WorkerPoolSpec = z.object({containerSpec: googleCloudAiplatformV1ContainerSpec.optional(), diskSpec: googleCloudAiplatformV1DiskSpec.optional(), lustreMounts: z.array(googleCloudAiplatformV1LustreMount).optional(), machineSpec: googleCloudAiplatformV1MachineSpec.optional(), nfsMounts: z.array(googleCloudAiplatformV1NfsMount).optional(), pythonPackageSpec: googleCloudAiplatformV1PythonPackageSpec.optional(), replicaCount: z.string().optional()}); export const googleCloudAiplatformV1CustomJobSpec = z.object({baseOutputDirectory: googleCloudAiplatformV1GcsDestination.optional(), enableDashboardAccess: z.boolean().optional(), enableWebAccess: z.boolean().optional(), experiment: z.string().optional(), experimentRun: z.string().optional(), models: z.array(z.string()).optional(), network: z.string().optional(), persistentResourceId: z.string().optional(), protectedArtifactLocationId: z.string().optional(), pscInterfaceConfig: googleCloudAiplatformV1PscInterfaceConfig.optional(), reservedIpRanges: z.array(z.string()).optional(), scheduling: googleCloudAiplatformV1Scheduling.optional(), serviceAccount: z.string().optional(), tensorboard: z.string().optional(), workerPoolSpecs: z.array(googleCloudAiplatformV1WorkerPoolSpec).optional()}); export const googleCloudAiplatformV1MeasurementMetric = z.object({metricId: z.string().optional(), value: z.number().optional()}); export const googleCloudAiplatformV1Measurement = z.object({elapsedDuration: z.string().optional(), metrics: z.array(googleCloudAiplatformV1MeasurementMetric).optional(), stepCount: z.string().optional()}); export const googleCloudAiplatformV1TrialParameter = z.object({parameterId: z.string().optional(), value: z.unknown()}); export const googleCloudAiplatformV1Trial = z.object({clientId: z.string().optional(), customJob: z.string().optional(), endTime: z.string().optional(), finalMeasurement: googleCloudAiplatformV1Measurement.optional(), id: z.string().optional(), infeasibleReason: z.string().optional(), measurements: z.array(googleCloudAiplatformV1Measurement).optional(), name: z.string().optional(), parameters: z.array(googleCloudAiplatformV1TrialParameter).optional(), startTime: z.string().optional(), state: z.enum(["STATE_UNSPECIFIED", "REQUESTED", "ACTIVE", "STOPPING", "SUCCEEDED", "INFEASIBLE"]).optional(), webAccessUris: z.record(z.string(), z.string()).optional()}); export const googleCloudAiplatformV1HyperparameterTuningJob = z.object({createTime: z.string().optional(), displayName: z.string().optional(), encryptionSpec: googleCloudAiplatformV1EncryptionSpec.optional(), endTime: z.string().optional(), error: googleRpcStatus.optional(), labels: z.record(z.string(), z.string()).optional(), maxFailedTrialCount: z.number().int().optional(), maxTrialCount: z.number().int().optional(), name: z.string().optional(), parallelTrialCount: z.number().int().optional(), satisfiesPzi: z.boolean().optional(), satisfiesPzs: z.boolean().optional(), startTime: z.string().optional(), state: z.enum(["JOB_STATE_UNSPECIFIED", "JOB_STATE_QUEUED", "JOB_STATE_PENDING", "JOB_STATE_RUNNING", "JOB_STATE_SUCCEEDED", "JOB_STATE_FAILED", "JOB_STATE_CANCELLING", "JOB_STATE_CANCELLED", "JOB_STATE_PAUSED", "JOB_STATE_EXPIRED", "JOB_STATE_UPDATING", "JOB_STATE_PARTIALLY_SUCCEEDED"]).optional(), studySpec: googleCloudAiplatformV1StudySpec.optional(), trialJobSpec: googleCloudAiplatformV1CustomJobSpec.optional(), trials: z.array(googleCloudAiplatformV1Trial).optional(), updateTime: z.string().optional()}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Creates a HyperparameterTuningJob * * POST /v1/projects/{projectsId}/locations/{locationsId}/hyperparameterTuningJobs */ export const createApiV1ProjectsProjectsIdLocationsLocationsIdHyperparameterTuningJobs = async (args: CreateApiV1ProjectsProjectsIdLocationsLocationsIdHyperparameterTuningJobsArgs, options?: CreateApiV1ProjectsProjectsIdLocationsLocationsIdHyperparameterTuningJobsOptions) => { const {baseUrl = "https://aiplatform.googleapis.com", fetch: fetchFn = fetch, Oauth2, Oauth2c} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (Oauth2 !== undefined) headers.set('authorization', `Bearer ${Oauth2}`) if (Oauth2c !== undefined) headers.set('authorization', `Bearer ${Oauth2c}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/projects/${encodeURIComponent(String(args.projectsId))}/locations/${encodeURIComponent(String(args.locationsId))}/hyperparameterTuningJobs${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(googleCloudAiplatformV1HyperparameterTuningJob, await res.json()) };