{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * Dataset response = datasetServiceClient.getDataset(name); + * } + * }+ * *
Note: close() needs to be called on the DatasetServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -159,6 +166,16 @@ public final OperationsClient getOperationsClient() { /** * Creates a Dataset. * + *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Dataset dataset = Dataset.newBuilder().build(); + * Dataset response = datasetServiceClient.createDatasetAsync(parent, dataset).get(); + * } + * }+ * * @param parent Required. The resource name of the Location to create the Dataset in. Format: * `projects/{project}/locations/{location}` * @param dataset Required. The Dataset to create. @@ -178,6 +195,16 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Dataset dataset = Dataset.newBuilder().build(); + * Dataset response = datasetServiceClient.createDatasetAsync(parent, dataset).get(); + * } + * }+ * * @param parent Required. The resource name of the Location to create the Dataset in. Format: * `projects/{project}/locations/{location}` * @param dataset Required. The Dataset to create. @@ -194,6 +221,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * CreateDatasetRequest request = + * CreateDatasetRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDataset(Dataset.newBuilder().build()) + * .build(); + * Dataset response = datasetServiceClient.createDatasetAsync(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 */ @@ -207,6 +247,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * CreateDatasetRequest request = + * CreateDatasetRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDataset(Dataset.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * datasetServiceClient.createDatasetOperationCallable().futureCall(request); + * // Do something. + * Dataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * CreateDatasetRequest request = + * CreateDatasetRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDataset(Dataset.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * datasetServiceClient.createDatasetCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * Dataset response = datasetServiceClient.getDataset(name); + * } + * }+ * * @param name Required. The name of the Dataset resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -240,6 +317,15 @@ public final Dataset getDataset(DatasetName name) { /** * Gets a Dataset. * + *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * Dataset response = datasetServiceClient.getDataset(name); + * } + * }+ * * @param name Required. The name of the Dataset resource. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -252,6 +338,19 @@ public final Dataset getDataset(String name) { /** * Gets a Dataset. * + *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * GetDatasetRequest request = + * GetDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * Dataset response = datasetServiceClient.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 */ @@ -264,6 +363,19 @@ public final Dataset getDataset(GetDatasetRequest request) { * Gets a Dataset. * *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * GetDatasetRequest request = + * GetDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = datasetServiceClient.getDatasetCallable().futureCall(request); + * // Do something. + * Dataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * Dataset dataset = Dataset.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Dataset response = datasetServiceClient.updateDataset(dataset, updateMask); + * } + * }+ * * @param dataset Required. The Dataset which replaces the resource on the server. * @param updateMask Required. The update mask applies to the resource. For the `FieldMask` * definition, see [FieldMask](https://tinyurl.com/protobufs/google.protobuf#fieldmask). @@ -290,6 +412,19 @@ public final Dataset updateDataset(Dataset dataset, FieldMask updateMask) { /** * Updates a Dataset. * + *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * UpdateDatasetRequest request = + * UpdateDatasetRequest.newBuilder() + * .setDataset(Dataset.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Dataset response = datasetServiceClient.updateDataset(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 */ @@ -302,6 +437,19 @@ public final Dataset updateDataset(UpdateDatasetRequest request) { * Updates a Dataset. * *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * UpdateDatasetRequest request = + * UpdateDatasetRequest.newBuilder() + * .setDataset(Dataset.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = datasetServiceClient.updateDatasetCallable().futureCall(request); + * // Do something. + * Dataset response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Dataset element : datasetServiceClient.listDatasets(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The name of the Dataset's parent resource. Format: * `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -327,6 +486,17 @@ public final ListDatasetsPagedResponse listDatasets(LocationName parent) { /** * Lists Datasets in a Location. * + *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Dataset element : datasetServiceClient.listDatasets(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The name of the Dataset's parent resource. Format: * `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -340,6 +510,25 @@ public final ListDatasetsPagedResponse listDatasets(String parent) { /** * Lists Datasets in a Location. * + *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * ListDatasetsRequest request = + * ListDatasetsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .setOrderBy("orderBy-1207110587") + * .build(); + * for (Dataset element : datasetServiceClient.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 */ @@ -352,6 +541,26 @@ public final ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request) * Lists Datasets in a Location. * *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * ListDatasetsRequest request = + * ListDatasetsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .setOrderBy("orderBy-1207110587") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * datasetServiceClient.listDatasetsPagedCallable().futureCall(request); + * // Do something. + * for (Dataset element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * while (true) { + * ListDatasetsResponse response = datasetServiceClient.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
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * datasetServiceClient.deleteDatasetAsync(name).get(); + * } + * }+ * * @param name Required. The resource name of the Dataset to delete. Format: * `projects/{project}/locations/{location}/datasets/{dataset}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -387,6 +622,15 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * datasetServiceClient.deleteDatasetAsync(name).get(); + * } + * }+ * * @param name Required. The resource name of the Dataset to delete. Format: * `projects/{project}/locations/{location}/datasets/{dataset}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -400,6 +644,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * DeleteDatasetRequest request = + * DeleteDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * datasetServiceClient.deleteDatasetAsync(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 */ @@ -413,6 +669,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * DeleteDatasetRequest request = + * DeleteDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * datasetServiceClient.deleteDatasetOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * DeleteDatasetRequest request = + * DeleteDatasetRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * datasetServiceClient.deleteDatasetCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * List+ * * @param name Required. The name of the Dataset resource. Format: * `projects/{project}/locations/{location}/datasets/{dataset}` * @param importConfigs Required. The desired input locations. The contents of all input locations @@ -453,6 +745,16 @@ public final OperationFutureimportConfigs = new ArrayList<>(); + * ImportDataResponse response = datasetServiceClient.importDataAsync(name, importConfigs).get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * List+ * * @param name Required. The name of the Dataset resource. Format: * `projects/{project}/locations/{location}/datasets/{dataset}` * @param importConfigs Required. The desired input locations. The contents of all input locations @@ -470,6 +772,19 @@ public final OperationFutureimportConfigs = new ArrayList<>(); + * ImportDataResponse response = datasetServiceClient.importDataAsync(name, importConfigs).get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * ImportDataRequest request = + * ImportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .addAllImportConfigs(new ArrayList+ * * @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 */ @@ -483,6 +798,20 @@ public final OperationFuture()) + * .build(); + * ImportDataResponse response = datasetServiceClient.importDataAsync(request).get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * ImportDataRequest request = + * ImportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .addAllImportConfigs(new ArrayList*/ public final OperationCallable()) + * .build(); + * OperationFuture future = + * datasetServiceClient.importDataOperationCallable().futureCall(request); + * // Do something. + * ImportDataResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * ImportDataRequest request = + * ImportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .addAllImportConfigs(new ArrayList*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = datasetServiceClient.importDataCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * ExportDataConfig exportConfig = ExportDataConfig.newBuilder().build(); + * ExportDataResponse response = datasetServiceClient.exportDataAsync(name, exportConfig).get(); + * } + * }+ * * @param name Required. The name of the Dataset resource. Format: * `projects/{project}/locations/{location}/datasets/{dataset}` * @param exportConfig Required. The desired output location. @@ -522,6 +874,16 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * ExportDataConfig exportConfig = ExportDataConfig.newBuilder().build(); + * ExportDataResponse response = datasetServiceClient.exportDataAsync(name, exportConfig).get(); + * } + * }+ * * @param name Required. The name of the Dataset resource. Format: * `projects/{project}/locations/{location}/datasets/{dataset}` * @param exportConfig Required. The desired output location. @@ -538,6 +900,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * ExportDataRequest request = + * ExportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setExportConfig(ExportDataConfig.newBuilder().build()) + * .build(); + * ExportDataResponse response = datasetServiceClient.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 */ @@ -551,6 +926,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * ExportDataRequest request = + * ExportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setExportConfig(ExportDataConfig.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * datasetServiceClient.exportDataOperationCallable().futureCall(request); + * // Do something. + * ExportDataResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * ExportDataRequest request = + * ExportDataRequest.newBuilder() + * .setName(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setExportConfig(ExportDataConfig.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = datasetServiceClient.exportDataCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]"); + * for (DataItem element : datasetServiceClient.listDataItems(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the Dataset to list DataItems from. Format: * `projects/{project}/locations/{location}/datasets/{dataset}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -587,6 +1000,17 @@ public final ListDataItemsPagedResponse listDataItems(DatasetName parent) { /** * Lists DataItems in a Dataset. * + *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString(); + * for (DataItem element : datasetServiceClient.listDataItems(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the Dataset to list DataItems from. Format: * `projects/{project}/locations/{location}/datasets/{dataset}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -600,6 +1024,25 @@ public final ListDataItemsPagedResponse listDataItems(String parent) { /** * Lists DataItems in a Dataset. * + *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * ListDataItemsRequest request = + * ListDataItemsRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .setOrderBy("orderBy-1207110587") + * .build(); + * for (DataItem element : datasetServiceClient.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 */ @@ -612,6 +1055,26 @@ public final ListDataItemsPagedResponse listDataItems(ListDataItemsRequest reque * Lists DataItems in a Dataset. * *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * ListDataItemsRequest request = + * ListDataItemsRequest.newBuilder() + * .setParent(DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .setOrderBy("orderBy-1207110587") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * datasetServiceClient.listDataItemsPagedCallable().futureCall(request); + * // Do something. + * for (DataItem element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * while (true) { + * ListDataItemsResponse response = datasetServiceClient.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
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * AnnotationSpecName name = + * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]"); + * AnnotationSpec response = datasetServiceClient.getAnnotationSpec(name); + * } + * }+ * * @param name Required. The name of the AnnotationSpec resource. Format: *
`projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -648,6 +1138,17 @@ public final AnnotationSpec getAnnotationSpec(AnnotationSpecName name) { /** * Gets an AnnotationSpec. * + *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * String name = + * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") + * .toString(); + * AnnotationSpec response = datasetServiceClient.getAnnotationSpec(name); + * } + * }+ * * @param name Required. The name of the AnnotationSpec resource. Format: *
`projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -661,6 +1162,21 @@ public final AnnotationSpec getAnnotationSpec(String name) { /** * Gets an AnnotationSpec. * + *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * GetAnnotationSpecRequest request = + * GetAnnotationSpecRequest.newBuilder() + * .setName( + * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") + * .toString()) + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * AnnotationSpec response = datasetServiceClient.getAnnotationSpec(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 */ @@ -673,6 +1189,22 @@ public final AnnotationSpec getAnnotationSpec(GetAnnotationSpecRequest request) * Gets an AnnotationSpec. * *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * GetAnnotationSpecRequest request = + * GetAnnotationSpecRequest.newBuilder() + * .setName( + * AnnotationSpecName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[ANNOTATION_SPEC]") + * .toString()) + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * datasetServiceClient.getAnnotationSpecCallable().futureCall(request); + * // Do something. + * AnnotationSpec response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * DataItemName parent = DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]"); + * for (Annotation element : datasetServiceClient.listAnnotations(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the DataItem to list Annotations from. Format: *
`projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -698,6 +1241,18 @@ public final ListAnnotationsPagedResponse listAnnotations(DataItemName parent) { /** * Lists Annotations belongs to a dataitem * + *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * String parent = + * DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]").toString(); + * for (Annotation element : datasetServiceClient.listAnnotations(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the DataItem to list Annotations from. Format: *
`projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -711,6 +1266,26 @@ public final ListAnnotationsPagedResponse listAnnotations(String parent) { /** * Lists Annotations belongs to a dataitem * + *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * ListAnnotationsRequest request = + * ListAnnotationsRequest.newBuilder() + * .setParent( + * DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .setOrderBy("orderBy-1207110587") + * .build(); + * for (Annotation element : datasetServiceClient.listAnnotations(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 */ @@ -723,6 +1298,27 @@ public final ListAnnotationsPagedResponse listAnnotations(ListAnnotationsRequest * Lists Annotations belongs to a dataitem * *
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * ListAnnotationsRequest request = + * ListAnnotationsRequest.newBuilder() + * .setParent( + * DataItemName.of("[PROJECT]", "[LOCATION]", "[DATASET]", "[DATA_ITEM]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .setOrderBy("orderBy-1207110587") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * datasetServiceClient.listAnnotationsPagedCallable().futureCall(request); + * // Do something. + * for (Annotation element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) { + * while (true) { + * ListAnnotationsResponse response = + * datasetServiceClient.listAnnotationsCallable().call(request); + * for (Annotation element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + * Endpoint response = endpointServiceClient.getEndpoint(name); + * } + * }+ * *
Note: close() needs to be called on the EndpointServiceClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -163,6 +170,16 @@ public final OperationsClient getOperationsClient() { /** * Creates an Endpoint. * + *
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Endpoint endpoint = Endpoint.newBuilder().build(); + * Endpoint response = endpointServiceClient.createEndpointAsync(parent, endpoint).get(); + * } + * }+ * * @param parent Required. The resource name of the Location to create the Endpoint in. Format: * `projects/{project}/locations/{location}` * @param endpoint Required. The Endpoint to create. @@ -182,6 +199,16 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * Endpoint endpoint = Endpoint.newBuilder().build(); + * Endpoint response = endpointServiceClient.createEndpointAsync(parent, endpoint).get(); + * } + * }+ * * @param parent Required. The resource name of the Location to create the Endpoint in. Format: * `projects/{project}/locations/{location}` * @param endpoint Required. The Endpoint to create. @@ -198,6 +225,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * CreateEndpointRequest request = + * CreateEndpointRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setEndpoint(Endpoint.newBuilder().build()) + * .build(); + * Endpoint response = endpointServiceClient.createEndpointAsync(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 */ @@ -211,6 +251,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * CreateEndpointRequest request = + * CreateEndpointRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setEndpoint(Endpoint.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * endpointServiceClient.createEndpointOperationCallable().futureCall(request); + * // Do something. + * Endpoint response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * CreateEndpointRequest request = + * CreateEndpointRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setEndpoint(Endpoint.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * endpointServiceClient.createEndpointCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + * Endpoint response = endpointServiceClient.getEndpoint(name); + * } + * }+ * * @param name Required. The name of the Endpoint resource. Format: * `projects/{project}/locations/{location}/endpoints/{endpoint}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -245,6 +322,15 @@ public final Endpoint getEndpoint(EndpointName name) { /** * Gets an Endpoint. * + *
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * String name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString(); + * Endpoint response = endpointServiceClient.getEndpoint(name); + * } + * }+ * * @param name Required. The name of the Endpoint resource. Format: * `projects/{project}/locations/{location}/endpoints/{endpoint}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -258,6 +344,18 @@ public final Endpoint getEndpoint(String name) { /** * Gets an Endpoint. * + *
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * GetEndpointRequest request = + * GetEndpointRequest.newBuilder() + * .setName(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString()) + * .build(); + * Endpoint response = endpointServiceClient.getEndpoint(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 */ @@ -270,6 +368,18 @@ public final Endpoint getEndpoint(GetEndpointRequest request) { * Gets an Endpoint. * *
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * GetEndpointRequest request = + * GetEndpointRequest.newBuilder() + * .setName(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = endpointServiceClient.getEndpointCallable().futureCall(request); + * // Do something. + * Endpoint response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Endpoint element : endpointServiceClient.listEndpoints(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the Location from which to list the Endpoints. * Format: `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -295,6 +416,17 @@ public final ListEndpointsPagedResponse listEndpoints(LocationName parent) { /** * Lists Endpoints in a Location. * + *
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Endpoint element : endpointServiceClient.listEndpoints(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the Location from which to list the Endpoints. * Format: `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -308,6 +440,25 @@ public final ListEndpointsPagedResponse listEndpoints(String parent) { /** * Lists Endpoints in a Location. * + *
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * ListEndpointsRequest request = + * ListEndpointsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .setOrderBy("orderBy-1207110587") + * .build(); + * for (Endpoint element : endpointServiceClient.listEndpoints(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 */ @@ -320,6 +471,26 @@ public final ListEndpointsPagedResponse listEndpoints(ListEndpointsRequest reque * Lists Endpoints in a Location. * *
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * ListEndpointsRequest request = + * ListEndpointsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .setOrderBy("orderBy-1207110587") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * endpointServiceClient.listEndpointsPagedCallable().futureCall(request); + * // Do something. + * for (Endpoint element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * while (true) { + * ListEndpointsResponse response = + * endpointServiceClient.listEndpointsCallable().call(request); + * for (Endpoint element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * Endpoint endpoint = Endpoint.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Endpoint response = endpointServiceClient.updateEndpoint(endpoint, updateMask); + * } + * }+ * * @param endpoint Required. The Endpoint which replaces the resource on the server. * @param updateMask Required. The update mask applies to the resource. See * [FieldMask](https://tinyurl.com/protobufs/google.protobuf#fieldmask). @@ -355,6 +554,19 @@ public final Endpoint updateEndpoint(Endpoint endpoint, FieldMask updateMask) { /** * Updates an Endpoint. * + *
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * UpdateEndpointRequest request = + * UpdateEndpointRequest.newBuilder() + * .setEndpoint(Endpoint.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Endpoint response = endpointServiceClient.updateEndpoint(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 +579,20 @@ public final Endpoint updateEndpoint(UpdateEndpointRequest request) { * Updates an Endpoint. * *
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * UpdateEndpointRequest request = + * UpdateEndpointRequest.newBuilder() + * .setEndpoint(Endpoint.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * endpointServiceClient.updateEndpointCallable().futureCall(request); + * // Do something. + * Endpoint response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + * endpointServiceClient.deleteEndpointAsync(name).get(); + * } + * }+ * * @param name Required. The name of the Endpoint resource to be deleted. Format: * `projects/{project}/locations/{location}/endpoints/{endpoint}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -391,6 +626,15 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * String name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString(); + * endpointServiceClient.deleteEndpointAsync(name).get(); + * } + * }+ * * @param name Required. The name of the Endpoint resource to be deleted. Format: * `projects/{project}/locations/{location}/endpoints/{endpoint}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -404,6 +648,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * DeleteEndpointRequest request = + * DeleteEndpointRequest.newBuilder() + * .setName(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString()) + * .build(); + * endpointServiceClient.deleteEndpointAsync(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 */ @@ -417,6 +673,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * DeleteEndpointRequest request = + * DeleteEndpointRequest.newBuilder() + * .setName(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * endpointServiceClient.deleteEndpointOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * DeleteEndpointRequest request = + * DeleteEndpointRequest.newBuilder() + * .setName(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * endpointServiceClient.deleteEndpointCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + * DeployedModel deployedModel = DeployedModel.newBuilder().build(); + * Map+ * * @param endpoint Required. The name of the Endpoint resource into which to deploy a Model. * Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` * @param deployedModel Required. The DeployedModel to be created within the Endpoint. Note that @@ -469,6 +763,18 @@ public final OperationFuturetrafficSplit = new HashMap<>(); + * DeployModelResponse response = + * endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * String endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString(); + * DeployedModel deployedModel = DeployedModel.newBuilder().build(); + * Map+ * * @param endpoint Required. The name of the Endpoint resource into which to deploy a Model. * Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` * @param deployedModel Required. The DeployedModel to be created within the Endpoint. Note that @@ -501,6 +807,20 @@ public final OperationFuturetrafficSplit = new HashMap<>(); + * DeployModelResponse response = + * endpointServiceClient.deployModelAsync(endpoint, deployedModel, trafficSplit).get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * DeployModelRequest request = + * DeployModelRequest.newBuilder() + * .setEndpoint(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString()) + * .setDeployedModel(DeployedModel.newBuilder().build()) + * .putAllTrafficSplit(new HashMap+ * * @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 */ @@ -514,6 +834,21 @@ public final OperationFuture()) + * .build(); + * DeployModelResponse response = endpointServiceClient.deployModelAsync(request).get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * DeployModelRequest request = + * DeployModelRequest.newBuilder() + * .setEndpoint(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString()) + * .setDeployedModel(DeployedModel.newBuilder().build()) + * .putAllTrafficSplit(new HashMap*/ public final OperationCallable< DeployModelRequest, DeployModelResponse, DeployModelOperationMetadata> @@ -526,6 +861,20 @@ public final OperationFuture()) + * .build(); + * OperationFuture future = + * endpointServiceClient.deployModelOperationCallable().futureCall(request); + * // Do something. + * DeployModelResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * DeployModelRequest request = + * DeployModelRequest.newBuilder() + * .setEndpoint(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString()) + * .setDeployedModel(DeployedModel.newBuilder().build()) + * .putAllTrafficSplit(new HashMap*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = endpointServiceClient.deployModelCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); + * String deployedModelId = "deployedModelId-1817547906"; + * Map+ * * @param endpoint Required. The name of the Endpoint resource from which to undeploy a Model. * Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` * @param deployedModelId Required. The ID of the DeployedModel to be undeployed from the @@ -565,6 +926,18 @@ public final UnaryCallabletrafficSplit = new HashMap<>(); + * UndeployModelResponse response = + * endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * String endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString(); + * String deployedModelId = "deployedModelId-1817547906"; + * Map+ * * @param endpoint Required. The name of the Endpoint resource from which to undeploy a Model. * Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` * @param deployedModelId Required. The ID of the DeployedModel to be undeployed from the @@ -594,6 +967,20 @@ public final UnaryCallabletrafficSplit = new HashMap<>(); + * UndeployModelResponse response = + * endpointServiceClient.undeployModelAsync(endpoint, deployedModelId, trafficSplit).get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * UndeployModelRequest request = + * UndeployModelRequest.newBuilder() + * .setEndpoint(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString()) + * .setDeployedModelId("deployedModelId-1817547906") + * .putAllTrafficSplit(new HashMap+ * * @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 */ @@ -608,6 +995,21 @@ public final UnaryCallable()) + * .build(); + * UndeployModelResponse response = endpointServiceClient.undeployModelAsync(request).get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * UndeployModelRequest request = + * UndeployModelRequest.newBuilder() + * .setEndpoint(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString()) + * .setDeployedModelId("deployedModelId-1817547906") + * .putAllTrafficSplit(new HashMap*/ public final OperationCallable< UndeployModelRequest, UndeployModelResponse, UndeployModelOperationMetadata> @@ -621,6 +1023,21 @@ public final UnaryCallable()) + * .build(); + * OperationFuture future = + * endpointServiceClient.undeployModelOperationCallable().futureCall(request); + * // Do something. + * UndeployModelResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) { + * UndeployModelRequest request = + * UndeployModelRequest.newBuilder() + * .setEndpoint(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString()) + * .setDeployedModelId("deployedModelId-1817547906") + * .putAllTrafficSplit(new HashMap*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * endpointServiceClient.undeployModelCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
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 (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * CustomJob customJob = CustomJob.newBuilder().build(); + * CustomJob response = jobServiceClient.createCustomJob(parent, customJob); + * } + * }+ * *
Note: close() needs to be called on the JobServiceClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -158,6 +166,16 @@ public final OperationsClient getOperationsClient() { /** * Creates a CustomJob. A created CustomJob right away will be attempted to be run. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * CustomJob customJob = CustomJob.newBuilder().build(); + * CustomJob response = jobServiceClient.createCustomJob(parent, customJob); + * } + * }+ * * @param parent Required. The resource name of the Location to create the CustomJob in. Format: * `projects/{project}/locations/{location}` * @param customJob Required. The CustomJob to create. @@ -176,6 +194,16 @@ public final CustomJob createCustomJob(LocationName parent, CustomJob customJob) /** * Creates a CustomJob. A created CustomJob right away will be attempted to be run. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * CustomJob customJob = CustomJob.newBuilder().build(); + * CustomJob response = jobServiceClient.createCustomJob(parent, customJob); + * } + * }+ * * @param parent Required. The resource name of the Location to create the CustomJob in. Format: * `projects/{project}/locations/{location}` * @param customJob Required. The CustomJob to create. @@ -191,6 +219,19 @@ public final CustomJob createCustomJob(String parent, CustomJob customJob) { /** * Creates a CustomJob. A created CustomJob right away will be attempted to be run. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CreateCustomJobRequest request = + * CreateCustomJobRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setCustomJob(CustomJob.newBuilder().build()) + * .build(); + * CustomJob response = jobServiceClient.createCustomJob(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 */ @@ -203,6 +244,19 @@ public final CustomJob createCustomJob(CreateCustomJobRequest request) { * Creates a CustomJob. A created CustomJob right away will be attempted to be run. * *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CreateCustomJobRequest request = + * CreateCustomJobRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setCustomJob(CustomJob.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobServiceClient.createCustomJobCallable().futureCall(request); + * // Do something. + * CustomJob response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]"); + * CustomJob response = jobServiceClient.getCustomJob(name); + * } + * }+ * * @param name Required. The name of the CustomJob resource. Format: * `projects/{project}/locations/{location}/customJobs/{custom_job}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -226,6 +289,15 @@ public final CustomJob getCustomJob(CustomJobName name) { /** * Gets a CustomJob. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString(); + * CustomJob response = jobServiceClient.getCustomJob(name); + * } + * }+ * * @param name Required. The name of the CustomJob resource. Format: * `projects/{project}/locations/{location}/customJobs/{custom_job}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -239,6 +311,18 @@ public final CustomJob getCustomJob(String name) { /** * Gets a CustomJob. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * GetCustomJobRequest request = + * GetCustomJobRequest.newBuilder() + * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) + * .build(); + * CustomJob response = jobServiceClient.getCustomJob(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 */ @@ -251,6 +335,18 @@ public final CustomJob getCustomJob(GetCustomJobRequest request) { * Gets a CustomJob. * *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * GetCustomJobRequest request = + * GetCustomJobRequest.newBuilder() + * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobServiceClient.getCustomJobCallable().futureCall(request); + * // Do something. + * CustomJob response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (CustomJob element : jobServiceClient.listCustomJobs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the Location to list the CustomJobs from. Format: * `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -276,6 +383,17 @@ public final ListCustomJobsPagedResponse listCustomJobs(LocationName parent) { /** * Lists CustomJobs in a Location. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (CustomJob element : jobServiceClient.listCustomJobs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the Location to list the CustomJobs from. Format: * `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -289,6 +407,24 @@ public final ListCustomJobsPagedResponse listCustomJobs(String parent) { /** * Lists CustomJobs in a Location. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListCustomJobsRequest request = + * ListCustomJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * for (CustomJob element : jobServiceClient.listCustomJobs(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 */ @@ -301,6 +437,25 @@ public final ListCustomJobsPagedResponse listCustomJobs(ListCustomJobsRequest re * Lists CustomJobs in a Location. * *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListCustomJobsRequest request = + * ListCustomJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * jobServiceClient.listCustomJobsPagedCallable().futureCall(request); + * // Do something. + * for (CustomJob element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * while (true) { + * ListCustomJobsResponse response = jobServiceClient.listCustomJobsCallable().call(request); + * for (CustomJob element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]"); + * jobServiceClient.deleteCustomJobAsync(name).get(); + * } + * }+ * * @param name Required. The name of the CustomJob resource to be deleted. Format: * `projects/{project}/locations/{location}/customJobs/{custom_job}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -337,6 +518,15 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString(); + * jobServiceClient.deleteCustomJobAsync(name).get(); + * } + * }+ * * @param name Required. The name of the CustomJob resource to be deleted. Format: * `projects/{project}/locations/{location}/customJobs/{custom_job}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -350,6 +540,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * DeleteCustomJobRequest request = + * DeleteCustomJobRequest.newBuilder() + * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) + * .build(); + * jobServiceClient.deleteCustomJobAsync(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 */ @@ -363,6 +565,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * DeleteCustomJobRequest request = + * DeleteCustomJobRequest.newBuilder() + * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * jobServiceClient.deleteCustomJobOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * DeleteCustomJobRequest request = + * DeleteCustomJobRequest.newBuilder() + * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobServiceClient.deleteCustomJobCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CustomJobName name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]"); + * jobServiceClient.cancelCustomJob(name); + * } + * }+ * * @param name Required. The name of the CustomJob to cancel. Format: * `projects/{project}/locations/{location}/customJobs/{custom_job}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -411,6 +647,15 @@ public final void cancelCustomJob(CustomJobName name) { * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and * [CustomJob.state][google.cloud.aiplatform.v1.CustomJob.state] is set to `CANCELLED`. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String name = CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString(); + * jobServiceClient.cancelCustomJob(name); + * } + * }+ * * @param name Required. The name of the CustomJob to cancel. Format: * `projects/{project}/locations/{location}/customJobs/{custom_job}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -431,6 +676,18 @@ public final void cancelCustomJob(String name) { * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and * [CustomJob.state][google.cloud.aiplatform.v1.CustomJob.state] is set to `CANCELLED`. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CancelCustomJobRequest request = + * CancelCustomJobRequest.newBuilder() + * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) + * .build(); + * jobServiceClient.cancelCustomJob(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 */ @@ -450,6 +707,18 @@ public final void cancelCustomJob(CancelCustomJobRequest request) { * [CustomJob.state][google.cloud.aiplatform.v1.CustomJob.state] is set to `CANCELLED`. * *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CancelCustomJobRequest request = + * CancelCustomJobRequest.newBuilder() + * .setName(CustomJobName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_JOB]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobServiceClient.cancelCustomJobCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().build(); + * DataLabelingJob response = jobServiceClient.createDataLabelingJob(parent, dataLabelingJob); + * } + * }+ * * @param parent Required. The parent of the DataLabelingJob. Format: * `projects/{project}/locations/{location}` * @param dataLabelingJob Required. The DataLabelingJob to create. @@ -478,6 +757,16 @@ public final DataLabelingJob createDataLabelingJob( /** * Creates a DataLabelingJob. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * DataLabelingJob dataLabelingJob = DataLabelingJob.newBuilder().build(); + * DataLabelingJob response = jobServiceClient.createDataLabelingJob(parent, dataLabelingJob); + * } + * }+ * * @param parent Required. The parent of the DataLabelingJob. Format: * `projects/{project}/locations/{location}` * @param dataLabelingJob Required. The DataLabelingJob to create. @@ -497,6 +786,19 @@ public final DataLabelingJob createDataLabelingJob( /** * Creates a DataLabelingJob. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CreateDataLabelingJobRequest request = + * CreateDataLabelingJobRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDataLabelingJob(DataLabelingJob.newBuilder().build()) + * .build(); + * DataLabelingJob response = jobServiceClient.createDataLabelingJob(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 */ @@ -509,6 +811,20 @@ public final DataLabelingJob createDataLabelingJob(CreateDataLabelingJobRequest * Creates a DataLabelingJob. * *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * CreateDataLabelingJobRequest request = + * CreateDataLabelingJobRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setDataLabelingJob(DataLabelingJob.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * jobServiceClient.createDataLabelingJobCallable().futureCall(request); + * // Do something. + * DataLabelingJob response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * DataLabelingJobName name = + * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]"); + * DataLabelingJob response = jobServiceClient.getDataLabelingJob(name); + * } + * }+ * * @param name Required. The name of the DataLabelingJob. Format: *
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -535,6 +861,16 @@ public final DataLabelingJob getDataLabelingJob(DataLabelingJobName name) { /** * Gets a DataLabelingJob. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String name = + * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]").toString(); + * DataLabelingJob response = jobServiceClient.getDataLabelingJob(name); + * } + * }+ * * @param name Required. The name of the DataLabelingJob. Format: *
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -549,6 +885,20 @@ public final DataLabelingJob getDataLabelingJob(String name) { /** * Gets a DataLabelingJob. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * GetDataLabelingJobRequest request = + * GetDataLabelingJobRequest.newBuilder() + * .setName( + * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]") + * .toString()) + * .build(); + * DataLabelingJob response = jobServiceClient.getDataLabelingJob(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 */ @@ -561,6 +911,21 @@ public final DataLabelingJob getDataLabelingJob(GetDataLabelingJobRequest reques * Gets a DataLabelingJob. * *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * GetDataLabelingJobRequest request = + * GetDataLabelingJobRequest.newBuilder() + * .setName( + * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * jobServiceClient.getDataLabelingJobCallable().futureCall(request); + * // Do something. + * DataLabelingJob response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The parent of the DataLabelingJob. Format: * `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -587,6 +963,17 @@ public final ListDataLabelingJobsPagedResponse listDataLabelingJobs(LocationName /** * Lists DataLabelingJobs in a Location. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The parent of the DataLabelingJob. Format: * `projects/{project}/locations/{location}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -601,6 +988,25 @@ public final ListDataLabelingJobsPagedResponse listDataLabelingJobs(String paren /** * Lists DataLabelingJobs in a Location. * + *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListDataLabelingJobsRequest request = + * ListDataLabelingJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .setOrderBy("orderBy-1207110587") + * .build(); + * for (DataLabelingJob element : jobServiceClient.listDataLabelingJobs(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 */ @@ -614,6 +1020,26 @@ public final ListDataLabelingJobsPagedResponse listDataLabelingJobs( * Lists DataLabelingJobs in a Location. * *
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * ListDataLabelingJobsRequest request = + * ListDataLabelingJobsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setReadMask(FieldMask.newBuilder().build()) + * .setOrderBy("orderBy-1207110587") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * jobServiceClient.listDataLabelingJobsPagedCallable().futureCall(request); + * // Do something. + * for (DataLabelingJob element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * while (true) { + * ListDataLabelingJobsResponse response = + * jobServiceClient.listDataLabelingJobsCallable().call(request); + * for (DataLabelingJob element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (JobServiceClient jobServiceClient = JobServiceClient.create()) { + * DataLabelingJobName name = + * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]"); + * jobServiceClient.deleteDataLabelingJobAsync(name).get(); + * } + * }+ * * @param name Required. The name of the DataLabelingJob to be deleted. Format: *
`projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -652,6 +1106,16 @@ public final OperationFuture Sample code:
+ *
+ * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -667,6 +1131,20 @@ public final OperationFuture Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -717,6 +1235,16 @@ public final void cancelDataLabelingJob(DataLabelingJobName name) {
/**
* Cancels a DataLabelingJob. Success of cancellation is not guaranteed.
*
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -731,6 +1259,20 @@ public final void cancelDataLabelingJob(String name) {
/**
* Cancels a DataLabelingJob. Success of cancellation is not guaranteed.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -830,6 +1448,17 @@ public final HyperparameterTuningJob getHyperparameterTuningJob(
/**
* Gets a HyperparameterTuningJob
*
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -844,6 +1473,21 @@ public final HyperparameterTuningJob getHyperparameterTuningJob(String name) {
/**
* Gets a HyperparameterTuningJob
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -952,6 +1702,17 @@ public final OperationFuture Sample code:
+ *
+ * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -967,6 +1728,21 @@ public final OperationFuture Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1040,6 +1858,17 @@ public final void cancelHyperparameterTuningJob(HyperparameterTuningJobName name
* [HyperparameterTuningJob.state][google.cloud.aiplatform.v1.HyperparameterTuningJob.state] is
* set to `CANCELLED`.
*
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1065,6 +1894,21 @@ public final void cancelHyperparameterTuningJob(String name) {
* [HyperparameterTuningJob.state][google.cloud.aiplatform.v1.HyperparameterTuningJob.state] is
* set to `CANCELLED`.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1179,6 +2098,16 @@ public final BatchPredictionJob getBatchPredictionJob(BatchPredictionJobName nam
/**
* Gets a BatchPredictionJob
*
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1193,6 +2122,20 @@ public final BatchPredictionJob getBatchPredictionJob(String name) {
/**
* Gets a BatchPredictionJob
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1296,6 +2344,16 @@ public final OperationFuture Sample code:
+ *
+ * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1311,6 +2369,20 @@ public final OperationFuture Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1379,6 +2491,16 @@ public final void cancelBatchPredictionJob(BatchPredictionJobName name) {
* [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state] is set to
* `CANCELLED`. Any files already outputted by the job are not deleted.
*
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1402,6 +2524,20 @@ public final void cancelBatchPredictionJob(String name) {
* [BatchPredictionJob.state][google.cloud.aiplatform.v1.BatchPredictionJob.state] is set to
* `CANCELLED`. Any files already outputted by the job are not deleted.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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:
*
+ * Note: close() needs to be called on the MigrationServiceClient object to clean up resources
* such as threads. In the example above, try-with-resources is used, which automatically calls
* close().
@@ -164,6 +174,18 @@ public final OperationsClient getOperationsClient() {
* Searches all of the resources in automl.googleapis.com, datalabeling.googleapis.com and
* ml.googleapis.com that can be migrated to AI Platform's given location.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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:
*
+ * Note: close() needs to be called on the ModelServiceClient object to clean up resources such
* as threads. In the example above, try-with-resources is used, which automatically calls close().
*
@@ -160,6 +167,16 @@ public final OperationsClient getOperationsClient() {
/**
* Uploads a Model artifact into AI Platform.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -531,6 +880,16 @@ public final ModelEvaluation getModelEvaluation(ModelEvaluationName name) {
/**
* Gets a ModelEvaluation.
*
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -545,6 +904,20 @@ public final ModelEvaluation getModelEvaluation(String name) {
/**
* Gets a ModelEvaluation.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -647,6 +1124,18 @@ public final ModelEvaluationSlice getModelEvaluationSlice(ModelEvaluationSliceNa
/**
* Gets a ModelEvaluationSlice.
*
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -661,6 +1150,21 @@ public final ModelEvaluationSlice getModelEvaluationSlice(String name) {
/**
* Gets a ModelEvaluationSlice.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
@@ -702,6 +1235,19 @@ public final ListModelEvaluationSlicesPagedResponse listModelEvaluationSlices(
/**
* Lists ModelEvaluationSlices in a ModelEvaluation.
*
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
@@ -717,6 +1263,27 @@ public final ListModelEvaluationSlicesPagedResponse listModelEvaluationSlices(St
/**
* Lists ModelEvaluationSlices in a ModelEvaluation.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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:
*
+ * Note: close() needs to be called on the PipelineServiceClient object to clean up resources
* such as threads. In the example above, try-with-resources is used, which automatically calls
* close().
@@ -163,6 +172,17 @@ public final OperationsClient getOperationsClient() {
/**
* Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -239,6 +307,16 @@ public final TrainingPipeline getTrainingPipeline(TrainingPipelineName name) {
/**
* Gets a TrainingPipeline.
*
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -253,6 +331,20 @@ public final TrainingPipeline getTrainingPipeline(String name) {
/**
* Gets a TrainingPipeline.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -356,6 +553,16 @@ public final OperationFuture Sample code:
+ *
+ * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -371,6 +578,20 @@ public final OperationFuture Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -441,6 +702,16 @@ public final void cancelTrainingPipeline(TrainingPipelineName name) {
* [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state] is set to
* `CANCELLED`.
*
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -465,6 +736,20 @@ public final void cancelTrainingPipeline(String name) {
* [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state] is set to
* `CANCELLED`.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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:
*
+ * Note: close() needs to be called on the PredictionServiceClient object to clean up resources
* such as threads. In the example above, try-with-resources is used, which automatically calls
* close().
@@ -140,6 +149,17 @@ public PredictionServiceStub getStub() {
/**
* Perform an online prediction.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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:
*
+ * Note: close() needs to be called on the SpecialistPoolServiceClient object to clean up
* resources such as threads. In the example above, try-with-resources is used, which automatically
* calls close().
@@ -168,6 +177,18 @@ public final OperationsClient getOperationsClient() {
/**
* Creates a SpecialistPool.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -257,6 +346,17 @@ public final SpecialistPool getSpecialistPool(SpecialistPoolName name) {
/**
* Gets a SpecialistPool.
*
+ * Sample code:
+ *
+ * `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -270,6 +370,20 @@ public final SpecialistPool getSpecialistPool(String name) {
/**
* Gets a SpecialistPool.
*
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample for DatasetServiceClient:
*
+ * ======================= EndpointServiceClient =======================
*
* Sample for EndpointServiceClient:
*
+ * ======================= JobServiceClient =======================
*
* Service Description: A service for creating and managing AI Platform's jobs.
*
* Sample for JobServiceClient:
*
+ * ======================= MigrationServiceClient =======================
*
* Service Description: A service that migrates resources from automl.googleapis.com,
@@ -38,24 +60,59 @@
*
* Sample for MigrationServiceClient:
*
+ * ======================= ModelServiceClient =======================
*
* Service Description: A service for managing AI Platform's machine learning Models.
*
* Sample for ModelServiceClient:
*
+ * ======================= PipelineServiceClient =======================
*
* Service Description: A service for creating and managing AI Platform's pipelines.
*
* Sample for PipelineServiceClient:
*
+ * ======================= PredictionServiceClient =======================
*
* Service Description: A service for online predictions and explanations.
*
* Sample for PredictionServiceClient:
*
+ * ======================= SpecialistPoolServiceClient =======================
*
* Service Description: A service for creating and managing Customer SpecialistPools. When
@@ -65,6 +122,15 @@
* CrowdCompute console.
*
* Sample for SpecialistPoolServiceClient:
+ *
+ * {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * String name =
+ * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]").toString();
+ * jobServiceClient.deleteDataLabelingJobAsync(name).get();
+ * }
+ * }
+ *
* @param name Required. The name of the DataLabelingJob to be deleted. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * DeleteDataLabelingJobRequest request =
+ * DeleteDataLabelingJobRequest.newBuilder()
+ * .setName(
+ * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
+ * .toString())
+ * .build();
+ * jobServiceClient.deleteDataLabelingJobAsync(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
*/
@@ -680,6 +1158,21 @@ public final OperationFuture{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * DeleteDataLabelingJobRequest request =
+ * DeleteDataLabelingJobRequest.newBuilder()
+ * .setName(
+ * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
+ * .toString())
+ * .build();
+ * OperationFuture
*/
public final OperationCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * DeleteDataLabelingJobRequest request =
+ * DeleteDataLabelingJobRequest.newBuilder()
+ * .setName(
+ * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * DataLabelingJobName name =
+ * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]");
+ * jobServiceClient.cancelDataLabelingJob(name);
+ * }
+ * }
+ *
* @param name Required. The name of the DataLabelingJob. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * String name =
+ * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]").toString();
+ * jobServiceClient.cancelDataLabelingJob(name);
+ * }
+ * }
+ *
* @param name Required. The name of the DataLabelingJob. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * CancelDataLabelingJobRequest request =
+ * CancelDataLabelingJobRequest.newBuilder()
+ * .setName(
+ * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
+ * .toString())
+ * .build();
+ * jobServiceClient.cancelDataLabelingJob(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
*/
@@ -743,6 +1285,21 @@ public final void cancelDataLabelingJob(CancelDataLabelingJobRequest request) {
* Cancels a DataLabelingJob. Success of cancellation is not guaranteed.
*
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * CancelDataLabelingJobRequest request =
+ * CancelDataLabelingJobRequest.newBuilder()
+ * .setName(
+ * DataLabelingJobName.of("[PROJECT]", "[LOCATION]", "[DATA_LABELING_JOB]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * HyperparameterTuningJob hyperparameterTuningJob =
+ * HyperparameterTuningJob.newBuilder().build();
+ * HyperparameterTuningJob response =
+ * jobServiceClient.createHyperparameterTuningJob(parent, hyperparameterTuningJob);
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to create the HyperparameterTuningJob
* in. Format: `projects/{project}/locations/{location}`
* @param hyperparameterTuningJob Required. The HyperparameterTuningJob to create.
@@ -771,6 +1340,18 @@ public final HyperparameterTuningJob createHyperparameterTuningJob(
/**
* Creates a HyperparameterTuningJob
*
+ * {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * HyperparameterTuningJob hyperparameterTuningJob =
+ * HyperparameterTuningJob.newBuilder().build();
+ * HyperparameterTuningJob response =
+ * jobServiceClient.createHyperparameterTuningJob(parent, hyperparameterTuningJob);
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to create the HyperparameterTuningJob
* in. Format: `projects/{project}/locations/{location}`
* @param hyperparameterTuningJob Required. The HyperparameterTuningJob to create.
@@ -790,6 +1371,19 @@ public final HyperparameterTuningJob createHyperparameterTuningJob(
/**
* Creates a HyperparameterTuningJob
*
+ * {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * CreateHyperparameterTuningJobRequest request =
+ * CreateHyperparameterTuningJobRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setHyperparameterTuningJob(HyperparameterTuningJob.newBuilder().build())
+ * .build();
+ * HyperparameterTuningJob response = jobServiceClient.createHyperparameterTuningJob(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
*/
@@ -803,6 +1397,20 @@ public final HyperparameterTuningJob createHyperparameterTuningJob(
* Creates a HyperparameterTuningJob
*
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * CreateHyperparameterTuningJobRequest request =
+ * CreateHyperparameterTuningJobRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setHyperparameterTuningJob(HyperparameterTuningJob.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * HyperparameterTuningJobName name =
+ * HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
+ * HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(name);
+ * }
+ * }
+ *
* @param name Required. The name of the HyperparameterTuningJob resource. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * String name =
+ * HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
+ * .toString();
+ * HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(name);
+ * }
+ * }
+ *
* @param name Required. The name of the HyperparameterTuningJob resource. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * GetHyperparameterTuningJobRequest request =
+ * GetHyperparameterTuningJobRequest.newBuilder()
+ * .setName(
+ * HyperparameterTuningJobName.of(
+ * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
+ * .toString())
+ * .build();
+ * HyperparameterTuningJob response = jobServiceClient.getHyperparameterTuningJob(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
*/
@@ -857,6 +1501,22 @@ public final HyperparameterTuningJob getHyperparameterTuningJob(
* Gets a HyperparameterTuningJob
*
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * GetHyperparameterTuningJobRequest request =
+ * GetHyperparameterTuningJobRequest.newBuilder()
+ * .setName(
+ * HyperparameterTuningJobName.of(
+ * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (HyperparameterTuningJob element :
+ * jobServiceClient.listHyperparameterTuningJobs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to list the HyperparameterTuningJobs
* from. Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -884,6 +1556,18 @@ public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJ
/**
* Lists HyperparameterTuningJobs in a Location.
*
+ * {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (HyperparameterTuningJob element :
+ * jobServiceClient.listHyperparameterTuningJobs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to list the HyperparameterTuningJobs
* from. Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -899,6 +1583,25 @@ public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJ
/**
* Lists HyperparameterTuningJobs in a Location.
*
+ * {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * ListHyperparameterTuningJobsRequest request =
+ * ListHyperparameterTuningJobsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * for (HyperparameterTuningJob element :
+ * jobServiceClient.listHyperparameterTuningJobs(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
*/
@@ -912,6 +1615,25 @@ public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJ
* Lists HyperparameterTuningJobs in a Location.
*
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * ListHyperparameterTuningJobsRequest request =
+ * ListHyperparameterTuningJobsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable<
ListHyperparameterTuningJobsRequest, ListHyperparameterTuningJobsPagedResponse>
@@ -924,6 +1646,24 @@ public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJ
* Lists HyperparameterTuningJobs in a Location.
*
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * while (true) {
+ * ListHyperparameterTuningJobsResponse response =
+ * jobServiceClient.listHyperparameterTuningJobsCallable().call(request);
+ * for (HyperparameterTuningJob element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallable<
ListHyperparameterTuningJobsRequest, ListHyperparameterTuningJobsResponse>
@@ -935,6 +1675,16 @@ public final ListHyperparameterTuningJobsPagedResponse listHyperparameterTuningJ
/**
* Deletes a HyperparameterTuningJob.
*
+ * {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * HyperparameterTuningJobName name =
+ * HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
+ * jobServiceClient.deleteHyperparameterTuningJobAsync(name).get();
+ * }
+ * }
+ *
* @param name Required. The name of the HyperparameterTuningJob resource to be deleted. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * String name =
+ * HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
+ * .toString();
+ * jobServiceClient.deleteHyperparameterTuningJobAsync(name).get();
+ * }
+ * }
+ *
* @param name Required. The name of the HyperparameterTuningJob resource to be deleted. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * DeleteHyperparameterTuningJobRequest request =
+ * DeleteHyperparameterTuningJobRequest.newBuilder()
+ * .setName(
+ * HyperparameterTuningJobName.of(
+ * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
+ * .toString())
+ * .build();
+ * jobServiceClient.deleteHyperparameterTuningJobAsync(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
*/
@@ -980,6 +1756,22 @@ public final OperationFuture{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * DeleteHyperparameterTuningJobRequest request =
+ * DeleteHyperparameterTuningJobRequest.newBuilder()
+ * .setName(
+ * HyperparameterTuningJobName.of(
+ * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
+ * .toString())
+ * .build();
+ * OperationFuture
*/
public final OperationCallable<
DeleteHyperparameterTuningJobRequest, Empty, DeleteOperationMetadata>
@@ -992,6 +1784,22 @@ public final OperationFuture{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * DeleteHyperparameterTuningJobRequest request =
+ * DeleteHyperparameterTuningJobRequest.newBuilder()
+ * .setName(
+ * HyperparameterTuningJobName.of(
+ * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * HyperparameterTuningJobName name =
+ * HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]");
+ * jobServiceClient.cancelHyperparameterTuningJob(name);
+ * }
+ * }
+ *
* @param name Required. The name of the HyperparameterTuningJob to cancel. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * String name =
+ * HyperparameterTuningJobName.of("[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
+ * .toString();
+ * jobServiceClient.cancelHyperparameterTuningJob(name);
+ * }
+ * }
+ *
* @param name Required. The name of the HyperparameterTuningJob to cancel. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * CancelHyperparameterTuningJobRequest request =
+ * CancelHyperparameterTuningJobRequest.newBuilder()
+ * .setName(
+ * HyperparameterTuningJobName.of(
+ * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
+ * .toString())
+ * .build();
+ * jobServiceClient.cancelHyperparameterTuningJob(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
*/
@@ -1088,6 +1932,22 @@ public final void cancelHyperparameterTuningJob(CancelHyperparameterTuningJobReq
* set to `CANCELLED`.
*
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * CancelHyperparameterTuningJobRequest request =
+ * CancelHyperparameterTuningJobRequest.newBuilder()
+ * .setName(
+ * HyperparameterTuningJobName.of(
+ * "[PROJECT]", "[LOCATION]", "[HYPERPARAMETER_TUNING_JOB]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build();
+ * BatchPredictionJob response =
+ * jobServiceClient.createBatchPredictionJob(parent, batchPredictionJob);
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to create the BatchPredictionJob in.
* Format: `projects/{project}/locations/{location}`
* @param batchPredictionJob Required. The BatchPredictionJob to create.
@@ -1119,6 +1990,17 @@ public final BatchPredictionJob createBatchPredictionJob(
* Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to
* start.
*
+ * {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * BatchPredictionJob batchPredictionJob = BatchPredictionJob.newBuilder().build();
+ * BatchPredictionJob response =
+ * jobServiceClient.createBatchPredictionJob(parent, batchPredictionJob);
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to create the BatchPredictionJob in.
* Format: `projects/{project}/locations/{location}`
* @param batchPredictionJob Required. The BatchPredictionJob to create.
@@ -1139,6 +2021,19 @@ public final BatchPredictionJob createBatchPredictionJob(
* Creates a BatchPredictionJob. A BatchPredictionJob once created will right away be attempted to
* start.
*
+ * {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * CreateBatchPredictionJobRequest request =
+ * CreateBatchPredictionJobRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setBatchPredictionJob(BatchPredictionJob.newBuilder().build())
+ * .build();
+ * BatchPredictionJob response = jobServiceClient.createBatchPredictionJob(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
*/
@@ -1153,6 +2048,20 @@ public final BatchPredictionJob createBatchPredictionJob(
* start.
*
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * CreateBatchPredictionJobRequest request =
+ * CreateBatchPredictionJobRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setBatchPredictionJob(BatchPredictionJob.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * BatchPredictionJobName name =
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
+ * BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(name);
+ * }
+ * }
+ *
* @param name Required. The name of the BatchPredictionJob resource. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * String name =
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]").toString();
+ * BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(name);
+ * }
+ * }
+ *
* @param name Required. The name of the BatchPredictionJob resource. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * GetBatchPredictionJobRequest request =
+ * GetBatchPredictionJobRequest.newBuilder()
+ * .setName(
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
+ * .toString())
+ * .build();
+ * BatchPredictionJob response = jobServiceClient.getBatchPredictionJob(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
*/
@@ -1205,6 +2148,21 @@ public final BatchPredictionJob getBatchPredictionJob(GetBatchPredictionJobReque
* Gets a BatchPredictionJob
*
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * GetBatchPredictionJobRequest request =
+ * GetBatchPredictionJobRequest.newBuilder()
+ * .setName(
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (BatchPredictionJob element :
+ * jobServiceClient.listBatchPredictionJobs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to list the BatchPredictionJobs from.
* Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1231,6 +2201,18 @@ public final ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(Locati
/**
* Lists BatchPredictionJobs in a Location.
*
+ * {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (BatchPredictionJob element :
+ * jobServiceClient.listBatchPredictionJobs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to list the BatchPredictionJobs from.
* Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -1245,6 +2227,25 @@ public final ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(String
/**
* Lists BatchPredictionJobs in a Location.
*
+ * {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * ListBatchPredictionJobsRequest request =
+ * ListBatchPredictionJobsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * for (BatchPredictionJob element :
+ * jobServiceClient.listBatchPredictionJobs(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
*/
@@ -1258,6 +2259,25 @@ public final ListBatchPredictionJobsPagedResponse listBatchPredictionJobs(
* Lists BatchPredictionJobs in a Location.
*
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * ListBatchPredictionJobsRequest request =
+ * ListBatchPredictionJobsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * while (true) {
+ * ListBatchPredictionJobsResponse response =
+ * jobServiceClient.listBatchPredictionJobsCallable().call(request);
+ * for (BatchPredictionJob element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * BatchPredictionJobName name =
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
+ * jobServiceClient.deleteBatchPredictionJobAsync(name).get();
+ * }
+ * }
+ *
* @param name Required. The name of the BatchPredictionJob resource to be deleted. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * String name =
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]").toString();
+ * jobServiceClient.deleteBatchPredictionJobAsync(name).get();
+ * }
+ * }
+ *
* @param name Required. The name of the BatchPredictionJob resource to be deleted. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * DeleteBatchPredictionJobRequest request =
+ * DeleteBatchPredictionJobRequest.newBuilder()
+ * .setName(
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
+ * .toString())
+ * .build();
+ * jobServiceClient.deleteBatchPredictionJobAsync(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
*/
@@ -1324,6 +2396,21 @@ public final OperationFuture{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * DeleteBatchPredictionJobRequest request =
+ * DeleteBatchPredictionJobRequest.newBuilder()
+ * .setName(
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
+ * .toString())
+ * .build();
+ * OperationFuture
*/
public final OperationCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * DeleteBatchPredictionJobRequest request =
+ * DeleteBatchPredictionJobRequest.newBuilder()
+ * .setName(
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * BatchPredictionJobName name =
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]");
+ * jobServiceClient.cancelBatchPredictionJob(name);
+ * }
+ * }
+ *
* @param name Required. The name of the BatchPredictionJob to cancel. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * String name =
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]").toString();
+ * jobServiceClient.cancelBatchPredictionJob(name);
+ * }
+ * }
+ *
* @param name Required. The name of the BatchPredictionJob to cancel. Format:
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * CancelBatchPredictionJobRequest request =
+ * CancelBatchPredictionJobRequest.newBuilder()
+ * .setName(
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
+ * .toString())
+ * .build();
+ * jobServiceClient.cancelBatchPredictionJob(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
*/
@@ -1423,6 +2559,21 @@ public final void cancelBatchPredictionJob(CancelBatchPredictionJobRequest reque
* `CANCELLED`. Any files already outputted by the job are not deleted.
*
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * CancelBatchPredictionJobRequest request =
+ * CancelBatchPredictionJobRequest.newBuilder()
+ * .setName(
+ * BatchPredictionJobName.of("[PROJECT]", "[LOCATION]", "[BATCH_PREDICTION_JOB]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (MigratableResource element :
+ * migrationServiceClient.searchMigratableResources(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* {@code
+ * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (MigratableResource element :
+ * migrationServiceClient.searchMigratableResources(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The location that the migratable resources should be searched from.
* It's the AI Platform location that the resources can be migrated to, not the resources'
* original location. Format: `projects/{project}/locations/{location}`
@@ -183,6 +205,18 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
* Searches all of the resources in automl.googleapis.com, datalabeling.googleapis.com and
* ml.googleapis.com that can be migrated to AI Platform's given location.
*
+ * {@code
+ * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (MigratableResource element :
+ * migrationServiceClient.searchMigratableResources(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The location that the migratable resources should be searched from.
* It's the AI Platform location that the resources can be migrated to, not the resources'
* original location. Format: `projects/{project}/locations/{location}`
@@ -199,6 +233,24 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(St
* Searches all of the resources in automl.googleapis.com, datalabeling.googleapis.com and
* ml.googleapis.com that can be migrated to AI Platform's given location.
*
+ * {@code
+ * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
+ * SearchMigratableResourcesRequest request =
+ * SearchMigratableResourcesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * for (MigratableResource element :
+ * migrationServiceClient.searchMigratableResources(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
*/
@@ -213,6 +265,24 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
* ml.googleapis.com that can be migrated to AI Platform's given location.
*
* {@code
+ * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
+ * SearchMigratableResourcesRequest request =
+ * SearchMigratableResourcesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable<
SearchMigratableResourcesRequest, SearchMigratableResourcesPagedResponse>
@@ -226,6 +296,24 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
* ml.googleapis.com that can be migrated to AI Platform's given location.
*
* {@code
+ * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
+ * while (true) {
+ * SearchMigratableResourcesResponse response =
+ * migrationServiceClient.searchMigratableResourcesCallable().call(request);
+ * for (MigratableResource element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallable{@code
+ * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * List
+ *
* @param parent Required. The location of the migrated resource will live in. Format:
* `projects/{project}/locations/{location}`
* @param migrateResourceRequests Required. The request messages specifying the resources to
@@ -261,6 +360,17 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
* Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and
* datalabeling.googleapis.com to AI Platform (Unified).
*
+ * {@code
+ * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * List
+ *
* @param parent Required. The location of the migrated resource will live in. Format:
* `projects/{project}/locations/{location}`
* @param migrateResourceRequests Required. The request messages specifying the resources to
@@ -285,6 +395,20 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
* Batch migrates resources from ml.googleapis.com, automl.googleapis.com, and
* datalabeling.googleapis.com to AI Platform (Unified).
*
+ * {@code
+ * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
+ * BatchMigrateResourcesRequest request =
+ * BatchMigrateResourcesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .addAllMigrateResourceRequests(new ArrayList
+ *
* @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
*/
@@ -300,6 +424,21 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
* datalabeling.googleapis.com to AI Platform (Unified).
*
* {@code
+ * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
+ * BatchMigrateResourcesRequest request =
+ * BatchMigrateResourcesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .addAllMigrateResourceRequests(new ArrayList
*/
public final OperationCallable<
BatchMigrateResourcesRequest,
@@ -315,6 +454,20 @@ public final SearchMigratableResourcesPagedResponse searchMigratableResources(
* datalabeling.googleapis.com to AI Platform (Unified).
*
* {@code
+ * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
+ * BatchMigrateResourcesRequest request =
+ * BatchMigrateResourcesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .addAllMigrateResourceRequests(new ArrayList
*/
public final UnaryCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+ * Model response = modelServiceClient.getModel(name);
+ * }
+ * }
+ *
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Model model = Model.newBuilder().build();
+ * UploadModelResponse response = modelServiceClient.uploadModelAsync(parent, model).get();
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location into which to upload the Model.
* Format: `projects/{project}/locations/{location}`
* @param model Required. The Model to create.
@@ -179,6 +196,16 @@ public final OperationFuture{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * Model model = Model.newBuilder().build();
+ * UploadModelResponse response = modelServiceClient.uploadModelAsync(parent, model).get();
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location into which to upload the Model.
* Format: `projects/{project}/locations/{location}`
* @param model Required. The Model to create.
@@ -195,6 +222,19 @@ public final OperationFuture{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * UploadModelRequest request =
+ * UploadModelRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setModel(Model.newBuilder().build())
+ * .build();
+ * UploadModelResponse response = modelServiceClient.uploadModelAsync(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
*/
@@ -208,6 +248,20 @@ public final OperationFuture{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * UploadModelRequest request =
+ * UploadModelRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setModel(Model.newBuilder().build())
+ * .build();
+ * OperationFuture
*/
public final OperationCallable<
UploadModelRequest, UploadModelResponse, UploadModelOperationMetadata>
@@ -220,6 +274,19 @@ public final OperationFuture{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * UploadModelRequest request =
+ * UploadModelRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setModel(Model.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+ * Model response = modelServiceClient.getModel(name);
+ * }
+ * }
+ *
* @param name Required. The name of the Model resource. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -243,6 +319,15 @@ public final Model getModel(ModelName name) {
/**
* Gets a Model.
*
+ * {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
+ * Model response = modelServiceClient.getModel(name);
+ * }
+ * }
+ *
* @param name Required. The name of the Model resource. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -256,6 +341,18 @@ public final Model getModel(String name) {
/**
* Gets a Model.
*
+ * {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * GetModelRequest request =
+ * GetModelRequest.newBuilder()
+ * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
+ * .build();
+ * Model response = modelServiceClient.getModel(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
*/
@@ -268,6 +365,18 @@ public final Model getModel(GetModelRequest request) {
* Gets a Model.
*
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * GetModelRequest request =
+ * GetModelRequest.newBuilder()
+ * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Model element : modelServiceClient.listModels(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to list the Models from. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -291,6 +411,17 @@ public final ListModelsPagedResponse listModels(LocationName parent) {
/**
* Lists Models in a Location.
*
+ * {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (Model element : modelServiceClient.listModels(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to list the Models from. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -304,6 +435,25 @@ public final ListModelsPagedResponse listModels(String parent) {
/**
* Lists Models in a Location.
*
+ * {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ListModelsRequest request =
+ * ListModelsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (Model element : modelServiceClient.listModels(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
*/
@@ -316,6 +466,25 @@ public final ListModelsPagedResponse listModels(ListModelsRequest request) {
* Lists Models in a Location.
*
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ListModelsRequest request =
+ * ListModelsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * while (true) {
+ * ListModelsResponse response = modelServiceClient.listModelsCallable().call(request);
+ * for (Model element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * Model model = Model.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Model response = modelServiceClient.updateModel(model, updateMask);
+ * }
+ * }
+ *
* @param model Required. The Model which replaces the resource on the server.
* @param updateMask Required. The update mask applies to the resource. For the `FieldMask`
* definition, see [FieldMask](https://tinyurl.com/protobufs/google.protobuf#fieldmask).
@@ -350,6 +546,19 @@ public final Model updateModel(Model model, FieldMask updateMask) {
/**
* Updates a Model.
*
+ * {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * UpdateModelRequest request =
+ * UpdateModelRequest.newBuilder()
+ * .setModel(Model.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Model response = modelServiceClient.updateModel(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
*/
@@ -362,6 +571,19 @@ public final Model updateModel(UpdateModelRequest request) {
* Updates a Model.
*
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * UpdateModelRequest request =
+ * UpdateModelRequest.newBuilder()
+ * .setModel(Model.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+ * modelServiceClient.deleteModelAsync(name).get();
+ * }
+ * }
+ *
* @param name Required. The name of the Model resource to be deleted. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -387,6 +618,15 @@ public final OperationFuture{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
+ * modelServiceClient.deleteModelAsync(name).get();
+ * }
+ * }
+ *
* @param name Required. The name of the Model resource to be deleted. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -401,6 +641,18 @@ public final OperationFuture{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * DeleteModelRequest request =
+ * DeleteModelRequest.newBuilder()
+ * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
+ * .build();
+ * modelServiceClient.deleteModelAsync(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
*/
@@ -415,6 +667,19 @@ public final OperationFuture{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * DeleteModelRequest request =
+ * DeleteModelRequest.newBuilder()
+ * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
+ * .build();
+ * OperationFuture
*/
public final OperationCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * DeleteModelRequest request =
+ * DeleteModelRequest.newBuilder()
+ * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+ * ExportModelRequest.OutputConfig outputConfig =
+ * ExportModelRequest.OutputConfig.newBuilder().build();
+ * ExportModelResponse response = modelServiceClient.exportModelAsync(name, outputConfig).get();
+ * }
+ * }
+ *
* @param name Required. The resource name of the Model to export. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @param outputConfig Required. The desired output location and configuration.
@@ -459,6 +747,17 @@ public final OperationFuture{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * String name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
+ * ExportModelRequest.OutputConfig outputConfig =
+ * ExportModelRequest.OutputConfig.newBuilder().build();
+ * ExportModelResponse response = modelServiceClient.exportModelAsync(name, outputConfig).get();
+ * }
+ * }
+ *
* @param name Required. The resource name of the Model to export. Format:
* `projects/{project}/locations/{location}/models/{model}`
* @param outputConfig Required. The desired output location and configuration.
@@ -477,6 +776,19 @@ public final OperationFuture{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ExportModelRequest request =
+ * ExportModelRequest.newBuilder()
+ * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
+ * .setOutputConfig(ExportModelRequest.OutputConfig.newBuilder().build())
+ * .build();
+ * ExportModelResponse response = modelServiceClient.exportModelAsync(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
*/
@@ -492,6 +804,20 @@ public final OperationFuture{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ExportModelRequest request =
+ * ExportModelRequest.newBuilder()
+ * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
+ * .setOutputConfig(ExportModelRequest.OutputConfig.newBuilder().build())
+ * .build();
+ * OperationFuture
*/
public final OperationCallable<
ExportModelRequest, ExportModelResponse, ExportModelOperationMetadata>
@@ -506,6 +832,19 @@ public final OperationFuture{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ExportModelRequest request =
+ * ExportModelRequest.newBuilder()
+ * .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
+ * .setOutputConfig(ExportModelRequest.OutputConfig.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ModelEvaluationName name =
+ * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
+ * ModelEvaluation response = modelServiceClient.getModelEvaluation(name);
+ * }
+ * }
+ *
* @param name Required. The name of the ModelEvaluation resource. Format:
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * String name =
+ * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]").toString();
+ * ModelEvaluation response = modelServiceClient.getModelEvaluation(name);
+ * }
+ * }
+ *
* @param name Required. The name of the ModelEvaluation resource. Format:
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * GetModelEvaluationRequest request =
+ * GetModelEvaluationRequest.newBuilder()
+ * .setName(
+ * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]")
+ * .toString())
+ * .build();
+ * ModelEvaluation response = modelServiceClient.getModelEvaluation(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
*/
@@ -557,6 +930,21 @@ public final ModelEvaluation getModelEvaluation(GetModelEvaluationRequest reques
* Gets a ModelEvaluation.
*
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * GetModelEvaluationRequest request =
+ * GetModelEvaluationRequest.newBuilder()
+ * .setName(
+ * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ModelName parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+ * for (ModelEvaluation element : modelServiceClient.listModelEvaluations(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Model to list the ModelEvaluations from.
* Format: `projects/{project}/locations/{location}/models/{model}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -583,6 +982,17 @@ public final ListModelEvaluationsPagedResponse listModelEvaluations(ModelName pa
/**
* Lists ModelEvaluations in a Model.
*
+ * {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * String parent = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString();
+ * for (ModelEvaluation element : modelServiceClient.listModelEvaluations(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Model to list the ModelEvaluations from.
* Format: `projects/{project}/locations/{location}/models/{model}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -597,6 +1007,25 @@ public final ListModelEvaluationsPagedResponse listModelEvaluations(String paren
/**
* Lists ModelEvaluations in a Model.
*
+ * {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ListModelEvaluationsRequest request =
+ * ListModelEvaluationsRequest.newBuilder()
+ * .setParent(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * for (ModelEvaluation element :
+ * modelServiceClient.listModelEvaluations(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
*/
@@ -610,6 +1039,25 @@ public final ListModelEvaluationsPagedResponse listModelEvaluations(
* Lists ModelEvaluations in a Model.
*
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ListModelEvaluationsRequest request =
+ * ListModelEvaluationsRequest.newBuilder()
+ * .setParent(ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * while (true) {
+ * ListModelEvaluationsResponse response =
+ * modelServiceClient.listModelEvaluationsCallable().call(request);
+ * for (ModelEvaluation element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ModelEvaluationSliceName name =
+ * ModelEvaluationSliceName.of(
+ * "[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]", "[SLICE]");
+ * ModelEvaluationSlice response = modelServiceClient.getModelEvaluationSlice(name);
+ * }
+ * }
+ *
* @param name Required. The name of the ModelEvaluationSlice resource. Format:
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * String name =
+ * ModelEvaluationSliceName.of(
+ * "[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]", "[SLICE]")
+ * .toString();
+ * ModelEvaluationSlice response = modelServiceClient.getModelEvaluationSlice(name);
+ * }
+ * }
+ *
* @param name Required. The name of the ModelEvaluationSlice resource. Format:
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * GetModelEvaluationSliceRequest request =
+ * GetModelEvaluationSliceRequest.newBuilder()
+ * .setName(
+ * ModelEvaluationSliceName.of(
+ * "[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]", "[SLICE]")
+ * .toString())
+ * .build();
+ * ModelEvaluationSlice response = modelServiceClient.getModelEvaluationSlice(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
*/
@@ -674,6 +1178,22 @@ public final ModelEvaluationSlice getModelEvaluationSlice(
* Gets a ModelEvaluationSlice.
*
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * GetModelEvaluationSliceRequest request =
+ * GetModelEvaluationSliceRequest.newBuilder()
+ * .setName(
+ * ModelEvaluationSliceName.of(
+ * "[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]", "[SLICE]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ModelEvaluationName parent =
+ * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
+ * for (ModelEvaluationSlice element :
+ * modelServiceClient.listModelEvaluationSlices(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The resource name of the ModelEvaluation to list the
* ModelEvaluationSlices from. Format:
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * String parent =
+ * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]").toString();
+ * for (ModelEvaluationSlice element :
+ * modelServiceClient.listModelEvaluationSlices(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The resource name of the ModelEvaluation to list the
* ModelEvaluationSlices from. Format:
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ListModelEvaluationSlicesRequest request =
+ * ListModelEvaluationSlicesRequest.newBuilder()
+ * .setParent(
+ * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]")
+ * .toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * for (ModelEvaluationSlice element :
+ * modelServiceClient.listModelEvaluationSlices(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
*/
@@ -730,6 +1297,27 @@ public final ListModelEvaluationSlicesPagedResponse listModelEvaluationSlices(
* Lists ModelEvaluationSlices in a ModelEvaluation.
*
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ListModelEvaluationSlicesRequest request =
+ * ListModelEvaluationSlicesRequest.newBuilder()
+ * .setParent(
+ * ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]")
+ * .toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable<
ListModelEvaluationSlicesRequest, ListModelEvaluationSlicesPagedResponse>
@@ -742,6 +1330,24 @@ public final ListModelEvaluationSlicesPagedResponse listModelEvaluationSlices(
* Lists ModelEvaluationSlices in a ModelEvaluation.
*
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * while (true) {
+ * ListModelEvaluationSlicesResponse response =
+ * modelServiceClient.listModelEvaluationSlicesCallable().call(request);
+ * for (ModelEvaluationSlice element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallable{@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
+ * TrainingPipeline response =
+ * pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline);
+ * }
+ * }
+ *
* {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
+ * TrainingPipeline response =
+ * pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline);
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to create the TrainingPipeline in.
* Format: `projects/{project}/locations/{location}`
* @param trainingPipeline Required. The TrainingPipeline to create.
@@ -182,6 +202,17 @@ public final TrainingPipeline createTrainingPipeline(
/**
* Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.
*
+ * {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
+ * TrainingPipeline response =
+ * pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline);
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to create the TrainingPipeline in.
* Format: `projects/{project}/locations/{location}`
* @param trainingPipeline Required. The TrainingPipeline to create.
@@ -201,6 +232,19 @@ public final TrainingPipeline createTrainingPipeline(
/**
* Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.
*
+ * {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * CreateTrainingPipelineRequest request =
+ * CreateTrainingPipelineRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setTrainingPipeline(TrainingPipeline.newBuilder().build())
+ * .build();
+ * TrainingPipeline response = pipelineServiceClient.createTrainingPipeline(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
*/
@@ -213,6 +257,20 @@ public final TrainingPipeline createTrainingPipeline(CreateTrainingPipelineReque
* Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.
*
* {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * CreateTrainingPipelineRequest request =
+ * CreateTrainingPipelineRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setTrainingPipeline(TrainingPipeline.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * TrainingPipelineName name =
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
+ * TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(name);
+ * }
+ * }
+ *
* @param name Required. The name of the TrainingPipeline resource. Format:
* {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * String name =
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]").toString();
+ * TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(name);
+ * }
+ * }
+ *
* @param name Required. The name of the TrainingPipeline resource. Format:
* {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * GetTrainingPipelineRequest request =
+ * GetTrainingPipelineRequest.newBuilder()
+ * .setName(
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
+ * .toString())
+ * .build();
+ * TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(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
*/
@@ -265,6 +357,21 @@ public final TrainingPipeline getTrainingPipeline(GetTrainingPipelineRequest req
* Gets a TrainingPipeline.
*
* {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * GetTrainingPipelineRequest request =
+ * GetTrainingPipelineRequest.newBuilder()
+ * .setName(
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (TrainingPipeline element :
+ * pipelineServiceClient.listTrainingPipelines(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to list the TrainingPipelines from.
* Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -291,6 +410,18 @@ public final ListTrainingPipelinesPagedResponse listTrainingPipelines(LocationNa
/**
* Lists TrainingPipelines in a Location.
*
+ * {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (TrainingPipeline element :
+ * pipelineServiceClient.listTrainingPipelines(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The resource name of the Location to list the TrainingPipelines from.
* Format: `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -305,6 +436,25 @@ public final ListTrainingPipelinesPagedResponse listTrainingPipelines(String par
/**
* Lists TrainingPipelines in a Location.
*
+ * {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * ListTrainingPipelinesRequest request =
+ * ListTrainingPipelinesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * for (TrainingPipeline element :
+ * pipelineServiceClient.listTrainingPipelines(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
*/
@@ -318,6 +468,25 @@ public final ListTrainingPipelinesPagedResponse listTrainingPipelines(
* Lists TrainingPipelines in a Location.
*
* {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * ListTrainingPipelinesRequest request =
+ * ListTrainingPipelinesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * while (true) {
+ * ListTrainingPipelinesResponse response =
+ * pipelineServiceClient.listTrainingPipelinesCallable().call(request);
+ * for (TrainingPipeline element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallable{@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * TrainingPipelineName name =
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
+ * pipelineServiceClient.deleteTrainingPipelineAsync(name).get();
+ * }
+ * }
+ *
* @param name Required. The name of the TrainingPipeline resource to be deleted. Format:
* {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * String name =
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]").toString();
+ * pipelineServiceClient.deleteTrainingPipelineAsync(name).get();
+ * }
+ * }
+ *
* @param name Required. The name of the TrainingPipeline resource to be deleted. Format:
* {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * DeleteTrainingPipelineRequest request =
+ * DeleteTrainingPipelineRequest.newBuilder()
+ * .setName(
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
+ * .toString())
+ * .build();
+ * pipelineServiceClient.deleteTrainingPipelineAsync(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
*/
@@ -384,6 +605,21 @@ public final OperationFuture{@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * DeleteTrainingPipelineRequest request =
+ * DeleteTrainingPipelineRequest.newBuilder()
+ * .setName(
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
+ * .toString())
+ * .build();
+ * OperationFuture
*/
public final OperationCallable{@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * DeleteTrainingPipelineRequest request =
+ * DeleteTrainingPipelineRequest.newBuilder()
+ * .setName(
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * TrainingPipelineName name =
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
+ * pipelineServiceClient.cancelTrainingPipeline(name);
+ * }
+ * }
+ *
* @param name Required. The name of the TrainingPipeline to cancel. Format:
* {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * String name =
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]").toString();
+ * pipelineServiceClient.cancelTrainingPipeline(name);
+ * }
+ * }
+ *
* @param name Required. The name of the TrainingPipeline to cancel. Format:
* {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * CancelTrainingPipelineRequest request =
+ * CancelTrainingPipelineRequest.newBuilder()
+ * .setName(
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
+ * .toString())
+ * .build();
+ * pipelineServiceClient.cancelTrainingPipeline(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
*/
@@ -487,6 +772,21 @@ public final void cancelTrainingPipeline(CancelTrainingPipelineRequest request)
* `CANCELLED`.
*
* {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * CancelTrainingPipelineRequest request =
+ * CancelTrainingPipelineRequest.newBuilder()
+ * .setName(
+ * TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
+ * .toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * List
+ *
* {@code
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * List
+ *
* @param endpoint Required. The name of the Endpoint requested to serve the prediction. Format:
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @param instances Required. The instances that are the input to the prediction call. A
@@ -172,6 +192,17 @@ public final PredictResponse predict(
/**
* Perform an online prediction.
*
+ * {@code
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * String endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString();
+ * List
+ *
* @param endpoint Required. The name of the Endpoint requested to serve the prediction. Format:
* `projects/{project}/locations/{location}/endpoints/{endpoint}`
* @param instances Required. The instances that are the input to the prediction call. A
@@ -203,6 +234,20 @@ public final PredictResponse predict(String endpoint, List{@code
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * PredictRequest request =
+ * PredictRequest.newBuilder()
+ * .setEndpoint(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString())
+ * .addAllInstances(new ArrayList
+ *
* @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
*/
@@ -215,6 +260,21 @@ public final PredictResponse predict(PredictRequest request) {
* Perform an online prediction.
*
* {@code
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * PredictRequest request =
+ * PredictRequest.newBuilder()
+ * .setEndpoint(EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]").toString())
+ * .addAllInstances(new ArrayList
*/
public final UnaryCallable{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * SpecialistPoolName name =
+ * SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]");
+ * SpecialistPool response = specialistPoolServiceClient.getSpecialistPool(name);
+ * }
+ * }
+ *
* {@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * SpecialistPool specialistPool = SpecialistPool.newBuilder().build();
+ * SpecialistPool response =
+ * specialistPoolServiceClient.createSpecialistPoolAsync(parent, specialistPool).get();
+ * }
+ * }
+ *
* @param parent Required. The parent Project name for the new SpecialistPool. The form is
* `projects/{project}/locations/{location}`.
* @param specialistPool Required. The SpecialistPool to create.
@@ -187,6 +208,18 @@ public final OperationsClient getOperationsClient() {
/**
* Creates a SpecialistPool.
*
+ * {@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * SpecialistPool specialistPool = SpecialistPool.newBuilder().build();
+ * SpecialistPool response =
+ * specialistPoolServiceClient.createSpecialistPoolAsync(parent, specialistPool).get();
+ * }
+ * }
+ *
* @param parent Required. The parent Project name for the new SpecialistPool. The form is
* `projects/{project}/locations/{location}`.
* @param specialistPool Required. The SpecialistPool to create.
@@ -206,6 +239,21 @@ public final OperationsClient getOperationsClient() {
/**
* Creates a SpecialistPool.
*
+ * {@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * CreateSpecialistPoolRequest request =
+ * CreateSpecialistPoolRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSpecialistPool(SpecialistPool.newBuilder().build())
+ * .build();
+ * SpecialistPool response =
+ * specialistPoolServiceClient.createSpecialistPoolAsync(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
*/
@@ -219,6 +267,21 @@ public final OperationsClient getOperationsClient() {
* Creates a SpecialistPool.
*
* {@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * CreateSpecialistPoolRequest request =
+ * CreateSpecialistPoolRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSpecialistPool(SpecialistPool.newBuilder().build())
+ * .build();
+ * OperationFuture
*/
public final OperationCallable<
CreateSpecialistPoolRequest, SpecialistPool, CreateSpecialistPoolOperationMetadata>
@@ -231,6 +294,21 @@ public final OperationsClient getOperationsClient() {
* Creates a SpecialistPool.
*
* {@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * CreateSpecialistPoolRequest request =
+ * CreateSpecialistPoolRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setSpecialistPool(SpecialistPool.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * SpecialistPoolName name =
+ * SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]");
+ * SpecialistPool response = specialistPoolServiceClient.getSpecialistPool(name);
+ * }
+ * }
+ *
* @param name Required. The name of the SpecialistPool resource. The form is
* {@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * String name =
+ * SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]").toString();
+ * SpecialistPool response = specialistPoolServiceClient.getSpecialistPool(name);
+ * }
+ * }
+ *
* @param name Required. The name of the SpecialistPool resource. The form is
* {@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * GetSpecialistPoolRequest request =
+ * GetSpecialistPoolRequest.newBuilder()
+ * .setName(
+ * SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]").toString())
+ * .build();
+ * SpecialistPool response = specialistPoolServiceClient.getSpecialistPool(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
*/
@@ -282,6 +396,21 @@ public final SpecialistPool getSpecialistPool(GetSpecialistPoolRequest request)
* Gets a SpecialistPool.
*
* {@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * GetSpecialistPoolRequest request =
+ * GetSpecialistPoolRequest.newBuilder()
+ * .setName(
+ * SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]").toString())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (SpecialistPool element :
+ * specialistPoolServiceClient.listSpecialistPools(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The name of the SpecialistPool's parent resource. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -307,6 +449,19 @@ public final ListSpecialistPoolsPagedResponse listSpecialistPools(LocationName p
/**
* Lists SpecialistPools in a Location.
*
+ * {@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (SpecialistPool element :
+ * specialistPoolServiceClient.listSpecialistPools(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The name of the SpecialistPool's parent resource. Format:
* `projects/{project}/locations/{location}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -321,6 +476,25 @@ public final ListSpecialistPoolsPagedResponse listSpecialistPools(String parent)
/**
* Lists SpecialistPools in a Location.
*
+ * {@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * ListSpecialistPoolsRequest request =
+ * ListSpecialistPoolsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * for (SpecialistPool element :
+ * specialistPoolServiceClient.listSpecialistPools(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
*/
@@ -334,6 +508,25 @@ public final ListSpecialistPoolsPagedResponse listSpecialistPools(
* Lists SpecialistPools in a Location.
*
* {@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * ListSpecialistPoolsRequest request =
+ * ListSpecialistPoolsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setReadMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * while (true) {
+ * ListSpecialistPoolsResponse response =
+ * specialistPoolServiceClient.listSpecialistPoolsCallable().call(request);
+ * for (SpecialistPool element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallable{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * SpecialistPoolName name =
+ * SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]");
+ * specialistPoolServiceClient.deleteSpecialistPoolAsync(name).get();
+ * }
+ * }
+ *
* @param name Required. The resource name of the SpecialistPool to delete. Format:
* `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -372,6 +595,17 @@ public final OperationFuture{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * String name =
+ * SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]").toString();
+ * specialistPoolServiceClient.deleteSpecialistPoolAsync(name).get();
+ * }
+ * }
+ *
* @param name Required. The resource name of the SpecialistPool to delete. Format:
* `projects/{project}/locations/{location}/specialistPools/{specialist_pool}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -387,6 +621,21 @@ public final OperationFuture{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * DeleteSpecialistPoolRequest request =
+ * DeleteSpecialistPoolRequest.newBuilder()
+ * .setName(
+ * SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]").toString())
+ * .setForce(true)
+ * .build();
+ * specialistPoolServiceClient.deleteSpecialistPoolAsync(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
*/
@@ -400,6 +649,22 @@ public final OperationFuture{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * DeleteSpecialistPoolRequest request =
+ * DeleteSpecialistPoolRequest.newBuilder()
+ * .setName(
+ * SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]").toString())
+ * .setForce(true)
+ * .build();
+ * OperationFuture
*/
public final OperationCallable{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * DeleteSpecialistPoolRequest request =
+ * DeleteSpecialistPoolRequest.newBuilder()
+ * .setName(
+ * SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]").toString())
+ * .setForce(true)
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * SpecialistPool specialistPool = SpecialistPool.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * SpecialistPool response =
+ * specialistPoolServiceClient.updateSpecialistPoolAsync(specialistPool, updateMask).get();
+ * }
+ * }
+ *
* @param specialistPool Required. The SpecialistPool which replaces the resource on the server.
* @param updateMask Required. The update mask applies to the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -439,6 +732,21 @@ public final OperationFuture{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * UpdateSpecialistPoolRequest request =
+ * UpdateSpecialistPoolRequest.newBuilder()
+ * .setSpecialistPool(SpecialistPool.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * SpecialistPool response =
+ * specialistPoolServiceClient.updateSpecialistPoolAsync(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
*/
@@ -452,6 +760,21 @@ public final OperationFuture{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * UpdateSpecialistPoolRequest request =
+ * UpdateSpecialistPoolRequest.newBuilder()
+ * .setSpecialistPool(SpecialistPool.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * OperationFuture
*/
public final OperationCallable<
UpdateSpecialistPoolRequest, SpecialistPool, UpdateSpecialistPoolOperationMetadata>
@@ -464,6 +787,21 @@ public final OperationFuture{@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * UpdateSpecialistPoolRequest request =
+ * UpdateSpecialistPoolRequest.newBuilder()
+ * .setSpecialistPool(SpecialistPool.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
*/
public final UnaryCallable{@code
+ * try (DatasetServiceClient datasetServiceClient = DatasetServiceClient.create()) {
+ * DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[DATASET]");
+ * Dataset response = datasetServiceClient.getDataset(name);
+ * }
+ * }
+ *
* {@code
+ * try (EndpointServiceClient endpointServiceClient = EndpointServiceClient.create()) {
+ * EndpointName name = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * Endpoint response = endpointServiceClient.getEndpoint(name);
+ * }
+ * }
+ *
* {@code
+ * try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * CustomJob customJob = CustomJob.newBuilder().build();
+ * CustomJob response = jobServiceClient.createCustomJob(parent, customJob);
+ * }
+ * }
+ *
* {@code
+ * try (MigrationServiceClient migrationServiceClient = MigrationServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (MigratableResource element :
+ * migrationServiceClient.searchMigratableResources(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* {@code
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ * ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[MODEL]");
+ * Model response = modelServiceClient.getModel(name);
+ * }
+ * }
+ *
* {@code
+ * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
+ * TrainingPipeline response =
+ * pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline);
+ * }
+ * }
+ *
* {@code
+ * try (PredictionServiceClient predictionServiceClient = PredictionServiceClient.create()) {
+ * EndpointName endpoint = EndpointName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT]");
+ * List
+ *
* {@code
+ * try (SpecialistPoolServiceClient specialistPoolServiceClient =
+ * SpecialistPoolServiceClient.create()) {
+ * SpecialistPoolName name =
+ * SpecialistPoolName.of("[PROJECT]", "[LOCATION]", "[SPECIALIST_POOL]");
+ * SpecialistPool response = specialistPoolServiceClient.getSpecialistPool(name);
+ * }
+ * }
*/
@Generated("by gapic-generator-java")
package com.google.cloud.aiplatform.v1;
diff --git a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcDatasetServiceStub.java b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcDatasetServiceStub.java
index f24e1ce12..c7ec877b0 100644
--- a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcDatasetServiceStub.java
+++ b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcDatasetServiceStub.java
@@ -442,75 +442,92 @@ public GrpcOperationsStub getOperationsStub() {
return operationsStub;
}
+ @Override
public UnaryCallable