diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 44e9e980..be3f2a9c 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-datalabeling.git", - "sha": "98385aa0662603dce3e157e03de36cf547b547d1" + "sha": "8fdbe49e28aa9b8380a3b6d3f4641b783abe99f3" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "67f09bf301083798e7220137723222eb00b8f88a" + "sha": "2414b817065726eae0bc525346c7e874f969369d" } } ] diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 2b6cdbc9..7c8816a7 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -4,7 +4,7 @@ name: auto-release jobs: approve: runs-on: ubuntu-latest - if: contains(github.head_ref, 'release-v') + if: contains(github.head_ref, 'release-please') steps: - uses: actions/github-script@v3 with: @@ -16,8 +16,8 @@ jobs: return; } - // only approve PRs like "chore: release " - if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + // only approve PRs like "chore(master): release " + if ( !context.payload.pull_request.title.startsWith("chore(master): release") ) { return; } diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 68302207..def8b3a2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,7 +54,11 @@ jobs: with: java-version: 8 - run: java -version - - run: .kokoro/linkage-monitor.sh + - name: Install artifacts to local Maven repository + run: .kokoro/build.sh + shell: bash + - name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release) + uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor lint: runs-on: ubuntu-latest steps: diff --git a/.kokoro/build.sh b/.kokoro/build.sh index a4ed6626..f661c9fb 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -29,7 +29,7 @@ echo ${JOB_TYPE} # attempt to install 3 times with exponential backoff (starting with 10 seconds) retry_with_backoff 3 10 \ - mvn install -B -V \ + mvn install -B -V -ntp \ -DskipTests=true \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -60,6 +60,7 @@ javadoc) ;; integration) mvn -B ${INTEGRATION_TEST_ARGS} \ + -ntp \ -Penable-integration-tests \ -DtrimStackTrace=false \ -Dclirr.skip=true \ @@ -81,6 +82,7 @@ samples) pushd ${SAMPLES_DIR} mvn -B \ -Penable-samples \ + -ntp \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -110,8 +112,8 @@ bash .kokoro/coerce_logs.sh if [[ "${ENABLE_BUILD_COP}" == "true" ]] then - chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop - ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-datalabeling + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot + ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-datalabeling fi echo "exiting with ${RETURN_CODE}" diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index c91e5a56..0fb8c843 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -31,7 +31,7 @@ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" # this should run maven enforcer retry_with_backoff 3 10 \ - mvn install -B -V \ + mvn install -B -V -ntp \ -DskipTests=true \ -Dclirr.skip=true @@ -86,4 +86,4 @@ then else msg "Errors found. See log statements above." exit 1 -fi \ No newline at end of file +fi diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh deleted file mode 100755 index 759ab4e2..00000000 --- a/.kokoro/linkage-monitor.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail -# Display commands being run. -set -x - -## Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Print out Java version -java -version -echo ${JOB_TYPE} - -# attempt to install 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true - -# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR -JAR=linkage-monitor-latest-all-deps.jar -curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" - -# Fails if there's new linkage errors compared with baseline -java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg index b8f4ebdd..7e1873b4 100644 --- a/.kokoro/release/publish_javadoc.cfg +++ b/.kokoro/release/publish_javadoc.cfg @@ -7,10 +7,10 @@ env_vars: { value: "docs-staging" } +# cloud-rad staging env_vars: { key: "STAGING_BUCKET_V2" - value: "docs-staging-v2" - # Production will be at: docs-staging-v2 + value: "docs-staging-v2-staging" } env_vars: { @@ -26,4 +26,4 @@ before_action { keyname: "docuploader_service_account" } } -} +} \ No newline at end of file diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index 70fbe50b..5025faf6 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -71,7 +71,7 @@ python3 -m docuploader create-metadata \ --version ${VERSION} \ --language java -# upload docs +# upload docs to staging bucket python3 -m docuploader upload . \ --credentials ${CREDENTIALS} \ --staging-bucket ${STAGING_BUCKET_V2} diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg new file mode 100644 index 00000000..b92a68ff --- /dev/null +++ b/.kokoro/release/publish_javadoc11.cfg @@ -0,0 +1,30 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# cloud-rad production +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2" +} + +# Configure the docker image for kokoro-trampoline +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-datalabeling/.kokoro/release/publish_javadoc11.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh new file mode 100755 index 00000000..28399360 --- /dev/null +++ b/.kokoro/release/publish_javadoc11.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Copyright 2021 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +export NAME=google-cloud-datalabeling +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# V3 generates docfx yml from javadoc +# generate yml +mvn clean site -B -q -P docFX + +pushd target/docfx-yml + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload yml to production bucket +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} \ + --destination-prefix docfx- diff --git a/CHANGELOG.md b/CHANGELOG.md index e9c7abe8..ff27e9f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +### [0.119.11](https://www.github.com/googleapis/java-datalabeling/compare/v0.119.10...v0.119.11) (2021-02-22) + + +### Documentation + +* generate sample code in the Java microgenerator ([#392](https://www.github.com/googleapis/java-datalabeling/issues/392)) ([e92f3e7](https://www.github.com/googleapis/java-datalabeling/commit/e92f3e7be7337fba186061d1fd944bd7380799a6)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.19.0 ([#404](https://www.github.com/googleapis/java-datalabeling/issues/404)) ([aba9d1c](https://www.github.com/googleapis/java-datalabeling/commit/aba9d1c737f66434bcbda9d8daad699d76d10cc4)) + ### [0.119.10](https://www.github.com/googleapis/java-datalabeling/compare/v0.119.9...v0.119.10) (2021-01-14) diff --git a/LICENSE b/LICENSE index d6456956..261eeb9e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/README.md b/README.md index 83e45da5..171b2833 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 16.2.1 + 16.4.0 pom import @@ -48,18 +48,18 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:16.2.1') +implementation platform('com.google.cloud:libraries-bom:16.4.0') compile 'com.google.cloud:google-cloud-datalabeling' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-datalabeling:0.119.9' +compile 'com.google.cloud:google-cloud-datalabeling:0.119.10' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-datalabeling" % "0.119.9" +libraryDependencies += "com.google.cloud" % "google-cloud-datalabeling" % "0.119.10" ``` ## Authentication diff --git a/google-cloud-datalabeling-bom/pom.xml b/google-cloud-datalabeling-bom/pom.xml index 8d9a01f8..7a46be99 100644 --- a/google-cloud-datalabeling-bom/pom.xml +++ b/google-cloud-datalabeling-bom/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.google.cloud google-cloud-datalabeling-bom - 0.119.10 + 0.119.11 pom com.google.cloud google-cloud-shared-config - 0.9.4 + 0.10.0 Google Cloud Data Labeling BOM @@ -64,17 +64,17 @@ com.google.api.grpc proto-google-cloud-datalabeling-v1beta1 - 0.84.10 + 0.84.11 com.google.api.grpc grpc-google-cloud-datalabeling-v1beta1 - 0.84.10 + 0.84.11 com.google.cloud google-cloud-datalabeling - 0.119.10 + 0.119.11 diff --git a/google-cloud-datalabeling/pom.xml b/google-cloud-datalabeling/pom.xml index 4ba91904..bc9d483e 100644 --- a/google-cloud-datalabeling/pom.xml +++ b/google-cloud-datalabeling/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-datalabeling - 0.119.10 + 0.119.11 jar Google Cloud Data Labeling https://github.com/googleapis/java-datalabeling @@ -11,7 +11,7 @@ com.google.cloud google-cloud-datalabeling-parent - 0.119.10 + 0.119.11 google-cloud-datalabeling diff --git a/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java b/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java index 274ca5cc..a69098b9 100644 --- a/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java +++ b/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java @@ -47,6 +47,14 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Dataset dataset = Dataset.newBuilder().build();
+ *   Dataset response = dataLabelingServiceClient.createDataset(parent, dataset);
+ * }
+ * }
+ * *

Note: close() needs to be called on the DataLabelingServiceClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -165,6 +173,16 @@ public final OperationsClient getOperationsClient() { /** * Creates dataset. If success return a Dataset resource. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   Dataset response = dataLabelingServiceClient.createDataset(parent, dataset);
+   * }
+   * }
+ * * @param parent Required. Dataset resource parent, format: projects/{project_id} * @param dataset Required. The dataset to be created. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -182,6 +200,16 @@ public final Dataset createDataset(ProjectName parent, Dataset dataset) { /** * Creates dataset. If success return a Dataset resource. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   Dataset dataset = Dataset.newBuilder().build();
+   *   Dataset response = dataLabelingServiceClient.createDataset(parent, dataset);
+   * }
+   * }
+ * * @param parent Required. Dataset resource parent, format: projects/{project_id} * @param dataset Required. The dataset to be created. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -196,6 +224,19 @@ public final Dataset createDataset(String parent, Dataset dataset) { /** * Creates dataset. If success return a Dataset resource. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   CreateDatasetRequest request =
+   *       CreateDatasetRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setDataset(Dataset.newBuilder().build())
+   *           .build();
+   *   Dataset response = dataLabelingServiceClient.createDataset(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -208,6 +249,20 @@ public final Dataset createDataset(CreateDatasetRequest request) { * Creates dataset. If success return a Dataset resource. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   CreateDatasetRequest request =
+   *       CreateDatasetRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setDataset(Dataset.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.createDatasetCallable().futureCall(request);
+   *   // Do something.
+   *   Dataset response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createDatasetCallable() { return stub.createDatasetCallable(); @@ -217,6 +272,15 @@ public final UnaryCallable createDatasetCallable( /** * Gets dataset by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   Dataset response = dataLabelingServiceClient.getDataset(name);
+   * }
+   * }
+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -231,6 +295,15 @@ public final Dataset getDataset(DatasetName name) { /** * Gets dataset by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   Dataset response = dataLabelingServiceClient.getDataset(name);
+   * }
+   * }
+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -244,6 +317,18 @@ public final Dataset getDataset(String name) { /** * Gets dataset by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetDatasetRequest request =
+   *       GetDatasetRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .build();
+   *   Dataset response = dataLabelingServiceClient.getDataset(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -256,6 +341,19 @@ public final Dataset getDataset(GetDatasetRequest request) { * Gets dataset by resource name. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetDatasetRequest request =
+   *       GetDatasetRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.getDatasetCallable().futureCall(request);
+   *   // Do something.
+   *   Dataset response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getDatasetCallable() { return stub.getDatasetCallable(); @@ -265,6 +363,18 @@ public final UnaryCallable getDatasetCallable() { /** * Lists datasets under a project. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   String filter = "filter-1274492040";
+   *   for (Dataset element : dataLabelingServiceClient.listDatasets(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Dataset resource parent, format: projects/{project_id} * @param filter Optional. Filter on dataset is not supported at this moment. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -282,6 +392,18 @@ public final ListDatasetsPagedResponse listDatasets(ProjectName parent, String f /** * Lists datasets under a project. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   String filter = "filter-1274492040";
+   *   for (Dataset element : dataLabelingServiceClient.listDatasets(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Dataset resource parent, format: projects/{project_id} * @param filter Optional. Filter on dataset is not supported at this moment. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -296,6 +418,23 @@ public final ListDatasetsPagedResponse listDatasets(String parent, String filter /** * Lists datasets under a project. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListDatasetsRequest request =
+   *       ListDatasetsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Dataset element : dataLabelingServiceClient.listDatasets(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -308,6 +447,24 @@ public final ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) * Lists datasets under a project. Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListDatasetsRequest request =
+   *       ListDatasetsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.listDatasetsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Dataset element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listDatasetsPagedCallable() { @@ -319,6 +476,24 @@ public final ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) * Lists datasets under a project. Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   while (true) {
+   *     ListDatasetsResponse response =
+   *         dataLabelingServiceClient.listDatasetsCallable().call(request);
+   *     for (Dataset element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listDatasetsCallable() { return stub.listDatasetsCallable(); @@ -328,6 +503,15 @@ public final UnaryCallable listDatase /** * Deletes a dataset by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   dataLabelingServiceClient.deleteDataset(name);
+   * }
+   * }
+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -342,6 +526,15 @@ public final void deleteDataset(DatasetName name) { /** * Deletes a dataset by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   dataLabelingServiceClient.deleteDataset(name);
+   * }
+   * }
+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -355,6 +548,18 @@ public final void deleteDataset(String name) { /** * Deletes a dataset by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DeleteDatasetRequest request =
+   *       DeleteDatasetRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .build();
+   *   dataLabelingServiceClient.deleteDataset(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -367,6 +572,19 @@ public final void deleteDataset(DeleteDatasetRequest request) { * Deletes a dataset by resource name. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DeleteDatasetRequest request =
+   *       DeleteDatasetRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.deleteDatasetCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteDatasetCallable() { return stub.deleteDatasetCallable(); @@ -379,6 +597,17 @@ public final UnaryCallable deleteDatasetCallable() * running on it. For example, no labeling task (also long running operation) can be started while * importing is still ongoing. Vice versa. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportDataOperationResponse response =
+   *       dataLabelingServiceClient.importDataAsync(name, inputConfig).get();
+   * }
+   * }
+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @param inputConfig Required. Specify the input source of the data. @@ -401,6 +630,17 @@ public final UnaryCallable deleteDatasetCallable() * running on it. For example, no labeling task (also long running operation) can be started while * importing is still ongoing. Vice versa. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   InputConfig inputConfig = InputConfig.newBuilder().build();
+   *   ImportDataOperationResponse response =
+   *       dataLabelingServiceClient.importDataAsync(name, inputConfig).get();
+   * }
+   * }
+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @param inputConfig Required. Specify the input source of the data. @@ -420,6 +660,21 @@ public final UnaryCallable deleteDatasetCallable() * running on it. For example, no labeling task (also long running operation) can be started while * importing is still ongoing. Vice versa. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ImportDataRequest request =
+   *       ImportDataRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setInputConfig(InputConfig.newBuilder().build())
+   *           .setUserEmailAddress("userEmailAddress-1844787165")
+   *           .build();
+   *   ImportDataOperationResponse response =
+   *       dataLabelingServiceClient.importDataAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -436,6 +691,21 @@ public final UnaryCallable deleteDatasetCallable() * importing is still ongoing. Vice versa. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ImportDataRequest request =
+   *       ImportDataRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setInputConfig(InputConfig.newBuilder().build())
+   *           .setUserEmailAddress("userEmailAddress-1844787165")
+   *           .build();
+   *   OperationFuture future =
+   *       dataLabelingServiceClient.importDataOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ImportDataOperationResponse response = future.get();
+   * }
+   * }
*/ public final OperationCallable< ImportDataRequest, ImportDataOperationResponse, ImportDataOperationMetadata> @@ -451,6 +721,21 @@ public final UnaryCallable deleteDatasetCallable() * importing is still ongoing. Vice versa. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ImportDataRequest request =
+   *       ImportDataRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setInputConfig(InputConfig.newBuilder().build())
+   *           .setUserEmailAddress("userEmailAddress-1844787165")
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.importDataCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable importDataCallable() { return stub.importDataCallable(); @@ -460,6 +745,22 @@ public final UnaryCallable importDataCallable() { /** * Exports data and annotations from dataset. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   AnnotatedDatasetName annotatedDataset =
+   *       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
+   *   String filter = "filter-1274492040";
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   ExportDataOperationResponse response =
+   *       dataLabelingServiceClient
+   *           .exportDataAsync(name, annotatedDataset, filter, outputConfig)
+   *           .get();
+   * }
+   * }
+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @param annotatedDataset Required. Annotated dataset resource name. DataItem in Dataset and @@ -489,6 +790,22 @@ public final UnaryCallable importDataCallable() { /** * Exports data and annotations from dataset. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DatasetName name = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   String annotatedDataset =
+   *       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString();
+   *   String filter = "filter-1274492040";
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   ExportDataOperationResponse response =
+   *       dataLabelingServiceClient
+   *           .exportDataAsync(name, annotatedDataset, filter, outputConfig)
+   *           .get();
+   * }
+   * }
+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @param annotatedDataset Required. Annotated dataset resource name. DataItem in Dataset and @@ -515,6 +832,22 @@ public final UnaryCallable importDataCallable() { /** * Exports data and annotations from dataset. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   AnnotatedDatasetName annotatedDataset =
+   *       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
+   *   String filter = "filter-1274492040";
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   ExportDataOperationResponse response =
+   *       dataLabelingServiceClient
+   *           .exportDataAsync(name, annotatedDataset, filter, outputConfig)
+   *           .get();
+   * }
+   * }
+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @param annotatedDataset Required. Annotated dataset resource name. DataItem in Dataset and @@ -544,6 +877,22 @@ public final UnaryCallable importDataCallable() { /** * Exports data and annotations from dataset. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   String annotatedDataset =
+   *       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString();
+   *   String filter = "filter-1274492040";
+   *   OutputConfig outputConfig = OutputConfig.newBuilder().build();
+   *   ExportDataOperationResponse response =
+   *       dataLabelingServiceClient
+   *           .exportDataAsync(name, annotatedDataset, filter, outputConfig)
+   *           .get();
+   * }
+   * }
+ * * @param name Required. Dataset resource name, format: * projects/{project_id}/datasets/{dataset_id} * @param annotatedDataset Required. Annotated dataset resource name. DataItem in Dataset and @@ -570,6 +919,25 @@ public final UnaryCallable importDataCallable() { /** * Exports data and annotations from dataset. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ExportDataRequest request =
+   *       ExportDataRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setAnnotatedDataset(
+   *               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .setUserEmailAddress("userEmailAddress-1844787165")
+   *           .build();
+   *   ExportDataOperationResponse response =
+   *       dataLabelingServiceClient.exportDataAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -583,6 +951,25 @@ public final UnaryCallable importDataCallable() { * Exports data and annotations from dataset. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ExportDataRequest request =
+   *       ExportDataRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setAnnotatedDataset(
+   *               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .setUserEmailAddress("userEmailAddress-1844787165")
+   *           .build();
+   *   OperationFuture future =
+   *       dataLabelingServiceClient.exportDataOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ExportDataOperationResponse response = future.get();
+   * }
+   * }
*/ public final OperationCallable< ExportDataRequest, ExportDataOperationResponse, ExportDataOperationMetadata> @@ -595,6 +982,25 @@ public final UnaryCallable importDataCallable() { * Exports data and annotations from dataset. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ExportDataRequest request =
+   *       ExportDataRequest.newBuilder()
+   *           .setName(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setAnnotatedDataset(
+   *               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .setUserEmailAddress("userEmailAddress-1844787165")
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.exportDataCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable exportDataCallable() { return stub.exportDataCallable(); @@ -605,6 +1011,15 @@ public final UnaryCallable exportDataCallable() { * Gets a data item in a dataset by resource name. This API can be called after data are imported * into dataset. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DataItemName name = DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]");
+   *   DataItem response = dataLabelingServiceClient.getDataItem(name);
+   * }
+   * }
+ * * @param name Required. The name of the data item to get, format: * projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -620,6 +1035,15 @@ public final DataItem getDataItem(DataItemName name) { * Gets a data item in a dataset by resource name. This API can be called after data are imported * into dataset. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]").toString();
+   *   DataItem response = dataLabelingServiceClient.getDataItem(name);
+   * }
+   * }
+ * * @param name Required. The name of the data item to get, format: * projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -634,6 +1058,18 @@ public final DataItem getDataItem(String name) { * Gets a data item in a dataset by resource name. This API can be called after data are imported * into dataset. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetDataItemRequest request =
+   *       GetDataItemRequest.newBuilder()
+   *           .setName(DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]").toString())
+   *           .build();
+   *   DataItem response = dataLabelingServiceClient.getDataItem(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -647,6 +1083,19 @@ public final DataItem getDataItem(GetDataItemRequest request) { * into dataset. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetDataItemRequest request =
+   *       GetDataItemRequest.newBuilder()
+   *           .setName(DataItemName.of("[PROJECT]", "[DATASET]", "[DATA_ITEM]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.getDataItemCallable().futureCall(request);
+   *   // Do something.
+   *   DataItem response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getDataItemCallable() { return stub.getDataItemCallable(); @@ -657,6 +1106,19 @@ public final UnaryCallable getDataItemCallable() { * Lists data items in a dataset. This API can be called after data are imported into dataset. * Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   String filter = "filter-1274492040";
+   *   for (DataItem element :
+   *       dataLabelingServiceClient.listDataItems(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Name of the dataset to list data items, format: * projects/{project_id}/datasets/{dataset_id} * @param filter Optional. Filter is not supported at this moment. @@ -676,6 +1138,19 @@ public final ListDataItemsPagedResponse listDataItems(DatasetName parent, String * Lists data items in a dataset. This API can be called after data are imported into dataset. * Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   String filter = "filter-1274492040";
+   *   for (DataItem element :
+   *       dataLabelingServiceClient.listDataItems(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Name of the dataset to list data items, format: * projects/{project_id}/datasets/{dataset_id} * @param filter Optional. Filter is not supported at this moment. @@ -692,6 +1167,23 @@ public final ListDataItemsPagedResponse listDataItems(String parent, String filt * Lists data items in a dataset. This API can be called after data are imported into dataset. * Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListDataItemsRequest request =
+   *       ListDataItemsRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (DataItem element : dataLabelingServiceClient.listDataItems(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -705,6 +1197,24 @@ public final ListDataItemsPagedResponse listDataItems(ListDataItemsRequest reque * Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListDataItemsRequest request =
+   *       ListDataItemsRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.listDataItemsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (DataItem element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listDataItemsPagedCallable() { @@ -717,6 +1227,24 @@ public final ListDataItemsPagedResponse listDataItems(ListDataItemsRequest reque * Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   while (true) {
+   *     ListDataItemsResponse response =
+   *         dataLabelingServiceClient.listDataItemsCallable().call(request);
+   *     for (DataItem element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listDataItemsCallable() { return stub.listDataItemsCallable(); @@ -726,6 +1254,16 @@ public final UnaryCallable listData /** * Gets an annotated dataset by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   AnnotatedDatasetName name =
+   *       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
+   *   AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(name);
+   * }
+   * }
+ * * @param name Required. Name of the annotated dataset to get, format: * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -742,6 +1280,16 @@ public final AnnotatedDataset getAnnotatedDataset(AnnotatedDatasetName name) { /** * Gets an annotated dataset by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name =
+   *       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString();
+   *   AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(name);
+   * }
+   * }
+ * * @param name Required. Name of the annotated dataset to get, format: * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -756,6 +1304,20 @@ public final AnnotatedDataset getAnnotatedDataset(String name) { /** * Gets an annotated dataset by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetAnnotatedDatasetRequest request =
+   *       GetAnnotatedDatasetRequest.newBuilder()
+   *           .setName(
+   *               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
+   *                   .toString())
+   *           .build();
+   *   AnnotatedDataset response = dataLabelingServiceClient.getAnnotatedDataset(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -768,6 +1330,21 @@ public final AnnotatedDataset getAnnotatedDataset(GetAnnotatedDatasetRequest req * Gets an annotated dataset by resource name. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetAnnotatedDatasetRequest request =
+   *       GetAnnotatedDatasetRequest.newBuilder()
+   *           .setName(
+   *               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.getAnnotatedDatasetCallable().futureCall(request);
+   *   // Do something.
+   *   AnnotatedDataset response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getAnnotatedDatasetCallable() { @@ -778,6 +1355,19 @@ public final AnnotatedDataset getAnnotatedDataset(GetAnnotatedDatasetRequest req /** * Lists annotated datasets for a dataset. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   String filter = "filter-1274492040";
+   *   for (AnnotatedDataset element :
+   *       dataLabelingServiceClient.listAnnotatedDatasets(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Name of the dataset to list annotated datasets, format: * projects/{project_id}/datasets/{dataset_id} * @param filter Optional. Filter is not supported at this moment. @@ -797,6 +1387,19 @@ public final ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets( /** * Lists annotated datasets for a dataset. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   String filter = "filter-1274492040";
+   *   for (AnnotatedDataset element :
+   *       dataLabelingServiceClient.listAnnotatedDatasets(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Name of the dataset to list annotated datasets, format: * projects/{project_id}/datasets/{dataset_id} * @param filter Optional. Filter is not supported at this moment. @@ -813,6 +1416,24 @@ public final ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets( /** * Lists annotated datasets for a dataset. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListAnnotatedDatasetsRequest request =
+   *       ListAnnotatedDatasetsRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (AnnotatedDataset element :
+   *       dataLabelingServiceClient.listAnnotatedDatasets(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -826,6 +1447,24 @@ public final ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets( * Lists annotated datasets for a dataset. Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListAnnotatedDatasetsRequest request =
+   *       ListAnnotatedDatasetsRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.listAnnotatedDatasetsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (AnnotatedDataset element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listAnnotatedDatasetsPagedCallable() { @@ -837,6 +1476,24 @@ public final ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets( * Lists annotated datasets for a dataset. Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   while (true) {
+   *     ListAnnotatedDatasetsResponse response =
+   *         dataLabelingServiceClient.listAnnotatedDatasetsCallable().call(request);
+   *     for (AnnotatedDataset element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listAnnotatedDatasetsCallable() { @@ -847,6 +1504,20 @@ public final ListAnnotatedDatasetsPagedResponse listAnnotatedDatasets( /** * Deletes an annotated dataset by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DeleteAnnotatedDatasetRequest request =
+   *       DeleteAnnotatedDatasetRequest.newBuilder()
+   *           .setName(
+   *               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
+   *                   .toString())
+   *           .build();
+   *   dataLabelingServiceClient.deleteAnnotatedDataset(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -859,6 +1530,21 @@ public final void deleteAnnotatedDataset(DeleteAnnotatedDatasetRequest request) * Deletes an annotated dataset by resource name. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DeleteAnnotatedDatasetRequest request =
+   *       DeleteAnnotatedDatasetRequest.newBuilder()
+   *           .setName(
+   *               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.deleteAnnotatedDatasetCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteAnnotatedDatasetCallable() { @@ -870,6 +1556,18 @@ public final void deleteAnnotatedDataset(DeleteAnnotatedDatasetRequest request) * Starts a labeling task for image. The type of image labeling task is configured by feature in * the request. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
+   *   LabelImageRequest.Feature feature = LabelImageRequest.Feature.forNumber(0);
+   *   AnnotatedDataset response =
+   *       dataLabelingServiceClient.labelImageAsync(parent, basicConfig, feature).get();
+   * }
+   * }
+ * * @param parent Required. Name of the dataset to request labeling task, format: * projects/{project_id}/datasets/{dataset_id} * @param basicConfig Required. Basic human annotation config. @@ -892,6 +1590,18 @@ public final OperationFuture labelImag * Starts a labeling task for image. The type of image labeling task is configured by feature in * the request. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
+   *   LabelImageRequest.Feature feature = LabelImageRequest.Feature.forNumber(0);
+   *   AnnotatedDataset response =
+   *       dataLabelingServiceClient.labelImageAsync(parent, basicConfig, feature).get();
+   * }
+   * }
+ * * @param parent Required. Name of the dataset to request labeling task, format: * projects/{project_id}/datasets/{dataset_id} * @param basicConfig Required. Basic human annotation config. @@ -914,6 +1624,19 @@ public final OperationFuture labelImag * Starts a labeling task for image. The type of image labeling task is configured by feature in * the request. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   LabelImageRequest request =
+   *       LabelImageRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setBasicConfig(HumanAnnotationConfig.newBuilder().build())
+   *           .build();
+   *   AnnotatedDataset response = dataLabelingServiceClient.labelImageAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -928,6 +1651,20 @@ public final OperationFuture labelImag * the request. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   LabelImageRequest request =
+   *       LabelImageRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setBasicConfig(HumanAnnotationConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       dataLabelingServiceClient.labelImageOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AnnotatedDataset response = future.get();
+   * }
+   * }
*/ public final OperationCallable labelImageOperationCallable() { @@ -940,6 +1677,20 @@ public final OperationFuture labelImag * the request. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   LabelImageRequest request =
+   *       LabelImageRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setBasicConfig(HumanAnnotationConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.labelImageCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable labelImageCallable() { return stub.labelImageCallable(); @@ -950,6 +1701,18 @@ public final UnaryCallable labelImageCallable() { * Starts a labeling task for video. The type of video labeling task is configured by feature in * the request. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
+   *   LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.forNumber(0);
+   *   AnnotatedDataset response =
+   *       dataLabelingServiceClient.labelVideoAsync(parent, basicConfig, feature).get();
+   * }
+   * }
+ * * @param parent Required. Name of the dataset to request labeling task, format: * projects/{project_id}/datasets/{dataset_id} * @param basicConfig Required. Basic human annotation config. @@ -972,6 +1735,18 @@ public final OperationFuture labelVide * Starts a labeling task for video. The type of video labeling task is configured by feature in * the request. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
+   *   LabelVideoRequest.Feature feature = LabelVideoRequest.Feature.forNumber(0);
+   *   AnnotatedDataset response =
+   *       dataLabelingServiceClient.labelVideoAsync(parent, basicConfig, feature).get();
+   * }
+   * }
+ * * @param parent Required. Name of the dataset to request labeling task, format: * projects/{project_id}/datasets/{dataset_id} * @param basicConfig Required. Basic human annotation config. @@ -994,6 +1769,19 @@ public final OperationFuture labelVide * Starts a labeling task for video. The type of video labeling task is configured by feature in * the request. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   LabelVideoRequest request =
+   *       LabelVideoRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setBasicConfig(HumanAnnotationConfig.newBuilder().build())
+   *           .build();
+   *   AnnotatedDataset response = dataLabelingServiceClient.labelVideoAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1008,6 +1796,20 @@ public final OperationFuture labelVide * the request. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   LabelVideoRequest request =
+   *       LabelVideoRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setBasicConfig(HumanAnnotationConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       dataLabelingServiceClient.labelVideoOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AnnotatedDataset response = future.get();
+   * }
+   * }
*/ public final OperationCallable labelVideoOperationCallable() { @@ -1020,6 +1822,20 @@ public final OperationFuture labelVide * the request. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   LabelVideoRequest request =
+   *       LabelVideoRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setBasicConfig(HumanAnnotationConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.labelVideoCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable labelVideoCallable() { return stub.labelVideoCallable(); @@ -1030,6 +1846,18 @@ public final UnaryCallable labelVideoCallable() { * Starts a labeling task for text. The type of text labeling task is configured by feature in the * request. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DatasetName parent = DatasetName.of("[PROJECT]", "[DATASET]");
+   *   HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
+   *   LabelTextRequest.Feature feature = LabelTextRequest.Feature.forNumber(0);
+   *   AnnotatedDataset response =
+   *       dataLabelingServiceClient.labelTextAsync(parent, basicConfig, feature).get();
+   * }
+   * }
+ * * @param parent Required. Name of the data set to request labeling task, format: * projects/{project_id}/datasets/{dataset_id} * @param basicConfig Required. Basic human annotation config. @@ -1052,6 +1880,18 @@ public final OperationFuture labelText * Starts a labeling task for text. The type of text labeling task is configured by feature in the * request. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = DatasetName.of("[PROJECT]", "[DATASET]").toString();
+   *   HumanAnnotationConfig basicConfig = HumanAnnotationConfig.newBuilder().build();
+   *   LabelTextRequest.Feature feature = LabelTextRequest.Feature.forNumber(0);
+   *   AnnotatedDataset response =
+   *       dataLabelingServiceClient.labelTextAsync(parent, basicConfig, feature).get();
+   * }
+   * }
+ * * @param parent Required. Name of the data set to request labeling task, format: * projects/{project_id}/datasets/{dataset_id} * @param basicConfig Required. Basic human annotation config. @@ -1074,6 +1914,19 @@ public final OperationFuture labelText * Starts a labeling task for text. The type of text labeling task is configured by feature in the * request. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   LabelTextRequest request =
+   *       LabelTextRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setBasicConfig(HumanAnnotationConfig.newBuilder().build())
+   *           .build();
+   *   AnnotatedDataset response = dataLabelingServiceClient.labelTextAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1088,6 +1941,20 @@ public final OperationFuture labelText * request. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   LabelTextRequest request =
+   *       LabelTextRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setBasicConfig(HumanAnnotationConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       dataLabelingServiceClient.labelTextOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AnnotatedDataset response = future.get();
+   * }
+   * }
*/ public final OperationCallable labelTextOperationCallable() { @@ -1100,6 +1967,20 @@ public final OperationFuture labelText * request. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   LabelTextRequest request =
+   *       LabelTextRequest.newBuilder()
+   *           .setParent(DatasetName.of("[PROJECT]", "[DATASET]").toString())
+   *           .setBasicConfig(HumanAnnotationConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.labelTextCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable labelTextCallable() { return stub.labelTextCallable(); @@ -1109,6 +1990,17 @@ public final UnaryCallable labelTextCallable() { /** * Gets an example by resource name, including both data and annotation. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ExampleName name =
+   *       ExampleName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]");
+   *   String filter = "filter-1274492040";
+   *   Example response = dataLabelingServiceClient.getExample(name, filter);
+   * }
+   * }
+ * * @param name Required. Name of example, format: * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ * {annotated_dataset_id}/examples/{example_id} @@ -1130,6 +2022,17 @@ public final Example getExample(ExampleName name, String filter) { /** * Gets an example by resource name, including both data and annotation. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name =
+   *       ExampleName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]").toString();
+   *   String filter = "filter-1274492040";
+   *   Example response = dataLabelingServiceClient.getExample(name, filter);
+   * }
+   * }
+ * * @param name Required. Name of example, format: * projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ * {annotated_dataset_id}/examples/{example_id} @@ -1148,6 +2051,21 @@ public final Example getExample(String name, String filter) { /** * Gets an example by resource name, including both data and annotation. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetExampleRequest request =
+   *       GetExampleRequest.newBuilder()
+   *           .setName(
+   *               ExampleName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   Example response = dataLabelingServiceClient.getExample(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1160,6 +2078,22 @@ public final Example getExample(GetExampleRequest request) { * Gets an example by resource name, including both data and annotation. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetExampleRequest request =
+   *       GetExampleRequest.newBuilder()
+   *           .setName(
+   *               ExampleName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMPLE]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.getExampleCallable().futureCall(request);
+   *   // Do something.
+   *   Example response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getExampleCallable() { return stub.getExampleCallable(); @@ -1169,6 +2103,19 @@ public final UnaryCallable getExampleCallable() { /** * Lists examples in an annotated dataset. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   AnnotatedDatasetName parent =
+   *       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]");
+   *   String filter = "filter-1274492040";
+   *   for (Example element : dataLabelingServiceClient.listExamples(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Example resource parent. * @param filter Optional. An expression for filtering Examples. For annotated datasets that have * annotation spec set, filter by annotation_spec.display_name is supported. Format @@ -1188,6 +2135,19 @@ public final ListExamplesPagedResponse listExamples(AnnotatedDatasetName parent, /** * Lists examples in an annotated dataset. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent =
+   *       AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString();
+   *   String filter = "filter-1274492040";
+   *   for (Example element : dataLabelingServiceClient.listExamples(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Example resource parent. * @param filter Optional. An expression for filtering Examples. For annotated datasets that have * annotation spec set, filter by annotation_spec.display_name is supported. Format @@ -1204,6 +2164,25 @@ public final ListExamplesPagedResponse listExamples(String parent, String filter /** * Lists examples in an annotated dataset. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListExamplesRequest request =
+   *       ListExamplesRequest.newBuilder()
+   *           .setParent(
+   *               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Example element : dataLabelingServiceClient.listExamples(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1216,6 +2195,26 @@ public final ListExamplesPagedResponse listExamples(ListExamplesRequest request) * Lists examples in an annotated dataset. Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListExamplesRequest request =
+   *       ListExamplesRequest.newBuilder()
+   *           .setParent(
+   *               AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.listExamplesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Example element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listExamplesPagedCallable() { @@ -1227,6 +2226,24 @@ public final ListExamplesPagedResponse listExamples(ListExamplesRequest request) * Lists examples in an annotated dataset. Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   while (true) {
+   *     ListExamplesResponse response =
+   *         dataLabelingServiceClient.listExamplesCallable().call(request);
+   *     for (Example element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listExamplesCallable() { return stub.listExamplesCallable(); @@ -1236,6 +2253,17 @@ public final UnaryCallable listExampl /** * Creates an annotation spec set by providing a set of labels. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build();
+   *   AnnotationSpecSet response =
+   *       dataLabelingServiceClient.createAnnotationSpecSet(parent, annotationSpecSet);
+   * }
+   * }
+ * * @param parent Required. AnnotationSpecSet resource parent, format: projects/{project_id} * @param annotationSpecSet Required. Annotation spec set to create. Annotation specs must be * included. Only one annotation spec will be accepted for annotation specs with same @@ -1256,6 +2284,17 @@ public final AnnotationSpecSet createAnnotationSpecSet( /** * Creates an annotation spec set by providing a set of labels. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   AnnotationSpecSet annotationSpecSet = AnnotationSpecSet.newBuilder().build();
+   *   AnnotationSpecSet response =
+   *       dataLabelingServiceClient.createAnnotationSpecSet(parent, annotationSpecSet);
+   * }
+   * }
+ * * @param parent Required. AnnotationSpecSet resource parent, format: projects/{project_id} * @param annotationSpecSet Required. Annotation spec set to create. Annotation specs must be * included. Only one annotation spec will be accepted for annotation specs with same @@ -1276,6 +2315,19 @@ public final AnnotationSpecSet createAnnotationSpecSet( /** * Creates an annotation spec set by providing a set of labels. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   CreateAnnotationSpecSetRequest request =
+   *       CreateAnnotationSpecSetRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setAnnotationSpecSet(AnnotationSpecSet.newBuilder().build())
+   *           .build();
+   *   AnnotationSpecSet response = dataLabelingServiceClient.createAnnotationSpecSet(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1288,6 +2340,20 @@ public final AnnotationSpecSet createAnnotationSpecSet(CreateAnnotationSpecSetRe * Creates an annotation spec set by providing a set of labels. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   CreateAnnotationSpecSetRequest request =
+   *       CreateAnnotationSpecSetRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setAnnotationSpecSet(AnnotationSpecSet.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.createAnnotationSpecSetCallable().futureCall(request);
+   *   // Do something.
+   *   AnnotationSpecSet response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createAnnotationSpecSetCallable() { @@ -1298,6 +2364,15 @@ public final AnnotationSpecSet createAnnotationSpecSet(CreateAnnotationSpecSetRe /** * Gets an annotation spec set by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   AnnotationSpecSetName name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]");
+   *   AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(name);
+   * }
+   * }
+ * * @param name Required. AnnotationSpecSet resource name, format: * projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1314,6 +2389,15 @@ public final AnnotationSpecSet getAnnotationSpecSet(AnnotationSpecSetName name) /** * Gets an annotation spec set by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString();
+   *   AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(name);
+   * }
+   * }
+ * * @param name Required. AnnotationSpecSet resource name, format: * projects/{project_id}/annotationSpecSets/{annotation_spec_set_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1328,6 +2412,18 @@ public final AnnotationSpecSet getAnnotationSpecSet(String name) { /** * Gets an annotation spec set by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetAnnotationSpecSetRequest request =
+   *       GetAnnotationSpecSetRequest.newBuilder()
+   *           .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString())
+   *           .build();
+   *   AnnotationSpecSet response = dataLabelingServiceClient.getAnnotationSpecSet(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1340,6 +2436,19 @@ public final AnnotationSpecSet getAnnotationSpecSet(GetAnnotationSpecSetRequest * Gets an annotation spec set by resource name. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetAnnotationSpecSetRequest request =
+   *       GetAnnotationSpecSetRequest.newBuilder()
+   *           .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.getAnnotationSpecSetCallable().futureCall(request);
+   *   // Do something.
+   *   AnnotationSpecSet response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getAnnotationSpecSetCallable() { @@ -1350,6 +2459,19 @@ public final AnnotationSpecSet getAnnotationSpecSet(GetAnnotationSpecSetRequest /** * Lists annotation spec sets for a project. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   String filter = "filter-1274492040";
+   *   for (AnnotationSpecSet element :
+   *       dataLabelingServiceClient.listAnnotationSpecSets(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Parent of AnnotationSpecSet resource, format: projects/{project_id} * @param filter Optional. Filter is not supported at this moment. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1368,6 +2490,19 @@ public final ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets( /** * Lists annotation spec sets for a project. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   String filter = "filter-1274492040";
+   *   for (AnnotationSpecSet element :
+   *       dataLabelingServiceClient.listAnnotationSpecSets(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Parent of AnnotationSpecSet resource, format: projects/{project_id} * @param filter Optional. Filter is not supported at this moment. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1383,6 +2518,24 @@ public final ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets( /** * Lists annotation spec sets for a project. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListAnnotationSpecSetsRequest request =
+   *       ListAnnotationSpecSetsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (AnnotationSpecSet element :
+   *       dataLabelingServiceClient.listAnnotationSpecSets(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1396,6 +2549,24 @@ public final ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets( * Lists annotation spec sets for a project. Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListAnnotationSpecSetsRequest request =
+   *       ListAnnotationSpecSetsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.listAnnotationSpecSetsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (AnnotationSpecSet element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listAnnotationSpecSetsPagedCallable() { @@ -1407,6 +2578,24 @@ public final ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets( * Lists annotation spec sets for a project. Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   while (true) {
+   *     ListAnnotationSpecSetsResponse response =
+   *         dataLabelingServiceClient.listAnnotationSpecSetsCallable().call(request);
+   *     for (AnnotationSpecSet element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listAnnotationSpecSetsCallable() { @@ -1417,6 +2606,15 @@ public final ListAnnotationSpecSetsPagedResponse listAnnotationSpecSets( /** * Deletes an annotation spec set by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   AnnotationSpecSetName name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]");
+   *   dataLabelingServiceClient.deleteAnnotationSpecSet(name);
+   * }
+   * }
+ * * @param name Required. AnnotationSpec resource name, format: * `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1433,6 +2631,15 @@ public final void deleteAnnotationSpecSet(AnnotationSpecSetName name) { /** * Deletes an annotation spec set by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString();
+   *   dataLabelingServiceClient.deleteAnnotationSpecSet(name);
+   * }
+   * }
+ * * @param name Required. AnnotationSpec resource name, format: * `projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1447,6 +2654,18 @@ public final void deleteAnnotationSpecSet(String name) { /** * Deletes an annotation spec set by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DeleteAnnotationSpecSetRequest request =
+   *       DeleteAnnotationSpecSetRequest.newBuilder()
+   *           .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString())
+   *           .build();
+   *   dataLabelingServiceClient.deleteAnnotationSpecSet(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1459,6 +2678,19 @@ public final void deleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest request * Deletes an annotation spec set by resource name. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DeleteAnnotationSpecSetRequest request =
+   *       DeleteAnnotationSpecSetRequest.newBuilder()
+   *           .setName(AnnotationSpecSetName.of("[PROJECT]", "[ANNOTATION_SPEC_SET]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.deleteAnnotationSpecSetCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteAnnotationSpecSetCallable() { @@ -1469,6 +2701,17 @@ public final void deleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest request /** * Creates an instruction for how data should be labeled. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Instruction instruction = Instruction.newBuilder().build();
+   *   Instruction response =
+   *       dataLabelingServiceClient.createInstructionAsync(parent, instruction).get();
+   * }
+   * }
+ * * @param parent Required. Instruction resource parent, format: projects/{project_id} * @param instruction Required. Instruction of how to perform the labeling task. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1487,6 +2730,17 @@ public final OperationFuture createInstr /** * Creates an instruction for how data should be labeled. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   Instruction instruction = Instruction.newBuilder().build();
+   *   Instruction response =
+   *       dataLabelingServiceClient.createInstructionAsync(parent, instruction).get();
+   * }
+   * }
+ * * @param parent Required. Instruction resource parent, format: projects/{project_id} * @param instruction Required. Instruction of how to perform the labeling task. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1502,6 +2756,19 @@ public final OperationFuture createInstr /** * Creates an instruction for how data should be labeled. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   CreateInstructionRequest request =
+   *       CreateInstructionRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setInstruction(Instruction.newBuilder().build())
+   *           .build();
+   *   Instruction response = dataLabelingServiceClient.createInstructionAsync(request).get();
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1515,6 +2782,20 @@ public final OperationFuture createInstr * Creates an instruction for how data should be labeled. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   CreateInstructionRequest request =
+   *       CreateInstructionRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setInstruction(Instruction.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       dataLabelingServiceClient.createInstructionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instruction response = future.get();
+   * }
+   * }
*/ public final OperationCallable createInstructionOperationCallable() { @@ -1526,6 +2807,20 @@ public final OperationFuture createInstr * Creates an instruction for how data should be labeled. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   CreateInstructionRequest request =
+   *       CreateInstructionRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setInstruction(Instruction.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.createInstructionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createInstructionCallable() { return stub.createInstructionCallable(); @@ -1535,6 +2830,15 @@ public final UnaryCallable createInstructio /** * Gets an instruction by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   InstructionName name = InstructionName.of("[PROJECT]", "[INSTRUCTION]");
+   *   Instruction response = dataLabelingServiceClient.getInstruction(name);
+   * }
+   * }
+ * * @param name Required. Instruction resource name, format: * projects/{project_id}/instructions/{instruction_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1549,6 +2853,15 @@ public final Instruction getInstruction(InstructionName name) { /** * Gets an instruction by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString();
+   *   Instruction response = dataLabelingServiceClient.getInstruction(name);
+   * }
+   * }
+ * * @param name Required. Instruction resource name, format: * projects/{project_id}/instructions/{instruction_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1562,6 +2875,18 @@ public final Instruction getInstruction(String name) { /** * Gets an instruction by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetInstructionRequest request =
+   *       GetInstructionRequest.newBuilder()
+   *           .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString())
+   *           .build();
+   *   Instruction response = dataLabelingServiceClient.getInstruction(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1574,6 +2899,19 @@ public final Instruction getInstruction(GetInstructionRequest request) { * Gets an instruction by resource name. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetInstructionRequest request =
+   *       GetInstructionRequest.newBuilder()
+   *           .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.getInstructionCallable().futureCall(request);
+   *   // Do something.
+   *   Instruction response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getInstructionCallable() { return stub.getInstructionCallable(); @@ -1583,6 +2921,19 @@ public final UnaryCallable getInstructionCal /** * Lists instructions for a project. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   String filter = "filter-1274492040";
+   *   for (Instruction element :
+   *       dataLabelingServiceClient.listInstructions(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Instruction resource parent, format: projects/{project_id} * @param filter Optional. Filter is not supported at this moment. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1600,6 +2951,19 @@ public final ListInstructionsPagedResponse listInstructions(ProjectName parent, /** * Lists instructions for a project. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   String filter = "filter-1274492040";
+   *   for (Instruction element :
+   *       dataLabelingServiceClient.listInstructions(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Instruction resource parent, format: projects/{project_id} * @param filter Optional. Filter is not supported at this moment. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1614,6 +2978,23 @@ public final ListInstructionsPagedResponse listInstructions(String parent, Strin /** * Lists instructions for a project. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListInstructionsRequest request =
+   *       ListInstructionsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Instruction element : dataLabelingServiceClient.listInstructions(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1626,6 +3007,24 @@ public final ListInstructionsPagedResponse listInstructions(ListInstructionsRequ * Lists instructions for a project. Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListInstructionsRequest request =
+   *       ListInstructionsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.listInstructionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Instruction element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listInstructionsPagedCallable() { @@ -1637,6 +3036,24 @@ public final ListInstructionsPagedResponse listInstructions(ListInstructionsRequ * Lists instructions for a project. Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   while (true) {
+   *     ListInstructionsResponse response =
+   *         dataLabelingServiceClient.listInstructionsCallable().call(request);
+   *     for (Instruction element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listInstructionsCallable() { @@ -1647,6 +3064,15 @@ public final ListInstructionsPagedResponse listInstructions(ListInstructionsRequ /** * Deletes an instruction object by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   InstructionName name = InstructionName.of("[PROJECT]", "[INSTRUCTION]");
+   *   dataLabelingServiceClient.deleteInstruction(name);
+   * }
+   * }
+ * * @param name Required. Instruction resource name, format: * projects/{project_id}/instructions/{instruction_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1663,6 +3089,15 @@ public final void deleteInstruction(InstructionName name) { /** * Deletes an instruction object by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString();
+   *   dataLabelingServiceClient.deleteInstruction(name);
+   * }
+   * }
+ * * @param name Required. Instruction resource name, format: * projects/{project_id}/instructions/{instruction_id} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1676,6 +3111,18 @@ public final void deleteInstruction(String name) { /** * Deletes an instruction object by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DeleteInstructionRequest request =
+   *       DeleteInstructionRequest.newBuilder()
+   *           .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString())
+   *           .build();
+   *   dataLabelingServiceClient.deleteInstruction(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1688,6 +3135,19 @@ public final void deleteInstruction(DeleteInstructionRequest request) { * Deletes an instruction object by resource name. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DeleteInstructionRequest request =
+   *       DeleteInstructionRequest.newBuilder()
+   *           .setName(InstructionName.of("[PROJECT]", "[INSTRUCTION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.deleteInstructionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteInstructionCallable() { return stub.deleteInstructionCallable(); @@ -1698,6 +3158,15 @@ public final UnaryCallable deleteInstructionCal * Gets an evaluation by resource name (to search, use * [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]). * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   EvaluationName name = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]");
+   *   Evaluation response = dataLabelingServiceClient.getEvaluation(name);
+   * }
+   * }
+ * * @param name Required. Name of the evaluation. Format: *

"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>' * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1713,6 +3182,15 @@ public final Evaluation getEvaluation(EvaluationName name) { * Gets an evaluation by resource name (to search, use * [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]). * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString();
+   *   Evaluation response = dataLabelingServiceClient.getEvaluation(name);
+   * }
+   * }
+ * * @param name Required. Name of the evaluation. Format: *

"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>' * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -1727,6 +3205,18 @@ public final Evaluation getEvaluation(String name) { * Gets an evaluation by resource name (to search, use * [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]). * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetEvaluationRequest request =
+   *       GetEvaluationRequest.newBuilder()
+   *           .setName(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString())
+   *           .build();
+   *   Evaluation response = dataLabelingServiceClient.getEvaluation(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1740,6 +3230,19 @@ public final Evaluation getEvaluation(GetEvaluationRequest request) { * [projects.evaluations.search][google.cloud.datalabeling.v1beta1.DataLabelingService.SearchEvaluations]). * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetEvaluationRequest request =
+   *       GetEvaluationRequest.newBuilder()
+   *           .setName(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.getEvaluationCallable().futureCall(request);
+   *   // Do something.
+   *   Evaluation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getEvaluationCallable() { return stub.getEvaluationCallable(); @@ -1749,6 +3252,19 @@ public final UnaryCallable getEvaluationCallab /** * Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   EvaluationName parent = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]");
+   *   String filter = "filter-1274492040";
+   *   for (Evaluation element :
+   *       dataLabelingServiceClient.searchEvaluations(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Evaluation search parent (project ID). Format: * "projects/<var>{project_id}</var>" * @param filter Optional. To search evaluations, you can filter by the following: @@ -1799,6 +3315,19 @@ public final SearchEvaluationsPagedResponse searchEvaluations( /** * Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString();
+   *   String filter = "filter-1274492040";
+   *   for (Evaluation element :
+   *       dataLabelingServiceClient.searchEvaluations(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Evaluation search parent (project ID). Format: * "projects/<var>{project_id}</var>" * @param filter Optional. To search evaluations, you can filter by the following: @@ -1845,6 +3374,23 @@ public final SearchEvaluationsPagedResponse searchEvaluations(String parent, Str /** * Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   SearchEvaluationsRequest request =
+   *       SearchEvaluationsRequest.newBuilder()
+   *           .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Evaluation element : dataLabelingServiceClient.searchEvaluations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1857,6 +3403,24 @@ public final SearchEvaluationsPagedResponse searchEvaluations(SearchEvaluationsR * Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   SearchEvaluationsRequest request =
+   *       SearchEvaluationsRequest.newBuilder()
+   *           .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.searchEvaluationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Evaluation element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable searchEvaluationsPagedCallable() { @@ -1868,6 +3432,24 @@ public final SearchEvaluationsPagedResponse searchEvaluations(SearchEvaluationsR * Searches [evaluations][google.cloud.datalabeling.v1beta1.Evaluation] within a project. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   while (true) {
+   *     SearchEvaluationsResponse response =
+   *         dataLabelingServiceClient.searchEvaluationsCallable().call(request);
+   *     for (Evaluation element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable searchEvaluationsCallable() { @@ -1880,6 +3462,18 @@ public final SearchEvaluationsPagedResponse searchEvaluations(SearchEvaluationsR * comparisons that show ground truth and prediction(s) for a single input. Search by providing an * evaluation ID. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   EvaluationName parent = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]");
+   *   for (SearchExampleComparisonsResponse.ExampleComparison element :
+   *       dataLabelingServiceClient.searchExampleComparisons(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Name of the [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation] * resource to search for example comparisons from. Format: *

"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>" @@ -1900,6 +3494,18 @@ public final SearchExampleComparisonsPagedResponse searchExampleComparisons( * comparisons that show ground truth and prediction(s) for a single input. Search by providing an * evaluation ID. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString();
+   *   for (SearchExampleComparisonsResponse.ExampleComparison element :
+   *       dataLabelingServiceClient.searchExampleComparisons(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Name of the [Evaluation][google.cloud.datalabeling.v1beta1.Evaluation] * resource to search for example comparisons from. Format: *

"projects/<var>{project_id}</var>/datasets/<var>{dataset_id}</var>/evaluations/<var>{evaluation_id}</var>" @@ -1917,6 +3523,23 @@ public final SearchExampleComparisonsPagedResponse searchExampleComparisons(Stri * comparisons that show ground truth and prediction(s) for a single input. Search by providing an * evaluation ID. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   SearchExampleComparisonsRequest request =
+   *       SearchExampleComparisonsRequest.newBuilder()
+   *           .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (SearchExampleComparisonsResponse.ExampleComparison element :
+   *       dataLabelingServiceClient.searchExampleComparisons(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -1932,6 +3555,23 @@ public final SearchExampleComparisonsPagedResponse searchExampleComparisons( * evaluation ID. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   SearchExampleComparisonsRequest request =
+   *       SearchExampleComparisonsRequest.newBuilder()
+   *           .setParent(EvaluationName.of("[PROJECT]", "[DATASET]", "[EVALUATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.searchExampleComparisonsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SearchExampleComparisonsResponse.ExampleComparison element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable searchExampleComparisonsPagedCallable() { @@ -1945,6 +3585,25 @@ public final SearchExampleComparisonsPagedResponse searchExampleComparisons( * evaluation ID. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   while (true) {
+   *     SearchExampleComparisonsResponse response =
+   *         dataLabelingServiceClient.searchExampleComparisonsCallable().call(request);
+   *     for (SearchExampleComparisonsResponse.ExampleComparison element :
+   *         response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable searchExampleComparisonsCallable() { @@ -1955,6 +3614,16 @@ public final SearchExampleComparisonsPagedResponse searchExampleComparisons( /** * Creates an evaluation job. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   EvaluationJob job = EvaluationJob.newBuilder().build();
+   *   EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(parent, job);
+   * }
+   * }
+ * * @param parent Required. Evaluation job resource parent. Format: * "projects/<var>{project_id}</var>" * @param job Required. The evaluation job to create. @@ -1973,6 +3642,16 @@ public final EvaluationJob createEvaluationJob(ProjectName parent, EvaluationJob /** * Creates an evaluation job. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   EvaluationJob job = EvaluationJob.newBuilder().build();
+   *   EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(parent, job);
+   * }
+   * }
+ * * @param parent Required. Evaluation job resource parent. Format: * "projects/<var>{project_id}</var>" * @param job Required. The evaluation job to create. @@ -1988,6 +3667,19 @@ public final EvaluationJob createEvaluationJob(String parent, EvaluationJob job) /** * Creates an evaluation job. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   CreateEvaluationJobRequest request =
+   *       CreateEvaluationJobRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setJob(EvaluationJob.newBuilder().build())
+   *           .build();
+   *   EvaluationJob response = dataLabelingServiceClient.createEvaluationJob(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -2000,6 +3692,20 @@ public final EvaluationJob createEvaluationJob(CreateEvaluationJobRequest reques * Creates an evaluation job. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   CreateEvaluationJobRequest request =
+   *       CreateEvaluationJobRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setJob(EvaluationJob.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.createEvaluationJobCallable().futureCall(request);
+   *   // Do something.
+   *   EvaluationJob response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createEvaluationJobCallable() { @@ -2015,6 +3721,17 @@ public final EvaluationJob createEvaluationJob(CreateEvaluationJobRequest reques *

If you want to change any other aspect of the evaluation job, you must delete the job and * create a new one. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   EvaluationJob evaluationJob = EvaluationJob.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   EvaluationJob response =
+   *       dataLabelingServiceClient.updateEvaluationJob(evaluationJob, updateMask);
+   * }
+   * }
+ * * @param evaluationJob Required. Evaluation job that is going to be updated. * @param updateMask Optional. Mask for which fields to update. You can only provide the following * fields: @@ -2045,6 +3762,19 @@ public final EvaluationJob updateEvaluationJob( *

If you want to change any other aspect of the evaluation job, you must delete the job and * create a new one. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   UpdateEvaluationJobRequest request =
+   *       UpdateEvaluationJobRequest.newBuilder()
+   *           .setEvaluationJob(EvaluationJob.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   EvaluationJob response = dataLabelingServiceClient.updateEvaluationJob(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -2062,6 +3792,20 @@ public final EvaluationJob updateEvaluationJob(UpdateEvaluationJobRequest reques * create a new one. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   UpdateEvaluationJobRequest request =
+   *       UpdateEvaluationJobRequest.newBuilder()
+   *           .setEvaluationJob(EvaluationJob.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.updateEvaluationJobCallable().futureCall(request);
+   *   // Do something.
+   *   EvaluationJob response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateEvaluationJobCallable() { @@ -2072,6 +3816,15 @@ public final EvaluationJob updateEvaluationJob(UpdateEvaluationJobRequest reques /** * Gets an evaluation job by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]");
+   *   EvaluationJob response = dataLabelingServiceClient.getEvaluationJob(name);
+   * }
+   * }
+ * * @param name Required. Name of the evaluation job. Format: *

"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2086,6 +3839,15 @@ public final EvaluationJob getEvaluationJob(EvaluationJobName name) { /** * Gets an evaluation job by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString();
+   *   EvaluationJob response = dataLabelingServiceClient.getEvaluationJob(name);
+   * }
+   * }
+ * * @param name Required. Name of the evaluation job. Format: *

"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2099,6 +3861,18 @@ public final EvaluationJob getEvaluationJob(String name) { /** * Gets an evaluation job by resource name. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetEvaluationJobRequest request =
+   *       GetEvaluationJobRequest.newBuilder()
+   *           .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString())
+   *           .build();
+   *   EvaluationJob response = dataLabelingServiceClient.getEvaluationJob(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -2111,6 +3885,19 @@ public final EvaluationJob getEvaluationJob(GetEvaluationJobRequest request) { * Gets an evaluation job by resource name. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   GetEvaluationJobRequest request =
+   *       GetEvaluationJobRequest.newBuilder()
+   *           .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.getEvaluationJobCallable().futureCall(request);
+   *   // Do something.
+   *   EvaluationJob response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getEvaluationJobCallable() { return stub.getEvaluationJobCallable(); @@ -2121,6 +3908,15 @@ public final UnaryCallable getEvaluation * Pauses an evaluation job. Pausing an evaluation job that is already in a `PAUSED` state is a * no-op. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]");
+   *   dataLabelingServiceClient.pauseEvaluationJob(name);
+   * }
+   * }
+ * * @param name Required. Name of the evaluation job that is going to be paused. Format: *

"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2138,6 +3934,15 @@ public final void pauseEvaluationJob(EvaluationJobName name) { * Pauses an evaluation job. Pausing an evaluation job that is already in a `PAUSED` state is a * no-op. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString();
+   *   dataLabelingServiceClient.pauseEvaluationJob(name);
+   * }
+   * }
+ * * @param name Required. Name of the evaluation job that is going to be paused. Format: *

"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2153,6 +3958,18 @@ public final void pauseEvaluationJob(String name) { * Pauses an evaluation job. Pausing an evaluation job that is already in a `PAUSED` state is a * no-op. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   PauseEvaluationJobRequest request =
+   *       PauseEvaluationJobRequest.newBuilder()
+   *           .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString())
+   *           .build();
+   *   dataLabelingServiceClient.pauseEvaluationJob(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -2166,6 +3983,19 @@ public final void pauseEvaluationJob(PauseEvaluationJobRequest request) { * no-op. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   PauseEvaluationJobRequest request =
+   *       PauseEvaluationJobRequest.newBuilder()
+   *           .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.pauseEvaluationJobCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable pauseEvaluationJobCallable() { return stub.pauseEvaluationJobCallable(); @@ -2176,6 +4006,15 @@ public final UnaryCallable pauseEvaluationJobC * Resumes a paused evaluation job. A deleted evaluation job can't be resumed. Resuming a running * or scheduled evaluation job is a no-op. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]");
+   *   dataLabelingServiceClient.resumeEvaluationJob(name);
+   * }
+   * }
+ * * @param name Required. Name of the evaluation job that is going to be resumed. Format: *

"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2193,6 +4032,15 @@ public final void resumeEvaluationJob(EvaluationJobName name) { * Resumes a paused evaluation job. A deleted evaluation job can't be resumed. Resuming a running * or scheduled evaluation job is a no-op. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString();
+   *   dataLabelingServiceClient.resumeEvaluationJob(name);
+   * }
+   * }
+ * * @param name Required. Name of the evaluation job that is going to be resumed. Format: *

"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2208,6 +4056,18 @@ public final void resumeEvaluationJob(String name) { * Resumes a paused evaluation job. A deleted evaluation job can't be resumed. Resuming a running * or scheduled evaluation job is a no-op. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ResumeEvaluationJobRequest request =
+   *       ResumeEvaluationJobRequest.newBuilder()
+   *           .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString())
+   *           .build();
+   *   dataLabelingServiceClient.resumeEvaluationJob(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -2221,6 +4081,19 @@ public final void resumeEvaluationJob(ResumeEvaluationJobRequest request) { * or scheduled evaluation job is a no-op. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ResumeEvaluationJobRequest request =
+   *       ResumeEvaluationJobRequest.newBuilder()
+   *           .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.resumeEvaluationJobCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable resumeEvaluationJobCallable() { return stub.resumeEvaluationJobCallable(); @@ -2230,6 +4103,15 @@ public final UnaryCallable resumeEvaluationJo /** * Stops and deletes an evaluation job. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   EvaluationJobName name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]");
+   *   dataLabelingServiceClient.deleteEvaluationJob(name);
+   * }
+   * }
+ * * @param name Required. Name of the evaluation job that is going to be deleted. Format: *

"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2246,6 +4128,15 @@ public final void deleteEvaluationJob(EvaluationJobName name) { /** * Stops and deletes an evaluation job. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String name = EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString();
+   *   dataLabelingServiceClient.deleteEvaluationJob(name);
+   * }
+   * }
+ * * @param name Required. Name of the evaluation job that is going to be deleted. Format: *

"projects/<var>{project_id}</var>/evaluationJobs/<var>{evaluation_job_id}</var>" * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -2260,6 +4151,18 @@ public final void deleteEvaluationJob(String name) { /** * Stops and deletes an evaluation job. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DeleteEvaluationJobRequest request =
+   *       DeleteEvaluationJobRequest.newBuilder()
+   *           .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString())
+   *           .build();
+   *   dataLabelingServiceClient.deleteEvaluationJob(request);
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -2272,6 +4175,19 @@ public final void deleteEvaluationJob(DeleteEvaluationJobRequest request) { * Stops and deletes an evaluation job. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   DeleteEvaluationJobRequest request =
+   *       DeleteEvaluationJobRequest.newBuilder()
+   *           .setName(EvaluationJobName.of("[PROJECT]", "[EVALUATION_JOB]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.deleteEvaluationJobCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteEvaluationJobCallable() { return stub.deleteEvaluationJobCallable(); @@ -2281,6 +4197,19 @@ public final UnaryCallable deleteEvaluationJo /** * Lists all evaluation jobs within a project with possible filters. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   String filter = "filter-1274492040";
+   *   for (EvaluationJob element :
+   *       dataLabelingServiceClient.listEvaluationJobs(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Evaluation job resource parent. Format: * "projects/<var>{project_id}</var>" * @param filter Optional. You can filter the jobs to list by model_id (also known as model_name, @@ -2308,6 +4237,19 @@ public final ListEvaluationJobsPagedResponse listEvaluationJobs( /** * Lists all evaluation jobs within a project with possible filters. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   String filter = "filter-1274492040";
+   *   for (EvaluationJob element :
+   *       dataLabelingServiceClient.listEvaluationJobs(parent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Evaluation job resource parent. Format: * "projects/<var>{project_id}</var>" * @param filter Optional. You can filter the jobs to list by model_id (also known as model_name, @@ -2331,6 +4273,24 @@ public final ListEvaluationJobsPagedResponse listEvaluationJobs(String parent, S /** * Lists all evaluation jobs within a project with possible filters. Pagination is supported. * + *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListEvaluationJobsRequest request =
+   *       ListEvaluationJobsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (EvaluationJob element :
+   *       dataLabelingServiceClient.listEvaluationJobs(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -2344,6 +4304,24 @@ public final ListEvaluationJobsPagedResponse listEvaluationJobs( * Lists all evaluation jobs within a project with possible filters. Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   ListEvaluationJobsRequest request =
+   *       ListEvaluationJobsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       dataLabelingServiceClient.listEvaluationJobsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (EvaluationJob element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listEvaluationJobsPagedCallable() { @@ -2355,6 +4333,24 @@ public final ListEvaluationJobsPagedResponse listEvaluationJobs( * Lists all evaluation jobs within a project with possible filters. Pagination is supported. * *

Sample code: + * + *

{@code
+   * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+   *   while (true) {
+   *     ListEvaluationJobsResponse response =
+   *         dataLabelingServiceClient.listEvaluationJobsCallable().call(request);
+   *     for (EvaluationJob element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listEvaluationJobsCallable() { diff --git a/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/gapic_metadata.json b/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/gapic_metadata.json new file mode 100644 index 00000000..2bc2604c --- /dev/null +++ b/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/gapic_metadata.json @@ -0,0 +1,120 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.datalabeling.v1beta1", + "libraryPackage": "com.google.cloud.datalabeling.v1beta1", + "services": { + "DataLabelingService": { + "clients": { + "grpc": { + "libraryClient": "DataLabelingServiceClient", + "rpcs": { + "CreateAnnotationSpecSet": { + "methods": ["createAnnotationSpecSet", "createAnnotationSpecSet", "createAnnotationSpecSet", "createAnnotationSpecSetCallable"] + }, + "CreateDataset": { + "methods": ["createDataset", "createDataset", "createDataset", "createDatasetCallable"] + }, + "CreateEvaluationJob": { + "methods": ["createEvaluationJob", "createEvaluationJob", "createEvaluationJob", "createEvaluationJobCallable"] + }, + "CreateInstruction": { + "methods": ["createInstructionAsync", "createInstructionAsync", "createInstructionAsync", "createInstructionOperationCallable", "createInstructionCallable"] + }, + "DeleteAnnotatedDataset": { + "methods": ["deleteAnnotatedDataset", "deleteAnnotatedDatasetCallable"] + }, + "DeleteAnnotationSpecSet": { + "methods": ["deleteAnnotationSpecSet", "deleteAnnotationSpecSet", "deleteAnnotationSpecSet", "deleteAnnotationSpecSetCallable"] + }, + "DeleteDataset": { + "methods": ["deleteDataset", "deleteDataset", "deleteDataset", "deleteDatasetCallable"] + }, + "DeleteEvaluationJob": { + "methods": ["deleteEvaluationJob", "deleteEvaluationJob", "deleteEvaluationJob", "deleteEvaluationJobCallable"] + }, + "DeleteInstruction": { + "methods": ["deleteInstruction", "deleteInstruction", "deleteInstruction", "deleteInstructionCallable"] + }, + "ExportData": { + "methods": ["exportDataAsync", "exportDataAsync", "exportDataAsync", "exportDataAsync", "exportDataAsync", "exportDataOperationCallable", "exportDataCallable"] + }, + "GetAnnotatedDataset": { + "methods": ["getAnnotatedDataset", "getAnnotatedDataset", "getAnnotatedDataset", "getAnnotatedDatasetCallable"] + }, + "GetAnnotationSpecSet": { + "methods": ["getAnnotationSpecSet", "getAnnotationSpecSet", "getAnnotationSpecSet", "getAnnotationSpecSetCallable"] + }, + "GetDataItem": { + "methods": ["getDataItem", "getDataItem", "getDataItem", "getDataItemCallable"] + }, + "GetDataset": { + "methods": ["getDataset", "getDataset", "getDataset", "getDatasetCallable"] + }, + "GetEvaluation": { + "methods": ["getEvaluation", "getEvaluation", "getEvaluation", "getEvaluationCallable"] + }, + "GetEvaluationJob": { + "methods": ["getEvaluationJob", "getEvaluationJob", "getEvaluationJob", "getEvaluationJobCallable"] + }, + "GetExample": { + "methods": ["getExample", "getExample", "getExample", "getExampleCallable"] + }, + "GetInstruction": { + "methods": ["getInstruction", "getInstruction", "getInstruction", "getInstructionCallable"] + }, + "ImportData": { + "methods": ["importDataAsync", "importDataAsync", "importDataAsync", "importDataOperationCallable", "importDataCallable"] + }, + "LabelImage": { + "methods": ["labelImageAsync", "labelImageAsync", "labelImageAsync", "labelImageOperationCallable", "labelImageCallable"] + }, + "LabelText": { + "methods": ["labelTextAsync", "labelTextAsync", "labelTextAsync", "labelTextOperationCallable", "labelTextCallable"] + }, + "LabelVideo": { + "methods": ["labelVideoAsync", "labelVideoAsync", "labelVideoAsync", "labelVideoOperationCallable", "labelVideoCallable"] + }, + "ListAnnotatedDatasets": { + "methods": ["listAnnotatedDatasets", "listAnnotatedDatasets", "listAnnotatedDatasets", "listAnnotatedDatasetsPagedCallable", "listAnnotatedDatasetsCallable"] + }, + "ListAnnotationSpecSets": { + "methods": ["listAnnotationSpecSets", "listAnnotationSpecSets", "listAnnotationSpecSets", "listAnnotationSpecSetsPagedCallable", "listAnnotationSpecSetsCallable"] + }, + "ListDataItems": { + "methods": ["listDataItems", "listDataItems", "listDataItems", "listDataItemsPagedCallable", "listDataItemsCallable"] + }, + "ListDatasets": { + "methods": ["listDatasets", "listDatasets", "listDatasets", "listDatasetsPagedCallable", "listDatasetsCallable"] + }, + "ListEvaluationJobs": { + "methods": ["listEvaluationJobs", "listEvaluationJobs", "listEvaluationJobs", "listEvaluationJobsPagedCallable", "listEvaluationJobsCallable"] + }, + "ListExamples": { + "methods": ["listExamples", "listExamples", "listExamples", "listExamplesPagedCallable", "listExamplesCallable"] + }, + "ListInstructions": { + "methods": ["listInstructions", "listInstructions", "listInstructions", "listInstructionsPagedCallable", "listInstructionsCallable"] + }, + "PauseEvaluationJob": { + "methods": ["pauseEvaluationJob", "pauseEvaluationJob", "pauseEvaluationJob", "pauseEvaluationJobCallable"] + }, + "ResumeEvaluationJob": { + "methods": ["resumeEvaluationJob", "resumeEvaluationJob", "resumeEvaluationJob", "resumeEvaluationJobCallable"] + }, + "SearchEvaluations": { + "methods": ["searchEvaluations", "searchEvaluations", "searchEvaluations", "searchEvaluationsPagedCallable", "searchEvaluationsCallable"] + }, + "SearchExampleComparisons": { + "methods": ["searchExampleComparisons", "searchExampleComparisons", "searchExampleComparisons", "searchExampleComparisonsPagedCallable", "searchExampleComparisonsCallable"] + }, + "UpdateEvaluationJob": { + "methods": ["updateEvaluationJob", "updateEvaluationJob", "updateEvaluationJobCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/package-info.java b/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/package-info.java index f18fc3ba..d7b54822 100644 --- a/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/package-info.java +++ b/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/package-info.java @@ -22,6 +22,14 @@ *

Service Description: Service for the AI Platform Data Labeling API. * *

Sample for DataLabelingServiceClient: + * + *

{@code
+ * try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Dataset dataset = Dataset.newBuilder().build();
+ *   Dataset response = dataLabelingServiceClient.createDataset(parent, dataset);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.datalabeling.v1beta1; diff --git a/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/stub/GrpcDataLabelingServiceStub.java b/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/stub/GrpcDataLabelingServiceStub.java index 93548f61..4aee07de 100644 --- a/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/stub/GrpcDataLabelingServiceStub.java +++ b/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/stub/GrpcDataLabelingServiceStub.java @@ -1272,220 +1272,269 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable createDatasetCallable() { return createDatasetCallable; } + @Override public UnaryCallable getDatasetCallable() { return getDatasetCallable; } + @Override public UnaryCallable listDatasetsCallable() { return listDatasetsCallable; } + @Override public UnaryCallable listDatasetsPagedCallable() { return listDatasetsPagedCallable; } + @Override public UnaryCallable deleteDatasetCallable() { return deleteDatasetCallable; } + @Override public UnaryCallable importDataCallable() { return importDataCallable; } + @Override public OperationCallable< ImportDataRequest, ImportDataOperationResponse, ImportDataOperationMetadata> importDataOperationCallable() { return importDataOperationCallable; } + @Override public UnaryCallable exportDataCallable() { return exportDataCallable; } + @Override public OperationCallable< ExportDataRequest, ExportDataOperationResponse, ExportDataOperationMetadata> exportDataOperationCallable() { return exportDataOperationCallable; } + @Override public UnaryCallable getDataItemCallable() { return getDataItemCallable; } + @Override public UnaryCallable listDataItemsCallable() { return listDataItemsCallable; } + @Override public UnaryCallable listDataItemsPagedCallable() { return listDataItemsPagedCallable; } + @Override public UnaryCallable getAnnotatedDatasetCallable() { return getAnnotatedDatasetCallable; } + @Override public UnaryCallable listAnnotatedDatasetsCallable() { return listAnnotatedDatasetsCallable; } + @Override public UnaryCallable listAnnotatedDatasetsPagedCallable() { return listAnnotatedDatasetsPagedCallable; } + @Override public UnaryCallable deleteAnnotatedDatasetCallable() { return deleteAnnotatedDatasetCallable; } + @Override public UnaryCallable labelImageCallable() { return labelImageCallable; } + @Override public OperationCallable labelImageOperationCallable() { return labelImageOperationCallable; } + @Override public UnaryCallable labelVideoCallable() { return labelVideoCallable; } + @Override public OperationCallable labelVideoOperationCallable() { return labelVideoOperationCallable; } + @Override public UnaryCallable labelTextCallable() { return labelTextCallable; } + @Override public OperationCallable labelTextOperationCallable() { return labelTextOperationCallable; } + @Override public UnaryCallable getExampleCallable() { return getExampleCallable; } + @Override public UnaryCallable listExamplesCallable() { return listExamplesCallable; } + @Override public UnaryCallable listExamplesPagedCallable() { return listExamplesPagedCallable; } + @Override public UnaryCallable createAnnotationSpecSetCallable() { return createAnnotationSpecSetCallable; } + @Override public UnaryCallable getAnnotationSpecSetCallable() { return getAnnotationSpecSetCallable; } + @Override public UnaryCallable listAnnotationSpecSetsCallable() { return listAnnotationSpecSetsCallable; } + @Override public UnaryCallable listAnnotationSpecSetsPagedCallable() { return listAnnotationSpecSetsPagedCallable; } + @Override public UnaryCallable deleteAnnotationSpecSetCallable() { return deleteAnnotationSpecSetCallable; } + @Override public UnaryCallable createInstructionCallable() { return createInstructionCallable; } + @Override public OperationCallable createInstructionOperationCallable() { return createInstructionOperationCallable; } + @Override public UnaryCallable getInstructionCallable() { return getInstructionCallable; } + @Override public UnaryCallable listInstructionsCallable() { return listInstructionsCallable; } + @Override public UnaryCallable listInstructionsPagedCallable() { return listInstructionsPagedCallable; } + @Override public UnaryCallable deleteInstructionCallable() { return deleteInstructionCallable; } + @Override public UnaryCallable getEvaluationCallable() { return getEvaluationCallable; } + @Override public UnaryCallable searchEvaluationsCallable() { return searchEvaluationsCallable; } + @Override public UnaryCallable searchEvaluationsPagedCallable() { return searchEvaluationsPagedCallable; } + @Override public UnaryCallable searchExampleComparisonsCallable() { return searchExampleComparisonsCallable; } + @Override public UnaryCallable searchExampleComparisonsPagedCallable() { return searchExampleComparisonsPagedCallable; } + @Override public UnaryCallable createEvaluationJobCallable() { return createEvaluationJobCallable; } + @Override public UnaryCallable updateEvaluationJobCallable() { return updateEvaluationJobCallable; } + @Override public UnaryCallable getEvaluationJobCallable() { return getEvaluationJobCallable; } + @Override public UnaryCallable pauseEvaluationJobCallable() { return pauseEvaluationJobCallable; } + @Override public UnaryCallable resumeEvaluationJobCallable() { return resumeEvaluationJobCallable; } + @Override public UnaryCallable deleteEvaluationJobCallable() { return deleteEvaluationJobCallable; } + @Override public UnaryCallable listEvaluationJobsCallable() { return listEvaluationJobsCallable; } + @Override public UnaryCallable listEvaluationJobsPagedCallable() { return listEvaluationJobsPagedCallable; diff --git a/google-cloud-datalabeling/src/test/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClientTest.java b/google-cloud-datalabeling/src/test/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClientTest.java index 40490b35..17975703 100644 --- a/google-cloud-datalabeling/src/test/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClientTest.java +++ b/google-cloud-datalabeling/src/test/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClientTest.java @@ -962,6 +962,8 @@ public void getAnnotatedDatasetTest() throws Exception { AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString()) .setDisplayName("displayName1714148973") .setDescription("description-1724546052") + .setAnnotationSource(AnnotationSource.forNumber(0)) + .setAnnotationType(AnnotationType.forNumber(0)) .setExampleCount(1517063674) .setCompletedExampleCount(-612567290) .setLabelStats(LabelStats.newBuilder().build()) @@ -1011,6 +1013,8 @@ public void getAnnotatedDatasetTest2() throws Exception { AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString()) .setDisplayName("displayName1714148973") .setDescription("description-1724546052") + .setAnnotationSource(AnnotationSource.forNumber(0)) + .setAnnotationType(AnnotationType.forNumber(0)) .setExampleCount(1517063674) .setCompletedExampleCount(-612567290) .setLabelStats(LabelStats.newBuilder().build()) @@ -1200,6 +1204,8 @@ public void labelImageTest() throws Exception { AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString()) .setDisplayName("displayName1714148973") .setDescription("description-1724546052") + .setAnnotationSource(AnnotationSource.forNumber(0)) + .setAnnotationType(AnnotationType.forNumber(0)) .setExampleCount(1517063674) .setCompletedExampleCount(-612567290) .setLabelStats(LabelStats.newBuilder().build()) @@ -1261,6 +1267,8 @@ public void labelImageTest2() throws Exception { AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString()) .setDisplayName("displayName1714148973") .setDescription("description-1724546052") + .setAnnotationSource(AnnotationSource.forNumber(0)) + .setAnnotationType(AnnotationType.forNumber(0)) .setExampleCount(1517063674) .setCompletedExampleCount(-612567290) .setLabelStats(LabelStats.newBuilder().build()) @@ -1322,6 +1330,8 @@ public void labelVideoTest() throws Exception { AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString()) .setDisplayName("displayName1714148973") .setDescription("description-1724546052") + .setAnnotationSource(AnnotationSource.forNumber(0)) + .setAnnotationType(AnnotationType.forNumber(0)) .setExampleCount(1517063674) .setCompletedExampleCount(-612567290) .setLabelStats(LabelStats.newBuilder().build()) @@ -1383,6 +1393,8 @@ public void labelVideoTest2() throws Exception { AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString()) .setDisplayName("displayName1714148973") .setDescription("description-1724546052") + .setAnnotationSource(AnnotationSource.forNumber(0)) + .setAnnotationType(AnnotationType.forNumber(0)) .setExampleCount(1517063674) .setCompletedExampleCount(-612567290) .setLabelStats(LabelStats.newBuilder().build()) @@ -1444,6 +1456,8 @@ public void labelTextTest() throws Exception { AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString()) .setDisplayName("displayName1714148973") .setDescription("description-1724546052") + .setAnnotationSource(AnnotationSource.forNumber(0)) + .setAnnotationType(AnnotationType.forNumber(0)) .setExampleCount(1517063674) .setCompletedExampleCount(-612567290) .setLabelStats(LabelStats.newBuilder().build()) @@ -1505,6 +1519,8 @@ public void labelTextTest2() throws Exception { AnnotatedDatasetName.of("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]").toString()) .setDisplayName("displayName1714148973") .setDescription("description-1724546052") + .setAnnotationSource(AnnotationSource.forNumber(0)) + .setAnnotationType(AnnotationType.forNumber(0)) .setExampleCount(1517063674) .setCompletedExampleCount(-612567290) .setLabelStats(LabelStats.newBuilder().build()) @@ -2098,6 +2114,7 @@ public void createInstructionTest() throws Exception { .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setDataType(DataType.forNumber(0)) .setCsvInstruction(CsvInstruction.newBuilder().build()) .setPdfInstruction(PdfInstruction.newBuilder().build()) .addAllBlockingResources(new ArrayList()) @@ -2154,6 +2171,7 @@ public void createInstructionTest2() throws Exception { .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setDataType(DataType.forNumber(0)) .setCsvInstruction(CsvInstruction.newBuilder().build()) .setPdfInstruction(PdfInstruction.newBuilder().build()) .addAllBlockingResources(new ArrayList()) @@ -2210,6 +2228,7 @@ public void getInstructionTest() throws Exception { .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setDataType(DataType.forNumber(0)) .setCsvInstruction(CsvInstruction.newBuilder().build()) .setPdfInstruction(PdfInstruction.newBuilder().build()) .addAllBlockingResources(new ArrayList()) @@ -2255,6 +2274,7 @@ public void getInstructionTest2() throws Exception { .setDescription("description-1724546052") .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) + .setDataType(DataType.forNumber(0)) .setCsvInstruction(CsvInstruction.newBuilder().build()) .setPdfInstruction(PdfInstruction.newBuilder().build()) .addAllBlockingResources(new ArrayList()) @@ -2462,6 +2482,7 @@ public void getEvaluationTest() throws Exception { .setEvaluationJobRunTime(Timestamp.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) .setEvaluationMetrics(EvaluationMetrics.newBuilder().build()) + .setAnnotationType(AnnotationType.forNumber(0)) .setEvaluatedItemCount(358077111) .build(); mockDataLabelingService.addResponse(expectedResponse); @@ -2505,6 +2526,7 @@ public void getEvaluationTest2() throws Exception { .setEvaluationJobRunTime(Timestamp.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) .setEvaluationMetrics(EvaluationMetrics.newBuilder().build()) + .setAnnotationType(AnnotationType.forNumber(0)) .setEvaluatedItemCount(358077111) .build(); mockDataLabelingService.addResponse(expectedResponse); diff --git a/google-cloud-datalabeling/src/test/java/com/google/cloud/datalabeling/v1beta1/MockDataLabelingServiceImpl.java b/google-cloud-datalabeling/src/test/java/com/google/cloud/datalabeling/v1beta1/MockDataLabelingServiceImpl.java index 45897788..1ad76d58 100644 --- a/google-cloud-datalabeling/src/test/java/com/google/cloud/datalabeling/v1beta1/MockDataLabelingServiceImpl.java +++ b/google-cloud-datalabeling/src/test/java/com/google/cloud/datalabeling/v1beta1/MockDataLabelingServiceImpl.java @@ -71,7 +71,13 @@ public void createDataset( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateDataset, expected %s or %s", + response.getClass().getName(), + Dataset.class.getName(), + Exception.class.getName()))); } } @@ -85,7 +91,13 @@ public void getDataset(GetDatasetRequest request, StreamObserver respon } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetDataset, expected %s or %s", + response.getClass().getName(), + Dataset.class.getName(), + Exception.class.getName()))); } } @@ -100,7 +112,13 @@ public void listDatasets( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListDatasets, expected %s or %s", + response.getClass().getName(), + ListDatasetsResponse.class.getName(), + Exception.class.getName()))); } } @@ -114,7 +132,13 @@ public void deleteDataset(DeleteDatasetRequest request, StreamObserver re } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteDataset, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -128,7 +152,13 @@ public void importData(ImportDataRequest request, StreamObserver resp } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ImportData, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -142,7 +172,13 @@ public void exportData(ExportDataRequest request, StreamObserver resp } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ExportData, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -156,7 +192,13 @@ public void getDataItem(GetDataItemRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetDataItem, expected %s or %s", + response.getClass().getName(), + DataItem.class.getName(), + Exception.class.getName()))); } } @@ -171,7 +213,13 @@ public void listDataItems( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListDataItems, expected %s or %s", + response.getClass().getName(), + ListDataItemsResponse.class.getName(), + Exception.class.getName()))); } } @@ -186,7 +234,13 @@ public void getAnnotatedDataset( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetAnnotatedDataset, expected %s or %s", + response.getClass().getName(), + AnnotatedDataset.class.getName(), + Exception.class.getName()))); } } @@ -202,7 +256,13 @@ public void listAnnotatedDatasets( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListAnnotatedDatasets, expected %s or %s", + response.getClass().getName(), + ListAnnotatedDatasetsResponse.class.getName(), + Exception.class.getName()))); } } @@ -217,7 +277,13 @@ public void deleteAnnotatedDataset( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteAnnotatedDataset, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -231,7 +297,13 @@ public void labelImage(LabelImageRequest request, StreamObserver resp } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method LabelImage, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -245,7 +317,13 @@ public void labelVideo(LabelVideoRequest request, StreamObserver resp } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method LabelVideo, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -259,7 +337,13 @@ public void labelText(LabelTextRequest request, StreamObserver respon } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method LabelText, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -273,7 +357,13 @@ public void getExample(GetExampleRequest request, StreamObserver respon } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetExample, expected %s or %s", + response.getClass().getName(), + Example.class.getName(), + Exception.class.getName()))); } } @@ -288,7 +378,13 @@ public void listExamples( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListExamples, expected %s or %s", + response.getClass().getName(), + ListExamplesResponse.class.getName(), + Exception.class.getName()))); } } @@ -303,7 +399,13 @@ public void createAnnotationSpecSet( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateAnnotationSpecSet, expected %s or %s", + response.getClass().getName(), + AnnotationSpecSet.class.getName(), + Exception.class.getName()))); } } @@ -318,7 +420,13 @@ public void getAnnotationSpecSet( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetAnnotationSpecSet, expected %s or %s", + response.getClass().getName(), + AnnotationSpecSet.class.getName(), + Exception.class.getName()))); } } @@ -334,7 +442,13 @@ public void listAnnotationSpecSets( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListAnnotationSpecSets, expected %s or %s", + response.getClass().getName(), + ListAnnotationSpecSetsResponse.class.getName(), + Exception.class.getName()))); } } @@ -349,7 +463,13 @@ public void deleteAnnotationSpecSet( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteAnnotationSpecSet, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -364,7 +484,13 @@ public void createInstruction( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateInstruction, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -379,7 +505,13 @@ public void getInstruction( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetInstruction, expected %s or %s", + response.getClass().getName(), + Instruction.class.getName(), + Exception.class.getName()))); } } @@ -394,7 +526,13 @@ public void listInstructions( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListInstructions, expected %s or %s", + response.getClass().getName(), + ListInstructionsResponse.class.getName(), + Exception.class.getName()))); } } @@ -409,7 +547,13 @@ public void deleteInstruction( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteInstruction, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -424,7 +568,13 @@ public void getEvaluation( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetEvaluation, expected %s or %s", + response.getClass().getName(), + Evaluation.class.getName(), + Exception.class.getName()))); } } @@ -440,7 +590,13 @@ public void searchEvaluations( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SearchEvaluations, expected %s or %s", + response.getClass().getName(), + SearchEvaluationsResponse.class.getName(), + Exception.class.getName()))); } } @@ -456,7 +612,13 @@ public void searchExampleComparisons( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SearchExampleComparisons, expected %s or %s", + response.getClass().getName(), + SearchExampleComparisonsResponse.class.getName(), + Exception.class.getName()))); } } @@ -471,7 +633,13 @@ public void createEvaluationJob( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateEvaluationJob, expected %s or %s", + response.getClass().getName(), + EvaluationJob.class.getName(), + Exception.class.getName()))); } } @@ -486,7 +654,13 @@ public void updateEvaluationJob( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateEvaluationJob, expected %s or %s", + response.getClass().getName(), + EvaluationJob.class.getName(), + Exception.class.getName()))); } } @@ -501,7 +675,13 @@ public void getEvaluationJob( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetEvaluationJob, expected %s or %s", + response.getClass().getName(), + EvaluationJob.class.getName(), + Exception.class.getName()))); } } @@ -516,7 +696,13 @@ public void pauseEvaluationJob( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PauseEvaluationJob, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -531,7 +717,13 @@ public void resumeEvaluationJob( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ResumeEvaluationJob, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -546,7 +738,13 @@ public void deleteEvaluationJob( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteEvaluationJob, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -562,7 +760,13 @@ public void listEvaluationJobs( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListEvaluationJobs, expected %s or %s", + response.getClass().getName(), + ListEvaluationJobsResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/grpc-google-cloud-datalabeling-v1beta1/pom.xml b/grpc-google-cloud-datalabeling-v1beta1/pom.xml index 55224276..ccbf075f 100644 --- a/grpc-google-cloud-datalabeling-v1beta1/pom.xml +++ b/grpc-google-cloud-datalabeling-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-datalabeling-v1beta1 - 0.84.10 + 0.84.11 grpc-google-cloud-datalabeling-v1beta1 GRPC library for grpc-google-cloud-datalabeling-v1beta1 com.google.cloud google-cloud-datalabeling-parent - 0.119.10 + 0.119.11 diff --git a/pom.xml b/pom.xml index ba0ec693..dd157106 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-datalabeling-parent pom - 0.119.10 + 0.119.11 Google Cloud Data Labeling Parent https://github.com/googleapis/java-datalabeling @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.9.4 + 0.10.0 @@ -70,23 +70,23 @@ com.google.api.grpc proto-google-cloud-datalabeling-v1beta1 - 0.84.10 + 0.84.11 com.google.api.grpc grpc-google-cloud-datalabeling-v1beta1 - 0.84.10 + 0.84.11 com.google.cloud google-cloud-datalabeling - 0.119.10 + 0.119.11 com.google.cloud google-cloud-shared-dependencies - 0.18.0 + 0.19.0 pom import @@ -94,7 +94,7 @@ junit junit - 4.13.1 + 4.13.2 test diff --git a/proto-google-cloud-datalabeling-v1beta1/pom.xml b/proto-google-cloud-datalabeling-v1beta1/pom.xml index 9b0bd231..a52cd1b0 100644 --- a/proto-google-cloud-datalabeling-v1beta1/pom.xml +++ b/proto-google-cloud-datalabeling-v1beta1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datalabeling-v1beta1 - 0.84.10 + 0.84.11 proto-google-cloud-datalabeling-v1beta1 PROTO library for proto-google-cloud-datalabeling-v1beta1 com.google.cloud google-cloud-datalabeling-parent - 0.119.10 + 0.119.11 diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 25218594..fbdebb1f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -36,13 +36,13 @@ junit junit - 4.13.1 + 4.13.2 test com.google.truth truth - 1.1 + 1.1.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d07e7316..1cd8658a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -34,13 +34,13 @@ junit junit - 4.13.1 + 4.13.2 test com.google.truth truth - 1.1 + 1.1.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index af314a53..c292c9cc 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 16.2.1 + 16.4.0 pom import @@ -47,13 +47,13 @@ junit junit - 4.13.1 + 4.13.2 test com.google.truth truth - 1.1 + 1.1.2 test diff --git a/synth.metadata b/synth.metadata index b07ea239..ad071de6 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-datalabeling.git", - "sha": "8fc819e398750563456a32b1b7453569dbb07e42" + "sha": "aba9d1c737f66434bcbda9d8daad699d76d10cc4" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "af8f71dae961ee036a0ac52a1965270149a6b2c9", + "internalRef": "358516065" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "fb53b6fb373b7c3edf4e55f3e8036bc6d73fa483" + "sha": "6946fd71ae9215b0e7ae188f5057df765ee6d7d2" } } ], @@ -59,7 +59,6 @@ ".kokoro/continuous/java8.cfg", ".kokoro/continuous/readme.cfg", ".kokoro/dependencies.sh", - ".kokoro/linkage-monitor.sh", ".kokoro/nightly/common.cfg", ".kokoro/nightly/integration.cfg", ".kokoro/nightly/java11.cfg", @@ -91,6 +90,8 @@ ".kokoro/release/promote.sh", ".kokoro/release/publish_javadoc.cfg", ".kokoro/release/publish_javadoc.sh", + ".kokoro/release/publish_javadoc11.cfg", + ".kokoro/release/publish_javadoc11.sh", ".kokoro/release/snapshot.cfg", ".kokoro/release/snapshot.sh", ".kokoro/release/stage.cfg", @@ -102,6 +103,7 @@ "codecov.yaml", "google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java", "google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceSettings.java", + "google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/gapic_metadata.json", "google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/package-info.java", "google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/stub/DataLabelingServiceStub.java", "google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/stub/DataLabelingServiceStubSettings.java", diff --git a/versions.txt b/versions.txt index 971946da..bff91808 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -proto-google-cloud-datalabeling-v1beta1:0.84.10:0.84.10 -grpc-google-cloud-datalabeling-v1beta1:0.84.10:0.84.10 -google-cloud-datalabeling:0.119.10:0.119.10 +proto-google-cloud-datalabeling-v1beta1:0.84.11:0.84.11 +grpc-google-cloud-datalabeling-v1beta1:0.84.11:0.84.11 +google-cloud-datalabeling:0.119.11:0.119.11