Class v1beta1.PredictionServiceClient (2.4.5)

AutoML Prediction API.

On any input that is documented to expect a string parameter in snake_case or kebab-case, either of those cases is accepted. v1beta1

Package

@google-cloud/automl!

Constructors

(constructor)(opts)

constructor(opts?: ClientOptions);

Construct an instance of PredictionServiceClient.

Parameter
Name Description
opts ClientOptions

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

Property Value
Type Description
string

auth

auth: gax.GoogleAuth;
Property Value
Type Description
gax.GoogleAuth

descriptors

descriptors: Descriptors;
Property Value
Type Description
Descriptors

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };
Property Value
Type Description
{ [name: string]: Function; }

operationsClient

operationsClient: gax.OperationsClient;
Property Value
Type Description
gax.OperationsClient

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };
Property Value
Type Description
{ [name: string]: gax.PathTemplate; }

port

static get port(): number;

The port for this API service.

Property Value
Type Description
number

predictionServiceStub

predictionServiceStub?: Promise<{
        [name: string]: Function;
    }>;
Property Value
Type Description
Promise<{ [name: string]: Function; }>

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

Property Value
Type Description
string[]

servicePath

static get servicePath(): string;

The DNS address for this API service.

Property Value
Type Description
string

warn

warn: (code: string, message: string, warnType?: string) => void;
Property Value
Type Description
(code: string, message: string, warnType?: string) => void

Methods

annotationSpecPath(project, location, dataset, annotationSpec)

annotationSpecPath(project: string, location: string, dataset: string, annotationSpec: string): string;

Return a fully-qualified annotationSpec resource name string.

Parameters
Name Description
project string
location string
dataset string
annotationSpec string
Returns
Type Description
string

{string} Resource name string.

batchPredict(request, options)

