![JAR search and dependency download from the Maven repository](/logo.png)
com.google.api.servicecontrol.v1.QuotaControllerGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of endpoints-management-protos Show documentation
Show all versions of endpoints-management-protos Show documentation
Contains the generated protocol buffer surface used by Endpoints
package com.google.api.servicecontrol.v1;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
/**
*
* [Google Quota Control API](/service-control/overview)
* (-- See //google/api/servicecontrol/doc/overview.md for details. --)
* Allows clients to allocate and release quota against
* a [managed service][google.api.servicemanagement.v1.ManagedService].
*
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.22.1)",
comments = "Source: google/api/servicecontrol/v1/quota_controller.proto")
public final class QuotaControllerGrpc {
private QuotaControllerGrpc() {}
public static final String SERVICE_NAME = "google.api.servicecontrol.v1.QuotaController";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getAllocateQuotaMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "AllocateQuota",
requestType = com.google.api.servicecontrol.v1.AllocateQuotaRequest.class,
responseType = com.google.api.servicecontrol.v1.AllocateQuotaResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getAllocateQuotaMethod() {
io.grpc.MethodDescriptor getAllocateQuotaMethod;
if ((getAllocateQuotaMethod = QuotaControllerGrpc.getAllocateQuotaMethod) == null) {
synchronized (QuotaControllerGrpc.class) {
if ((getAllocateQuotaMethod = QuotaControllerGrpc.getAllocateQuotaMethod) == null) {
QuotaControllerGrpc.getAllocateQuotaMethod = getAllocateQuotaMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(
"google.api.servicecontrol.v1.QuotaController", "AllocateQuota"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.api.servicecontrol.v1.AllocateQuotaRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.api.servicecontrol.v1.AllocateQuotaResponse.getDefaultInstance()))
.setSchemaDescriptor(new QuotaControllerMethodDescriptorSupplier("AllocateQuota"))
.build();
}
}
}
return getAllocateQuotaMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static QuotaControllerStub newStub(io.grpc.Channel channel) {
return new QuotaControllerStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static QuotaControllerBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new QuotaControllerBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static QuotaControllerFutureStub newFutureStub(
io.grpc.Channel channel) {
return new QuotaControllerFutureStub(channel);
}
/**
*
* [Google Quota Control API](/service-control/overview)
* (-- See //google/api/servicecontrol/doc/overview.md for details. --)
* Allows clients to allocate and release quota against
* a [managed service][google.api.servicemanagement.v1.ManagedService].
*
*/
public static abstract class QuotaControllerImplBase implements io.grpc.BindableService {
/**
*
* Attempts to allocate quota for the specified consumer. It should be called
* before the operation is executed.
* This method requires the `servicemanagement.services.quota`
* permission on the specified service. For more information, see
* [Google Cloud IAM](https://cloud.google.com/iam).
*
*/
public void allocateQuota(com.google.api.servicecontrol.v1.AllocateQuotaRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(getAllocateQuotaMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getAllocateQuotaMethod(),
asyncUnaryCall(
new MethodHandlers<
com.google.api.servicecontrol.v1.AllocateQuotaRequest,
com.google.api.servicecontrol.v1.AllocateQuotaResponse>(
this, METHODID_ALLOCATE_QUOTA)))
.build();
}
}
/**
*
* [Google Quota Control API](/service-control/overview)
* (-- See //google/api/servicecontrol/doc/overview.md for details. --)
* Allows clients to allocate and release quota against
* a [managed service][google.api.servicemanagement.v1.ManagedService].
*
*/
public static final class QuotaControllerStub extends io.grpc.stub.AbstractStub {
private QuotaControllerStub(io.grpc.Channel channel) {
super(channel);
}
private QuotaControllerStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected QuotaControllerStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new QuotaControllerStub(channel, callOptions);
}
/**
*
* Attempts to allocate quota for the specified consumer. It should be called
* before the operation is executed.
* This method requires the `servicemanagement.services.quota`
* permission on the specified service. For more information, see
* [Google Cloud IAM](https://cloud.google.com/iam).
*
*/
public void allocateQuota(com.google.api.servicecontrol.v1.AllocateQuotaRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(getAllocateQuotaMethod(), getCallOptions()), request, responseObserver);
}
}
/**
*
* [Google Quota Control API](/service-control/overview)
* (-- See //google/api/servicecontrol/doc/overview.md for details. --)
* Allows clients to allocate and release quota against
* a [managed service][google.api.servicemanagement.v1.ManagedService].
*
*/
public static final class QuotaControllerBlockingStub extends io.grpc.stub.AbstractStub {
private QuotaControllerBlockingStub(io.grpc.Channel channel) {
super(channel);
}
private QuotaControllerBlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected QuotaControllerBlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new QuotaControllerBlockingStub(channel, callOptions);
}
/**
*
* Attempts to allocate quota for the specified consumer. It should be called
* before the operation is executed.
* This method requires the `servicemanagement.services.quota`
* permission on the specified service. For more information, see
* [Google Cloud IAM](https://cloud.google.com/iam).
*
*/
public com.google.api.servicecontrol.v1.AllocateQuotaResponse allocateQuota(com.google.api.servicecontrol.v1.AllocateQuotaRequest request) {
return blockingUnaryCall(
getChannel(), getAllocateQuotaMethod(), getCallOptions(), request);
}
}
/**
*
* [Google Quota Control API](/service-control/overview)
* (-- See //google/api/servicecontrol/doc/overview.md for details. --)
* Allows clients to allocate and release quota against
* a [managed service][google.api.servicemanagement.v1.ManagedService].
*
*/
public static final class QuotaControllerFutureStub extends io.grpc.stub.AbstractStub {
private QuotaControllerFutureStub(io.grpc.Channel channel) {
super(channel);
}
private QuotaControllerFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected QuotaControllerFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new QuotaControllerFutureStub(channel, callOptions);
}
/**
*
* Attempts to allocate quota for the specified consumer. It should be called
* before the operation is executed.
* This method requires the `servicemanagement.services.quota`
* permission on the specified service. For more information, see
* [Google Cloud IAM](https://cloud.google.com/iam).
*
*/
public com.google.common.util.concurrent.ListenableFuture allocateQuota(
com.google.api.servicecontrol.v1.AllocateQuotaRequest request) {
return futureUnaryCall(
getChannel().newCall(getAllocateQuotaMethod(), getCallOptions()), request);
}
}
private static final int METHODID_ALLOCATE_QUOTA = 0;
private static final class MethodHandlers implements
io.grpc.stub.ServerCalls.UnaryMethod,
io.grpc.stub.ServerCalls.ServerStreamingMethod,
io.grpc.stub.ServerCalls.ClientStreamingMethod,
io.grpc.stub.ServerCalls.BidiStreamingMethod {
private final QuotaControllerImplBase serviceImpl;
private final int methodId;
MethodHandlers(QuotaControllerImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
case METHODID_ALLOCATE_QUOTA:
serviceImpl.allocateQuota((com.google.api.servicecontrol.v1.AllocateQuotaRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver invoke(
io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
default:
throw new AssertionError();
}
}
}
private static abstract class QuotaControllerBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
QuotaControllerBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.google.api.servicecontrol.v1.QuotaControllerProto.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("QuotaController");
}
}
private static final class QuotaControllerFileDescriptorSupplier
extends QuotaControllerBaseDescriptorSupplier {
QuotaControllerFileDescriptorSupplier() {}
}
private static final class QuotaControllerMethodDescriptorSupplier
extends QuotaControllerBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
QuotaControllerMethodDescriptorSupplier(String methodName) {
this.methodName = methodName;
}
@java.lang.Override
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
return getServiceDescriptor().findMethodByName(methodName);
}
}
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) {
synchronized (QuotaControllerGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new QuotaControllerFileDescriptorSupplier())
.addMethod(getAllocateQuotaMethod())
.build();
}
}
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy