com.google.cloud.aiplatform.v1.stub.GrpcNotebookServiceStub Maven / Gradle / Ivy
Show all versions of google-cloud-aiplatform Show documentation
/*
* Copyright 2024 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.NotebookServiceClient.ListLocationsPagedResponse;
import static com.google.cloud.aiplatform.v1.NotebookServiceClient.ListNotebookExecutionJobsPagedResponse;
import static com.google.cloud.aiplatform.v1.NotebookServiceClient.ListNotebookRuntimeTemplatesPagedResponse;
import static com.google.cloud.aiplatform.v1.NotebookServiceClient.ListNotebookRuntimesPagedResponse;
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.AssignNotebookRuntimeOperationMetadata;
import com.google.cloud.aiplatform.v1.AssignNotebookRuntimeRequest;
import com.google.cloud.aiplatform.v1.CreateNotebookExecutionJobOperationMetadata;
import com.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest;
import com.google.cloud.aiplatform.v1.CreateNotebookRuntimeTemplateOperationMetadata;
import com.google.cloud.aiplatform.v1.CreateNotebookRuntimeTemplateRequest;
import com.google.cloud.aiplatform.v1.DeleteNotebookExecutionJobRequest;
import com.google.cloud.aiplatform.v1.DeleteNotebookRuntimeRequest;
import com.google.cloud.aiplatform.v1.DeleteNotebookRuntimeTemplateRequest;
import com.google.cloud.aiplatform.v1.DeleteOperationMetadata;
import com.google.cloud.aiplatform.v1.GetNotebookExecutionJobRequest;
import com.google.cloud.aiplatform.v1.GetNotebookRuntimeRequest;
import com.google.cloud.aiplatform.v1.GetNotebookRuntimeTemplateRequest;
import com.google.cloud.aiplatform.v1.ListNotebookExecutionJobsRequest;
import com.google.cloud.aiplatform.v1.ListNotebookExecutionJobsResponse;
import com.google.cloud.aiplatform.v1.ListNotebookRuntimeTemplatesRequest;
import com.google.cloud.aiplatform.v1.ListNotebookRuntimeTemplatesResponse;
import com.google.cloud.aiplatform.v1.ListNotebookRuntimesRequest;
import com.google.cloud.aiplatform.v1.ListNotebookRuntimesResponse;
import com.google.cloud.aiplatform.v1.NotebookExecutionJob;
import com.google.cloud.aiplatform.v1.NotebookRuntime;
import com.google.cloud.aiplatform.v1.NotebookRuntimeTemplate;
import com.google.cloud.aiplatform.v1.StartNotebookRuntimeOperationMetadata;
import com.google.cloud.aiplatform.v1.StartNotebookRuntimeRequest;
import com.google.cloud.aiplatform.v1.StartNotebookRuntimeResponse;
import com.google.cloud.aiplatform.v1.UpdateNotebookRuntimeTemplateRequest;
import com.google.cloud.aiplatform.v1.UpgradeNotebookRuntimeOperationMetadata;
import com.google.cloud.aiplatform.v1.UpgradeNotebookRuntimeRequest;
import com.google.cloud.aiplatform.v1.UpgradeNotebookRuntimeResponse;
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 NotebookService service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator-java")
public class GrpcNotebookServiceStub extends NotebookServiceStub {
private static final MethodDescriptor
createNotebookRuntimeTemplateMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.aiplatform.v1.NotebookService/CreateNotebookRuntimeTemplate")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateNotebookRuntimeTemplateRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
getNotebookRuntimeTemplateMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.aiplatform.v1.NotebookService/GetNotebookRuntimeTemplate")
.setRequestMarshaller(
ProtoUtils.marshaller(GetNotebookRuntimeTemplateRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(NotebookRuntimeTemplate.getDefaultInstance()))
.build();
private static final MethodDescriptor<
ListNotebookRuntimeTemplatesRequest, ListNotebookRuntimeTemplatesResponse>
listNotebookRuntimeTemplatesMethodDescriptor =
MethodDescriptor
.
newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.aiplatform.v1.NotebookService/ListNotebookRuntimeTemplates")
.setRequestMarshaller(
ProtoUtils.marshaller(ListNotebookRuntimeTemplatesRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListNotebookRuntimeTemplatesResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteNotebookRuntimeTemplateMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.aiplatform.v1.NotebookService/DeleteNotebookRuntimeTemplate")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteNotebookRuntimeTemplateRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor<
UpdateNotebookRuntimeTemplateRequest, NotebookRuntimeTemplate>
updateNotebookRuntimeTemplateMethodDescriptor =
MethodDescriptor
.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.aiplatform.v1.NotebookService/UpdateNotebookRuntimeTemplate")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateNotebookRuntimeTemplateRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(NotebookRuntimeTemplate.getDefaultInstance()))
.build();
private static final MethodDescriptor
assignNotebookRuntimeMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.aiplatform.v1.NotebookService/AssignNotebookRuntime")
.setRequestMarshaller(
ProtoUtils.marshaller(AssignNotebookRuntimeRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
getNotebookRuntimeMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.aiplatform.v1.NotebookService/GetNotebookRuntime")
.setRequestMarshaller(
ProtoUtils.marshaller(GetNotebookRuntimeRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(NotebookRuntime.getDefaultInstance()))
.build();
private static final MethodDescriptor
listNotebookRuntimesMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.aiplatform.v1.NotebookService/ListNotebookRuntimes")
.setRequestMarshaller(
ProtoUtils.marshaller(ListNotebookRuntimesRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListNotebookRuntimesResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteNotebookRuntimeMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.aiplatform.v1.NotebookService/DeleteNotebookRuntime")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteNotebookRuntimeRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
upgradeNotebookRuntimeMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.aiplatform.v1.NotebookService/UpgradeNotebookRuntime")
.setRequestMarshaller(
ProtoUtils.marshaller(UpgradeNotebookRuntimeRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
startNotebookRuntimeMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.aiplatform.v1.NotebookService/StartNotebookRuntime")
.setRequestMarshaller(
ProtoUtils.marshaller(StartNotebookRuntimeRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
createNotebookExecutionJobMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.aiplatform.v1.NotebookService/CreateNotebookExecutionJob")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateNotebookExecutionJobRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
getNotebookExecutionJobMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.aiplatform.v1.NotebookService/GetNotebookExecutionJob")
.setRequestMarshaller(
ProtoUtils.marshaller(GetNotebookExecutionJobRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(NotebookExecutionJob.getDefaultInstance()))
.build();
private static final MethodDescriptor<
ListNotebookExecutionJobsRequest, ListNotebookExecutionJobsResponse>
listNotebookExecutionJobsMethodDescriptor =
MethodDescriptor
.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.aiplatform.v1.NotebookService/ListNotebookExecutionJobs")
.setRequestMarshaller(
ProtoUtils.marshaller(ListNotebookExecutionJobsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListNotebookExecutionJobsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteNotebookExecutionJobMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.aiplatform.v1.NotebookService/DeleteNotebookExecutionJob")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteNotebookExecutionJobRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.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
createNotebookRuntimeTemplateCallable;
private final OperationCallable<
CreateNotebookRuntimeTemplateRequest,
NotebookRuntimeTemplate,
CreateNotebookRuntimeTemplateOperationMetadata>
createNotebookRuntimeTemplateOperationCallable;
private final UnaryCallable
getNotebookRuntimeTemplateCallable;
private final UnaryCallable<
ListNotebookRuntimeTemplatesRequest, ListNotebookRuntimeTemplatesResponse>
listNotebookRuntimeTemplatesCallable;
private final UnaryCallable<
ListNotebookRuntimeTemplatesRequest, ListNotebookRuntimeTemplatesPagedResponse>
listNotebookRuntimeTemplatesPagedCallable;
private final UnaryCallable
deleteNotebookRuntimeTemplateCallable;
private final OperationCallable<
DeleteNotebookRuntimeTemplateRequest, Empty, DeleteOperationMetadata>
deleteNotebookRuntimeTemplateOperationCallable;
private final UnaryCallable
updateNotebookRuntimeTemplateCallable;
private final UnaryCallable
assignNotebookRuntimeCallable;
private final OperationCallable<
AssignNotebookRuntimeRequest, NotebookRuntime, AssignNotebookRuntimeOperationMetadata>
assignNotebookRuntimeOperationCallable;
private final UnaryCallable
getNotebookRuntimeCallable;
private final UnaryCallable
listNotebookRuntimesCallable;
private final UnaryCallable
listNotebookRuntimesPagedCallable;
private final UnaryCallable
deleteNotebookRuntimeCallable;
private final OperationCallable
deleteNotebookRuntimeOperationCallable;
private final UnaryCallable
upgradeNotebookRuntimeCallable;
private final OperationCallable<
UpgradeNotebookRuntimeRequest,
UpgradeNotebookRuntimeResponse,
UpgradeNotebookRuntimeOperationMetadata>
upgradeNotebookRuntimeOperationCallable;
private final UnaryCallable startNotebookRuntimeCallable;
private final OperationCallable<
StartNotebookRuntimeRequest,
StartNotebookRuntimeResponse,
StartNotebookRuntimeOperationMetadata>
startNotebookRuntimeOperationCallable;
private final UnaryCallable
createNotebookExecutionJobCallable;
private final OperationCallable<
CreateNotebookExecutionJobRequest,
NotebookExecutionJob,
CreateNotebookExecutionJobOperationMetadata>
createNotebookExecutionJobOperationCallable;
private final UnaryCallable
getNotebookExecutionJobCallable;
private final UnaryCallable
listNotebookExecutionJobsCallable;
private final UnaryCallable<
ListNotebookExecutionJobsRequest, ListNotebookExecutionJobsPagedResponse>
listNotebookExecutionJobsPagedCallable;
private final UnaryCallable
deleteNotebookExecutionJobCallable;
private final OperationCallable
deleteNotebookExecutionJobOperationCallable;
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 GrpcNotebookServiceStub create(NotebookServiceStubSettings settings)
throws IOException {
return new GrpcNotebookServiceStub(settings, ClientContext.create(settings));
}
public static final GrpcNotebookServiceStub create(ClientContext clientContext)
throws IOException {
return new GrpcNotebookServiceStub(
NotebookServiceStubSettings.newBuilder().build(), clientContext);
}
public static final GrpcNotebookServiceStub create(
ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
return new GrpcNotebookServiceStub(
NotebookServiceStubSettings.newBuilder().build(), clientContext, callableFactory);
}
/**
* Constructs an instance of GrpcNotebookServiceStub, 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 GrpcNotebookServiceStub(
NotebookServiceStubSettings settings, ClientContext clientContext) throws IOException {
this(settings, clientContext, new GrpcNotebookServiceCallableFactory());
}
/**
* Constructs an instance of GrpcNotebookServiceStub, 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 GrpcNotebookServiceStub(
NotebookServiceStubSettings settings,
ClientContext clientContext,
GrpcStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
GrpcCallSettings
createNotebookRuntimeTemplateTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createNotebookRuntimeTemplateMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings
getNotebookRuntimeTemplateTransportSettings =
GrpcCallSettings
.newBuilder()
.setMethodDescriptor(getNotebookRuntimeTemplateMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
listNotebookRuntimeTemplatesTransportSettings =
GrpcCallSettings
.
newBuilder()
.setMethodDescriptor(listNotebookRuntimeTemplatesMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings
deleteNotebookRuntimeTemplateTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteNotebookRuntimeTemplateMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
updateNotebookRuntimeTemplateTransportSettings =
GrpcCallSettings
.newBuilder()
.setMethodDescriptor(updateNotebookRuntimeTemplateMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(
"notebook_runtime_template.name",
String.valueOf(request.getNotebookRuntimeTemplate().getName()));
return builder.build();
})
.build();
GrpcCallSettings
assignNotebookRuntimeTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(assignNotebookRuntimeMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings
getNotebookRuntimeTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getNotebookRuntimeMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
listNotebookRuntimesTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listNotebookRuntimesMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings
deleteNotebookRuntimeTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteNotebookRuntimeMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
upgradeNotebookRuntimeTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(upgradeNotebookRuntimeMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings startNotebookRuntimeTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(startNotebookRuntimeMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
createNotebookExecutionJobTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createNotebookExecutionJobMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings
getNotebookExecutionJobTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getNotebookExecutionJobMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
listNotebookExecutionJobsTransportSettings =
GrpcCallSettings
.newBuilder()
.setMethodDescriptor(listNotebookExecutionJobsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings
deleteNotebookExecutionJobTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteNotebookExecutionJobMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
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.createNotebookRuntimeTemplateCallable =
callableFactory.createUnaryCallable(
createNotebookRuntimeTemplateTransportSettings,
settings.createNotebookRuntimeTemplateSettings(),
clientContext);
this.createNotebookRuntimeTemplateOperationCallable =
callableFactory.createOperationCallable(
createNotebookRuntimeTemplateTransportSettings,
settings.createNotebookRuntimeTemplateOperationSettings(),
clientContext,
operationsStub);
this.getNotebookRuntimeTemplateCallable =
callableFactory.createUnaryCallable(
getNotebookRuntimeTemplateTransportSettings,
settings.getNotebookRuntimeTemplateSettings(),
clientContext);
this.listNotebookRuntimeTemplatesCallable =
callableFactory.createUnaryCallable(
listNotebookRuntimeTemplatesTransportSettings,
settings.listNotebookRuntimeTemplatesSettings(),
clientContext);
this.listNotebookRuntimeTemplatesPagedCallable =
callableFactory.createPagedCallable(
listNotebookRuntimeTemplatesTransportSettings,
settings.listNotebookRuntimeTemplatesSettings(),
clientContext);
this.deleteNotebookRuntimeTemplateCallable =
callableFactory.createUnaryCallable(
deleteNotebookRuntimeTemplateTransportSettings,
settings.deleteNotebookRuntimeTemplateSettings(),
clientContext);
this.deleteNotebookRuntimeTemplateOperationCallable =
callableFactory.createOperationCallable(
deleteNotebookRuntimeTemplateTransportSettings,
settings.deleteNotebookRuntimeTemplateOperationSettings(),
clientContext,
operationsStub);
this.updateNotebookRuntimeTemplateCallable =
callableFactory.createUnaryCallable(
updateNotebookRuntimeTemplateTransportSettings,
settings.updateNotebookRuntimeTemplateSettings(),
clientContext);
this.assignNotebookRuntimeCallable =
callableFactory.createUnaryCallable(
assignNotebookRuntimeTransportSettings,
settings.assignNotebookRuntimeSettings(),
clientContext);
this.assignNotebookRuntimeOperationCallable =
callableFactory.createOperationCallable(
assignNotebookRuntimeTransportSettings,
settings.assignNotebookRuntimeOperationSettings(),
clientContext,
operationsStub);
this.getNotebookRuntimeCallable =
callableFactory.createUnaryCallable(
getNotebookRuntimeTransportSettings,
settings.getNotebookRuntimeSettings(),
clientContext);
this.listNotebookRuntimesCallable =
callableFactory.createUnaryCallable(
listNotebookRuntimesTransportSettings,
settings.listNotebookRuntimesSettings(),
clientContext);
this.listNotebookRuntimesPagedCallable =
callableFactory.createPagedCallable(
listNotebookRuntimesTransportSettings,
settings.listNotebookRuntimesSettings(),
clientContext);
this.deleteNotebookRuntimeCallable =
callableFactory.createUnaryCallable(
deleteNotebookRuntimeTransportSettings,
settings.deleteNotebookRuntimeSettings(),
clientContext);
this.deleteNotebookRuntimeOperationCallable =
callableFactory.createOperationCallable(
deleteNotebookRuntimeTransportSettings,
settings.deleteNotebookRuntimeOperationSettings(),
clientContext,
operationsStub);
this.upgradeNotebookRuntimeCallable =
callableFactory.createUnaryCallable(
upgradeNotebookRuntimeTransportSettings,
settings.upgradeNotebookRuntimeSettings(),
clientContext);
this.upgradeNotebookRuntimeOperationCallable =
callableFactory.createOperationCallable(
upgradeNotebookRuntimeTransportSettings,
settings.upgradeNotebookRuntimeOperationSettings(),
clientContext,
operationsStub);
this.startNotebookRuntimeCallable =
callableFactory.createUnaryCallable(
startNotebookRuntimeTransportSettings,
settings.startNotebookRuntimeSettings(),
clientContext);
this.startNotebookRuntimeOperationCallable =
callableFactory.createOperationCallable(
startNotebookRuntimeTransportSettings,
settings.startNotebookRuntimeOperationSettings(),
clientContext,
operationsStub);
this.createNotebookExecutionJobCallable =
callableFactory.createUnaryCallable(
createNotebookExecutionJobTransportSettings,
settings.createNotebookExecutionJobSettings(),
clientContext);
this.createNotebookExecutionJobOperationCallable =
callableFactory.createOperationCallable(
createNotebookExecutionJobTransportSettings,
settings.createNotebookExecutionJobOperationSettings(),
clientContext,
operationsStub);
this.getNotebookExecutionJobCallable =
callableFactory.createUnaryCallable(
getNotebookExecutionJobTransportSettings,
settings.getNotebookExecutionJobSettings(),
clientContext);
this.listNotebookExecutionJobsCallable =
callableFactory.createUnaryCallable(
listNotebookExecutionJobsTransportSettings,
settings.listNotebookExecutionJobsSettings(),
clientContext);
this.listNotebookExecutionJobsPagedCallable =
callableFactory.createPagedCallable(
listNotebookExecutionJobsTransportSettings,
settings.listNotebookExecutionJobsSettings(),
clientContext);
this.deleteNotebookExecutionJobCallable =
callableFactory.createUnaryCallable(
deleteNotebookExecutionJobTransportSettings,
settings.deleteNotebookExecutionJobSettings(),
clientContext);
this.deleteNotebookExecutionJobOperationCallable =
callableFactory.createOperationCallable(
deleteNotebookExecutionJobTransportSettings,
settings.deleteNotebookExecutionJobOperationSettings(),
clientContext,
operationsStub);
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
createNotebookRuntimeTemplateCallable() {
return createNotebookRuntimeTemplateCallable;
}
@Override
public OperationCallable<
CreateNotebookRuntimeTemplateRequest,
NotebookRuntimeTemplate,
CreateNotebookRuntimeTemplateOperationMetadata>
createNotebookRuntimeTemplateOperationCallable() {
return createNotebookRuntimeTemplateOperationCallable;
}
@Override
public UnaryCallable
getNotebookRuntimeTemplateCallable() {
return getNotebookRuntimeTemplateCallable;
}
@Override
public UnaryCallable
listNotebookRuntimeTemplatesCallable() {
return listNotebookRuntimeTemplatesCallable;
}
@Override
public UnaryCallable<
ListNotebookRuntimeTemplatesRequest, ListNotebookRuntimeTemplatesPagedResponse>
listNotebookRuntimeTemplatesPagedCallable() {
return listNotebookRuntimeTemplatesPagedCallable;
}
@Override
public UnaryCallable
deleteNotebookRuntimeTemplateCallable() {
return deleteNotebookRuntimeTemplateCallable;
}
@Override
public OperationCallable
deleteNotebookRuntimeTemplateOperationCallable() {
return deleteNotebookRuntimeTemplateOperationCallable;
}
@Override
public UnaryCallable
updateNotebookRuntimeTemplateCallable() {
return updateNotebookRuntimeTemplateCallable;
}
@Override
public UnaryCallable assignNotebookRuntimeCallable() {
return assignNotebookRuntimeCallable;
}
@Override
public OperationCallable<
AssignNotebookRuntimeRequest, NotebookRuntime, AssignNotebookRuntimeOperationMetadata>
assignNotebookRuntimeOperationCallable() {
return assignNotebookRuntimeOperationCallable;
}
@Override
public UnaryCallable getNotebookRuntimeCallable() {
return getNotebookRuntimeCallable;
}
@Override
public UnaryCallable
listNotebookRuntimesCallable() {
return listNotebookRuntimesCallable;
}
@Override
public UnaryCallable
listNotebookRuntimesPagedCallable() {
return listNotebookRuntimesPagedCallable;
}
@Override
public UnaryCallable deleteNotebookRuntimeCallable() {
return deleteNotebookRuntimeCallable;
}
@Override
public OperationCallable
deleteNotebookRuntimeOperationCallable() {
return deleteNotebookRuntimeOperationCallable;
}
@Override
public UnaryCallable upgradeNotebookRuntimeCallable() {
return upgradeNotebookRuntimeCallable;
}
@Override
public OperationCallable<
UpgradeNotebookRuntimeRequest,
UpgradeNotebookRuntimeResponse,
UpgradeNotebookRuntimeOperationMetadata>
upgradeNotebookRuntimeOperationCallable() {
return upgradeNotebookRuntimeOperationCallable;
}
@Override
public UnaryCallable startNotebookRuntimeCallable() {
return startNotebookRuntimeCallable;
}
@Override
public OperationCallable<
StartNotebookRuntimeRequest,
StartNotebookRuntimeResponse,
StartNotebookRuntimeOperationMetadata>
startNotebookRuntimeOperationCallable() {
return startNotebookRuntimeOperationCallable;
}
@Override
public UnaryCallable
createNotebookExecutionJobCallable() {
return createNotebookExecutionJobCallable;
}
@Override
public OperationCallable<
CreateNotebookExecutionJobRequest,
NotebookExecutionJob,
CreateNotebookExecutionJobOperationMetadata>
createNotebookExecutionJobOperationCallable() {
return createNotebookExecutionJobOperationCallable;
}
@Override
public UnaryCallable
getNotebookExecutionJobCallable() {
return getNotebookExecutionJobCallable;
}
@Override
public UnaryCallable
listNotebookExecutionJobsCallable() {
return listNotebookExecutionJobsCallable;
}
@Override
public UnaryCallable
listNotebookExecutionJobsPagedCallable() {
return listNotebookExecutionJobsPagedCallable;
}
@Override
public UnaryCallable
deleteNotebookExecutionJobCallable() {
return deleteNotebookExecutionJobCallable;
}
@Override
public OperationCallable
deleteNotebookExecutionJobOperationCallable() {
return deleteNotebookExecutionJobOperationCallable;
}
@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);
}
}