![JAR search and dependency download from the Maven repository](/logo.png)
com.google.api.servicecontrol.v1.AllocateQuotaRequest 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
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/servicecontrol/v1/quota_controller.proto
package com.google.api.servicecontrol.v1;
/**
*
* Request message for the AllocateQuota method.
*
*
* Protobuf type {@code google.api.servicecontrol.v1.AllocateQuotaRequest}
*/
public final class AllocateQuotaRequest extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.AllocateQuotaRequest)
AllocateQuotaRequestOrBuilder {
// Use AllocateQuotaRequest.newBuilder() to construct.
private AllocateQuotaRequest(com.google.protobuf.GeneratedMessage.Builder> builder) {
super(builder);
}
private AllocateQuotaRequest() {
serviceName_ = "";
allocationMode_ = 0;
serviceConfigId_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private AllocateQuotaRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
java.lang.String s = input.readStringRequireUtf8();
serviceName_ = s;
break;
}
case 18: {
com.google.api.servicecontrol.v1.QuotaOperation.Builder subBuilder = null;
if (allocateOperation_ != null) {
subBuilder = allocateOperation_.toBuilder();
}
allocateOperation_ = input.readMessage(com.google.api.servicecontrol.v1.QuotaOperation.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(allocateOperation_);
allocateOperation_ = subBuilder.buildPartial();
}
break;
}
case 24: {
int rawValue = input.readEnum();
allocationMode_ = rawValue;
break;
}
case 34: {
java.lang.String s = input.readStringRequireUtf8();
serviceConfigId_ = s;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.servicecontrol.v1.QuotaControllerProto.internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.servicecontrol.v1.QuotaControllerProto.internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.servicecontrol.v1.AllocateQuotaRequest.class, com.google.api.servicecontrol.v1.AllocateQuotaRequest.Builder.class);
}
/**
*
* Supported allocation modes.
*
*
* Protobuf enum {@code google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode}
*/
public enum AllocationMode
implements com.google.protobuf.ProtocolMessageEnum {
/**
* UNSPECIFIED = 0;
*/
UNSPECIFIED(0),
/**
*
* Allocates quota for the amount specified in the service configuration or
* specified using the quota_metrics. If the amount is higher than the
* available quota, allocation error will be returned and no quota will be
* allocated.
*
*
* NORMAL = 1;
*/
NORMAL(1),
/**
*
* Allocates quota for the amount specified in the service configuration or
* specified using the quota_metrics. If the amount is higher than the
* available quota, request does not fail but all available quota will be
* allocated.
*
*
* BEST_EFFORT = 2;
*/
BEST_EFFORT(2),
/**
*
* Only checks if there is enough quota available and does not change the
* available quota. No lock is placed on the available quota either.
*
*
* CHECK_ONLY = 3;
*/
CHECK_ONLY(3),
UNRECOGNIZED(-1),
;
/**
* UNSPECIFIED = 0;
*/
public static final int UNSPECIFIED_VALUE = 0;
/**
*
* Allocates quota for the amount specified in the service configuration or
* specified using the quota_metrics. If the amount is higher than the
* available quota, allocation error will be returned and no quota will be
* allocated.
*
*
* NORMAL = 1;
*/
public static final int NORMAL_VALUE = 1;
/**
*
* Allocates quota for the amount specified in the service configuration or
* specified using the quota_metrics. If the amount is higher than the
* available quota, request does not fail but all available quota will be
* allocated.
*
*
* BEST_EFFORT = 2;
*/
public static final int BEST_EFFORT_VALUE = 2;
/**
*
* Only checks if there is enough quota available and does not change the
* available quota. No lock is placed on the available quota either.
*
*
* CHECK_ONLY = 3;
*/
public static final int CHECK_ONLY_VALUE = 3;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static AllocationMode valueOf(int value) {
return forNumber(value);
}
public static AllocationMode forNumber(int value) {
switch (value) {
case 0: return UNSPECIFIED;
case 1: return NORMAL;
case 2: return BEST_EFFORT;
case 3: return CHECK_ONLY;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
AllocationMode> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public AllocationMode findValueByNumber(int number) {
return AllocationMode.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return com.google.api.servicecontrol.v1.AllocateQuotaRequest.getDescriptor().getEnumTypes().get(0);
}
private static final AllocationMode[] VALUES = values();
public static AllocationMode valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private AllocationMode(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode)
}
public static final int SERVICE_NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object serviceName_;
/**
*
* Name of the service as specified in the service configuration. For example,
* `"pubsub.googleapis.com"`.
* See [google.api.Service][] for the definition of a service name.
*
*
* optional string service_name = 1;
*/
public java.lang.String getServiceName() {
java.lang.Object ref = serviceName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
serviceName_ = s;
return s;
}
}
/**
*
* Name of the service as specified in the service configuration. For example,
* `"pubsub.googleapis.com"`.
* See [google.api.Service][] for the definition of a service name.
*
*
* optional string service_name = 1;
*/
public com.google.protobuf.ByteString
getServiceNameBytes() {
java.lang.Object ref = serviceName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
serviceName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ALLOCATE_OPERATION_FIELD_NUMBER = 2;
private com.google.api.servicecontrol.v1.QuotaOperation allocateOperation_;
/**
*
* Operation that describes the quota allocation.
*
*
* optional .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2;
*/
public boolean hasAllocateOperation() {
return allocateOperation_ != null;
}
/**
*
* Operation that describes the quota allocation.
*
*
* optional .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2;
*/
public com.google.api.servicecontrol.v1.QuotaOperation getAllocateOperation() {
return allocateOperation_ == null ? com.google.api.servicecontrol.v1.QuotaOperation.getDefaultInstance() : allocateOperation_;
}
/**
*
* Operation that describes the quota allocation.
*
*
* optional .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2;
*/
public com.google.api.servicecontrol.v1.QuotaOperationOrBuilder getAllocateOperationOrBuilder() {
return getAllocateOperation();
}
public static final int ALLOCATION_MODE_FIELD_NUMBER = 3;
private int allocationMode_;
/**
*
* Allocation mode for this operation.
* Deprecated: use QuotaMode inside the QuotaOperation.
*
*
* optional .google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode allocation_mode = 3 [deprecated = true];
*/
@java.lang.Deprecated public int getAllocationModeValue() {
return allocationMode_;
}
/**
*
* Allocation mode for this operation.
* Deprecated: use QuotaMode inside the QuotaOperation.
*
*
* optional .google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode allocation_mode = 3 [deprecated = true];
*/
@java.lang.Deprecated public com.google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode getAllocationMode() {
com.google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode result = com.google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode.valueOf(allocationMode_);
return result == null ? com.google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode.UNRECOGNIZED : result;
}
public static final int SERVICE_CONFIG_ID_FIELD_NUMBER = 4;
private volatile java.lang.Object serviceConfigId_;
/**
*
* Specifies which version of service configuration should be used to process
* the request. If unspecified or no matching version can be found, the latest
* one will be used.
*
*
* optional string service_config_id = 4;
*/
public java.lang.String getServiceConfigId() {
java.lang.Object ref = serviceConfigId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
serviceConfigId_ = s;
return s;
}
}
/**
*
* Specifies which version of service configuration should be used to process
* the request. If unspecified or no matching version can be found, the latest
* one will be used.
*
*
* optional string service_config_id = 4;
*/
public com.google.protobuf.ByteString
getServiceConfigIdBytes() {
java.lang.Object ref = serviceConfigId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
serviceConfigId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getServiceNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessage.writeString(output, 1, serviceName_);
}
if (allocateOperation_ != null) {
output.writeMessage(2, getAllocateOperation());
}
if (allocationMode_ != com.google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode.UNSPECIFIED.getNumber()) {
output.writeEnum(3, allocationMode_);
}
if (!getServiceConfigIdBytes().isEmpty()) {
com.google.protobuf.GeneratedMessage.writeString(output, 4, serviceConfigId_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getServiceNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, serviceName_);
}
if (allocateOperation_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getAllocateOperation());
}
if (allocationMode_ != com.google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode.UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, allocationMode_);
}
if (!getServiceConfigIdBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(4, serviceConfigId_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.api.servicecontrol.v1.AllocateQuotaRequest)) {
return super.equals(obj);
}
com.google.api.servicecontrol.v1.AllocateQuotaRequest other = (com.google.api.servicecontrol.v1.AllocateQuotaRequest) obj;
boolean result = true;
result = result && getServiceName()
.equals(other.getServiceName());
result = result && (hasAllocateOperation() == other.hasAllocateOperation());
if (hasAllocateOperation()) {
result = result && getAllocateOperation()
.equals(other.getAllocateOperation());
}
result = result && allocationMode_ == other.allocationMode_;
result = result && getServiceConfigId()
.equals(other.getServiceConfigId());
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().hashCode();
hash = (37 * hash) + SERVICE_NAME_FIELD_NUMBER;
hash = (53 * hash) + getServiceName().hashCode();
if (hasAllocateOperation()) {
hash = (37 * hash) + ALLOCATE_OPERATION_FIELD_NUMBER;
hash = (53 * hash) + getAllocateOperation().hashCode();
}
hash = (37 * hash) + ALLOCATION_MODE_FIELD_NUMBER;
hash = (53 * hash) + allocationMode_;
hash = (37 * hash) + SERVICE_CONFIG_ID_FIELD_NUMBER;
hash = (53 * hash) + getServiceConfigId().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static com.google.api.servicecontrol.v1.AllocateQuotaRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.api.servicecontrol.v1.AllocateQuotaRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Request message for the AllocateQuota method.
*
*
* Protobuf type {@code google.api.servicecontrol.v1.AllocateQuotaRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.AllocateQuotaRequest)
com.google.api.servicecontrol.v1.AllocateQuotaRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.servicecontrol.v1.QuotaControllerProto.internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.servicecontrol.v1.QuotaControllerProto.internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.servicecontrol.v1.AllocateQuotaRequest.class, com.google.api.servicecontrol.v1.AllocateQuotaRequest.Builder.class);
}
// Construct using com.google.api.servicecontrol.v1.AllocateQuotaRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
serviceName_ = "";
if (allocateOperationBuilder_ == null) {
allocateOperation_ = null;
} else {
allocateOperation_ = null;
allocateOperationBuilder_ = null;
}
allocationMode_ = 0;
serviceConfigId_ = "";
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.api.servicecontrol.v1.QuotaControllerProto.internal_static_google_api_servicecontrol_v1_AllocateQuotaRequest_descriptor;
}
public com.google.api.servicecontrol.v1.AllocateQuotaRequest getDefaultInstanceForType() {
return com.google.api.servicecontrol.v1.AllocateQuotaRequest.getDefaultInstance();
}
public com.google.api.servicecontrol.v1.AllocateQuotaRequest build() {
com.google.api.servicecontrol.v1.AllocateQuotaRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.google.api.servicecontrol.v1.AllocateQuotaRequest buildPartial() {
com.google.api.servicecontrol.v1.AllocateQuotaRequest result = new com.google.api.servicecontrol.v1.AllocateQuotaRequest(this);
result.serviceName_ = serviceName_;
if (allocateOperationBuilder_ == null) {
result.allocateOperation_ = allocateOperation_;
} else {
result.allocateOperation_ = allocateOperationBuilder_.build();
}
result.allocationMode_ = allocationMode_;
result.serviceConfigId_ = serviceConfigId_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.api.servicecontrol.v1.AllocateQuotaRequest) {
return mergeFrom((com.google.api.servicecontrol.v1.AllocateQuotaRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.api.servicecontrol.v1.AllocateQuotaRequest other) {
if (other == com.google.api.servicecontrol.v1.AllocateQuotaRequest.getDefaultInstance()) return this;
if (!other.getServiceName().isEmpty()) {
serviceName_ = other.serviceName_;
onChanged();
}
if (other.hasAllocateOperation()) {
mergeAllocateOperation(other.getAllocateOperation());
}
if (other.allocationMode_ != 0) {
setAllocationModeValue(other.getAllocationModeValue());
}
if (!other.getServiceConfigId().isEmpty()) {
serviceConfigId_ = other.serviceConfigId_;
onChanged();
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.api.servicecontrol.v1.AllocateQuotaRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.api.servicecontrol.v1.AllocateQuotaRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object serviceName_ = "";
/**
*
* Name of the service as specified in the service configuration. For example,
* `"pubsub.googleapis.com"`.
* See [google.api.Service][] for the definition of a service name.
*
*
* optional string service_name = 1;
*/
public java.lang.String getServiceName() {
java.lang.Object ref = serviceName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
serviceName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Name of the service as specified in the service configuration. For example,
* `"pubsub.googleapis.com"`.
* See [google.api.Service][] for the definition of a service name.
*
*
* optional string service_name = 1;
*/
public com.google.protobuf.ByteString
getServiceNameBytes() {
java.lang.Object ref = serviceName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
serviceName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Name of the service as specified in the service configuration. For example,
* `"pubsub.googleapis.com"`.
* See [google.api.Service][] for the definition of a service name.
*
*
* optional string service_name = 1;
*/
public Builder setServiceName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
serviceName_ = value;
onChanged();
return this;
}
/**
*
* Name of the service as specified in the service configuration. For example,
* `"pubsub.googleapis.com"`.
* See [google.api.Service][] for the definition of a service name.
*
*
* optional string service_name = 1;
*/
public Builder clearServiceName() {
serviceName_ = getDefaultInstance().getServiceName();
onChanged();
return this;
}
/**
*
* Name of the service as specified in the service configuration. For example,
* `"pubsub.googleapis.com"`.
* See [google.api.Service][] for the definition of a service name.
*
*
* optional string service_name = 1;
*/
public Builder setServiceNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
serviceName_ = value;
onChanged();
return this;
}
private com.google.api.servicecontrol.v1.QuotaOperation allocateOperation_ = null;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.api.servicecontrol.v1.QuotaOperation, com.google.api.servicecontrol.v1.QuotaOperation.Builder, com.google.api.servicecontrol.v1.QuotaOperationOrBuilder> allocateOperationBuilder_;
/**
*
* Operation that describes the quota allocation.
*
*
* optional .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2;
*/
public boolean hasAllocateOperation() {
return allocateOperationBuilder_ != null || allocateOperation_ != null;
}
/**
*
* Operation that describes the quota allocation.
*
*
* optional .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2;
*/
public com.google.api.servicecontrol.v1.QuotaOperation getAllocateOperation() {
if (allocateOperationBuilder_ == null) {
return allocateOperation_ == null ? com.google.api.servicecontrol.v1.QuotaOperation.getDefaultInstance() : allocateOperation_;
} else {
return allocateOperationBuilder_.getMessage();
}
}
/**
*
* Operation that describes the quota allocation.
*
*
* optional .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2;
*/
public Builder setAllocateOperation(com.google.api.servicecontrol.v1.QuotaOperation value) {
if (allocateOperationBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
allocateOperation_ = value;
onChanged();
} else {
allocateOperationBuilder_.setMessage(value);
}
return this;
}
/**
*
* Operation that describes the quota allocation.
*
*
* optional .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2;
*/
public Builder setAllocateOperation(
com.google.api.servicecontrol.v1.QuotaOperation.Builder builderForValue) {
if (allocateOperationBuilder_ == null) {
allocateOperation_ = builderForValue.build();
onChanged();
} else {
allocateOperationBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Operation that describes the quota allocation.
*
*
* optional .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2;
*/
public Builder mergeAllocateOperation(com.google.api.servicecontrol.v1.QuotaOperation value) {
if (allocateOperationBuilder_ == null) {
if (allocateOperation_ != null) {
allocateOperation_ =
com.google.api.servicecontrol.v1.QuotaOperation.newBuilder(allocateOperation_).mergeFrom(value).buildPartial();
} else {
allocateOperation_ = value;
}
onChanged();
} else {
allocateOperationBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Operation that describes the quota allocation.
*
*
* optional .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2;
*/
public Builder clearAllocateOperation() {
if (allocateOperationBuilder_ == null) {
allocateOperation_ = null;
onChanged();
} else {
allocateOperation_ = null;
allocateOperationBuilder_ = null;
}
return this;
}
/**
*
* Operation that describes the quota allocation.
*
*
* optional .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2;
*/
public com.google.api.servicecontrol.v1.QuotaOperation.Builder getAllocateOperationBuilder() {
onChanged();
return getAllocateOperationFieldBuilder().getBuilder();
}
/**
*
* Operation that describes the quota allocation.
*
*
* optional .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2;
*/
public com.google.api.servicecontrol.v1.QuotaOperationOrBuilder getAllocateOperationOrBuilder() {
if (allocateOperationBuilder_ != null) {
return allocateOperationBuilder_.getMessageOrBuilder();
} else {
return allocateOperation_ == null ?
com.google.api.servicecontrol.v1.QuotaOperation.getDefaultInstance() : allocateOperation_;
}
}
/**
*
* Operation that describes the quota allocation.
*
*
* optional .google.api.servicecontrol.v1.QuotaOperation allocate_operation = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.api.servicecontrol.v1.QuotaOperation, com.google.api.servicecontrol.v1.QuotaOperation.Builder, com.google.api.servicecontrol.v1.QuotaOperationOrBuilder>
getAllocateOperationFieldBuilder() {
if (allocateOperationBuilder_ == null) {
allocateOperationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.api.servicecontrol.v1.QuotaOperation, com.google.api.servicecontrol.v1.QuotaOperation.Builder, com.google.api.servicecontrol.v1.QuotaOperationOrBuilder>(
getAllocateOperation(),
getParentForChildren(),
isClean());
allocateOperation_ = null;
}
return allocateOperationBuilder_;
}
private int allocationMode_ = 0;
/**
*
* Allocation mode for this operation.
* Deprecated: use QuotaMode inside the QuotaOperation.
*
*
* optional .google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode allocation_mode = 3 [deprecated = true];
*/
@java.lang.Deprecated public int getAllocationModeValue() {
return allocationMode_;
}
/**
*
* Allocation mode for this operation.
* Deprecated: use QuotaMode inside the QuotaOperation.
*
*
* optional .google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode allocation_mode = 3 [deprecated = true];
*/
@java.lang.Deprecated public Builder setAllocationModeValue(int value) {
allocationMode_ = value;
onChanged();
return this;
}
/**
*
* Allocation mode for this operation.
* Deprecated: use QuotaMode inside the QuotaOperation.
*
*
* optional .google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode allocation_mode = 3 [deprecated = true];
*/
@java.lang.Deprecated public com.google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode getAllocationMode() {
com.google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode result = com.google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode.valueOf(allocationMode_);
return result == null ? com.google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode.UNRECOGNIZED : result;
}
/**
*
* Allocation mode for this operation.
* Deprecated: use QuotaMode inside the QuotaOperation.
*
*
* optional .google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode allocation_mode = 3 [deprecated = true];
*/
@java.lang.Deprecated public Builder setAllocationMode(com.google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode value) {
if (value == null) {
throw new NullPointerException();
}
allocationMode_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Allocation mode for this operation.
* Deprecated: use QuotaMode inside the QuotaOperation.
*
*
* optional .google.api.servicecontrol.v1.AllocateQuotaRequest.AllocationMode allocation_mode = 3 [deprecated = true];
*/
@java.lang.Deprecated public Builder clearAllocationMode() {
allocationMode_ = 0;
onChanged();
return this;
}
private java.lang.Object serviceConfigId_ = "";
/**
*
* Specifies which version of service configuration should be used to process
* the request. If unspecified or no matching version can be found, the latest
* one will be used.
*
*
* optional string service_config_id = 4;
*/
public java.lang.String getServiceConfigId() {
java.lang.Object ref = serviceConfigId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
serviceConfigId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Specifies which version of service configuration should be used to process
* the request. If unspecified or no matching version can be found, the latest
* one will be used.
*
*
* optional string service_config_id = 4;
*/
public com.google.protobuf.ByteString
getServiceConfigIdBytes() {
java.lang.Object ref = serviceConfigId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
serviceConfigId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Specifies which version of service configuration should be used to process
* the request. If unspecified or no matching version can be found, the latest
* one will be used.
*
*
* optional string service_config_id = 4;
*/
public Builder setServiceConfigId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
serviceConfigId_ = value;
onChanged();
return this;
}
/**
*
* Specifies which version of service configuration should be used to process
* the request. If unspecified or no matching version can be found, the latest
* one will be used.
*
*
* optional string service_config_id = 4;
*/
public Builder clearServiceConfigId() {
serviceConfigId_ = getDefaultInstance().getServiceConfigId();
onChanged();
return this;
}
/**
*
* Specifies which version of service configuration should be used to process
* the request. If unspecified or no matching version can be found, the latest
* one will be used.
*
*
* optional string service_config_id = 4;
*/
public Builder setServiceConfigIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
serviceConfigId_ = value;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:google.api.servicecontrol.v1.AllocateQuotaRequest)
}
// @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.AllocateQuotaRequest)
private static final com.google.api.servicecontrol.v1.AllocateQuotaRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.AllocateQuotaRequest();
}
public static com.google.api.servicecontrol.v1.AllocateQuotaRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public AllocateQuotaRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new AllocateQuotaRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public com.google.api.servicecontrol.v1.AllocateQuotaRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy