com.google.api.Visibility Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grpc-core-proto Show documentation
Show all versions of grpc-core-proto Show documentation
GoogleAPI classes generated from core protos
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/visibility.proto
package com.google.api;
/**
* Protobuf type {@code google.api.Visibility}
*
*
* `Visibility` defines restrictions for the visibility of service
* elements. Restrictions are specified using visibility labels
* (e.g., TRUSTED_TESTER) that are elsewhere linked to users and projects.
* User and projects can have access to more than one visibility label. The
* effective visibility for multiple labels is the union of each label's
* elements, plus any unrestricted elements. You must list any supported label
* combinations in `label_combinations`.
* If an element and its parents have no restrictions, visibility is
* unconditionally granted.
* Example:
* visibility:
* label_combinations:
* - GOOGLE_INTERNAL, TRUSTED_TESTER
* rules:
* - selector: google.calendar.Calendar.EnhancedSearch
* restriction: TRUSTED_TESTER
* - selector: google.calendar.Calendar.Delegate
* restriction: GOOGLE_INTERNAL
* Here, all methods are publicly visible except for the restricted methods
* EnhancedSearch and Delegate. In addition, since `label_combinations`
* lists both GOOGLE_INTERNAL and TRUSTED_TESTER, users and projects can be
* given access to a combined visibility with both EnhancedSearch and Delegate.
*
*/
public final class Visibility extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:google.api.Visibility)
VisibilityOrBuilder {
// Use Visibility.newBuilder() to construct.
private Visibility(com.google.protobuf.GeneratedMessage.Builder> builder) {
super(builder);
}
private Visibility() {
rules_ = java.util.Collections.emptyList();
labelCombinations_ = com.google.protobuf.LazyStringArrayList.EMPTY;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private Visibility(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) {
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: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
rules_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
rules_.add(input.readMessage(com.google.api.VisibilityRule.parser(), extensionRegistry));
break;
}
case 18: {
String s = input.readStringRequireUtf8();
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
labelCombinations_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000002;
}
labelCombinations_.add(s);
break;
}
case 26: {
com.google.protobuf.BoolValue.Builder subBuilder = null;
if (enforceRuntimeVisibility_ != null) {
subBuilder = enforceRuntimeVisibility_.toBuilder();
}
enforceRuntimeVisibility_ = input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(enforceRuntimeVisibility_);
enforceRuntimeVisibility_ = subBuilder.buildPartial();
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw new RuntimeException(e.setUnfinishedMessage(this));
} catch (java.io.IOException e) {
throw new RuntimeException(
new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this));
} finally {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
rules_ = java.util.Collections.unmodifiableList(rules_);
}
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
labelCombinations_ = labelCombinations_.getUnmodifiableView();
}
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.VisibilityProto.internal_static_google_api_Visibility_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.VisibilityProto.internal_static_google_api_Visibility_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.Visibility.class, com.google.api.Visibility.Builder.class);
}
private int bitField0_;
public static final int RULES_FIELD_NUMBER = 1;
private java.util.List rules_;
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public java.util.List getRulesList() {
return rules_;
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public java.util.List extends com.google.api.VisibilityRuleOrBuilder>
getRulesOrBuilderList() {
return rules_;
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public int getRulesCount() {
return rules_.size();
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public com.google.api.VisibilityRule getRules(int index) {
return rules_.get(index);
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public com.google.api.VisibilityRuleOrBuilder getRulesOrBuilder(
int index) {
return rules_.get(index);
}
public static final int LABEL_COMBINATIONS_FIELD_NUMBER = 2;
private com.google.protobuf.LazyStringList labelCombinations_;
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public com.google.protobuf.ProtocolStringList
getLabelCombinationsList() {
return labelCombinations_;
}
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public int getLabelCombinationsCount() {
return labelCombinations_.size();
}
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public java.lang.String getLabelCombinations(int index) {
return labelCombinations_.get(index);
}
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public com.google.protobuf.ByteString
getLabelCombinationsBytes(int index) {
return labelCombinations_.getByteString(index);
}
public static final int ENFORCE_RUNTIME_VISIBILITY_FIELD_NUMBER = 3;
private com.google.protobuf.BoolValue enforceRuntimeVisibility_;
/**
* optional .google.protobuf.BoolValue enforce_runtime_visibility = 3;
*
*
* Controls whether visibility rules are enforced at runtime for requests to
* all APIs and methods.
* If true, requests without method visibility will receive a
* NOT_FOUND error, and any non-visible fields will be scrubbed from
* the response messages. The default is false.
* Note, the `enforce_runtime_visibility` specified in a visibility rule
* overrides this setting for the APIs or methods asscoiated with the rule.
*
*/
public boolean hasEnforceRuntimeVisibility() {
return enforceRuntimeVisibility_ != null;
}
/**
* optional .google.protobuf.BoolValue enforce_runtime_visibility = 3;
*
*
* Controls whether visibility rules are enforced at runtime for requests to
* all APIs and methods.
* If true, requests without method visibility will receive a
* NOT_FOUND error, and any non-visible fields will be scrubbed from
* the response messages. The default is false.
* Note, the `enforce_runtime_visibility` specified in a visibility rule
* overrides this setting for the APIs or methods asscoiated with the rule.
*
*/
public com.google.protobuf.BoolValue getEnforceRuntimeVisibility() {
return enforceRuntimeVisibility_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enforceRuntimeVisibility_;
}
/**
* optional .google.protobuf.BoolValue enforce_runtime_visibility = 3;
*
*
* Controls whether visibility rules are enforced at runtime for requests to
* all APIs and methods.
* If true, requests without method visibility will receive a
* NOT_FOUND error, and any non-visible fields will be scrubbed from
* the response messages. The default is false.
* Note, the `enforce_runtime_visibility` specified in a visibility rule
* overrides this setting for the APIs or methods asscoiated with the rule.
*
*/
public com.google.protobuf.BoolValueOrBuilder getEnforceRuntimeVisibilityOrBuilder() {
return getEnforceRuntimeVisibility();
}
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 {
for (int i = 0; i < rules_.size(); i++) {
output.writeMessage(1, rules_.get(i));
}
for (int i = 0; i < labelCombinations_.size(); i++) {
com.google.protobuf.GeneratedMessage.writeString(output, 2, labelCombinations_.getRaw(i));
}
if (enforceRuntimeVisibility_ != null) {
output.writeMessage(3, getEnforceRuntimeVisibility());
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < rules_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, rules_.get(i));
}
{
int dataSize = 0;
for (int i = 0; i < labelCombinations_.size(); i++) {
dataSize += computeStringSizeNoTag(labelCombinations_.getRaw(i));
}
size += dataSize;
size += 1 * getLabelCombinationsList().size();
}
if (enforceRuntimeVisibility_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, getEnforceRuntimeVisibility());
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
public static com.google.api.Visibility parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.Visibility 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.Visibility parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.Visibility parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.Visibility parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.google.api.Visibility parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static com.google.api.Visibility parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static com.google.api.Visibility parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static com.google.api.Visibility parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.google.api.Visibility parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.api.Visibility 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;
}
/**
* Protobuf type {@code google.api.Visibility}
*
*
* `Visibility` defines restrictions for the visibility of service
* elements. Restrictions are specified using visibility labels
* (e.g., TRUSTED_TESTER) that are elsewhere linked to users and projects.
* User and projects can have access to more than one visibility label. The
* effective visibility for multiple labels is the union of each label's
* elements, plus any unrestricted elements. You must list any supported label
* combinations in `label_combinations`.
* If an element and its parents have no restrictions, visibility is
* unconditionally granted.
* Example:
* visibility:
* label_combinations:
* - GOOGLE_INTERNAL, TRUSTED_TESTER
* rules:
* - selector: google.calendar.Calendar.EnhancedSearch
* restriction: TRUSTED_TESTER
* - selector: google.calendar.Calendar.Delegate
* restriction: GOOGLE_INTERNAL
* Here, all methods are publicly visible except for the restricted methods
* EnhancedSearch and Delegate. In addition, since `label_combinations`
* lists both GOOGLE_INTERNAL and TRUSTED_TESTER, users and projects can be
* given access to a combined visibility with both EnhancedSearch and Delegate.
*
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.Visibility)
com.google.api.VisibilityOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.VisibilityProto.internal_static_google_api_Visibility_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.VisibilityProto.internal_static_google_api_Visibility_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.Visibility.class, com.google.api.Visibility.Builder.class);
}
// Construct using com.google.api.Visibility.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getRulesFieldBuilder();
}
}
public Builder clear() {
super.clear();
if (rulesBuilder_ == null) {
rules_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
rulesBuilder_.clear();
}
labelCombinations_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
if (enforceRuntimeVisibilityBuilder_ == null) {
enforceRuntimeVisibility_ = null;
} else {
enforceRuntimeVisibility_ = null;
enforceRuntimeVisibilityBuilder_ = null;
}
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.api.VisibilityProto.internal_static_google_api_Visibility_descriptor;
}
public com.google.api.Visibility getDefaultInstanceForType() {
return com.google.api.Visibility.getDefaultInstance();
}
public com.google.api.Visibility build() {
com.google.api.Visibility result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.google.api.Visibility buildPartial() {
com.google.api.Visibility result = new com.google.api.Visibility(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (rulesBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001)) {
rules_ = java.util.Collections.unmodifiableList(rules_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.rules_ = rules_;
} else {
result.rules_ = rulesBuilder_.build();
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
labelCombinations_ = labelCombinations_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000002);
}
result.labelCombinations_ = labelCombinations_;
if (enforceRuntimeVisibilityBuilder_ == null) {
result.enforceRuntimeVisibility_ = enforceRuntimeVisibility_;
} else {
result.enforceRuntimeVisibility_ = enforceRuntimeVisibilityBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.api.Visibility) {
return mergeFrom((com.google.api.Visibility)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.api.Visibility other) {
if (other == com.google.api.Visibility.getDefaultInstance()) return this;
if (rulesBuilder_ == null) {
if (!other.rules_.isEmpty()) {
if (rules_.isEmpty()) {
rules_ = other.rules_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureRulesIsMutable();
rules_.addAll(other.rules_);
}
onChanged();
}
} else {
if (!other.rules_.isEmpty()) {
if (rulesBuilder_.isEmpty()) {
rulesBuilder_.dispose();
rulesBuilder_ = null;
rules_ = other.rules_;
bitField0_ = (bitField0_ & ~0x00000001);
rulesBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getRulesFieldBuilder() : null;
} else {
rulesBuilder_.addAllMessages(other.rules_);
}
}
}
if (!other.labelCombinations_.isEmpty()) {
if (labelCombinations_.isEmpty()) {
labelCombinations_ = other.labelCombinations_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureLabelCombinationsIsMutable();
labelCombinations_.addAll(other.labelCombinations_);
}
onChanged();
}
if (other.hasEnforceRuntimeVisibility()) {
mergeEnforceRuntimeVisibility(other.getEnforceRuntimeVisibility());
}
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.Visibility parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.api.Visibility) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List rules_ =
java.util.Collections.emptyList();
private void ensureRulesIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
rules_ = new java.util.ArrayList(rules_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
com.google.api.VisibilityRule, com.google.api.VisibilityRule.Builder, com.google.api.VisibilityRuleOrBuilder> rulesBuilder_;
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public java.util.List getRulesList() {
if (rulesBuilder_ == null) {
return java.util.Collections.unmodifiableList(rules_);
} else {
return rulesBuilder_.getMessageList();
}
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public int getRulesCount() {
if (rulesBuilder_ == null) {
return rules_.size();
} else {
return rulesBuilder_.getCount();
}
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public com.google.api.VisibilityRule getRules(int index) {
if (rulesBuilder_ == null) {
return rules_.get(index);
} else {
return rulesBuilder_.getMessage(index);
}
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public Builder setRules(
int index, com.google.api.VisibilityRule value) {
if (rulesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureRulesIsMutable();
rules_.set(index, value);
onChanged();
} else {
rulesBuilder_.setMessage(index, value);
}
return this;
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public Builder setRules(
int index, com.google.api.VisibilityRule.Builder builderForValue) {
if (rulesBuilder_ == null) {
ensureRulesIsMutable();
rules_.set(index, builderForValue.build());
onChanged();
} else {
rulesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public Builder addRules(com.google.api.VisibilityRule value) {
if (rulesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureRulesIsMutable();
rules_.add(value);
onChanged();
} else {
rulesBuilder_.addMessage(value);
}
return this;
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public Builder addRules(
int index, com.google.api.VisibilityRule value) {
if (rulesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureRulesIsMutable();
rules_.add(index, value);
onChanged();
} else {
rulesBuilder_.addMessage(index, value);
}
return this;
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public Builder addRules(
com.google.api.VisibilityRule.Builder builderForValue) {
if (rulesBuilder_ == null) {
ensureRulesIsMutable();
rules_.add(builderForValue.build());
onChanged();
} else {
rulesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public Builder addRules(
int index, com.google.api.VisibilityRule.Builder builderForValue) {
if (rulesBuilder_ == null) {
ensureRulesIsMutable();
rules_.add(index, builderForValue.build());
onChanged();
} else {
rulesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public Builder addAllRules(
java.lang.Iterable extends com.google.api.VisibilityRule> values) {
if (rulesBuilder_ == null) {
ensureRulesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, rules_);
onChanged();
} else {
rulesBuilder_.addAllMessages(values);
}
return this;
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public Builder clearRules() {
if (rulesBuilder_ == null) {
rules_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
rulesBuilder_.clear();
}
return this;
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public Builder removeRules(int index) {
if (rulesBuilder_ == null) {
ensureRulesIsMutable();
rules_.remove(index);
onChanged();
} else {
rulesBuilder_.remove(index);
}
return this;
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public com.google.api.VisibilityRule.Builder getRulesBuilder(
int index) {
return getRulesFieldBuilder().getBuilder(index);
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public com.google.api.VisibilityRuleOrBuilder getRulesOrBuilder(
int index) {
if (rulesBuilder_ == null) {
return rules_.get(index); } else {
return rulesBuilder_.getMessageOrBuilder(index);
}
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public java.util.List extends com.google.api.VisibilityRuleOrBuilder>
getRulesOrBuilderList() {
if (rulesBuilder_ != null) {
return rulesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(rules_);
}
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public com.google.api.VisibilityRule.Builder addRulesBuilder() {
return getRulesFieldBuilder().addBuilder(
com.google.api.VisibilityRule.getDefaultInstance());
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public com.google.api.VisibilityRule.Builder addRulesBuilder(
int index) {
return getRulesFieldBuilder().addBuilder(
index, com.google.api.VisibilityRule.getDefaultInstance());
}
/**
* repeated .google.api.VisibilityRule rules = 1;
*
*
* A list of visibility rules providing visibility configuration for
* individual API elements.
*
*/
public java.util.List
getRulesBuilderList() {
return getRulesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
com.google.api.VisibilityRule, com.google.api.VisibilityRule.Builder, com.google.api.VisibilityRuleOrBuilder>
getRulesFieldBuilder() {
if (rulesBuilder_ == null) {
rulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
com.google.api.VisibilityRule, com.google.api.VisibilityRule.Builder, com.google.api.VisibilityRuleOrBuilder>(
rules_,
((bitField0_ & 0x00000001) == 0x00000001),
getParentForChildren(),
isClean());
rules_ = null;
}
return rulesBuilder_;
}
private com.google.protobuf.LazyStringList labelCombinations_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureLabelCombinationsIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
labelCombinations_ = new com.google.protobuf.LazyStringArrayList(labelCombinations_);
bitField0_ |= 0x00000002;
}
}
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public com.google.protobuf.ProtocolStringList
getLabelCombinationsList() {
return labelCombinations_.getUnmodifiableView();
}
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public int getLabelCombinationsCount() {
return labelCombinations_.size();
}
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public java.lang.String getLabelCombinations(int index) {
return labelCombinations_.get(index);
}
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public com.google.protobuf.ByteString
getLabelCombinationsBytes(int index) {
return labelCombinations_.getByteString(index);
}
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public Builder setLabelCombinations(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelCombinationsIsMutable();
labelCombinations_.set(index, value);
onChanged();
return this;
}
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public Builder addLabelCombinations(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelCombinationsIsMutable();
labelCombinations_.add(value);
onChanged();
return this;
}
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public Builder addAllLabelCombinations(
java.lang.Iterable values) {
ensureLabelCombinationsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, labelCombinations_);
onChanged();
return this;
}
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public Builder clearLabelCombinations() {
labelCombinations_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
* repeated string label_combinations = 2;
*
*
* Lists valid label combinations for this service in comma-delimited form.
* This lets users and projects see the union of these labels' elements.
* Removing a label combination can be a breaking change, as clients with
* access to the combination will now see non-restricted elements only.
*
*/
public Builder addLabelCombinationsBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureLabelCombinationsIsMutable();
labelCombinations_.add(value);
onChanged();
return this;
}
private com.google.protobuf.BoolValue enforceRuntimeVisibility_ = null;
private com.google.protobuf.SingleFieldBuilder<
com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> enforceRuntimeVisibilityBuilder_;
/**
* optional .google.protobuf.BoolValue enforce_runtime_visibility = 3;
*
*
* Controls whether visibility rules are enforced at runtime for requests to
* all APIs and methods.
* If true, requests without method visibility will receive a
* NOT_FOUND error, and any non-visible fields will be scrubbed from
* the response messages. The default is false.
* Note, the `enforce_runtime_visibility` specified in a visibility rule
* overrides this setting for the APIs or methods asscoiated with the rule.
*
*/
public boolean hasEnforceRuntimeVisibility() {
return enforceRuntimeVisibilityBuilder_ != null || enforceRuntimeVisibility_ != null;
}
/**
* optional .google.protobuf.BoolValue enforce_runtime_visibility = 3;
*
*
* Controls whether visibility rules are enforced at runtime for requests to
* all APIs and methods.
* If true, requests without method visibility will receive a
* NOT_FOUND error, and any non-visible fields will be scrubbed from
* the response messages. The default is false.
* Note, the `enforce_runtime_visibility` specified in a visibility rule
* overrides this setting for the APIs or methods asscoiated with the rule.
*
*/
public com.google.protobuf.BoolValue getEnforceRuntimeVisibility() {
if (enforceRuntimeVisibilityBuilder_ == null) {
return enforceRuntimeVisibility_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enforceRuntimeVisibility_;
} else {
return enforceRuntimeVisibilityBuilder_.getMessage();
}
}
/**
* optional .google.protobuf.BoolValue enforce_runtime_visibility = 3;
*
*
* Controls whether visibility rules are enforced at runtime for requests to
* all APIs and methods.
* If true, requests without method visibility will receive a
* NOT_FOUND error, and any non-visible fields will be scrubbed from
* the response messages. The default is false.
* Note, the `enforce_runtime_visibility` specified in a visibility rule
* overrides this setting for the APIs or methods asscoiated with the rule.
*
*/
public Builder setEnforceRuntimeVisibility(com.google.protobuf.BoolValue value) {
if (enforceRuntimeVisibilityBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
enforceRuntimeVisibility_ = value;
onChanged();
} else {
enforceRuntimeVisibilityBuilder_.setMessage(value);
}
return this;
}
/**
* optional .google.protobuf.BoolValue enforce_runtime_visibility = 3;
*
*
* Controls whether visibility rules are enforced at runtime for requests to
* all APIs and methods.
* If true, requests without method visibility will receive a
* NOT_FOUND error, and any non-visible fields will be scrubbed from
* the response messages. The default is false.
* Note, the `enforce_runtime_visibility` specified in a visibility rule
* overrides this setting for the APIs or methods asscoiated with the rule.
*
*/
public Builder setEnforceRuntimeVisibility(
com.google.protobuf.BoolValue.Builder builderForValue) {
if (enforceRuntimeVisibilityBuilder_ == null) {
enforceRuntimeVisibility_ = builderForValue.build();
onChanged();
} else {
enforceRuntimeVisibilityBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* optional .google.protobuf.BoolValue enforce_runtime_visibility = 3;
*
*
* Controls whether visibility rules are enforced at runtime for requests to
* all APIs and methods.
* If true, requests without method visibility will receive a
* NOT_FOUND error, and any non-visible fields will be scrubbed from
* the response messages. The default is false.
* Note, the `enforce_runtime_visibility` specified in a visibility rule
* overrides this setting for the APIs or methods asscoiated with the rule.
*
*/
public Builder mergeEnforceRuntimeVisibility(com.google.protobuf.BoolValue value) {
if (enforceRuntimeVisibilityBuilder_ == null) {
if (enforceRuntimeVisibility_ != null) {
enforceRuntimeVisibility_ =
com.google.protobuf.BoolValue.newBuilder(enforceRuntimeVisibility_).mergeFrom(value).buildPartial();
} else {
enforceRuntimeVisibility_ = value;
}
onChanged();
} else {
enforceRuntimeVisibilityBuilder_.mergeFrom(value);
}
return this;
}
/**
* optional .google.protobuf.BoolValue enforce_runtime_visibility = 3;
*
*
* Controls whether visibility rules are enforced at runtime for requests to
* all APIs and methods.
* If true, requests without method visibility will receive a
* NOT_FOUND error, and any non-visible fields will be scrubbed from
* the response messages. The default is false.
* Note, the `enforce_runtime_visibility` specified in a visibility rule
* overrides this setting for the APIs or methods asscoiated with the rule.
*
*/
public Builder clearEnforceRuntimeVisibility() {
if (enforceRuntimeVisibilityBuilder_ == null) {
enforceRuntimeVisibility_ = null;
onChanged();
} else {
enforceRuntimeVisibility_ = null;
enforceRuntimeVisibilityBuilder_ = null;
}
return this;
}
/**
* optional .google.protobuf.BoolValue enforce_runtime_visibility = 3;
*
*
* Controls whether visibility rules are enforced at runtime for requests to
* all APIs and methods.
* If true, requests without method visibility will receive a
* NOT_FOUND error, and any non-visible fields will be scrubbed from
* the response messages. The default is false.
* Note, the `enforce_runtime_visibility` specified in a visibility rule
* overrides this setting for the APIs or methods asscoiated with the rule.
*
*/
public com.google.protobuf.BoolValue.Builder getEnforceRuntimeVisibilityBuilder() {
onChanged();
return getEnforceRuntimeVisibilityFieldBuilder().getBuilder();
}
/**
* optional .google.protobuf.BoolValue enforce_runtime_visibility = 3;
*
*
* Controls whether visibility rules are enforced at runtime for requests to
* all APIs and methods.
* If true, requests without method visibility will receive a
* NOT_FOUND error, and any non-visible fields will be scrubbed from
* the response messages. The default is false.
* Note, the `enforce_runtime_visibility` specified in a visibility rule
* overrides this setting for the APIs or methods asscoiated with the rule.
*
*/
public com.google.protobuf.BoolValueOrBuilder getEnforceRuntimeVisibilityOrBuilder() {
if (enforceRuntimeVisibilityBuilder_ != null) {
return enforceRuntimeVisibilityBuilder_.getMessageOrBuilder();
} else {
return enforceRuntimeVisibility_ == null ?
com.google.protobuf.BoolValue.getDefaultInstance() : enforceRuntimeVisibility_;
}
}
/**
* optional .google.protobuf.BoolValue enforce_runtime_visibility = 3;
*
*
* Controls whether visibility rules are enforced at runtime for requests to
* all APIs and methods.
* If true, requests without method visibility will receive a
* NOT_FOUND error, and any non-visible fields will be scrubbed from
* the response messages. The default is false.
* Note, the `enforce_runtime_visibility` specified in a visibility rule
* overrides this setting for the APIs or methods asscoiated with the rule.
*
*/
private com.google.protobuf.SingleFieldBuilder<
com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder>
getEnforceRuntimeVisibilityFieldBuilder() {
if (enforceRuntimeVisibilityBuilder_ == null) {
enforceRuntimeVisibilityBuilder_ = new com.google.protobuf.SingleFieldBuilder<
com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder>(
getEnforceRuntimeVisibility(),
getParentForChildren(),
isClean());
enforceRuntimeVisibility_ = null;
}
return enforceRuntimeVisibilityBuilder_;
}
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.Visibility)
}
// @@protoc_insertion_point(class_scope:google.api.Visibility)
private static final com.google.api.Visibility DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.api.Visibility();
}
public static com.google.api.Visibility getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public Visibility parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
try {
return new Visibility(input, extensionRegistry);
} catch (RuntimeException e) {
if (e.getCause() instanceof
com.google.protobuf.InvalidProtocolBufferException) {
throw (com.google.protobuf.InvalidProtocolBufferException)
e.getCause();
}
throw e;
}
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public com.google.api.Visibility getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}