All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.aiplatform.v1.stub.GrpcDatasetServiceStub Maven / Gradle / Ivy

There is a newer version: 3.55.0
Show newest version
/*
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.cloud.aiplatform.v1.stub;

import static com.google.cloud.aiplatform.v1.DatasetServiceClient.ListAnnotationsPagedResponse;
import static com.google.cloud.aiplatform.v1.DatasetServiceClient.ListDataItemsPagedResponse;
import static com.google.cloud.aiplatform.v1.DatasetServiceClient.ListDatasetVersionsPagedResponse;
import static com.google.cloud.aiplatform.v1.DatasetServiceClient.ListDatasetsPagedResponse;
import static com.google.cloud.aiplatform.v1.DatasetServiceClient.ListLocationsPagedResponse;
import static com.google.cloud.aiplatform.v1.DatasetServiceClient.ListSavedQueriesPagedResponse;
import static com.google.cloud.aiplatform.v1.DatasetServiceClient.SearchDataItemsPagedResponse;

import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.aiplatform.v1.AnnotationSpec;
import com.google.cloud.aiplatform.v1.CreateDatasetOperationMetadata;
import com.google.cloud.aiplatform.v1.CreateDatasetRequest;
import com.google.cloud.aiplatform.v1.CreateDatasetVersionOperationMetadata;
import com.google.cloud.aiplatform.v1.CreateDatasetVersionRequest;
import com.google.cloud.aiplatform.v1.Dataset;
import com.google.cloud.aiplatform.v1.DatasetVersion;
import com.google.cloud.aiplatform.v1.DeleteDatasetRequest;
import com.google.cloud.aiplatform.v1.DeleteDatasetVersionRequest;
import com.google.cloud.aiplatform.v1.DeleteOperationMetadata;
import com.google.cloud.aiplatform.v1.DeleteSavedQueryRequest;
import com.google.cloud.aiplatform.v1.ExportDataOperationMetadata;
import com.google.cloud.aiplatform.v1.ExportDataRequest;
import com.google.cloud.aiplatform.v1.ExportDataResponse;
import com.google.cloud.aiplatform.v1.GetAnnotationSpecRequest;
import com.google.cloud.aiplatform.v1.GetDatasetRequest;
import com.google.cloud.aiplatform.v1.GetDatasetVersionRequest;
import com.google.cloud.aiplatform.v1.ImportDataOperationMetadata;
import com.google.cloud.aiplatform.v1.ImportDataRequest;
import com.google.cloud.aiplatform.v1.ImportDataResponse;
import com.google.cloud.aiplatform.v1.ListAnnotationsRequest;
import com.google.cloud.aiplatform.v1.ListAnnotationsResponse;
import com.google.cloud.aiplatform.v1.ListDataItemsRequest;
import com.google.cloud.aiplatform.v1.ListDataItemsResponse;
import com.google.cloud.aiplatform.v1.ListDatasetVersionsRequest;
import com.google.cloud.aiplatform.v1.ListDatasetVersionsResponse;
import com.google.cloud.aiplatform.v1.ListDatasetsRequest;
import com.google.cloud.aiplatform.v1.ListDatasetsResponse;
import com.google.cloud.aiplatform.v1.ListSavedQueriesRequest;
import com.google.cloud.aiplatform.v1.ListSavedQueriesResponse;
import com.google.cloud.aiplatform.v1.RestoreDatasetVersionOperationMetadata;
import com.google.cloud.aiplatform.v1.RestoreDatasetVersionRequest;
import com.google.cloud.aiplatform.v1.SearchDataItemsRequest;
import com.google.cloud.aiplatform.v1.SearchDataItemsResponse;
import com.google.cloud.aiplatform.v1.UpdateDatasetRequest;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.protobuf.Empty;
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * gRPC stub implementation for the DatasetService service API.
 *
 * 

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator-java") public class GrpcDatasetServiceStub extends DatasetServiceStub { private static final MethodDescriptor createDatasetMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/CreateDataset") .setRequestMarshaller( ProtoUtils.marshaller(CreateDatasetRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor getDatasetMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/GetDataset") .setRequestMarshaller(ProtoUtils.marshaller(GetDatasetRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) .build(); private static final MethodDescriptor updateDatasetMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/UpdateDataset") .setRequestMarshaller( ProtoUtils.marshaller(UpdateDatasetRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Dataset.getDefaultInstance())) .build(); private static final MethodDescriptor listDatasetsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/ListDatasets") .setRequestMarshaller(ProtoUtils.marshaller(ListDatasetsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListDatasetsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor deleteDatasetMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/DeleteDataset") .setRequestMarshaller( ProtoUtils.marshaller(DeleteDatasetRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor importDataMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/ImportData") .setRequestMarshaller(ProtoUtils.marshaller(ImportDataRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor exportDataMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/ExportData") .setRequestMarshaller(ProtoUtils.marshaller(ExportDataRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor createDatasetVersionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/CreateDatasetVersion") .setRequestMarshaller( ProtoUtils.marshaller(CreateDatasetVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor deleteDatasetVersionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/DeleteDatasetVersion") .setRequestMarshaller( ProtoUtils.marshaller(DeleteDatasetVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor getDatasetVersionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/GetDatasetVersion") .setRequestMarshaller( ProtoUtils.marshaller(GetDatasetVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(DatasetVersion.getDefaultInstance())) .build(); private static final MethodDescriptor listDatasetVersionsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/ListDatasetVersions") .setRequestMarshaller( ProtoUtils.marshaller(ListDatasetVersionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListDatasetVersionsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor restoreDatasetVersionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/RestoreDatasetVersion") .setRequestMarshaller( ProtoUtils.marshaller(RestoreDatasetVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor listDataItemsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/ListDataItems") .setRequestMarshaller( ProtoUtils.marshaller(ListDataItemsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListDataItemsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor searchDataItemsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/SearchDataItems") .setRequestMarshaller( ProtoUtils.marshaller(SearchDataItemsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(SearchDataItemsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor listSavedQueriesMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/ListSavedQueries") .setRequestMarshaller( ProtoUtils.marshaller(ListSavedQueriesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListSavedQueriesResponse.getDefaultInstance())) .build(); private static final MethodDescriptor deleteSavedQueryMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/DeleteSavedQuery") .setRequestMarshaller( ProtoUtils.marshaller(DeleteSavedQueryRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor getAnnotationSpecMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/GetAnnotationSpec") .setRequestMarshaller( ProtoUtils.marshaller(GetAnnotationSpecRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(AnnotationSpec.getDefaultInstance())) .build(); private static final MethodDescriptor listAnnotationsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.aiplatform.v1.DatasetService/ListAnnotations") .setRequestMarshaller( ProtoUtils.marshaller(ListAnnotationsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListAnnotationsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor listLocationsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.location.Locations/ListLocations") .setRequestMarshaller( ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor getLocationMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.location.Locations/GetLocation") .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) .build(); private static final MethodDescriptor setIamPolicyMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) .build(); private static final MethodDescriptor getIamPolicyMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) .build(); private static final MethodDescriptor testIamPermissionsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") .setRequestMarshaller( ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) .build(); private final UnaryCallable createDatasetCallable; private final OperationCallable createDatasetOperationCallable; private final UnaryCallable getDatasetCallable; private final UnaryCallable updateDatasetCallable; private final UnaryCallable listDatasetsCallable; private final UnaryCallable listDatasetsPagedCallable; private final UnaryCallable deleteDatasetCallable; private final OperationCallable deleteDatasetOperationCallable; private final UnaryCallable importDataCallable; private final OperationCallable< ImportDataRequest, ImportDataResponse, ImportDataOperationMetadata> importDataOperationCallable; private final UnaryCallable exportDataCallable; private final OperationCallable< ExportDataRequest, ExportDataResponse, ExportDataOperationMetadata> exportDataOperationCallable; private final UnaryCallable createDatasetVersionCallable; private final OperationCallable< CreateDatasetVersionRequest, DatasetVersion, CreateDatasetVersionOperationMetadata> createDatasetVersionOperationCallable; private final UnaryCallable deleteDatasetVersionCallable; private final OperationCallable deleteDatasetVersionOperationCallable; private final UnaryCallable getDatasetVersionCallable; private final UnaryCallable listDatasetVersionsCallable; private final UnaryCallable listDatasetVersionsPagedCallable; private final UnaryCallable restoreDatasetVersionCallable; private final OperationCallable< RestoreDatasetVersionRequest, DatasetVersion, RestoreDatasetVersionOperationMetadata> restoreDatasetVersionOperationCallable; private final UnaryCallable listDataItemsCallable; private final UnaryCallable listDataItemsPagedCallable; private final UnaryCallable searchDataItemsCallable; private final UnaryCallable searchDataItemsPagedCallable; private final UnaryCallable listSavedQueriesCallable; private final UnaryCallable listSavedQueriesPagedCallable; private final UnaryCallable deleteSavedQueryCallable; private final OperationCallable deleteSavedQueryOperationCallable; private final UnaryCallable getAnnotationSpecCallable; private final UnaryCallable listAnnotationsCallable; private final UnaryCallable listAnnotationsPagedCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; private final UnaryCallable getLocationCallable; private final UnaryCallable setIamPolicyCallable; private final UnaryCallable getIamPolicyCallable; private final UnaryCallable testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcDatasetServiceStub create(DatasetServiceStubSettings settings) throws IOException { return new GrpcDatasetServiceStub(settings, ClientContext.create(settings)); } public static final GrpcDatasetServiceStub create(ClientContext clientContext) throws IOException { return new GrpcDatasetServiceStub( DatasetServiceStubSettings.newBuilder().build(), clientContext); } public static final GrpcDatasetServiceStub create( ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { return new GrpcDatasetServiceStub( DatasetServiceStubSettings.newBuilder().build(), clientContext, callableFactory); } /** * Constructs an instance of GrpcDatasetServiceStub, using the given settings. This is protected * so that it is easy to make a subclass, but otherwise, the static factory methods should be * preferred. */ protected GrpcDatasetServiceStub(DatasetServiceStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcDatasetServiceCallableFactory()); } /** * Constructs an instance of GrpcDatasetServiceStub, using the given settings. This is protected * so that it is easy to make a subclass, but otherwise, the static factory methods should be * preferred. */ protected GrpcDatasetServiceStub( DatasetServiceStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings createDatasetTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createDatasetMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings getDatasetTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getDatasetMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings updateDatasetTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateDatasetMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("dataset.name", String.valueOf(request.getDataset().getName())); return builder.build(); }) .build(); GrpcCallSettings listDatasetsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listDatasetsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings deleteDatasetTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteDatasetMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings importDataTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(importDataMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings exportDataTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(exportDataMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings createDatasetVersionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createDatasetVersionMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings deleteDatasetVersionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteDatasetVersionMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings getDatasetVersionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getDatasetVersionMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings listDatasetVersionsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listDatasetVersionsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings restoreDatasetVersionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(restoreDatasetVersionMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings listDataItemsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listDataItemsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings searchDataItemsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(searchDataItemsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("dataset", String.valueOf(request.getDataset())); return builder.build(); }) .build(); GrpcCallSettings listSavedQueriesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listSavedQueriesMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings deleteSavedQueryTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteSavedQueryMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings getAnnotationSpecTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getAnnotationSpecMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings listAnnotationsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listAnnotationsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings listLocationsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listLocationsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings getLocationTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getLocationMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("resource", String.valueOf(request.getResource())); return builder.build(); }) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("resource", String.valueOf(request.getResource())); return builder.build(); }) .build(); GrpcCallSettings testIamPermissionsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("resource", String.valueOf(request.getResource())); return builder.build(); }) .build(); this.createDatasetCallable = callableFactory.createUnaryCallable( createDatasetTransportSettings, settings.createDatasetSettings(), clientContext); this.createDatasetOperationCallable = callableFactory.createOperationCallable( createDatasetTransportSettings, settings.createDatasetOperationSettings(), clientContext, operationsStub); this.getDatasetCallable = callableFactory.createUnaryCallable( getDatasetTransportSettings, settings.getDatasetSettings(), clientContext); this.updateDatasetCallable = callableFactory.createUnaryCallable( updateDatasetTransportSettings, settings.updateDatasetSettings(), clientContext); this.listDatasetsCallable = callableFactory.createUnaryCallable( listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); this.listDatasetsPagedCallable = callableFactory.createPagedCallable( listDatasetsTransportSettings, settings.listDatasetsSettings(), clientContext); this.deleteDatasetCallable = callableFactory.createUnaryCallable( deleteDatasetTransportSettings, settings.deleteDatasetSettings(), clientContext); this.deleteDatasetOperationCallable = callableFactory.createOperationCallable( deleteDatasetTransportSettings, settings.deleteDatasetOperationSettings(), clientContext, operationsStub); this.importDataCallable = callableFactory.createUnaryCallable( importDataTransportSettings, settings.importDataSettings(), clientContext); this.importDataOperationCallable = callableFactory.createOperationCallable( importDataTransportSettings, settings.importDataOperationSettings(), clientContext, operationsStub); this.exportDataCallable = callableFactory.createUnaryCallable( exportDataTransportSettings, settings.exportDataSettings(), clientContext); this.exportDataOperationCallable = callableFactory.createOperationCallable( exportDataTransportSettings, settings.exportDataOperationSettings(), clientContext, operationsStub); this.createDatasetVersionCallable = callableFactory.createUnaryCallable( createDatasetVersionTransportSettings, settings.createDatasetVersionSettings(), clientContext); this.createDatasetVersionOperationCallable = callableFactory.createOperationCallable( createDatasetVersionTransportSettings, settings.createDatasetVersionOperationSettings(), clientContext, operationsStub); this.deleteDatasetVersionCallable = callableFactory.createUnaryCallable( deleteDatasetVersionTransportSettings, settings.deleteDatasetVersionSettings(), clientContext); this.deleteDatasetVersionOperationCallable = callableFactory.createOperationCallable( deleteDatasetVersionTransportSettings, settings.deleteDatasetVersionOperationSettings(), clientContext, operationsStub); this.getDatasetVersionCallable = callableFactory.createUnaryCallable( getDatasetVersionTransportSettings, settings.getDatasetVersionSettings(), clientContext); this.listDatasetVersionsCallable = callableFactory.createUnaryCallable( listDatasetVersionsTransportSettings, settings.listDatasetVersionsSettings(), clientContext); this.listDatasetVersionsPagedCallable = callableFactory.createPagedCallable( listDatasetVersionsTransportSettings, settings.listDatasetVersionsSettings(), clientContext); this.restoreDatasetVersionCallable = callableFactory.createUnaryCallable( restoreDatasetVersionTransportSettings, settings.restoreDatasetVersionSettings(), clientContext); this.restoreDatasetVersionOperationCallable = callableFactory.createOperationCallable( restoreDatasetVersionTransportSettings, settings.restoreDatasetVersionOperationSettings(), clientContext, operationsStub); this.listDataItemsCallable = callableFactory.createUnaryCallable( listDataItemsTransportSettings, settings.listDataItemsSettings(), clientContext); this.listDataItemsPagedCallable = callableFactory.createPagedCallable( listDataItemsTransportSettings, settings.listDataItemsSettings(), clientContext); this.searchDataItemsCallable = callableFactory.createUnaryCallable( searchDataItemsTransportSettings, settings.searchDataItemsSettings(), clientContext); this.searchDataItemsPagedCallable = callableFactory.createPagedCallable( searchDataItemsTransportSettings, settings.searchDataItemsSettings(), clientContext); this.listSavedQueriesCallable = callableFactory.createUnaryCallable( listSavedQueriesTransportSettings, settings.listSavedQueriesSettings(), clientContext); this.listSavedQueriesPagedCallable = callableFactory.createPagedCallable( listSavedQueriesTransportSettings, settings.listSavedQueriesSettings(), clientContext); this.deleteSavedQueryCallable = callableFactory.createUnaryCallable( deleteSavedQueryTransportSettings, settings.deleteSavedQuerySettings(), clientContext); this.deleteSavedQueryOperationCallable = callableFactory.createOperationCallable( deleteSavedQueryTransportSettings, settings.deleteSavedQueryOperationSettings(), clientContext, operationsStub); this.getAnnotationSpecCallable = callableFactory.createUnaryCallable( getAnnotationSpecTransportSettings, settings.getAnnotationSpecSettings(), clientContext); this.listAnnotationsCallable = callableFactory.createUnaryCallable( listAnnotationsTransportSettings, settings.listAnnotationsSettings(), clientContext); this.listAnnotationsPagedCallable = callableFactory.createPagedCallable( listAnnotationsTransportSettings, settings.listAnnotationsSettings(), clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); this.listLocationsPagedCallable = callableFactory.createPagedCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); this.getLocationCallable = callableFactory.createUnaryCallable( getLocationTransportSettings, settings.getLocationSettings(), clientContext); this.setIamPolicyCallable = callableFactory.createUnaryCallable( setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); this.getIamPolicyCallable = callableFactory.createUnaryCallable( getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); this.testIamPermissionsCallable = callableFactory.createUnaryCallable( testIamPermissionsTransportSettings, settings.testIamPermissionsSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } public GrpcOperationsStub getOperationsStub() { return operationsStub; } @Override public UnaryCallable createDatasetCallable() { return createDatasetCallable; } @Override public OperationCallable createDatasetOperationCallable() { return createDatasetOperationCallable; } @Override public UnaryCallable getDatasetCallable() { return getDatasetCallable; } @Override public UnaryCallable updateDatasetCallable() { return updateDatasetCallable; } @Override public UnaryCallable listDatasetsCallable() { return listDatasetsCallable; } @Override public UnaryCallable listDatasetsPagedCallable() { return listDatasetsPagedCallable; } @Override public UnaryCallable deleteDatasetCallable() { return deleteDatasetCallable; } @Override public OperationCallable deleteDatasetOperationCallable() { return deleteDatasetOperationCallable; } @Override public UnaryCallable importDataCallable() { return importDataCallable; } @Override public OperationCallable importDataOperationCallable() { return importDataOperationCallable; } @Override public UnaryCallable exportDataCallable() { return exportDataCallable; } @Override public OperationCallable exportDataOperationCallable() { return exportDataOperationCallable; } @Override public UnaryCallable createDatasetVersionCallable() { return createDatasetVersionCallable; } @Override public OperationCallable< CreateDatasetVersionRequest, DatasetVersion, CreateDatasetVersionOperationMetadata> createDatasetVersionOperationCallable() { return createDatasetVersionOperationCallable; } @Override public UnaryCallable deleteDatasetVersionCallable() { return deleteDatasetVersionCallable; } @Override public OperationCallable deleteDatasetVersionOperationCallable() { return deleteDatasetVersionOperationCallable; } @Override public UnaryCallable getDatasetVersionCallable() { return getDatasetVersionCallable; } @Override public UnaryCallable listDatasetVersionsCallable() { return listDatasetVersionsCallable; } @Override public UnaryCallable listDatasetVersionsPagedCallable() { return listDatasetVersionsPagedCallable; } @Override public UnaryCallable restoreDatasetVersionCallable() { return restoreDatasetVersionCallable; } @Override public OperationCallable< RestoreDatasetVersionRequest, DatasetVersion, RestoreDatasetVersionOperationMetadata> restoreDatasetVersionOperationCallable() { return restoreDatasetVersionOperationCallable; } @Override public UnaryCallable listDataItemsCallable() { return listDataItemsCallable; } @Override public UnaryCallable listDataItemsPagedCallable() { return listDataItemsPagedCallable; } @Override public UnaryCallable searchDataItemsCallable() { return searchDataItemsCallable; } @Override public UnaryCallable searchDataItemsPagedCallable() { return searchDataItemsPagedCallable; } @Override public UnaryCallable listSavedQueriesCallable() { return listSavedQueriesCallable; } @Override public UnaryCallable listSavedQueriesPagedCallable() { return listSavedQueriesPagedCallable; } @Override public UnaryCallable deleteSavedQueryCallable() { return deleteSavedQueryCallable; } @Override public OperationCallable deleteSavedQueryOperationCallable() { return deleteSavedQueryOperationCallable; } @Override public UnaryCallable getAnnotationSpecCallable() { return getAnnotationSpecCallable; } @Override public UnaryCallable listAnnotationsCallable() { return listAnnotationsCallable; } @Override public UnaryCallable listAnnotationsPagedCallable() { return listAnnotationsPagedCallable; } @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; } @Override public UnaryCallable listLocationsPagedCallable() { return listLocationsPagedCallable; } @Override public UnaryCallable getLocationCallable() { return getLocationCallable; } @Override public UnaryCallable setIamPolicyCallable() { return setIamPolicyCallable; } @Override public UnaryCallable getIamPolicyCallable() { return getIamPolicyCallable; } @Override public UnaryCallable testIamPermissionsCallable() { return testIamPermissionsCallable; } @Override public final void close() { try { backgroundResources.close(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new IllegalStateException("Failed to close resource", e); } } @Override public void shutdown() { backgroundResources.shutdown(); } @Override public boolean isShutdown() { return backgroundResources.isShutdown(); } @Override public boolean isTerminated() { return backgroundResources.isTerminated(); } @Override public void shutdownNow() { backgroundResources.shutdownNow(); } @Override public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return backgroundResources.awaitTermination(duration, unit); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy