@google-cloud/datalabeling 0.1.0 » Class: DataLabelingServiceClient

v1beta1.DataLabelingServiceClient

Constructor

DataLabelingServiceClient

Parameter

The configuration object. See the subsequent
parameters for more details.

Values in options have the following properties:

Parameter

credentials

Optional

object

Credentials object.

credentials.client_email

Optional

string

credentials.private_key

Optional

string

email

Optional

string

Account email address. Required when
using a .pem or .p12 keyFilename.

keyFilename

Optional

string

Full path to the a .json, .pem, or
.p12 key downloaded from the Google Developers Console. If you provide
a path to a JSON file, the projectId option below is not necessary.
NOTE: .pem and .p12 require you to specify options.email as well.

port

Optional

number

The port on which to connect to
the remote host.

projectId

Optional

string

The project ID from the Google
Developer's Console, e.g. 'grape-spaceship-123'. We will also check
the environment variable GCLOUD_PROJECT for your project ID. If your
app is running in an environment which supports
Application Default Credentials,
your project ID will be detected automatically.

promise

Optional

function()

Custom promise module to use instead
of native Promises.

servicePath

Optional

string

The domain name of the
API remote host.

Properties

port

static

The port for this API service.

scopes

static

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

Parameter

Required. Annotated dataset resource name. DataItem in
Dataset and their annotations in specified annotated dataset will be
exported. It's in format of
projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/
{annotated_dataset_id}

getProjectId

Parameter

callback

function(Error, string)

the callback to
be called with the current project Id.

importData

importData(request, options, callback) returns Promise

Imports data into dataset based on source locations defined in request.
It can be called multiple times for the same dataset. Each dataset can
only have one long running operation running on it. For example, no
labeling task (also long running operation) can be started while
importing is still ongoing. Vice versa.

Parameter

Parameter

Required. Name of the dataset to list annotated datasets, format:
projects/{project_id}/datasets/{dataset_id}

filter

Optional

string

Optional. Filter is not supported at this moment.

pageSize

Optional

number

The maximum number of resources contained in the underlying API
response. If page streaming is performed per-resource, this
parameter does not affect the return value. If page streaming is
performed per-page, this determines the maximum number of
resources in a page.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout,
retries, paginations, etc. See gax.CallOptions for the details.

When autoPaginate: false is specified through options, it contains the result
in a single response. If the response indicates the next page exists, the third
parameter is set to be used for the next request object. The fourth parameter keeps
the raw response object of an object representing ListAnnotatedDatasetsResponse.

Returns

Promise

The promise which resolves to an array.
The first element of the array is Array of AnnotatedDataset.

When autoPaginate: false is specified through options, the array has three elements.
The first element is Array of AnnotatedDataset in a single response.
The second element is the next request object if the response
indicates the next page exists, or null. The third element is
an object representing ListAnnotatedDatasetsResponse.

The promise has a method named "cancel" which cancels the ongoing API call.

listAnnotatedDatasetsStream

Equivalent to listAnnotatedDatasets, but returns a NodeJS Stream object.

This fetches the paged responses for listAnnotatedDatasets continuously
and invokes the callback registered for 'data' event for each element in the
responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

Required. Name of the dataset to list annotated datasets, format:
projects/{project_id}/datasets/{dataset_id}

filter

Optional

string

Optional. Filter is not supported at this moment.

pageSize

Optional

number

The maximum number of resources contained in the underlying API
response. If page streaming is performed per-resource, this
parameter does not affect the return value. If page streaming is
performed per-page, this determines the maximum number of
resources in a page.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout,
retries, paginations, etc. See gax.CallOptions for the details.

Parameter

The maximum number of resources contained in the underlying API
response. If page streaming is performed per-resource, this
parameter does not affect the return value. If page streaming is
performed per-page, this determines the maximum number of
resources in a page.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout,
retries, paginations, etc. See gax.CallOptions for the details.

When autoPaginate: false is specified through options, it contains the result
in a single response. If the response indicates the next page exists, the third
parameter is set to be used for the next request object. The fourth parameter keeps
the raw response object of an object representing ListAnnotationSpecSetsResponse.

Returns

Promise

The promise which resolves to an array.
The first element of the array is Array of AnnotationSpecSet.

When autoPaginate: false is specified through options, the array has three elements.
The first element is Array of AnnotationSpecSet in a single response.
The second element is the next request object if the response
indicates the next page exists, or null. The third element is
an object representing ListAnnotationSpecSetsResponse.

The promise has a method named "cancel" which cancels the ongoing API call.

Parameter

The maximum number of resources contained in the underlying API
response. If page streaming is performed per-resource, this
parameter does not affect the return value. If page streaming is
performed per-page, this determines the maximum number of
resources in a page.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout,
retries, paginations, etc. See gax.CallOptions for the details.

listDataItems

Lists data items in a dataset. This API can be called after data
are imported into dataset. Pagination is supported.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

Required. Name of the dataset to list data items, format:
projects/{project_id}/datasets/{dataset_id}

filter

Optional

string

Optional. Filter is not supported at this moment.

pageSize

Optional

number

The maximum number of resources contained in the underlying API
response. If page streaming is performed per-resource, this
parameter does not affect the return value. If page streaming is
performed per-page, this determines the maximum number of
resources in a page.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout,
retries, paginations, etc. See gax.CallOptions for the details.

When autoPaginate: false is specified through options, it contains the result
in a single response. If the response indicates the next page exists, the third
parameter is set to be used for the next request object. The fourth parameter keeps
the raw response object of an object representing ListDataItemsResponse.

Returns

Promise

The promise which resolves to an array.
The first element of the array is Array of DataItem.