batchPredict(request?: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, options?: CallOptions): Promise<[LROperation<protos.google.cloud.automl.v1beta1.IBatchPredictResult, protos.google.cloud.automl.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
Parameters
Name Description
request protos.google.cloud.automl.v1beta1.IBatchPredictRequest
options CallOptions
Returns
Type Description
Promise<[LROperation<protos.google.cloud.automl.v1beta1.IBatchPredictResult, protos.google.cloud.automl.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>

batchPredict(request, options, callback)

batchPredict(request: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.automl.v1beta1.IBatchPredictResult, protos.google.cloud.automl.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request protos.google.cloud.automl.v1beta1.IBatchPredictRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.automl.v1beta1.IBatchPredictResult, protos.google.cloud.automl.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

batchPredict(request, callback)

batchPredict(request: protos.google.cloud.automl.v1beta1.IBatchPredictRequest, callback: Callback<LROperation<protos.google.cloud.automl.v1beta1.IBatchPredictResult, protos.google.cloud.automl.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request protos.google.cloud.automl.v1beta1.IBatchPredictRequest
callback Callback<LROperation<protos.google.cloud.automl.v1beta1.IBatchPredictResult, protos.google.cloud.automl.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

checkBatchPredictProgress(name)

checkBatchPredictProgress(name: string): Promise<LROperation<protos.google.cloud.automl.v1beta1.BatchPredictResult, protos.google.cloud.automl.v1beta1.OperationMetadata>>;

Check the status of the long running operation returned by batchPredict().

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.automl.v1beta1.BatchPredictResult, protos.google.cloud.automl.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
Type Description
Promise<void>

{Promise} A promise that resolves when the client is closed.

columnSpecPath(project, location, dataset, tableSpec, columnSpec)

columnSpecPath(project: string, location: string, dataset: string, tableSpec: string, columnSpec: string): string;

Return a fully-qualified columnSpec resource name string.

Parameters
Name Description
project string
location string
dataset string
tableSpec string
columnSpec string
Returns
Type Description
string

{string} Resource name string.

datasetPath(project, location, dataset)

datasetPath(project: string, location: string, dataset: string): string;

Return a fully-qualified dataset resource name string.

Parameters
Name Description
project string
location string
dataset string
Returns
Type Description
string

{string} Resource name string.

getProjectId()

getProjectId(): Promise<string>;
Returns
Type Description
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name Description
callback Callback<string, undefined, undefined>
Returns
Type Description
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
Type Description
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

matchAnnotationSpecFromAnnotationSpecName(annotationSpecName)

matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string): string | number;

Parse the annotation_spec from AnnotationSpec resource.

Parameter
Name Description
annotationSpecName string

A fully-qualified path representing AnnotationSpec resource.

Returns
Type Description
string | number

{string} A string representing the annotation_spec.

matchColumnSpecFromColumnSpecName(columnSpecName)

matchColumnSpecFromColumnSpecName(columnSpecName: string): string | number;

Parse the column_spec from ColumnSpec resource.

Parameter
Name Description
columnSpecName string

A fully-qualified path representing ColumnSpec resource.

Returns
Type Description
string | number

{string} A string representing the column_spec.

matchDatasetFromAnnotationSpecName(annotationSpecName)

matchDatasetFromAnnotationSpecName(annotationSpecName: string): string | number;

Parse the dataset from AnnotationSpec resource.

Parameter
Name Description
annotationSpecName string

A fully-qualified path representing AnnotationSpec resource.

Returns
Type Description
string | number

{string} A string representing the dataset.

matchDatasetFromColumnSpecName(columnSpecName)

matchDatasetFromColumnSpecName(columnSpecName: string): string | number;

Parse the dataset from ColumnSpec resource.

Parameter
Name Description
columnSpecName string

A fully-qualified path representing ColumnSpec resource.

Returns
Type Description
string | number

{string} A string representing the dataset.

matchDatasetFromDatasetName(datasetName)

matchDatasetFromDatasetName(datasetName: string): string | number;

Parse the dataset from Dataset resource.

Parameter
Name Description
datasetName string

A fully-qualified path representing Dataset resource.

Returns
Type Description
string | number

{string} A string representing the dataset.

matchDatasetFromTableSpecName(tableSpecName)

matchDatasetFromTableSpecName(tableSpecName: string): string | number;

Parse the dataset from TableSpec resource.

Parameter
Name Description
tableSpecName string

A fully-qualified path representing TableSpec resource.

Returns
Type Description
string | number

{string} A string representing the dataset.

matchLocationFromAnnotationSpecName(annotationSpecName)

matchLocationFromAnnotationSpecName(annotationSpecName: string): string | number;

Parse the location from AnnotationSpec resource.

Parameter
Name Description
annotationSpecName string

A fully-qualified path representing AnnotationSpec resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromColumnSpecName(columnSpecName)

matchLocationFromColumnSpecName(columnSpecName: string): string | number;

Parse the location from ColumnSpec resource.

Parameter
Name Description
columnSpecName string

A fully-qualified path representing ColumnSpec resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromDatasetName(datasetName)

matchLocationFromDatasetName(datasetName: string): string | number;

Parse the location from Dataset resource.

Parameter
Name Description
datasetName string

A fully-qualified path representing Dataset resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromModelEvaluationName(modelEvaluationName)

matchLocationFromModelEvaluationName(modelEvaluationName: string): string | number;

Parse the location from ModelEvaluation resource.

Parameter
Name Description
modelEvaluationName string

A fully-qualified path representing ModelEvaluation resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromModelName(modelName)

matchLocationFromModelName(modelName: string): string | number;

Parse the location from Model resource.

Parameter
Name Description
modelName string

A fully-qualified path representing Model resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromTableSpecName(tableSpecName)

matchLocationFromTableSpecName(tableSpecName: string): string | number;

Parse the location from TableSpec resource.

Parameter
Name Description
tableSpecName string

A fully-qualified path representing TableSpec resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchModelEvaluationFromModelEvaluationName(modelEvaluationName)

matchModelEvaluationFromModelEvaluationName(modelEvaluationName: string): string | number;

Parse the model_evaluation from ModelEvaluation resource.

Parameter
Name Description
modelEvaluationName string

A fully-qualified path representing ModelEvaluation resource.

Returns
Type Description
string | number

{string} A string representing the model_evaluation.

matchModelFromModelEvaluationName(modelEvaluationName)

matchModelFromModelEvaluationName(modelEvaluationName: string): string | number;

Parse the model from ModelEvaluation resource.

Parameter
Name Description
modelEvaluationName string

A fully-qualified path representing ModelEvaluation resource.

Returns
Type Description
string | number

{string} A string representing the model.

matchModelFromModelName(modelName)

matchModelFromModelName(modelName: string): string | number;

Parse the model from Model resource.

Parameter
Name Description
modelName string

A fully-qualified path representing Model resource.

Returns
Type Description
string | number

{string} A string representing the model.

matchProjectFromAnnotationSpecName(annotationSpecName)

matchProjectFromAnnotationSpecName(annotationSpecName: string): string | number;

Parse the project from AnnotationSpec resource.

Parameter
Name Description
annotationSpecName string

A fully-qualified path representing AnnotationSpec resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromColumnSpecName(columnSpecName)

matchProjectFromColumnSpecName(columnSpecName: string): string | number;

Parse the project from ColumnSpec resource.

Parameter
Name Description
columnSpecName string

A fully-qualified path representing ColumnSpec resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromDatasetName(datasetName)

matchProjectFromDatasetName(datasetName: string): string | number;

Parse the project from Dataset resource.

Parameter
Name Description
datasetName string

A fully-qualified path representing Dataset resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromModelEvaluationName(modelEvaluationName)

matchProjectFromModelEvaluationName(modelEvaluationName: string): string | number;

Parse the project from ModelEvaluation resource.

Parameter
Name Description
modelEvaluationName string

A fully-qualified path representing ModelEvaluation resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromModelName(modelName)

matchProjectFromModelName(modelName: string): string | number;

Parse the project from Model resource.

Parameter
Name Description
modelName string

A fully-qualified path representing Model resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromTableSpecName(tableSpecName)

matchProjectFromTableSpecName(tableSpecName: string): string | number;

Parse the project from TableSpec resource.

Parameter
Name Description
tableSpecName string

A fully-qualified path representing TableSpec resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchTableSpecFromColumnSpecName(columnSpecName)

matchTableSpecFromColumnSpecName(columnSpecName: string): string | number;

Parse the table_spec from ColumnSpec resource.

Parameter
Name Description
columnSpecName string

A fully-qualified path representing ColumnSpec resource.

Returns
Type Description
string | number

{string} A string representing the table_spec.

matchTableSpecFromTableSpecName(tableSpecName)

matchTableSpecFromTableSpecName(tableSpecName: string): string | number;

Parse the table_spec from TableSpec resource.

Parameter
Name Description
tableSpecName string

A fully-qualified path representing TableSpec resource.

Returns
Type Description
string | number

{string} A string representing the table_spec.

modelEvaluationPath(project, location, model, modelEvaluation)

modelEvaluationPath(project: string, location: string, model: string, modelEvaluation: string): string;

Return a fully-qualified modelEvaluation resource name string.

Parameters
Name Description
project string
location string
model string
modelEvaluation string
Returns
Type Description
string

{string} Resource name string.

modelPath(project, location, model)

modelPath(project: string, location: string, model: string): string;

Return a fully-qualified model resource name string.

Parameters
Name Description
project string
location string
model string
Returns
Type Description
string

{string} Resource name string.

predict(request, options)

predict(request?: protos.google.cloud.automl.v1beta1.IPredictRequest, options?: CallOptions): Promise<[protos.google.cloud.automl.v1beta1.IPredictResponse, protos.google.cloud.automl.v1beta1.IPredictRequest | undefined, {} | undefined]>;
Parameters
Name Description
request protos.google.cloud.automl.v1beta1.IPredictRequest
options CallOptions
Returns
Type Description
Promise<[protos.google.cloud.automl.v1beta1.IPredictResponse, protos.google.cloud.automl.v1beta1.IPredictRequest | undefined, {} | undefined]>

predict(request, options, callback)

predict(request: protos.google.cloud.automl.v1beta1.IPredictRequest, options: CallOptions, callback: Callback<protos.google.cloud.automl.v1beta1.IPredictResponse, protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request protos.google.cloud.automl.v1beta1.IPredictRequest
options CallOptions
callback Callback<protos.google.cloud.automl.v1beta1.IPredictResponse, protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

predict(request, callback)

predict(request: protos.google.cloud.automl.v1beta1.IPredictRequest, callback: Callback<protos.google.cloud.automl.v1beta1.IPredictResponse, protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request protos.google.cloud.automl.v1beta1.IPredictRequest
callback Callback<protos.google.cloud.automl.v1beta1.IPredictResponse, protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

tableSpecPath(project, location, dataset, tableSpec)

tableSpecPath(project: string, location: string, dataset: string, tableSpec: string): string;

Return a fully-qualified tableSpec resource name string.

Parameters
Name Description
project string
location string
dataset string
tableSpec string
Returns
Type Description
string

{string} Resource name string.