import {z} from 'zod' export type GoogleCloudAiplatformV1CompletionStats = {failedCount?: unknown | undefined, incompleteCount?: unknown | undefined, successfulCount?: unknown | undefined, successfulForecastPointCount?: unknown | 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 GoogleCloudAiplatformV1BatchDedicatedResources = {machineSpec?: GoogleCloudAiplatformV1MachineSpec | undefined, maxReplicaCount?: number | undefined, startingReplicaCount?: number | undefined}; export type GoogleCloudAiplatformV1EncryptionSpec = {kmsKeyName?: string | undefined}; export type GoogleRpcStatus = {code?: number | undefined, details?: Array<{[key: string]: unknown}> | undefined, message?: string | undefined}; export type GoogleCloudAiplatformV1ExplanationMetadataInputMetadataFeatureValueDomain = {maxValue?: number | undefined, minValue?: number | undefined, originalMean?: number | undefined, originalStddev?: number | undefined}; export type GoogleCloudAiplatformV1ExplanationMetadataInputMetadataVisualization = {clipPercentLowerbound?: number | undefined, clipPercentUpperbound?: number | undefined, colorMap?: ('COLOR_MAP_UNSPECIFIED' | 'PINK_GREEN' | 'VIRIDIS' | 'RED' | 'GREEN' | 'RED_GREEN' | 'PINK_WHITE_GREEN') | undefined, overlayType?: ('OVERLAY_TYPE_UNSPECIFIED' | 'NONE' | 'ORIGINAL' | 'GRAYSCALE' | 'MASK_BLACK') | undefined, polarity?: ('POLARITY_UNSPECIFIED' | 'POSITIVE' | 'NEGATIVE' | 'BOTH') | undefined, type?: ('TYPE_UNSPECIFIED' | 'PIXELS' | 'OUTLINES') | undefined}; export type GoogleCloudAiplatformV1ExplanationMetadataInputMetadata = {denseShapeTensorName?: string | undefined, encodedBaselines?: Array | undefined, encodedTensorName?: string | undefined, encoding?: ('ENCODING_UNSPECIFIED' | 'IDENTITY' | 'BAG_OF_FEATURES' | 'BAG_OF_FEATURES_SPARSE' | 'INDICATOR' | 'COMBINED_EMBEDDING' | 'CONCAT_EMBEDDING') | undefined, featureValueDomain?: GoogleCloudAiplatformV1ExplanationMetadataInputMetadataFeatureValueDomain | undefined, groupName?: string | undefined, indexFeatureMapping?: Array | undefined, indicesTensorName?: string | undefined, inputBaselines?: Array | undefined, inputTensorName?: string | undefined, modality?: string | undefined, visualization?: GoogleCloudAiplatformV1ExplanationMetadataInputMetadataVisualization | undefined}; export type GoogleCloudAiplatformV1ExplanationMetadataOutputMetadata = {displayNameMappingKey?: string | undefined, indexDisplayNameMapping: unknown, outputTensorName?: string | undefined}; export type GoogleCloudAiplatformV1ExplanationMetadata = {featureAttributionsSchemaUri?: string | undefined, inputs?: {[key: string]: GoogleCloudAiplatformV1ExplanationMetadataInputMetadata} | undefined, latentSpaceSource?: string | undefined, outputs?: {[key: string]: GoogleCloudAiplatformV1ExplanationMetadataOutputMetadata} | undefined}; export type GoogleCloudAiplatformV1GcsSource = {uris?: Array | undefined}; export type GoogleCloudAiplatformV1ExamplesExampleGcsSource = {dataFormat?: ('DATA_FORMAT_UNSPECIFIED' | 'JSONL') | undefined, gcsSource?: GoogleCloudAiplatformV1GcsSource | undefined}; export type GoogleCloudAiplatformV1Presets = {modality?: ('MODALITY_UNSPECIFIED' | 'IMAGE' | 'TEXT' | 'TABULAR') | undefined, query?: ('PRECISE' | 'FAST') | undefined}; export type GoogleCloudAiplatformV1Examples = {exampleGcsSource?: GoogleCloudAiplatformV1ExamplesExampleGcsSource | undefined, nearestNeighborSearchConfig: unknown, neighborCount?: number | undefined, presets?: GoogleCloudAiplatformV1Presets | undefined}; export type GoogleCloudAiplatformV1BlurBaselineConfig = {maxBlurSigma?: number | undefined}; export type GoogleCloudAiplatformV1FeatureNoiseSigmaNoiseSigmaForFeature = {name?: string | undefined, sigma?: number | undefined}; export type GoogleCloudAiplatformV1FeatureNoiseSigma = {noiseSigma?: Array | undefined}; export type GoogleCloudAiplatformV1SmoothGradConfig = {featureNoiseSigma?: GoogleCloudAiplatformV1FeatureNoiseSigma | undefined, noiseSigma?: number | undefined, noisySampleCount?: number | undefined}; export type GoogleCloudAiplatformV1IntegratedGradientsAttribution = {blurBaselineConfig?: GoogleCloudAiplatformV1BlurBaselineConfig | undefined, smoothGradConfig?: GoogleCloudAiplatformV1SmoothGradConfig | undefined, stepCount?: number | undefined}; export type GoogleCloudAiplatformV1SampledShapleyAttribution = {pathCount?: number | undefined}; export type GoogleCloudAiplatformV1XraiAttribution = {blurBaselineConfig?: GoogleCloudAiplatformV1BlurBaselineConfig | undefined, smoothGradConfig?: GoogleCloudAiplatformV1SmoothGradConfig | undefined, stepCount?: number | undefined}; export type GoogleCloudAiplatformV1ExplanationParameters = {examples?: GoogleCloudAiplatformV1Examples | undefined, integratedGradientsAttribution?: GoogleCloudAiplatformV1IntegratedGradientsAttribution | undefined, outputIndices?: Array | undefined, sampledShapleyAttribution?: GoogleCloudAiplatformV1SampledShapleyAttribution | undefined, topK?: number | undefined, xraiAttribution?: GoogleCloudAiplatformV1XraiAttribution | undefined}; export type GoogleCloudAiplatformV1ExplanationSpec = {metadata?: GoogleCloudAiplatformV1ExplanationMetadata | undefined, parameters?: GoogleCloudAiplatformV1ExplanationParameters | undefined}; export type GoogleCloudAiplatformV1BigQuerySource = {inputUri?: string | undefined}; export type GoogleCloudAiplatformV1VertexMultimodalDatasetSource = {datasetName?: string | undefined}; export type GoogleCloudAiplatformV1BatchPredictionJobInputConfig = {bigquerySource?: GoogleCloudAiplatformV1BigQuerySource | undefined, gcsSource?: GoogleCloudAiplatformV1GcsSource | undefined, instancesFormat?: string | undefined, vertexMultimodalDatasetSource?: GoogleCloudAiplatformV1VertexMultimodalDatasetSource | undefined}; export type GoogleCloudAiplatformV1BatchPredictionJobInstanceConfig = {excludedFields?: Array | undefined, includedFields?: Array | undefined, instanceType?: string | undefined, keyField?: string | undefined}; export type GoogleCloudAiplatformV1ManualBatchTuningParameters = {batchSize?: number | undefined}; export type GoogleCloudAiplatformV1BigQueryDestination = {outputUri?: string | undefined}; export type GoogleCloudAiplatformV1GcsDestination = {outputUriPrefix?: string | undefined}; export type GoogleCloudAiplatformV1VertexMultimodalDatasetDestination = {bigqueryDestination?: GoogleCloudAiplatformV1BigQueryDestination | undefined, displayName?: string | undefined}; export type GoogleCloudAiplatformV1BatchPredictionJobOutputConfig = {bigqueryDestination?: GoogleCloudAiplatformV1BigQueryDestination | undefined, gcsDestination?: GoogleCloudAiplatformV1GcsDestination | undefined, predictionsFormat?: string | undefined, vertexMultimodalDatasetDestination?: GoogleCloudAiplatformV1VertexMultimodalDatasetDestination | undefined}; export type GoogleCloudAiplatformV1BatchPredictionJobOutputInfo = {bigqueryOutputDataset?: string | undefined, bigqueryOutputTable?: string | undefined, gcsOutputDirectory?: string | undefined, vertexMultimodalDatasetName?: string | undefined}; export type GoogleCloudAiplatformV1ResourcesConsumed = {replicaHours?: number | undefined}; export type GoogleCloudAiplatformV1EnvVar = {name?: string | undefined, value?: string | undefined}; export type GoogleCloudAiplatformV1Port = {containerPort?: number | undefined}; export type GoogleCloudAiplatformV1ProbeExecAction = {command?: Array | undefined}; export type GoogleCloudAiplatformV1ProbeGrpcAction = {port?: number | undefined, service?: string | undefined}; export type GoogleCloudAiplatformV1ProbeHttpHeader = {name?: string | undefined, value?: string | undefined}; export type GoogleCloudAiplatformV1ProbeHttpGetAction = {host?: string | undefined, httpHeaders?: Array | undefined, path?: string | undefined, port?: number | undefined, scheme?: string | undefined}; export type GoogleCloudAiplatformV1ProbeTcpSocketAction = {host?: string | undefined, port?: number | undefined}; export type GoogleCloudAiplatformV1Probe = {exec?: GoogleCloudAiplatformV1ProbeExecAction | undefined, failureThreshold?: number | undefined, grpc?: GoogleCloudAiplatformV1ProbeGrpcAction | undefined, httpGet?: GoogleCloudAiplatformV1ProbeHttpGetAction | undefined, initialDelaySeconds?: number | undefined, periodSeconds?: number | undefined, successThreshold?: number | undefined, tcpSocket?: GoogleCloudAiplatformV1ProbeTcpSocketAction | undefined, timeoutSeconds?: number | undefined}; export type GoogleCloudAiplatformV1ModelContainerSpec = {args?: Array | undefined, command?: Array | undefined, deploymentTimeout?: unknown | undefined, env?: Array | undefined, grpcPorts?: Array | undefined, healthProbe?: GoogleCloudAiplatformV1Probe | undefined, healthRoute?: string | undefined, imageUri?: string | undefined, invokeRoutePrefix?: string | undefined, livenessProbe?: GoogleCloudAiplatformV1Probe | undefined, ports?: Array | undefined, predictRoute?: string | undefined, sharedMemorySizeMb?: unknown | undefined, startupProbe?: GoogleCloudAiplatformV1Probe | undefined}; export type GoogleCloudAiplatformV1PredictSchemata = {instanceSchemaUri?: string | undefined, parametersSchemaUri?: string | undefined, predictionSchemaUri?: string | undefined}; export type GoogleCloudAiplatformV1UnmanagedContainerModel = {artifactUri?: string | undefined, containerSpec?: GoogleCloudAiplatformV1ModelContainerSpec | undefined, predictSchemata?: GoogleCloudAiplatformV1PredictSchemata | undefined}; export type GoogleCloudAiplatformV1BatchPredictionJob = {completionStats?: GoogleCloudAiplatformV1CompletionStats | undefined, createTime?: unknown | undefined, dedicatedResources?: GoogleCloudAiplatformV1BatchDedicatedResources | undefined, disableContainerLogging?: boolean | undefined, displayName?: string | undefined, encryptionSpec?: GoogleCloudAiplatformV1EncryptionSpec | undefined, endTime?: unknown | undefined, error?: GoogleRpcStatus | undefined, explanationSpec?: GoogleCloudAiplatformV1ExplanationSpec | undefined, generateExplanation?: boolean | undefined, inputConfig?: GoogleCloudAiplatformV1BatchPredictionJobInputConfig | undefined, instanceConfig?: GoogleCloudAiplatformV1BatchPredictionJobInstanceConfig | undefined, labels?: {[key: string]: string} | undefined, manualBatchTuningParameters?: GoogleCloudAiplatformV1ManualBatchTuningParameters | undefined, model?: string | undefined, modelParameters: unknown, modelVersionId?: string | undefined, name?: string | undefined, outputConfig?: GoogleCloudAiplatformV1BatchPredictionJobOutputConfig | undefined, outputInfo?: GoogleCloudAiplatformV1BatchPredictionJobOutputInfo | undefined, partialFailures?: Array | undefined, resourcesConsumed?: GoogleCloudAiplatformV1ResourcesConsumed | undefined, satisfiesPzi?: boolean | undefined, satisfiesPzs?: boolean | undefined, serviceAccount?: string | 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, unmanagedContainerModel?: GoogleCloudAiplatformV1UnmanagedContainerModel | undefined, updateTime?: unknown | undefined}; export type CreateApiV1ProjectsProjectsIdLocationsLocationsIdBatchPredictionJobsArgs = {projectsId: string, locationsId: string, body: GoogleCloudAiplatformV1BatchPredictionJob}; export type CreateApiV1ProjectsProjectsIdLocationsLocationsIdBatchPredictionJobsOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; export const googleCloudAiplatformV1CompletionStats = z.object({failedCount: z.string().optional(), incompleteCount: z.string().optional(), successfulCount: z.string().optional(), successfulForecastPointCount: 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 googleCloudAiplatformV1BatchDedicatedResources = z.object({machineSpec: googleCloudAiplatformV1MachineSpec.optional(), maxReplicaCount: z.number().int().optional(), startingReplicaCount: z.number().int().optional()}); 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 googleCloudAiplatformV1ExplanationMetadataInputMetadataFeatureValueDomain = z.object({maxValue: z.number().optional(), minValue: z.number().optional(), originalMean: z.number().optional(), originalStddev: z.number().optional()}); export const googleCloudAiplatformV1ExplanationMetadataInputMetadataVisualization = z.object({clipPercentLowerbound: z.number().optional(), clipPercentUpperbound: z.number().optional(), colorMap: z.enum(["COLOR_MAP_UNSPECIFIED", "PINK_GREEN", "VIRIDIS", "RED", "GREEN", "RED_GREEN", "PINK_WHITE_GREEN"]).optional(), overlayType: z.enum(["OVERLAY_TYPE_UNSPECIFIED", "NONE", "ORIGINAL", "GRAYSCALE", "MASK_BLACK"]).optional(), polarity: z.enum(["POLARITY_UNSPECIFIED", "POSITIVE", "NEGATIVE", "BOTH"]).optional(), type: z.enum(["TYPE_UNSPECIFIED", "PIXELS", "OUTLINES"]).optional()}); export const googleCloudAiplatformV1ExplanationMetadataInputMetadata = z.object({denseShapeTensorName: z.string().optional(), encodedBaselines: z.array(z.unknown()).optional(), encodedTensorName: z.string().optional(), encoding: z.enum(["ENCODING_UNSPECIFIED", "IDENTITY", "BAG_OF_FEATURES", "BAG_OF_FEATURES_SPARSE", "INDICATOR", "COMBINED_EMBEDDING", "CONCAT_EMBEDDING"]).optional(), featureValueDomain: googleCloudAiplatformV1ExplanationMetadataInputMetadataFeatureValueDomain.optional(), groupName: z.string().optional(), indexFeatureMapping: z.array(z.string()).optional(), indicesTensorName: z.string().optional(), inputBaselines: z.array(z.unknown()).optional(), inputTensorName: z.string().optional(), modality: z.string().optional(), visualization: googleCloudAiplatformV1ExplanationMetadataInputMetadataVisualization.optional()}); export const googleCloudAiplatformV1ExplanationMetadataOutputMetadata = z.object({displayNameMappingKey: z.string().optional(), indexDisplayNameMapping: z.unknown(), outputTensorName: z.string().optional()}); export const googleCloudAiplatformV1ExplanationMetadata = z.object({featureAttributionsSchemaUri: z.string().optional(), inputs: z.record(z.string(), googleCloudAiplatformV1ExplanationMetadataInputMetadata).optional(), latentSpaceSource: z.string().optional(), outputs: z.record(z.string(), googleCloudAiplatformV1ExplanationMetadataOutputMetadata).optional()}); export const googleCloudAiplatformV1GcsSource = z.object({uris: z.array(z.string()).optional()}); export const googleCloudAiplatformV1ExamplesExampleGcsSource = z.object({dataFormat: z.enum(["DATA_FORMAT_UNSPECIFIED", "JSONL"]).optional(), gcsSource: googleCloudAiplatformV1GcsSource.optional()}); export const googleCloudAiplatformV1Presets = z.object({modality: z.enum(["MODALITY_UNSPECIFIED", "IMAGE", "TEXT", "TABULAR"]).optional(), query: z.enum(["PRECISE", "FAST"]).optional()}); export const googleCloudAiplatformV1Examples = z.object({exampleGcsSource: googleCloudAiplatformV1ExamplesExampleGcsSource.optional(), nearestNeighborSearchConfig: z.unknown(), neighborCount: z.number().int().optional(), presets: googleCloudAiplatformV1Presets.optional()}); export const googleCloudAiplatformV1BlurBaselineConfig = z.object({maxBlurSigma: z.number().optional()}); export const googleCloudAiplatformV1FeatureNoiseSigmaNoiseSigmaForFeature = z.object({name: z.string().optional(), sigma: z.number().optional()}); export const googleCloudAiplatformV1FeatureNoiseSigma = z.object({noiseSigma: z.array(googleCloudAiplatformV1FeatureNoiseSigmaNoiseSigmaForFeature).optional()}); export const googleCloudAiplatformV1SmoothGradConfig = z.object({featureNoiseSigma: googleCloudAiplatformV1FeatureNoiseSigma.optional(), noiseSigma: z.number().optional(), noisySampleCount: z.number().int().optional()}); export const googleCloudAiplatformV1IntegratedGradientsAttribution = z.object({blurBaselineConfig: googleCloudAiplatformV1BlurBaselineConfig.optional(), smoothGradConfig: googleCloudAiplatformV1SmoothGradConfig.optional(), stepCount: z.number().int().optional()}); export const googleCloudAiplatformV1SampledShapleyAttribution = z.object({pathCount: z.number().int().optional()}); export const googleCloudAiplatformV1XraiAttribution = z.object({blurBaselineConfig: googleCloudAiplatformV1BlurBaselineConfig.optional(), smoothGradConfig: googleCloudAiplatformV1SmoothGradConfig.optional(), stepCount: z.number().int().optional()}); export const googleCloudAiplatformV1ExplanationParameters = z.object({examples: googleCloudAiplatformV1Examples.optional(), integratedGradientsAttribution: googleCloudAiplatformV1IntegratedGradientsAttribution.optional(), outputIndices: z.array(z.unknown()).optional(), sampledShapleyAttribution: googleCloudAiplatformV1SampledShapleyAttribution.optional(), topK: z.number().int().optional(), xraiAttribution: googleCloudAiplatformV1XraiAttribution.optional()}); export const googleCloudAiplatformV1ExplanationSpec = z.object({metadata: googleCloudAiplatformV1ExplanationMetadata.optional(), parameters: googleCloudAiplatformV1ExplanationParameters.optional()}); export const googleCloudAiplatformV1BigQuerySource = z.object({inputUri: z.string().optional()}); export const googleCloudAiplatformV1VertexMultimodalDatasetSource = z.object({datasetName: z.string().optional()}); export const googleCloudAiplatformV1BatchPredictionJobInputConfig = z.object({bigquerySource: googleCloudAiplatformV1BigQuerySource.optional(), gcsSource: googleCloudAiplatformV1GcsSource.optional(), instancesFormat: z.string().optional(), vertexMultimodalDatasetSource: googleCloudAiplatformV1VertexMultimodalDatasetSource.optional()}); export const googleCloudAiplatformV1BatchPredictionJobInstanceConfig = z.object({excludedFields: z.array(z.string()).optional(), includedFields: z.array(z.string()).optional(), instanceType: z.string().optional(), keyField: z.string().optional()}); export const googleCloudAiplatformV1ManualBatchTuningParameters = z.object({batchSize: z.number().int().optional()}); export const googleCloudAiplatformV1BigQueryDestination = z.object({outputUri: z.string().optional()}); export const googleCloudAiplatformV1GcsDestination = z.object({outputUriPrefix: z.string().optional()}); export const googleCloudAiplatformV1VertexMultimodalDatasetDestination = z.object({bigqueryDestination: googleCloudAiplatformV1BigQueryDestination.optional(), displayName: z.string().optional()}); export const googleCloudAiplatformV1BatchPredictionJobOutputConfig = z.object({bigqueryDestination: googleCloudAiplatformV1BigQueryDestination.optional(), gcsDestination: googleCloudAiplatformV1GcsDestination.optional(), predictionsFormat: z.string().optional(), vertexMultimodalDatasetDestination: googleCloudAiplatformV1VertexMultimodalDatasetDestination.optional()}); export const googleCloudAiplatformV1BatchPredictionJobOutputInfo = z.object({bigqueryOutputDataset: z.string().optional(), bigqueryOutputTable: z.string().optional(), gcsOutputDirectory: z.string().optional(), vertexMultimodalDatasetName: z.string().optional()}); export const googleCloudAiplatformV1ResourcesConsumed = z.object({replicaHours: z.number().optional()}); export const googleCloudAiplatformV1EnvVar = z.object({name: z.string().optional(), value: z.string().optional()}); export const googleCloudAiplatformV1Port = z.object({containerPort: z.number().int().optional()}); export const googleCloudAiplatformV1ProbeExecAction = z.object({command: z.array(z.string()).optional()}); export const googleCloudAiplatformV1ProbeGrpcAction = z.object({port: z.number().int().optional(), service: z.string().optional()}); export const googleCloudAiplatformV1ProbeHttpHeader = z.object({name: z.string().optional(), value: z.string().optional()}); export const googleCloudAiplatformV1ProbeHttpGetAction = z.object({host: z.string().optional(), httpHeaders: z.array(googleCloudAiplatformV1ProbeHttpHeader).optional(), path: z.string().optional(), port: z.number().int().optional(), scheme: z.string().optional()}); export const googleCloudAiplatformV1ProbeTcpSocketAction = z.object({host: z.string().optional(), port: z.number().int().optional()}); export const googleCloudAiplatformV1Probe = z.object({exec: googleCloudAiplatformV1ProbeExecAction.optional(), failureThreshold: z.number().int().optional(), grpc: googleCloudAiplatformV1ProbeGrpcAction.optional(), httpGet: googleCloudAiplatformV1ProbeHttpGetAction.optional(), initialDelaySeconds: z.number().int().optional(), periodSeconds: z.number().int().optional(), successThreshold: z.number().int().optional(), tcpSocket: googleCloudAiplatformV1ProbeTcpSocketAction.optional(), timeoutSeconds: z.number().int().optional()}); export const googleCloudAiplatformV1ModelContainerSpec = z.object({args: z.array(z.string()).optional(), command: z.array(z.string()).optional(), deploymentTimeout: z.string().optional(), env: z.array(googleCloudAiplatformV1EnvVar).optional(), grpcPorts: z.array(googleCloudAiplatformV1Port).optional(), healthProbe: googleCloudAiplatformV1Probe.optional(), healthRoute: z.string().optional(), imageUri: z.string().optional(), invokeRoutePrefix: z.string().optional(), livenessProbe: googleCloudAiplatformV1Probe.optional(), ports: z.array(googleCloudAiplatformV1Port).optional(), predictRoute: z.string().optional(), sharedMemorySizeMb: z.string().optional(), startupProbe: googleCloudAiplatformV1Probe.optional()}); export const googleCloudAiplatformV1PredictSchemata = z.object({instanceSchemaUri: z.string().optional(), parametersSchemaUri: z.string().optional(), predictionSchemaUri: z.string().optional()}); export const googleCloudAiplatformV1UnmanagedContainerModel = z.object({artifactUri: z.string().optional(), containerSpec: googleCloudAiplatformV1ModelContainerSpec.optional(), predictSchemata: googleCloudAiplatformV1PredictSchemata.optional()}); export const googleCloudAiplatformV1BatchPredictionJob = z.object({completionStats: googleCloudAiplatformV1CompletionStats.optional(), createTime: z.string().optional(), dedicatedResources: googleCloudAiplatformV1BatchDedicatedResources.optional(), disableContainerLogging: z.boolean().optional(), displayName: z.string().optional(), encryptionSpec: googleCloudAiplatformV1EncryptionSpec.optional(), endTime: z.string().optional(), error: googleRpcStatus.optional(), explanationSpec: googleCloudAiplatformV1ExplanationSpec.optional(), generateExplanation: z.boolean().optional(), inputConfig: googleCloudAiplatformV1BatchPredictionJobInputConfig.optional(), instanceConfig: googleCloudAiplatformV1BatchPredictionJobInstanceConfig.optional(), labels: z.record(z.string(), z.string()).optional(), manualBatchTuningParameters: googleCloudAiplatformV1ManualBatchTuningParameters.optional(), model: z.string().optional(), modelParameters: z.unknown(), modelVersionId: z.string().optional(), name: z.string().optional(), outputConfig: googleCloudAiplatformV1BatchPredictionJobOutputConfig.optional(), outputInfo: googleCloudAiplatformV1BatchPredictionJobOutputInfo.optional(), partialFailures: z.array(googleRpcStatus).optional(), resourcesConsumed: googleCloudAiplatformV1ResourcesConsumed.optional(), satisfiesPzi: z.boolean().optional(), satisfiesPzs: z.boolean().optional(), serviceAccount: z.string().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(), unmanagedContainerModel: googleCloudAiplatformV1UnmanagedContainerModel.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 BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to start. * * POST /v1/projects/{projectsId}/locations/{locationsId}/batchPredictionJobs */ export const createApiV1ProjectsProjectsIdLocationsLocationsIdBatchPredictionJobs = async (args: CreateApiV1ProjectsProjectsIdLocationsLocationsIdBatchPredictionJobsArgs, options?: CreateApiV1ProjectsProjectsIdLocationsLocationsIdBatchPredictionJobsOptions) => { 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))}/batchPredictionJobs${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(googleCloudAiplatformV1BatchPredictionJob, await res.json()) };