When autoPaginate: false is specified through options, the array has three elements.
The first element is Array of DataItem in a single response.
The second element is the next request object if the response
indicates the next page exists, or null. The third element is
an object representing ListDataItemsResponse.

The promise has a method named "cancel" which cancels the ongoing API call.

listDataItemsStream

This fetches the paged responses for listDataItems continuously
and invokes the callback registered for 'data' event for each element in the
responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

Required. Name of the dataset to list data items, format:
projects/{project_id}/datasets/{dataset_id}

filter

Optional

string

Optional. Filter is not supported at this moment.

pageSize

Optional

number

The maximum number of resources contained in the underlying API
response. If page streaming is performed per-resource, this
parameter does not affect the return value. If page streaming is
performed per-page, this determines the maximum number of
resources in a page.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout,
retries, paginations, etc. See gax.CallOptions for the details.

Parameter

Parameter

parent

string

Required. Dataset resource parent, format:
projects/{project_id}

filter

Optional

string

Optional. Filter on dataset is not supported at this moment.

pageSize

Optional

number

The maximum number of resources contained in the underlying API
response. If page streaming is performed per-resource, this
parameter does not affect the return value. If page streaming is
performed per-page, this determines the maximum number of
resources in a page.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout,
retries, paginations, etc. See gax.CallOptions for the details.

When autoPaginate: false is specified through options, it contains the result
in a single response. If the response indicates the next page exists, the third
parameter is set to be used for the next request object. The fourth parameter keeps
the raw response object of an object representing ListDatasetsResponse.

Returns

Promise

The promise which resolves to an array.
The first element of the array is Array of Dataset.

When autoPaginate: false is specified through options, the array has three elements.
The first element is Array of Dataset in a single response.
The second element is the next request object if the response
indicates the next page exists, or null. The third element is
an object representing ListDatasetsResponse.

The promise has a method named "cancel" which cancels the ongoing API call.

listDatasetsStream

This fetches the paged responses for listDatasets continuously
and invokes the callback registered for 'data' event for each element in the
responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

Required. Dataset resource parent, format:
projects/{project_id}

filter

Optional

string

Optional. Filter on dataset is not supported at this moment.

pageSize

Optional

number

The maximum number of resources contained in the underlying API
response. If page streaming is performed per-resource, this
parameter does not affect the return value. If page streaming is
performed per-page, this determines the maximum number of
resources in a page.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout,
retries, paginations, etc. See gax.CallOptions for the details.

Parameter

Parameter

Optional. An expression for filtering Examples. For annotated datasets that
have annotation spec set, filter by
annotation_spec.display_name is supported. Format
"annotation_spec.display_name = {display_name}"

pageSize

Optional

number

The maximum number of resources contained in the underlying API
response. If page streaming is performed per-resource, this
parameter does not affect the return value. If page streaming is
performed per-page, this determines the maximum number of
resources in a page.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout,
retries, paginations, etc. See gax.CallOptions for the details.

When autoPaginate: false is specified through options, it contains the result
in a single response. If the response indicates the next page exists, the third
parameter is set to be used for the next request object. The fourth parameter keeps
the raw response object of an object representing ListExamplesResponse.

Returns

Promise

The promise which resolves to an array.
The first element of the array is Array of Example.

When autoPaginate: false is specified through options, the array has three elements.
The first element is Array of Example in a single response.
The second element is the next request object if the response
indicates the next page exists, or null. The third element is
an object representing ListExamplesResponse.

The promise has a method named "cancel" which cancels the ongoing API call.

listExamplesStream

This fetches the paged responses for listExamples continuously
and invokes the callback registered for 'data' event for each element in the
responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

Required. Example resource parent.

filter

Optional

string

Optional. An expression for filtering Examples. For annotated datasets that
have annotation spec set, filter by
annotation_spec.display_name is supported. Format
"annotation_spec.display_name = {display_name}"

pageSize

Optional

number

The maximum number of resources contained in the underlying API
response. If page streaming is performed per-resource, this
parameter does not affect the return value. If page streaming is
performed per-page, this determines the maximum number of
resources in a page.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout,
retries, paginations, etc. See gax.CallOptions for the details.

Parameter

Parameter

parent

string

Required. Instruction resource parent, format:
projects/{project_id}

filter

Optional

string

Optional. Filter is not supported at this moment.

pageSize

Optional

number

The maximum number of resources contained in the underlying API
response. If page streaming is performed per-resource, this
parameter does not affect the return value. If page streaming is
performed per-page, this determines the maximum number of
resources in a page.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout,
retries, paginations, etc. See gax.CallOptions for the details.

When autoPaginate: false is specified through options, it contains the result
in a single response. If the response indicates the next page exists, the third
parameter is set to be used for the next request object. The fourth parameter keeps
the raw response object of an object representing ListInstructionsResponse.

Returns

Promise

The promise which resolves to an array.
The first element of the array is Array of Instruction.

When autoPaginate: false is specified through options, the array has three elements.
The first element is Array of Instruction in a single response.
The second element is the next request object if the response
indicates the next page exists, or null. The third element is
an object representing ListInstructionsResponse.

The promise has a method named "cancel" which cancels the ongoing API call.

listInstructionsStream

This fetches the paged responses for listInstructions continuously
and invokes the callback registered for 'data' event for each element in the
responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

parent

string

Required. Instruction resource parent, format:
projects/{project_id}

filter

Optional

string

Optional. Filter is not supported at this moment.

pageSize

Optional

number

The maximum number of resources contained in the underlying API
response. If page streaming is performed per-resource, this
parameter does not affect the return value. If page streaming is
performed per-page, this determines the maximum number of
resources in a page.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout,
retries, paginations, etc. See gax.CallOptions for the details.