1 /* 2 * Copyright 2022 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.cloud.automl.v1beta1.stub; 18 19 import static com.google.cloud.automl.v1beta1.AutoMlClient.ListColumnSpecsPagedResponse; 20 import static com.google.cloud.automl.v1beta1.AutoMlClient.ListDatasetsPagedResponse; 21 import static com.google.cloud.automl.v1beta1.AutoMlClient.ListModelEvaluationsPagedResponse; 22 import static com.google.cloud.automl.v1beta1.AutoMlClient.ListModelsPagedResponse; 23 import static com.google.cloud.automl.v1beta1.AutoMlClient.ListTableSpecsPagedResponse; 24 25 import com.google.api.core.BetaApi; 26 import com.google.api.gax.core.BackgroundResource; 27 import com.google.api.gax.core.BackgroundResourceAggregation; 28 import com.google.api.gax.grpc.GrpcCallSettings; 29 import com.google.api.gax.grpc.GrpcStubCallableFactory; 30 import com.google.api.gax.rpc.ClientContext; 31 import com.google.api.gax.rpc.OperationCallable; 32 import com.google.api.gax.rpc.UnaryCallable; 33 import com.google.cloud.automl.v1beta1.AnnotationSpec; 34 import com.google.cloud.automl.v1beta1.ColumnSpec; 35 import com.google.cloud.automl.v1beta1.CreateDatasetRequest; 36 import com.google.cloud.automl.v1beta1.CreateModelRequest; 37 import com.google.cloud.automl.v1beta1.Dataset; 38 import com.google.cloud.automl.v1beta1.DeleteDatasetRequest; 39 import com.google.cloud.automl.v1beta1.DeleteModelRequest; 40 import com.google.cloud.automl.v1beta1.DeployModelRequest; 41 import com.google.cloud.automl.v1beta1.ExportDataRequest; 42 import com.google.cloud.automl.v1beta1.ExportEvaluatedExamplesRequest; 43 import com.google.cloud.automl.v1beta1.ExportModelRequest; 44 import com.google.cloud.automl.v1beta1.GetAnnotationSpecRequest; 45 import com.google.cloud.automl.v1beta1.GetColumnSpecRequest; 46 import com.google.cloud.automl.v1beta1.GetDatasetRequest; 47 import com.google.cloud.automl.v1beta1.GetModelEvaluationRequest; 48 import com.google.cloud.automl.v1beta1.GetModelRequest; 49 import com.google.cloud.automl.v1beta1.GetTableSpecRequest; 50 import com.google.cloud.automl.v1beta1.ImportDataRequest; 51 import com.google.cloud.automl.v1beta1.ListColumnSpecsRequest; 52 import com.google.cloud.automl.v1beta1.ListColumnSpecsResponse; 53 import com.google.cloud.automl.v1beta1.ListDatasetsRequest; 54 import com.google.cloud.automl.v1beta1.ListDatasetsResponse; 55 import com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest; 56 import com.google.cloud.automl.v1beta1.ListModelEvaluationsResponse; 57 import com.google.cloud.automl.v1beta1.ListModelsRequest; 58 import com.google.cloud.automl.v1beta1.ListModelsResponse; 59 import com.google.cloud.automl.v1beta1.ListTableSpecsRequest; 60 import com.google.cloud.automl.v1beta1.ListTableSpecsResponse; 61 import com.google.cloud.automl.v1beta1.Model; 62 import com.google.cloud.automl.v1beta1.ModelEvaluation; 63 import com.google.cloud.automl.v1beta1.OperationMetadata; 64 import com.google.cloud.automl.v1beta1.TableSpec; 65 import com.google.cloud.automl.v1beta1.UndeployModelRequest; 66 import com.google.cloud.automl.v1beta1.UpdateColumnSpecRequest; 67 import com.google.cloud.automl.v1beta1.UpdateDatasetRequest; 68 import com.google.cloud.automl.v1beta1.UpdateTableSpecRequest; 69 import com.google.common.collect.ImmutableMap; 70 import com.google.longrunning.Operation; 71 import com.google.longrunning.stub.GrpcOperationsStub; 72 import com.google.protobuf.Empty; 73 import io.grpc.MethodDescriptor; 74 import io.grpc.protobuf.ProtoUtils; 75 import java.io.IOException; 76 import java.util.concurrent.TimeUnit; 77 import javax.annotation.Generated; 78 79 // AUTO-GENERATED DOCUMENTATION AND CLASS. 80 /** 81 * gRPC stub implementation for the AutoMl service API. 82 * 83 * <p>This class is for advanced usage and reflects the underlying API directly. 84 */ 85 @BetaApi 86 @Generated("by gapic-generator-java") 87 public class GrpcAutoMlStub extends AutoMlStub { 88 private static final MethodDescriptor<CreateDatasetRequest, Dataset> 89 createDatasetMethodDescriptor = 90 MethodDescriptor.<CreateDatasetRequest, Dataset>newBuilder() 91 .setType(MethodDescriptor.MethodType.UNARY) 92 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/CreateDataset") 93 .setRequestMarshaller( 94 ProtoUtils.marshaller(CreateDatasetRequest.getDefaultInstance())) 95 .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) 96 .build(); 97 98 private static final MethodDescriptor<GetDatasetRequest, Dataset> getDatasetMethodDescriptor = 99 MethodDescriptor.<GetDatasetRequest, Dataset>newBuilder() 100 .setType(MethodDescriptor.MethodType.UNARY) 101 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/GetDataset") 102 .setRequestMarshaller(ProtoUtils.marshaller(GetDatasetRequest.getDefaultInstance())) 103 .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) 104 .build(); 105 106 private static final MethodDescriptor<ListDatasetsRequest, ListDatasetsResponse> 107 listDatasetsMethodDescriptor = 108 MethodDescriptor.<ListDatasetsRequest, ListDatasetsResponse>newBuilder() 109 .setType(MethodDescriptor.MethodType.UNARY) 110 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ListDatasets") 111 .setRequestMarshaller(ProtoUtils.marshaller(ListDatasetsRequest.getDefaultInstance())) 112 .setResponseMarshaller( 113 ProtoUtils.marshaller(ListDatasetsResponse.getDefaultInstance())) 114 .build(); 115 116 private static final MethodDescriptor<UpdateDatasetRequest, Dataset> 117 updateDatasetMethodDescriptor = 118 MethodDescriptor.<UpdateDatasetRequest, Dataset>newBuilder() 119 .setType(MethodDescriptor.MethodType.UNARY) 120 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/UpdateDataset") 121 .setRequestMarshaller( 122 ProtoUtils.marshaller(UpdateDatasetRequest.getDefaultInstance())) 123 .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) 124 .build(); 125 126 private static final MethodDescriptor<DeleteDatasetRequest, Operation> 127 deleteDatasetMethodDescriptor = 128 MethodDescriptor.<DeleteDatasetRequest, Operation>newBuilder() 129 .setType(MethodDescriptor.MethodType.UNARY) 130 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/DeleteDataset") 131 .setRequestMarshaller( 132 ProtoUtils.marshaller(DeleteDatasetRequest.getDefaultInstance())) 133 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 134 .build(); 135 136 private static final MethodDescriptor<ImportDataRequest, Operation> importDataMethodDescriptor = 137 MethodDescriptor.<ImportDataRequest, Operation>newBuilder() 138 .setType(MethodDescriptor.MethodType.UNARY) 139 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ImportData") 140 .setRequestMarshaller(ProtoUtils.marshaller(ImportDataRequest.getDefaultInstance())) 141 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 142 .build(); 143 144 private static final MethodDescriptor<ExportDataRequest, Operation> exportDataMethodDescriptor = 145 MethodDescriptor.<ExportDataRequest, Operation>newBuilder() 146 .setType(MethodDescriptor.MethodType.UNARY) 147 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ExportData") 148 .setRequestMarshaller(ProtoUtils.marshaller(ExportDataRequest.getDefaultInstance())) 149 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 150 .build(); 151 152 private static final MethodDescriptor<GetAnnotationSpecRequest, AnnotationSpec> 153 getAnnotationSpecMethodDescriptor = 154 MethodDescriptor.<GetAnnotationSpecRequest, AnnotationSpec>newBuilder() 155 .setType(MethodDescriptor.MethodType.UNARY) 156 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/GetAnnotationSpec") 157 .setRequestMarshaller( 158 ProtoUtils.marshaller(GetAnnotationSpecRequest.getDefaultInstance())) 159 .setResponseMarshaller(ProtoUtils.marshaller(AnnotationSpec.getDefaultInstance())) 160 .build(); 161 162 private static final MethodDescriptor<GetTableSpecRequest, TableSpec> 163 getTableSpecMethodDescriptor = 164 MethodDescriptor.<GetTableSpecRequest, TableSpec>newBuilder() 165 .setType(MethodDescriptor.MethodType.UNARY) 166 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/GetTableSpec") 167 .setRequestMarshaller(ProtoUtils.marshaller(GetTableSpecRequest.getDefaultInstance())) 168 .setResponseMarshaller(ProtoUtils.marshaller(TableSpec.getDefaultInstance())) 169 .build(); 170 171 private static final MethodDescriptor<ListTableSpecsRequest, ListTableSpecsResponse> 172 listTableSpecsMethodDescriptor = 173 MethodDescriptor.<ListTableSpecsRequest, ListTableSpecsResponse>newBuilder() 174 .setType(MethodDescriptor.MethodType.UNARY) 175 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ListTableSpecs") 176 .setRequestMarshaller( 177 ProtoUtils.marshaller(ListTableSpecsRequest.getDefaultInstance())) 178 .setResponseMarshaller( 179 ProtoUtils.marshaller(ListTableSpecsResponse.getDefaultInstance())) 180 .build(); 181 182 private static final MethodDescriptor<UpdateTableSpecRequest, TableSpec> 183 updateTableSpecMethodDescriptor = 184 MethodDescriptor.<UpdateTableSpecRequest, TableSpec>newBuilder() 185 .setType(MethodDescriptor.MethodType.UNARY) 186 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/UpdateTableSpec") 187 .setRequestMarshaller( 188 ProtoUtils.marshaller(UpdateTableSpecRequest.getDefaultInstance())) 189 .setResponseMarshaller(ProtoUtils.marshaller(TableSpec.getDefaultInstance())) 190 .build(); 191 192 private static final MethodDescriptor<GetColumnSpecRequest, ColumnSpec> 193 getColumnSpecMethodDescriptor = 194 MethodDescriptor.<GetColumnSpecRequest, ColumnSpec>newBuilder() 195 .setType(MethodDescriptor.MethodType.UNARY) 196 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/GetColumnSpec") 197 .setRequestMarshaller( 198 ProtoUtils.marshaller(GetColumnSpecRequest.getDefaultInstance())) 199 .setResponseMarshaller(ProtoUtils.marshaller(ColumnSpec.getDefaultInstance())) 200 .build(); 201 202 private static final MethodDescriptor<ListColumnSpecsRequest, ListColumnSpecsResponse> 203 listColumnSpecsMethodDescriptor = 204 MethodDescriptor.<ListColumnSpecsRequest, ListColumnSpecsResponse>newBuilder() 205 .setType(MethodDescriptor.MethodType.UNARY) 206 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ListColumnSpecs") 207 .setRequestMarshaller( 208 ProtoUtils.marshaller(ListColumnSpecsRequest.getDefaultInstance())) 209 .setResponseMarshaller( 210 ProtoUtils.marshaller(ListColumnSpecsResponse.getDefaultInstance())) 211 .build(); 212 213 private static final MethodDescriptor<UpdateColumnSpecRequest, ColumnSpec> 214 updateColumnSpecMethodDescriptor = 215 MethodDescriptor.<UpdateColumnSpecRequest, ColumnSpec>newBuilder() 216 .setType(MethodDescriptor.MethodType.UNARY) 217 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/UpdateColumnSpec") 218 .setRequestMarshaller( 219 ProtoUtils.marshaller(UpdateColumnSpecRequest.getDefaultInstance())) 220 .setResponseMarshaller(ProtoUtils.marshaller(ColumnSpec.getDefaultInstance())) 221 .build(); 222 223 private static final MethodDescriptor<CreateModelRequest, Operation> createModelMethodDescriptor = 224 MethodDescriptor.<CreateModelRequest, Operation>newBuilder() 225 .setType(MethodDescriptor.MethodType.UNARY) 226 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/CreateModel") 227 .setRequestMarshaller(ProtoUtils.marshaller(CreateModelRequest.getDefaultInstance())) 228 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 229 .build(); 230 231 private static final MethodDescriptor<GetModelRequest, Model> getModelMethodDescriptor = 232 MethodDescriptor.<GetModelRequest, Model>newBuilder() 233 .setType(MethodDescriptor.MethodType.UNARY) 234 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/GetModel") 235 .setRequestMarshaller(ProtoUtils.marshaller(GetModelRequest.getDefaultInstance())) 236 .setResponseMarshaller(ProtoUtils.marshaller(Model.getDefaultInstance())) 237 .build(); 238 239 private static final MethodDescriptor<ListModelsRequest, ListModelsResponse> 240 listModelsMethodDescriptor = 241 MethodDescriptor.<ListModelsRequest, ListModelsResponse>newBuilder() 242 .setType(MethodDescriptor.MethodType.UNARY) 243 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ListModels") 244 .setRequestMarshaller(ProtoUtils.marshaller(ListModelsRequest.getDefaultInstance())) 245 .setResponseMarshaller(ProtoUtils.marshaller(ListModelsResponse.getDefaultInstance())) 246 .build(); 247 248 private static final MethodDescriptor<DeleteModelRequest, Operation> deleteModelMethodDescriptor = 249 MethodDescriptor.<DeleteModelRequest, Operation>newBuilder() 250 .setType(MethodDescriptor.MethodType.UNARY) 251 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/DeleteModel") 252 .setRequestMarshaller(ProtoUtils.marshaller(DeleteModelRequest.getDefaultInstance())) 253 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 254 .build(); 255 256 private static final MethodDescriptor<DeployModelRequest, Operation> deployModelMethodDescriptor = 257 MethodDescriptor.<DeployModelRequest, Operation>newBuilder() 258 .setType(MethodDescriptor.MethodType.UNARY) 259 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/DeployModel") 260 .setRequestMarshaller(ProtoUtils.marshaller(DeployModelRequest.getDefaultInstance())) 261 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 262 .build(); 263 264 private static final MethodDescriptor<UndeployModelRequest, Operation> 265 undeployModelMethodDescriptor = 266 MethodDescriptor.<UndeployModelRequest, Operation>newBuilder() 267 .setType(MethodDescriptor.MethodType.UNARY) 268 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/UndeployModel") 269 .setRequestMarshaller( 270 ProtoUtils.marshaller(UndeployModelRequest.getDefaultInstance())) 271 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 272 .build(); 273 274 private static final MethodDescriptor<ExportModelRequest, Operation> exportModelMethodDescriptor = 275 MethodDescriptor.<ExportModelRequest, Operation>newBuilder() 276 .setType(MethodDescriptor.MethodType.UNARY) 277 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ExportModel") 278 .setRequestMarshaller(ProtoUtils.marshaller(ExportModelRequest.getDefaultInstance())) 279 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 280 .build(); 281 282 private static final MethodDescriptor<ExportEvaluatedExamplesRequest, Operation> 283 exportEvaluatedExamplesMethodDescriptor = 284 MethodDescriptor.<ExportEvaluatedExamplesRequest, Operation>newBuilder() 285 .setType(MethodDescriptor.MethodType.UNARY) 286 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ExportEvaluatedExamples") 287 .setRequestMarshaller( 288 ProtoUtils.marshaller(ExportEvaluatedExamplesRequest.getDefaultInstance())) 289 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 290 .build(); 291 292 private static final MethodDescriptor<GetModelEvaluationRequest, ModelEvaluation> 293 getModelEvaluationMethodDescriptor = 294 MethodDescriptor.<GetModelEvaluationRequest, ModelEvaluation>newBuilder() 295 .setType(MethodDescriptor.MethodType.UNARY) 296 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/GetModelEvaluation") 297 .setRequestMarshaller( 298 ProtoUtils.marshaller(GetModelEvaluationRequest.getDefaultInstance())) 299 .setResponseMarshaller(ProtoUtils.marshaller(ModelEvaluation.getDefaultInstance())) 300 .build(); 301 302 private static final MethodDescriptor<ListModelEvaluationsRequest, ListModelEvaluationsResponse> 303 listModelEvaluationsMethodDescriptor = 304 MethodDescriptor.<ListModelEvaluationsRequest, ListModelEvaluationsResponse>newBuilder() 305 .setType(MethodDescriptor.MethodType.UNARY) 306 .setFullMethodName("google.cloud.automl.v1beta1.AutoMl/ListModelEvaluations") 307 .setRequestMarshaller( 308 ProtoUtils.marshaller(ListModelEvaluationsRequest.getDefaultInstance())) 309 .setResponseMarshaller( 310 ProtoUtils.marshaller(ListModelEvaluationsResponse.getDefaultInstance())) 311 .build(); 312 313 private final UnaryCallable<CreateDatasetRequest, Dataset> createDatasetCallable; 314 private final UnaryCallable<GetDatasetRequest, Dataset> getDatasetCallable; 315 private final UnaryCallable<ListDatasetsRequest, ListDatasetsResponse> listDatasetsCallable; 316 private final UnaryCallable<ListDatasetsRequest, ListDatasetsPagedResponse> 317 listDatasetsPagedCallable; 318 private final UnaryCallable<UpdateDatasetRequest, Dataset> updateDatasetCallable; 319 private final UnaryCallable<DeleteDatasetRequest, Operation> deleteDatasetCallable; 320 private final OperationCallable<DeleteDatasetRequest, Empty, OperationMetadata> 321 deleteDatasetOperationCallable; 322 private final UnaryCallable<ImportDataRequest, Operation> importDataCallable; 323 private final OperationCallable<ImportDataRequest, Empty, OperationMetadata> 324 importDataOperationCallable; 325 private final UnaryCallable<ExportDataRequest, Operation> exportDataCallable; 326 private final OperationCallable<ExportDataRequest, Empty, OperationMetadata> 327 exportDataOperationCallable; 328 private final UnaryCallable<GetAnnotationSpecRequest, AnnotationSpec> getAnnotationSpecCallable; 329 private final UnaryCallable<GetTableSpecRequest, TableSpec> getTableSpecCallable; 330 private final UnaryCallable<ListTableSpecsRequest, ListTableSpecsResponse> listTableSpecsCallable; 331 private final UnaryCallable<ListTableSpecsRequest, ListTableSpecsPagedResponse> 332 listTableSpecsPagedCallable; 333 private final UnaryCallable<UpdateTableSpecRequest, TableSpec> updateTableSpecCallable; 334 private final UnaryCallable<GetColumnSpecRequest, ColumnSpec> getColumnSpecCallable; 335 private final UnaryCallable<ListColumnSpecsRequest, ListColumnSpecsResponse> 336 listColumnSpecsCallable; 337 private final UnaryCallable<ListColumnSpecsRequest, ListColumnSpecsPagedResponse> 338 listColumnSpecsPagedCallable; 339 private final UnaryCallable<UpdateColumnSpecRequest, ColumnSpec> updateColumnSpecCallable; 340 private final UnaryCallable<CreateModelRequest, Operation> createModelCallable; 341 private final OperationCallable<CreateModelRequest, Model, OperationMetadata> 342 createModelOperationCallable; 343 private final UnaryCallable<GetModelRequest, Model> getModelCallable; 344 private final UnaryCallable<ListModelsRequest, ListModelsResponse> listModelsCallable; 345 private final UnaryCallable<ListModelsRequest, ListModelsPagedResponse> listModelsPagedCallable; 346 private final UnaryCallable<DeleteModelRequest, Operation> deleteModelCallable; 347 private final OperationCallable<DeleteModelRequest, Empty, OperationMetadata> 348 deleteModelOperationCallable; 349 private final UnaryCallable<DeployModelRequest, Operation> deployModelCallable; 350 private final OperationCallable<DeployModelRequest, Empty, OperationMetadata> 351 deployModelOperationCallable; 352 private final UnaryCallable<UndeployModelRequest, Operation> undeployModelCallable; 353 private final OperationCallable<UndeployModelRequest, Empty, OperationMetadata> 354 undeployModelOperationCallable; 355 private final UnaryCallable<ExportModelRequest, Operation> exportModelCallable; 356 private final OperationCallable<ExportModelRequest, Empty, OperationMetadata> 357 exportModelOperationCallable; 358 private final UnaryCallable<ExportEvaluatedExamplesRequest, Operation> 359 exportEvaluatedExamplesCallable; 360 private final OperationCallable<ExportEvaluatedExamplesRequest, Empty, OperationMetadata> 361 exportEvaluatedExamplesOperationCallable; 362 private final UnaryCallable<GetModelEvaluationRequest, ModelEvaluation> 363 getModelEvaluationCallable; 364 private final UnaryCallable<ListModelEvaluationsRequest, ListModelEvaluationsResponse> 365 listModelEvaluationsCallable; 366 private final UnaryCallable<ListModelEvaluationsRequest, ListModelEvaluationsPagedResponse> 367 listModelEvaluationsPagedCallable; 368 369 private final BackgroundResource backgroundResources; 370 private final GrpcOperationsStub operationsStub; 371 private final GrpcStubCallableFactory callableFactory; 372 create(AutoMlStubSettings settings)373 public static final GrpcAutoMlStub create(AutoMlStubSettings settings) throws IOException { 374 return new GrpcAutoMlStub(settings, ClientContext.create(settings)); 375 } 376 create(ClientContext clientContext)377 public static final GrpcAutoMlStub create(ClientContext clientContext) throws IOException { 378 return new GrpcAutoMlStub(AutoMlStubSettings.newBuilder().build(), clientContext); 379 } 380 create( ClientContext clientContext, GrpcStubCallableFactory callableFactory)381 public static final GrpcAutoMlStub create( 382 ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { 383 return new GrpcAutoMlStub( 384 AutoMlStubSettings.newBuilder().build(), clientContext, callableFactory); 385 } 386 387 /** 388 * Constructs an instance of GrpcAutoMlStub, using the given settings. This is protected so that 389 * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. 390 */ GrpcAutoMlStub(AutoMlStubSettings settings, ClientContext clientContext)391 protected GrpcAutoMlStub(AutoMlStubSettings settings, ClientContext clientContext) 392 throws IOException { 393 this(settings, clientContext, new GrpcAutoMlCallableFactory()); 394 } 395 396 /** 397 * Constructs an instance of GrpcAutoMlStub, using the given settings. This is protected so that 398 * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. 399 */ GrpcAutoMlStub( AutoMlStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)400 protected GrpcAutoMlStub( 401 AutoMlStubSettings settings, 402 ClientContext clientContext, 403 GrpcStubCallableFactory callableFactory) 404 throws IOException { 405 this.callableFactory = callableFactory; 406 this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); 407 408 GrpcCallSettings<CreateDatasetRequest, Dataset> createDatasetTransportSettings = 409 GrpcCallSettings.<CreateDatasetRequest, Dataset>newBuilder() 410 .setMethodDescriptor(createDatasetMethodDescriptor) 411 .setParamsExtractor( 412 request -> { 413 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 414 params.put("parent", String.valueOf(request.getParent())); 415 return params.build(); 416 }) 417 .build(); 418 GrpcCallSettings<GetDatasetRequest, Dataset> getDatasetTransportSettings = 419 GrpcCallSettings.<GetDatasetRequest, Dataset>newBuilder() 420 .setMethodDescriptor(getDatasetMethodDescriptor) 421 .setParamsExtractor( 422 request -> { 423 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 424 params.put("name", String.valueOf(request.getName())); 425 return params.build(); 426 }) 427 .build(); 428 GrpcCallSettings<ListDatasetsRequest, ListDatasetsResponse> listDatasetsTransportSettings = 429 GrpcCallSettings.<ListDatasetsRequest, ListDatasetsResponse>newBuilder() 430 .setMethodDescriptor(listDatasetsMethodDescriptor) 431 .setParamsExtractor( 432 request -> { 433 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 434 params.put("parent", String.valueOf(request.getParent())); 435 return params.build(); 436 }) 437 .build(); 438 GrpcCallSettings<UpdateDatasetRequest, Dataset> updateDatasetTransportSettings = 439 GrpcCallSettings.<UpdateDatasetRequest, Dataset>newBuilder() 440 .setMethodDescriptor(updateDatasetMethodDescriptor) 441 .setParamsExtractor( 442 request -> { 443 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 444 params.put("dataset.name", String.valueOf(request.getDataset().getName())); 445 return params.build(); 446 }) 447 .build(); 448 GrpcCallSettings<DeleteDatasetRequest, Operation> deleteDatasetTransportSettings = 449 GrpcCallSettings.<DeleteDatasetRequest, Operation>newBuilder() 450 .setMethodDescriptor(deleteDatasetMethodDescriptor) 451 .setParamsExtractor( 452 request -> { 453 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 454 params.put("name", String.valueOf(request.getName())); 455 return params.build(); 456 }) 457 .build(); 458 GrpcCallSettings<ImportDataRequest, Operation> importDataTransportSettings = 459 GrpcCallSettings.<ImportDataRequest, Operation>newBuilder() 460 .setMethodDescriptor(importDataMethodDescriptor) 461 .setParamsExtractor( 462 request -> { 463 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 464 params.put("name", String.valueOf(request.getName())); 465 return params.build(); 466 }) 467 .build(); 468 GrpcCallSettings<ExportDataRequest, Operation> exportDataTransportSettings = 469 GrpcCallSettings.<ExportDataRequest, Operation>newBuilder() 470 .setMethodDescriptor(exportDataMethodDescriptor) 471 .setParamsExtractor( 472 request -> { 473 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 474 params.put("name", String.valueOf(request.getName())); 475 return params.build(); 476 }) 477 .build(); 478 GrpcCallSettings<GetAnnotationSpecRequest, AnnotationSpec> getAnnotationSpecTransportSettings = 479 GrpcCallSettings.<GetAnnotationSpecRequest, AnnotationSpec>newBuilder() 480 .setMethodDescriptor(getAnnotationSpecMethodDescriptor) 481 .setParamsExtractor( 482 request -> { 483 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 484 params.put("name", String.valueOf(request.getName())); 485 return params.build(); 486 }) 487 .build(); 488 GrpcCallSettings<GetTableSpecRequest, TableSpec> getTableSpecTransportSettings = 489 GrpcCallSettings.<GetTableSpecRequest, TableSpec>newBuilder() 490 .setMethodDescriptor(getTableSpecMethodDescriptor) 491 .setParamsExtractor( 492 request -> { 493 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 494 params.put("name", String.valueOf(request.getName())); 495 return params.build(); 496 }) 497 .build(); 498 GrpcCallSettings<ListTableSpecsRequest, ListTableSpecsResponse> 499 listTableSpecsTransportSettings = 500 GrpcCallSettings.<ListTableSpecsRequest, ListTableSpecsResponse>newBuilder() 501 .setMethodDescriptor(listTableSpecsMethodDescriptor) 502 .setParamsExtractor( 503 request -> { 504 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 505 params.put("parent", String.valueOf(request.getParent())); 506 return params.build(); 507 }) 508 .build(); 509 GrpcCallSettings<UpdateTableSpecRequest, TableSpec> updateTableSpecTransportSettings = 510 GrpcCallSettings.<UpdateTableSpecRequest, TableSpec>newBuilder() 511 .setMethodDescriptor(updateTableSpecMethodDescriptor) 512 .setParamsExtractor( 513 request -> { 514 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 515 params.put("table_spec.name", String.valueOf(request.getTableSpec().getName())); 516 return params.build(); 517 }) 518 .build(); 519 GrpcCallSettings<GetColumnSpecRequest, ColumnSpec> getColumnSpecTransportSettings = 520 GrpcCallSettings.<GetColumnSpecRequest, ColumnSpec>newBuilder() 521 .setMethodDescriptor(getColumnSpecMethodDescriptor) 522 .setParamsExtractor( 523 request -> { 524 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 525 params.put("name", String.valueOf(request.getName())); 526 return params.build(); 527 }) 528 .build(); 529 GrpcCallSettings<ListColumnSpecsRequest, ListColumnSpecsResponse> 530 listColumnSpecsTransportSettings = 531 GrpcCallSettings.<ListColumnSpecsRequest, ListColumnSpecsResponse>newBuilder() 532 .setMethodDescriptor(listColumnSpecsMethodDescriptor) 533 .setParamsExtractor( 534 request -> { 535 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 536 params.put("parent", String.valueOf(request.getParent())); 537 return params.build(); 538 }) 539 .build(); 540 GrpcCallSettings<UpdateColumnSpecRequest, ColumnSpec> updateColumnSpecTransportSettings = 541 GrpcCallSettings.<UpdateColumnSpecRequest, ColumnSpec>newBuilder() 542 .setMethodDescriptor(updateColumnSpecMethodDescriptor) 543 .setParamsExtractor( 544 request -> { 545 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 546 params.put("column_spec.name", String.valueOf(request.getColumnSpec().getName())); 547 return params.build(); 548 }) 549 .build(); 550 GrpcCallSettings<CreateModelRequest, Operation> createModelTransportSettings = 551 GrpcCallSettings.<CreateModelRequest, Operation>newBuilder() 552 .setMethodDescriptor(createModelMethodDescriptor) 553 .setParamsExtractor( 554 request -> { 555 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 556 params.put("parent", String.valueOf(request.getParent())); 557 return params.build(); 558 }) 559 .build(); 560 GrpcCallSettings<GetModelRequest, Model> getModelTransportSettings = 561 GrpcCallSettings.<GetModelRequest, Model>newBuilder() 562 .setMethodDescriptor(getModelMethodDescriptor) 563 .setParamsExtractor( 564 request -> { 565 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 566 params.put("name", String.valueOf(request.getName())); 567 return params.build(); 568 }) 569 .build(); 570 GrpcCallSettings<ListModelsRequest, ListModelsResponse> listModelsTransportSettings = 571 GrpcCallSettings.<ListModelsRequest, ListModelsResponse>newBuilder() 572 .setMethodDescriptor(listModelsMethodDescriptor) 573 .setParamsExtractor( 574 request -> { 575 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 576 params.put("parent", String.valueOf(request.getParent())); 577 return params.build(); 578 }) 579 .build(); 580 GrpcCallSettings<DeleteModelRequest, Operation> deleteModelTransportSettings = 581 GrpcCallSettings.<DeleteModelRequest, Operation>newBuilder() 582 .setMethodDescriptor(deleteModelMethodDescriptor) 583 .setParamsExtractor( 584 request -> { 585 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 586 params.put("name", String.valueOf(request.getName())); 587 return params.build(); 588 }) 589 .build(); 590 GrpcCallSettings<DeployModelRequest, Operation> deployModelTransportSettings = 591 GrpcCallSettings.<DeployModelRequest, Operation>newBuilder() 592 .setMethodDescriptor(deployModelMethodDescriptor) 593 .setParamsExtractor( 594 request -> { 595 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 596 params.put("name", String.valueOf(request.getName())); 597 return params.build(); 598 }) 599 .build(); 600 GrpcCallSettings<UndeployModelRequest, Operation> undeployModelTransportSettings = 601 GrpcCallSettings.<UndeployModelRequest, Operation>newBuilder() 602 .setMethodDescriptor(undeployModelMethodDescriptor) 603 .setParamsExtractor( 604 request -> { 605 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 606 params.put("name", String.valueOf(request.getName())); 607 return params.build(); 608 }) 609 .build(); 610 GrpcCallSettings<ExportModelRequest, Operation> exportModelTransportSettings = 611 GrpcCallSettings.<ExportModelRequest, Operation>newBuilder() 612 .setMethodDescriptor(exportModelMethodDescriptor) 613 .setParamsExtractor( 614 request -> { 615 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 616 params.put("name", String.valueOf(request.getName())); 617 return params.build(); 618 }) 619 .build(); 620 GrpcCallSettings<ExportEvaluatedExamplesRequest, Operation> 621 exportEvaluatedExamplesTransportSettings = 622 GrpcCallSettings.<ExportEvaluatedExamplesRequest, Operation>newBuilder() 623 .setMethodDescriptor(exportEvaluatedExamplesMethodDescriptor) 624 .setParamsExtractor( 625 request -> { 626 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 627 params.put("name", String.valueOf(request.getName())); 628 return params.build(); 629 }) 630 .build(); 631 GrpcCallSettings<GetModelEvaluationRequest, ModelEvaluation> 632 getModelEvaluationTransportSettings = 633 GrpcCallSettings.<GetModelEvaluationRequest, ModelEvaluation>newBuilder() 634 .setMethodDescriptor(getModelEvaluationMethodDescriptor) 635 .setParamsExtractor( 636 request -> { 637 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 638 params.put("name", String.valueOf(request.getName())); 639 return params.build(); 640 }) 641 .build(); 642 GrpcCallSettings<ListModelEvaluationsRequest, ListModelEvaluationsResponse> 643 listModelEvaluationsTransportSettings = 644 GrpcCallSettings.<ListModelEvaluationsRequest, ListModelEvaluationsResponse>newBuilder() 645 .setMethodDescriptor(listModelEvaluationsMethodDescriptor) 646 .setParamsExtractor( 647 request -> { 648 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 649 params.put("parent", String.valueOf(request.getParent())); 650 return params.build(); 651 }) 652 .build(); 653 654 this.createDatasetCallable = 655 callableFactory.createUnaryCallable( 656 createDatasetTransportSettings, settings.createDatasetSettings(), clientContext); 657 this.getDatasetCallable = 658 callableFactory.createUnaryCallable( 659 getDatasetTransportSettings, settings.getDatasetSettings(), clientContext); 660 this.listDatasetsCallable = 661 callableFactory.createUnaryCallable( 662 listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); 663 this.listDatasetsPagedCallable = 664 callableFactory.createPagedCallable( 665 listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); 666 this.updateDatasetCallable = 667 callableFactory.createUnaryCallable( 668 updateDatasetTransportSettings, settings.updateDatasetSettings(), clientContext); 669 this.deleteDatasetCallable = 670 callableFactory.createUnaryCallable( 671 deleteDatasetTransportSettings, settings.deleteDatasetSettings(), clientContext); 672 this.deleteDatasetOperationCallable = 673 callableFactory.createOperationCallable( 674 deleteDatasetTransportSettings, 675 settings.deleteDatasetOperationSettings(), 676 clientContext, 677 operationsStub); 678 this.importDataCallable = 679 callableFactory.createUnaryCallable( 680 importDataTransportSettings, settings.importDataSettings(), clientContext); 681 this.importDataOperationCallable = 682 callableFactory.createOperationCallable( 683 importDataTransportSettings, 684 settings.importDataOperationSettings(), 685 clientContext, 686 operationsStub); 687 this.exportDataCallable = 688 callableFactory.createUnaryCallable( 689 exportDataTransportSettings, settings.exportDataSettings(), clientContext); 690 this.exportDataOperationCallable = 691 callableFactory.createOperationCallable( 692 exportDataTransportSettings, 693 settings.exportDataOperationSettings(), 694 clientContext, 695 operationsStub); 696 this.getAnnotationSpecCallable = 697 callableFactory.createUnaryCallable( 698 getAnnotationSpecTransportSettings, 699 settings.getAnnotationSpecSettings(), 700 clientContext); 701 this.getTableSpecCallable = 702 callableFactory.createUnaryCallable( 703 getTableSpecTransportSettings, settings.getTableSpecSettings(), clientContext); 704 this.listTableSpecsCallable = 705 callableFactory.createUnaryCallable( 706 listTableSpecsTransportSettings, settings.listTableSpecsSettings(), clientContext); 707 this.listTableSpecsPagedCallable = 708 callableFactory.createPagedCallable( 709 listTableSpecsTransportSettings, settings.listTableSpecsSettings(), clientContext); 710 this.updateTableSpecCallable = 711 callableFactory.createUnaryCallable( 712 updateTableSpecTransportSettings, settings.updateTableSpecSettings(), clientContext); 713 this.getColumnSpecCallable = 714 callableFactory.createUnaryCallable( 715 getColumnSpecTransportSettings, settings.getColumnSpecSettings(), clientContext); 716 this.listColumnSpecsCallable = 717 callableFactory.createUnaryCallable( 718 listColumnSpecsTransportSettings, settings.listColumnSpecsSettings(), clientContext); 719 this.listColumnSpecsPagedCallable = 720 callableFactory.createPagedCallable( 721 listColumnSpecsTransportSettings, settings.listColumnSpecsSettings(), clientContext); 722 this.updateColumnSpecCallable = 723 callableFactory.createUnaryCallable( 724 updateColumnSpecTransportSettings, settings.updateColumnSpecSettings(), clientContext); 725 this.createModelCallable = 726 callableFactory.createUnaryCallable( 727 createModelTransportSettings, settings.createModelSettings(), clientContext); 728 this.createModelOperationCallable = 729 callableFactory.createOperationCallable( 730 createModelTransportSettings, 731 settings.createModelOperationSettings(), 732 clientContext, 733 operationsStub); 734 this.getModelCallable = 735 callableFactory.createUnaryCallable( 736 getModelTransportSettings, settings.getModelSettings(), clientContext); 737 this.listModelsCallable = 738 callableFactory.createUnaryCallable( 739 listModelsTransportSettings, settings.listModelsSettings(), clientContext); 740 this.listModelsPagedCallable = 741 callableFactory.createPagedCallable( 742 listModelsTransportSettings, settings.listModelsSettings(), clientContext); 743 this.deleteModelCallable = 744 callableFactory.createUnaryCallable( 745 deleteModelTransportSettings, settings.deleteModelSettings(), clientContext); 746 this.deleteModelOperationCallable = 747 callableFactory.createOperationCallable( 748 deleteModelTransportSettings, 749 settings.deleteModelOperationSettings(), 750 clientContext, 751 operationsStub); 752 this.deployModelCallable = 753 callableFactory.createUnaryCallable( 754 deployModelTransportSettings, settings.deployModelSettings(), clientContext); 755 this.deployModelOperationCallable = 756 callableFactory.createOperationCallable( 757 deployModelTransportSettings, 758 settings.deployModelOperationSettings(), 759 clientContext, 760 operationsStub); 761 this.undeployModelCallable = 762 callableFactory.createUnaryCallable( 763 undeployModelTransportSettings, settings.undeployModelSettings(), clientContext); 764 this.undeployModelOperationCallable = 765 callableFactory.createOperationCallable( 766 undeployModelTransportSettings, 767 settings.undeployModelOperationSettings(), 768 clientContext, 769 operationsStub); 770 this.exportModelCallable = 771 callableFactory.createUnaryCallable( 772 exportModelTransportSettings, settings.exportModelSettings(), clientContext); 773 this.exportModelOperationCallable = 774 callableFactory.createOperationCallable( 775 exportModelTransportSettings, 776 settings.exportModelOperationSettings(), 777 clientContext, 778 operationsStub); 779 this.exportEvaluatedExamplesCallable = 780 callableFactory.createUnaryCallable( 781 exportEvaluatedExamplesTransportSettings, 782 settings.exportEvaluatedExamplesSettings(), 783 clientContext); 784 this.exportEvaluatedExamplesOperationCallable = 785 callableFactory.createOperationCallable( 786 exportEvaluatedExamplesTransportSettings, 787 settings.exportEvaluatedExamplesOperationSettings(), 788 clientContext, 789 operationsStub); 790 this.getModelEvaluationCallable = 791 callableFactory.createUnaryCallable( 792 getModelEvaluationTransportSettings, 793 settings.getModelEvaluationSettings(), 794 clientContext); 795 this.listModelEvaluationsCallable = 796 callableFactory.createUnaryCallable( 797 listModelEvaluationsTransportSettings, 798 settings.listModelEvaluationsSettings(), 799 clientContext); 800 this.listModelEvaluationsPagedCallable = 801 callableFactory.createPagedCallable( 802 listModelEvaluationsTransportSettings, 803 settings.listModelEvaluationsSettings(), 804 clientContext); 805 806 this.backgroundResources = 807 new BackgroundResourceAggregation(clientContext.getBackgroundResources()); 808 } 809 getOperationsStub()810 public GrpcOperationsStub getOperationsStub() { 811 return operationsStub; 812 } 813 814 @Override createDatasetCallable()815 public UnaryCallable<CreateDatasetRequest, Dataset> createDatasetCallable() { 816 return createDatasetCallable; 817 } 818 819 @Override getDatasetCallable()820 public UnaryCallable<GetDatasetRequest, Dataset> getDatasetCallable() { 821 return getDatasetCallable; 822 } 823 824 @Override listDatasetsCallable()825 public UnaryCallable<ListDatasetsRequest, ListDatasetsResponse> listDatasetsCallable() { 826 return listDatasetsCallable; 827 } 828 829 @Override listDatasetsPagedCallable()830 public UnaryCallable<ListDatasetsRequest, ListDatasetsPagedResponse> listDatasetsPagedCallable() { 831 return listDatasetsPagedCallable; 832 } 833 834 @Override updateDatasetCallable()835 public UnaryCallable<UpdateDatasetRequest, Dataset> updateDatasetCallable() { 836 return updateDatasetCallable; 837 } 838 839 @Override deleteDatasetCallable()840 public UnaryCallable<DeleteDatasetRequest, Operation> deleteDatasetCallable() { 841 return deleteDatasetCallable; 842 } 843 844 @Override 845 public OperationCallable<DeleteDatasetRequest, Empty, OperationMetadata> deleteDatasetOperationCallable()846 deleteDatasetOperationCallable() { 847 return deleteDatasetOperationCallable; 848 } 849 850 @Override importDataCallable()851 public UnaryCallable<ImportDataRequest, Operation> importDataCallable() { 852 return importDataCallable; 853 } 854 855 @Override 856 public OperationCallable<ImportDataRequest, Empty, OperationMetadata> importDataOperationCallable()857 importDataOperationCallable() { 858 return importDataOperationCallable; 859 } 860 861 @Override exportDataCallable()862 public UnaryCallable<ExportDataRequest, Operation> exportDataCallable() { 863 return exportDataCallable; 864 } 865 866 @Override 867 public OperationCallable<ExportDataRequest, Empty, OperationMetadata> exportDataOperationCallable()868 exportDataOperationCallable() { 869 return exportDataOperationCallable; 870 } 871 872 @Override getAnnotationSpecCallable()873 public UnaryCallable<GetAnnotationSpecRequest, AnnotationSpec> getAnnotationSpecCallable() { 874 return getAnnotationSpecCallable; 875 } 876 877 @Override getTableSpecCallable()878 public UnaryCallable<GetTableSpecRequest, TableSpec> getTableSpecCallable() { 879 return getTableSpecCallable; 880 } 881 882 @Override listTableSpecsCallable()883 public UnaryCallable<ListTableSpecsRequest, ListTableSpecsResponse> listTableSpecsCallable() { 884 return listTableSpecsCallable; 885 } 886 887 @Override 888 public UnaryCallable<ListTableSpecsRequest, ListTableSpecsPagedResponse> listTableSpecsPagedCallable()889 listTableSpecsPagedCallable() { 890 return listTableSpecsPagedCallable; 891 } 892 893 @Override updateTableSpecCallable()894 public UnaryCallable<UpdateTableSpecRequest, TableSpec> updateTableSpecCallable() { 895 return updateTableSpecCallable; 896 } 897 898 @Override getColumnSpecCallable()899 public UnaryCallable<GetColumnSpecRequest, ColumnSpec> getColumnSpecCallable() { 900 return getColumnSpecCallable; 901 } 902 903 @Override listColumnSpecsCallable()904 public UnaryCallable<ListColumnSpecsRequest, ListColumnSpecsResponse> listColumnSpecsCallable() { 905 return listColumnSpecsCallable; 906 } 907 908 @Override 909 public UnaryCallable<ListColumnSpecsRequest, ListColumnSpecsPagedResponse> listColumnSpecsPagedCallable()910 listColumnSpecsPagedCallable() { 911 return listColumnSpecsPagedCallable; 912 } 913 914 @Override updateColumnSpecCallable()915 public UnaryCallable<UpdateColumnSpecRequest, ColumnSpec> updateColumnSpecCallable() { 916 return updateColumnSpecCallable; 917 } 918 919 @Override createModelCallable()920 public UnaryCallable<CreateModelRequest, Operation> createModelCallable() { 921 return createModelCallable; 922 } 923 924 @Override 925 public OperationCallable<CreateModelRequest, Model, OperationMetadata> createModelOperationCallable()926 createModelOperationCallable() { 927 return createModelOperationCallable; 928 } 929 930 @Override getModelCallable()931 public UnaryCallable<GetModelRequest, Model> getModelCallable() { 932 return getModelCallable; 933 } 934 935 @Override listModelsCallable()936 public UnaryCallable<ListModelsRequest, ListModelsResponse> listModelsCallable() { 937 return listModelsCallable; 938 } 939 940 @Override listModelsPagedCallable()941 public UnaryCallable<ListModelsRequest, ListModelsPagedResponse> listModelsPagedCallable() { 942 return listModelsPagedCallable; 943 } 944 945 @Override deleteModelCallable()946 public UnaryCallable<DeleteModelRequest, Operation> deleteModelCallable() { 947 return deleteModelCallable; 948 } 949 950 @Override 951 public OperationCallable<DeleteModelRequest, Empty, OperationMetadata> deleteModelOperationCallable()952 deleteModelOperationCallable() { 953 return deleteModelOperationCallable; 954 } 955 956 @Override deployModelCallable()957 public UnaryCallable<DeployModelRequest, Operation> deployModelCallable() { 958 return deployModelCallable; 959 } 960 961 @Override 962 public OperationCallable<DeployModelRequest, Empty, OperationMetadata> deployModelOperationCallable()963 deployModelOperationCallable() { 964 return deployModelOperationCallable; 965 } 966 967 @Override undeployModelCallable()968 public UnaryCallable<UndeployModelRequest, Operation> undeployModelCallable() { 969 return undeployModelCallable; 970 } 971 972 @Override 973 public OperationCallable<UndeployModelRequest, Empty, OperationMetadata> undeployModelOperationCallable()974 undeployModelOperationCallable() { 975 return undeployModelOperationCallable; 976 } 977 978 @Override exportModelCallable()979 public UnaryCallable<ExportModelRequest, Operation> exportModelCallable() { 980 return exportModelCallable; 981 } 982 983 @Override 984 public OperationCallable<ExportModelRequest, Empty, OperationMetadata> exportModelOperationCallable()985 exportModelOperationCallable() { 986 return exportModelOperationCallable; 987 } 988 989 @Override 990 public UnaryCallable<ExportEvaluatedExamplesRequest, Operation> exportEvaluatedExamplesCallable()991 exportEvaluatedExamplesCallable() { 992 return exportEvaluatedExamplesCallable; 993 } 994 995 @Override 996 public OperationCallable<ExportEvaluatedExamplesRequest, Empty, OperationMetadata> exportEvaluatedExamplesOperationCallable()997 exportEvaluatedExamplesOperationCallable() { 998 return exportEvaluatedExamplesOperationCallable; 999 } 1000 1001 @Override getModelEvaluationCallable()1002 public UnaryCallable<GetModelEvaluationRequest, ModelEvaluation> getModelEvaluationCallable() { 1003 return getModelEvaluationCallable; 1004 } 1005 1006 @Override 1007 public UnaryCallable<ListModelEvaluationsRequest, ListModelEvaluationsResponse> listModelEvaluationsCallable()1008 listModelEvaluationsCallable() { 1009 return listModelEvaluationsCallable; 1010 } 1011 1012 @Override 1013 public UnaryCallable<ListModelEvaluationsRequest, ListModelEvaluationsPagedResponse> listModelEvaluationsPagedCallable()1014 listModelEvaluationsPagedCallable() { 1015 return listModelEvaluationsPagedCallable; 1016 } 1017 1018 @Override close()1019 public final void close() { 1020 try { 1021 backgroundResources.close(); 1022 } catch (RuntimeException e) { 1023 throw e; 1024 } catch (Exception e) { 1025 throw new IllegalStateException("Failed to close resource", e); 1026 } 1027 } 1028 1029 @Override shutdown()1030 public void shutdown() { 1031 backgroundResources.shutdown(); 1032 } 1033 1034 @Override isShutdown()1035 public boolean isShutdown() { 1036 return backgroundResources.isShutdown(); 1037 } 1038 1039 @Override isTerminated()1040 public boolean isTerminated() { 1041 return backgroundResources.isTerminated(); 1042 } 1043 1044 @Override shutdownNow()1045 public void shutdownNow() { 1046 backgroundResources.shutdownNow(); 1047 } 1048 1049 @Override awaitTermination(long duration, TimeUnit unit)1050 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 1051 return backgroundResources.awaitTermination(duration, unit); 1052 } 1053 } 1054