implements
// @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p2beta1.Asset)
com.google.cloud.asset.v1p2beta1.AssetOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.asset.v1p2beta1.AssetProto
.internal_static_google_cloud_asset_v1p2beta1_Asset_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.asset.v1p2beta1.AssetProto
.internal_static_google_cloud_asset_v1p2beta1_Asset_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.asset.v1p2beta1.Asset.class,
com.google.cloud.asset.v1p2beta1.Asset.Builder.class);
}
// Construct using com.google.cloud.asset.v1p2beta1.Asset.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getResourceFieldBuilder();
getIamPolicyFieldBuilder();
getOrgPolicyFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
name_ = "";
assetType_ = "";
resource_ = null;
if (resourceBuilder_ != null) {
resourceBuilder_.dispose();
resourceBuilder_ = null;
}
iamPolicy_ = null;
if (iamPolicyBuilder_ != null) {
iamPolicyBuilder_.dispose();
iamPolicyBuilder_ = null;
}
ancestors_ = com.google.protobuf.LazyStringArrayList.emptyList();
if (accessPolicyBuilder_ != null) {
accessPolicyBuilder_.clear();
}
if (accessLevelBuilder_ != null) {
accessLevelBuilder_.clear();
}
if (servicePerimeterBuilder_ != null) {
servicePerimeterBuilder_.clear();
}
if (orgPolicyBuilder_ == null) {
orgPolicy_ = java.util.Collections.emptyList();
} else {
orgPolicy_ = null;
orgPolicyBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000100);
accessContextPolicyCase_ = 0;
accessContextPolicy_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.asset.v1p2beta1.AssetProto
.internal_static_google_cloud_asset_v1p2beta1_Asset_descriptor;
}
@java.lang.Override
public com.google.cloud.asset.v1p2beta1.Asset getDefaultInstanceForType() {
return com.google.cloud.asset.v1p2beta1.Asset.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.asset.v1p2beta1.Asset build() {
com.google.cloud.asset.v1p2beta1.Asset result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.asset.v1p2beta1.Asset buildPartial() {
com.google.cloud.asset.v1p2beta1.Asset result =
new com.google.cloud.asset.v1p2beta1.Asset(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartialRepeatedFields(com.google.cloud.asset.v1p2beta1.Asset result) {
if (orgPolicyBuilder_ == null) {
if (((bitField0_ & 0x00000100) != 0)) {
orgPolicy_ = java.util.Collections.unmodifiableList(orgPolicy_);
bitField0_ = (bitField0_ & ~0x00000100);
}
result.orgPolicy_ = orgPolicy_;
} else {
result.orgPolicy_ = orgPolicyBuilder_.build();
}
}
private void buildPartial0(com.google.cloud.asset.v1p2beta1.Asset result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.name_ = name_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.assetType_ = assetType_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000004) != 0)) {
result.resource_ = resourceBuilder_ == null ? resource_ : resourceBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.iamPolicy_ = iamPolicyBuilder_ == null ? iamPolicy_ : iamPolicyBuilder_.build();
to_bitField0_ |= 0x00000002;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
ancestors_.makeImmutable();
result.ancestors_ = ancestors_;
}
result.bitField0_ |= to_bitField0_;
}
private void buildPartialOneofs(com.google.cloud.asset.v1p2beta1.Asset result) {
result.accessContextPolicyCase_ = accessContextPolicyCase_;
result.accessContextPolicy_ = this.accessContextPolicy_;
if (accessContextPolicyCase_ == 7 && accessPolicyBuilder_ != null) {
result.accessContextPolicy_ = accessPolicyBuilder_.build();
}
if (accessContextPolicyCase_ == 8 && accessLevelBuilder_ != null) {
result.accessContextPolicy_ = accessLevelBuilder_.build();
}
if (accessContextPolicyCase_ == 9 && servicePerimeterBuilder_ != null) {
result.accessContextPolicy_ = servicePerimeterBuilder_.build();
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.asset.v1p2beta1.Asset) {
return mergeFrom((com.google.cloud.asset.v1p2beta1.Asset) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.asset.v1p2beta1.Asset other) {
if (other == com.google.cloud.asset.v1p2beta1.Asset.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getAssetType().isEmpty()) {
assetType_ = other.assetType_;
bitField0_ |= 0x00000002;
onChanged();
}
if (other.hasResource()) {
mergeResource(other.getResource());
}
if (other.hasIamPolicy()) {
mergeIamPolicy(other.getIamPolicy());
}
if (!other.ancestors_.isEmpty()) {
if (ancestors_.isEmpty()) {
ancestors_ = other.ancestors_;
bitField0_ |= 0x00000010;
} else {
ensureAncestorsIsMutable();
ancestors_.addAll(other.ancestors_);
}
onChanged();
}
if (orgPolicyBuilder_ == null) {
if (!other.orgPolicy_.isEmpty()) {
if (orgPolicy_.isEmpty()) {
orgPolicy_ = other.orgPolicy_;
bitField0_ = (bitField0_ & ~0x00000100);
} else {
ensureOrgPolicyIsMutable();
orgPolicy_.addAll(other.orgPolicy_);
}
onChanged();
}
} else {
if (!other.orgPolicy_.isEmpty()) {
if (orgPolicyBuilder_.isEmpty()) {
orgPolicyBuilder_.dispose();
orgPolicyBuilder_ = null;
orgPolicy_ = other.orgPolicy_;
bitField0_ = (bitField0_ & ~0x00000100);
orgPolicyBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getOrgPolicyFieldBuilder()
: null;
} else {
orgPolicyBuilder_.addAllMessages(other.orgPolicy_);
}
}
}
switch (other.getAccessContextPolicyCase()) {
case ACCESS_POLICY:
{
mergeAccessPolicy(other.getAccessPolicy());
break;
}
case ACCESS_LEVEL:
{
mergeAccessLevel(other.getAccessLevel());
break;
}
case SERVICE_PERIMETER:
{
mergeServicePerimeter(other.getServicePerimeter());
break;
}
case ACCESSCONTEXTPOLICY_NOT_SET:
{
break;
}
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
name_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
assetType_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 26:
{
input.readMessage(getResourceFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000004;
break;
} // case 26
case 34:
{
input.readMessage(getIamPolicyFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000008;
break;
} // case 34
case 50:
{
java.lang.String s = input.readStringRequireUtf8();
ensureAncestorsIsMutable();
ancestors_.add(s);
break;
} // case 50
case 58:
{
input.readMessage(getAccessPolicyFieldBuilder().getBuilder(), extensionRegistry);
accessContextPolicyCase_ = 7;
break;
} // case 58
case 66:
{
input.readMessage(getAccessLevelFieldBuilder().getBuilder(), extensionRegistry);
accessContextPolicyCase_ = 8;
break;
} // case 66
case 74:
{
input.readMessage(
getServicePerimeterFieldBuilder().getBuilder(), extensionRegistry);
accessContextPolicyCase_ = 9;
break;
} // case 74
case 82:
{
com.google.cloud.orgpolicy.v1.Policy m =
input.readMessage(
com.google.cloud.orgpolicy.v1.Policy.parser(), extensionRegistry);
if (orgPolicyBuilder_ == null) {
ensureOrgPolicyIsMutable();
orgPolicy_.add(m);
} else {
orgPolicyBuilder_.addMessage(m);
}
break;
} // case 82
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int accessContextPolicyCase_ = 0;
private java.lang.Object accessContextPolicy_;
public AccessContextPolicyCase getAccessContextPolicyCase() {
return AccessContextPolicyCase.forNumber(accessContextPolicyCase_);
}
public Builder clearAccessContextPolicy() {
accessContextPolicyCase_ = 0;
accessContextPolicy_ = null;
onChanged();
return this;
}
private int bitField0_;
private java.lang.Object name_ = "";
/**
*
*
*
* The full name of the asset. Example:
* `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
*
* See [Resource
* names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
* for more information.
*
*
* string name = 1;
*
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The full name of the asset. Example:
* `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
*
* See [Resource
* names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
* for more information.
*
*
* string name = 1;
*
* @return The bytes for name.
*/
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The full name of the asset. Example:
* `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
*
* See [Resource
* names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
* for more information.
*
*
* string name = 1;
*
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* The full name of the asset. Example:
* `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
*
* See [Resource
* names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
* for more information.
*
*
* string name = 1;
*
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* The full name of the asset. Example:
* `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
*
* See [Resource
* names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
* for more information.
*
*
* string name = 1;
*
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object assetType_ = "";
/**
*
*
*
* The type of the asset. Example: `compute.googleapis.com/Disk`
*
* See [Supported asset
* types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
* for more information.
*
*
* string asset_type = 2;
*
* @return The assetType.
*/
public java.lang.String getAssetType() {
java.lang.Object ref = assetType_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
assetType_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The type of the asset. Example: `compute.googleapis.com/Disk`
*
* See [Supported asset
* types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
* for more information.
*
*
* string asset_type = 2;
*
* @return The bytes for assetType.
*/
public com.google.protobuf.ByteString getAssetTypeBytes() {
java.lang.Object ref = assetType_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
assetType_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The type of the asset. Example: `compute.googleapis.com/Disk`
*
* See [Supported asset
* types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
* for more information.
*
*
* string asset_type = 2;
*
* @param value The assetType to set.
* @return This builder for chaining.
*/
public Builder setAssetType(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
assetType_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* The type of the asset. Example: `compute.googleapis.com/Disk`
*
* See [Supported asset
* types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
* for more information.
*
*
* string asset_type = 2;
*
* @return This builder for chaining.
*/
public Builder clearAssetType() {
assetType_ = getDefaultInstance().getAssetType();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
*
*
* The type of the asset. Example: `compute.googleapis.com/Disk`
*
* See [Supported asset
* types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
* for more information.
*
*
* string asset_type = 2;
*
* @param value The bytes for assetType to set.
* @return This builder for chaining.
*/
public Builder setAssetTypeBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
assetType_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private com.google.cloud.asset.v1p2beta1.Resource resource_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.asset.v1p2beta1.Resource,
com.google.cloud.asset.v1p2beta1.Resource.Builder,
com.google.cloud.asset.v1p2beta1.ResourceOrBuilder>
resourceBuilder_;
/**
*
*
*
* A representation of the resource.
*
*
* .google.cloud.asset.v1p2beta1.Resource resource = 3;
*
* @return Whether the resource field is set.
*/
public boolean hasResource() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
*
*
* A representation of the resource.
*
*
* .google.cloud.asset.v1p2beta1.Resource resource = 3;
*
* @return The resource.
*/
public com.google.cloud.asset.v1p2beta1.Resource getResource() {
if (resourceBuilder_ == null) {
return resource_ == null
? com.google.cloud.asset.v1p2beta1.Resource.getDefaultInstance()
: resource_;
} else {
return resourceBuilder_.getMessage();
}
}
/**
*
*
*
* A representation of the resource.
*
*
* .google.cloud.asset.v1p2beta1.Resource resource = 3;
*/
public Builder setResource(com.google.cloud.asset.v1p2beta1.Resource value) {
if (resourceBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
resource_ = value;
} else {
resourceBuilder_.setMessage(value);
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* A representation of the resource.
*
*
* .google.cloud.asset.v1p2beta1.Resource resource = 3;
*/
public Builder setResource(com.google.cloud.asset.v1p2beta1.Resource.Builder builderForValue) {
if (resourceBuilder_ == null) {
resource_ = builderForValue.build();
} else {
resourceBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* A representation of the resource.
*
*
* .google.cloud.asset.v1p2beta1.Resource resource = 3;
*/
public Builder mergeResource(com.google.cloud.asset.v1p2beta1.Resource value) {
if (resourceBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)
&& resource_ != null
&& resource_ != com.google.cloud.asset.v1p2beta1.Resource.getDefaultInstance()) {
getResourceBuilder().mergeFrom(value);
} else {
resource_ = value;
}
} else {
resourceBuilder_.mergeFrom(value);
}
if (resource_ != null) {
bitField0_ |= 0x00000004;
onChanged();
}
return this;
}
/**
*
*
*
* A representation of the resource.
*
*
* .google.cloud.asset.v1p2beta1.Resource resource = 3;
*/
public Builder clearResource() {
bitField0_ = (bitField0_ & ~0x00000004);
resource_ = null;
if (resourceBuilder_ != null) {
resourceBuilder_.dispose();
resourceBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* A representation of the resource.
*
*
* .google.cloud.asset.v1p2beta1.Resource resource = 3;
*/
public com.google.cloud.asset.v1p2beta1.Resource.Builder getResourceBuilder() {
bitField0_ |= 0x00000004;
onChanged();
return getResourceFieldBuilder().getBuilder();
}
/**
*
*
*
* A representation of the resource.
*
*
* .google.cloud.asset.v1p2beta1.Resource resource = 3;
*/
public com.google.cloud.asset.v1p2beta1.ResourceOrBuilder getResourceOrBuilder() {
if (resourceBuilder_ != null) {
return resourceBuilder_.getMessageOrBuilder();
} else {
return resource_ == null
? com.google.cloud.asset.v1p2beta1.Resource.getDefaultInstance()
: resource_;
}
}
/**
*
*
*
* A representation of the resource.
*
*
* .google.cloud.asset.v1p2beta1.Resource resource = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.asset.v1p2beta1.Resource,
com.google.cloud.asset.v1p2beta1.Resource.Builder,
com.google.cloud.asset.v1p2beta1.ResourceOrBuilder>
getResourceFieldBuilder() {
if (resourceBuilder_ == null) {
resourceBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.asset.v1p2beta1.Resource,
com.google.cloud.asset.v1p2beta1.Resource.Builder,
com.google.cloud.asset.v1p2beta1.ResourceOrBuilder>(
getResource(), getParentForChildren(), isClean());
resource_ = null;
}
return resourceBuilder_;
}
private com.google.iam.v1.Policy iamPolicy_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.iam.v1.Policy,
com.google.iam.v1.Policy.Builder,
com.google.iam.v1.PolicyOrBuilder>
iamPolicyBuilder_;
/**
*
*
*
* A representation of the IAM policy set on a Google Cloud resource.
* There can be a maximum of one IAM policy set on any given resource.
* In addition, IAM policies inherit their granted access scope from any
* policies set on parent resources in the resource hierarchy. Therefore, the
* effectively policy is the union of both the policy set on this resource
* and each policy set on all of the resource's ancestry resource levels in
* the hierarchy. See
* [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance)
* for more information.
*
*
* .google.iam.v1.Policy iam_policy = 4;
*
* @return Whether the iamPolicy field is set.
*/
public boolean hasIamPolicy() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
*
*
*
* A representation of the IAM policy set on a Google Cloud resource.
* There can be a maximum of one IAM policy set on any given resource.
* In addition, IAM policies inherit their granted access scope from any
* policies set on parent resources in the resource hierarchy. Therefore, the
* effectively policy is the union of both the policy set on this resource
* and each policy set on all of the resource's ancestry resource levels in
* the hierarchy. See
* [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance)
* for more information.
*
*
* .google.iam.v1.Policy iam_policy = 4;
*
* @return The iamPolicy.
*/
public com.google.iam.v1.Policy getIamPolicy() {
if (iamPolicyBuilder_ == null) {
return iamPolicy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : iamPolicy_;
} else {
return iamPolicyBuilder_.getMessage();
}
}
/**
*
*
*
* A representation of the IAM policy set on a Google Cloud resource.
* There can be a maximum of one IAM policy set on any given resource.
* In addition, IAM policies inherit their granted access scope from any
* policies set on parent resources in the resource hierarchy. Therefore, the
* effectively policy is the union of both the policy set on this resource
* and each policy set on all of the resource's ancestry resource levels in
* the hierarchy. See
* [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance)
* for more information.
*
*
* .google.iam.v1.Policy iam_policy = 4;
*/
public Builder setIamPolicy(com.google.iam.v1.Policy value) {
if (iamPolicyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
iamPolicy_ = value;
} else {
iamPolicyBuilder_.setMessage(value);
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
*
* A representation of the IAM policy set on a Google Cloud resource.
* There can be a maximum of one IAM policy set on any given resource.
* In addition, IAM policies inherit their granted access scope from any
* policies set on parent resources in the resource hierarchy. Therefore, the
* effectively policy is the union of both the policy set on this resource
* and each policy set on all of the resource's ancestry resource levels in
* the hierarchy. See
* [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance)
* for more information.
*
*
* .google.iam.v1.Policy iam_policy = 4;
*/
public Builder setIamPolicy(com.google.iam.v1.Policy.Builder builderForValue) {
if (iamPolicyBuilder_ == null) {
iamPolicy_ = builderForValue.build();
} else {
iamPolicyBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
*
* A representation of the IAM policy set on a Google Cloud resource.
* There can be a maximum of one IAM policy set on any given resource.
* In addition, IAM policies inherit their granted access scope from any
* policies set on parent resources in the resource hierarchy. Therefore, the
* effectively policy is the union of both the policy set on this resource
* and each policy set on all of the resource's ancestry resource levels in
* the hierarchy. See
* [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance)
* for more information.
*
*
* .google.iam.v1.Policy iam_policy = 4;
*/
public Builder mergeIamPolicy(com.google.iam.v1.Policy value) {
if (iamPolicyBuilder_ == null) {
if (((bitField0_ & 0x00000008) != 0)
&& iamPolicy_ != null
&& iamPolicy_ != com.google.iam.v1.Policy.getDefaultInstance()) {
getIamPolicyBuilder().mergeFrom(value);
} else {
iamPolicy_ = value;
}
} else {
iamPolicyBuilder_.mergeFrom(value);
}
if (iamPolicy_ != null) {
bitField0_ |= 0x00000008;
onChanged();
}
return this;
}
/**
*
*
*
* A representation of the IAM policy set on a Google Cloud resource.
* There can be a maximum of one IAM policy set on any given resource.
* In addition, IAM policies inherit their granted access scope from any
* policies set on parent resources in the resource hierarchy. Therefore, the
* effectively policy is the union of both the policy set on this resource
* and each policy set on all of the resource's ancestry resource levels in
* the hierarchy. See
* [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance)
* for more information.
*
*
* .google.iam.v1.Policy iam_policy = 4;
*/
public Builder clearIamPolicy() {
bitField0_ = (bitField0_ & ~0x00000008);
iamPolicy_ = null;
if (iamPolicyBuilder_ != null) {
iamPolicyBuilder_.dispose();
iamPolicyBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* A representation of the IAM policy set on a Google Cloud resource.
* There can be a maximum of one IAM policy set on any given resource.
* In addition, IAM policies inherit their granted access scope from any
* policies set on parent resources in the resource hierarchy. Therefore, the
* effectively policy is the union of both the policy set on this resource
* and each policy set on all of the resource's ancestry resource levels in
* the hierarchy. See
* [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance)
* for more information.
*
*
* .google.iam.v1.Policy iam_policy = 4;
*/
public com.google.iam.v1.Policy.Builder getIamPolicyBuilder() {
bitField0_ |= 0x00000008;
onChanged();
return getIamPolicyFieldBuilder().getBuilder();
}
/**
*
*
*
* A representation of the IAM policy set on a Google Cloud resource.
* There can be a maximum of one IAM policy set on any given resource.
* In addition, IAM policies inherit their granted access scope from any
* policies set on parent resources in the resource hierarchy. Therefore, the
* effectively policy is the union of both the policy set on this resource
* and each policy set on all of the resource's ancestry resource levels in
* the hierarchy. See
* [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance)
* for more information.
*
*
* .google.iam.v1.Policy iam_policy = 4;
*/
public com.google.iam.v1.PolicyOrBuilder getIamPolicyOrBuilder() {
if (iamPolicyBuilder_ != null) {
return iamPolicyBuilder_.getMessageOrBuilder();
} else {
return iamPolicy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : iamPolicy_;
}
}
/**
*
*
*
* A representation of the IAM policy set on a Google Cloud resource.
* There can be a maximum of one IAM policy set on any given resource.
* In addition, IAM policies inherit their granted access scope from any
* policies set on parent resources in the resource hierarchy. Therefore, the
* effectively policy is the union of both the policy set on this resource
* and each policy set on all of the resource's ancestry resource levels in
* the hierarchy. See
* [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance)
* for more information.
*
*
* .google.iam.v1.Policy iam_policy = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.iam.v1.Policy,
com.google.iam.v1.Policy.Builder,
com.google.iam.v1.PolicyOrBuilder>
getIamPolicyFieldBuilder() {
if (iamPolicyBuilder_ == null) {
iamPolicyBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.iam.v1.Policy,
com.google.iam.v1.Policy.Builder,
com.google.iam.v1.PolicyOrBuilder>(
getIamPolicy(), getParentForChildren(), isClean());
iamPolicy_ = null;
}
return iamPolicyBuilder_;
}
private com.google.protobuf.LazyStringArrayList ancestors_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureAncestorsIsMutable() {
if (!ancestors_.isModifiable()) {
ancestors_ = new com.google.protobuf.LazyStringArrayList(ancestors_);
}
bitField0_ |= 0x00000010;
}
/**
*
*
*
* The ancestry path of an asset in Google Cloud [resource
* hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
* represented as a list of relative resource names. An ancestry path starts
* with the closest ancestor in the hierarchy and ends at root. If the asset
* is a project, folder, or organization, the ancestry path starts from the
* asset itself.
*
* Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
*
*
* repeated string ancestors = 6;
*
* @return A list containing the ancestors.
*/
public com.google.protobuf.ProtocolStringList getAncestorsList() {
ancestors_.makeImmutable();
return ancestors_;
}
/**
*
*
*
* The ancestry path of an asset in Google Cloud [resource
* hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
* represented as a list of relative resource names. An ancestry path starts
* with the closest ancestor in the hierarchy and ends at root. If the asset
* is a project, folder, or organization, the ancestry path starts from the
* asset itself.
*
* Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
*
*
* repeated string ancestors = 6;
*
* @return The count of ancestors.
*/
public int getAncestorsCount() {
return ancestors_.size();
}
/**
*
*
*
* The ancestry path of an asset in Google Cloud [resource
* hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
* represented as a list of relative resource names. An ancestry path starts
* with the closest ancestor in the hierarchy and ends at root. If the asset
* is a project, folder, or organization, the ancestry path starts from the
* asset itself.
*
* Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
*
*
* repeated string ancestors = 6;
*
* @param index The index of the element to return.
* @return The ancestors at the given index.
*/
public java.lang.String getAncestors(int index) {
return ancestors_.get(index);
}
/**
*
*
*
* The ancestry path of an asset in Google Cloud [resource
* hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
* represented as a list of relative resource names. An ancestry path starts
* with the closest ancestor in the hierarchy and ends at root. If the asset
* is a project, folder, or organization, the ancestry path starts from the
* asset itself.
*
* Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
*
*
* repeated string ancestors = 6;
*
* @param index The index of the value to return.
* @return The bytes of the ancestors at the given index.
*/
public com.google.protobuf.ByteString getAncestorsBytes(int index) {
return ancestors_.getByteString(index);
}
/**
*
*
*
* The ancestry path of an asset in Google Cloud [resource
* hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
* represented as a list of relative resource names. An ancestry path starts
* with the closest ancestor in the hierarchy and ends at root. If the asset
* is a project, folder, or organization, the ancestry path starts from the
* asset itself.
*
* Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
*
*
* repeated string ancestors = 6;
*
* @param index The index to set the value at.
* @param value The ancestors to set.
* @return This builder for chaining.
*/
public Builder setAncestors(int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAncestorsIsMutable();
ancestors_.set(index, value);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* The ancestry path of an asset in Google Cloud [resource
* hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
* represented as a list of relative resource names. An ancestry path starts
* with the closest ancestor in the hierarchy and ends at root. If the asset
* is a project, folder, or organization, the ancestry path starts from the
* asset itself.
*
* Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
*
*
* repeated string ancestors = 6;
*
* @param value The ancestors to add.
* @return This builder for chaining.
*/
public Builder addAncestors(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureAncestorsIsMutable();
ancestors_.add(value);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* The ancestry path of an asset in Google Cloud [resource
* hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
* represented as a list of relative resource names. An ancestry path starts
* with the closest ancestor in the hierarchy and ends at root. If the asset
* is a project, folder, or organization, the ancestry path starts from the
* asset itself.
*
* Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
*
*
* repeated string ancestors = 6;
*
* @param values The ancestors to add.
* @return This builder for chaining.
*/
public Builder addAllAncestors(java.lang.Iterable values) {
ensureAncestorsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ancestors_);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* The ancestry path of an asset in Google Cloud [resource
* hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
* represented as a list of relative resource names. An ancestry path starts
* with the closest ancestor in the hierarchy and ends at root. If the asset
* is a project, folder, or organization, the ancestry path starts from the
* asset itself.
*
* Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
*
*
* repeated string ancestors = 6;
*
* @return This builder for chaining.
*/
public Builder clearAncestors() {
ancestors_ = com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
;
onChanged();
return this;
}
/**
*
*
*
* The ancestry path of an asset in Google Cloud [resource
* hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
* represented as a list of relative resource names. An ancestry path starts
* with the closest ancestor in the hierarchy and ends at root. If the asset
* is a project, folder, or organization, the ancestry path starts from the
* asset itself.
*
* Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
*
*
* repeated string ancestors = 6;
*
* @param value The bytes of the ancestors to add.
* @return This builder for chaining.
*/
public Builder addAncestorsBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureAncestorsIsMutable();
ancestors_.add(value);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.identity.accesscontextmanager.v1.AccessPolicy,
com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder,
com.google.identity.accesscontextmanager.v1.AccessPolicyOrBuilder>
accessPolicyBuilder_;
/**
*
*
*
* Please also refer to the [access policy user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
*
*
* .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
*
* @return Whether the accessPolicy field is set.
*/
@java.lang.Override
public boolean hasAccessPolicy() {
return accessContextPolicyCase_ == 7;
}
/**
*
*
*
* Please also refer to the [access policy user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
*
*
* .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
*
* @return The accessPolicy.
*/
@java.lang.Override
public com.google.identity.accesscontextmanager.v1.AccessPolicy getAccessPolicy() {
if (accessPolicyBuilder_ == null) {
if (accessContextPolicyCase_ == 7) {
return (com.google.identity.accesscontextmanager.v1.AccessPolicy) accessContextPolicy_;
}
return com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance();
} else {
if (accessContextPolicyCase_ == 7) {
return accessPolicyBuilder_.getMessage();
}
return com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance();
}
}
/**
*
*
*
* Please also refer to the [access policy user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
*
*
* .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
*/
public Builder setAccessPolicy(com.google.identity.accesscontextmanager.v1.AccessPolicy value) {
if (accessPolicyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
accessContextPolicy_ = value;
onChanged();
} else {
accessPolicyBuilder_.setMessage(value);
}
accessContextPolicyCase_ = 7;
return this;
}
/**
*
*
*
* Please also refer to the [access policy user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
*
*
* .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
*/
public Builder setAccessPolicy(
com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder builderForValue) {
if (accessPolicyBuilder_ == null) {
accessContextPolicy_ = builderForValue.build();
onChanged();
} else {
accessPolicyBuilder_.setMessage(builderForValue.build());
}
accessContextPolicyCase_ = 7;
return this;
}
/**
*
*
*
* Please also refer to the [access policy user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
*
*
* .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
*/
public Builder mergeAccessPolicy(
com.google.identity.accesscontextmanager.v1.AccessPolicy value) {
if (accessPolicyBuilder_ == null) {
if (accessContextPolicyCase_ == 7
&& accessContextPolicy_
!= com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance()) {
accessContextPolicy_ =
com.google.identity.accesscontextmanager.v1.AccessPolicy.newBuilder(
(com.google.identity.accesscontextmanager.v1.AccessPolicy)
accessContextPolicy_)
.mergeFrom(value)
.buildPartial();
} else {
accessContextPolicy_ = value;
}
onChanged();
} else {
if (accessContextPolicyCase_ == 7) {
accessPolicyBuilder_.mergeFrom(value);
} else {
accessPolicyBuilder_.setMessage(value);
}
}
accessContextPolicyCase_ = 7;
return this;
}
/**
*
*
*
* Please also refer to the [access policy user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
*
*
* .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
*/
public Builder clearAccessPolicy() {
if (accessPolicyBuilder_ == null) {
if (accessContextPolicyCase_ == 7) {
accessContextPolicyCase_ = 0;
accessContextPolicy_ = null;
onChanged();
}
} else {
if (accessContextPolicyCase_ == 7) {
accessContextPolicyCase_ = 0;
accessContextPolicy_ = null;
}
accessPolicyBuilder_.clear();
}
return this;
}
/**
*
*
*
* Please also refer to the [access policy user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
*
*
* .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
*/
public com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder
getAccessPolicyBuilder() {
return getAccessPolicyFieldBuilder().getBuilder();
}
/**
*
*
*
* Please also refer to the [access policy user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
*
*
* .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
*/
@java.lang.Override
public com.google.identity.accesscontextmanager.v1.AccessPolicyOrBuilder
getAccessPolicyOrBuilder() {
if ((accessContextPolicyCase_ == 7) && (accessPolicyBuilder_ != null)) {
return accessPolicyBuilder_.getMessageOrBuilder();
} else {
if (accessContextPolicyCase_ == 7) {
return (com.google.identity.accesscontextmanager.v1.AccessPolicy) accessContextPolicy_;
}
return com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance();
}
}
/**
*
*
*
* Please also refer to the [access policy user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
*
*
* .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.identity.accesscontextmanager.v1.AccessPolicy,
com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder,
com.google.identity.accesscontextmanager.v1.AccessPolicyOrBuilder>
getAccessPolicyFieldBuilder() {
if (accessPolicyBuilder_ == null) {
if (!(accessContextPolicyCase_ == 7)) {
accessContextPolicy_ =
com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance();
}
accessPolicyBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.identity.accesscontextmanager.v1.AccessPolicy,
com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder,
com.google.identity.accesscontextmanager.v1.AccessPolicyOrBuilder>(
(com.google.identity.accesscontextmanager.v1.AccessPolicy) accessContextPolicy_,
getParentForChildren(),
isClean());
accessContextPolicy_ = null;
}
accessContextPolicyCase_ = 7;
onChanged();
return accessPolicyBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.identity.accesscontextmanager.v1.AccessLevel,
com.google.identity.accesscontextmanager.v1.AccessLevel.Builder,
com.google.identity.accesscontextmanager.v1.AccessLevelOrBuilder>
accessLevelBuilder_;
/**
*
*
*
* Please also refer to the [access level user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
*
*
* .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
*
* @return Whether the accessLevel field is set.
*/
@java.lang.Override
public boolean hasAccessLevel() {
return accessContextPolicyCase_ == 8;
}
/**
*
*
*
* Please also refer to the [access level user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
*
*
* .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
*
* @return The accessLevel.
*/
@java.lang.Override
public com.google.identity.accesscontextmanager.v1.AccessLevel getAccessLevel() {
if (accessLevelBuilder_ == null) {
if (accessContextPolicyCase_ == 8) {
return (com.google.identity.accesscontextmanager.v1.AccessLevel) accessContextPolicy_;
}
return com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance();
} else {
if (accessContextPolicyCase_ == 8) {
return accessLevelBuilder_.getMessage();
}
return com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance();
}
}
/**
*
*
*
* Please also refer to the [access level user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
*
*
* .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
*/
public Builder setAccessLevel(com.google.identity.accesscontextmanager.v1.AccessLevel value) {
if (accessLevelBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
accessContextPolicy_ = value;
onChanged();
} else {
accessLevelBuilder_.setMessage(value);
}
accessContextPolicyCase_ = 8;
return this;
}
/**
*
*
*
* Please also refer to the [access level user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
*
*
* .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
*/
public Builder setAccessLevel(
com.google.identity.accesscontextmanager.v1.AccessLevel.Builder builderForValue) {
if (accessLevelBuilder_ == null) {
accessContextPolicy_ = builderForValue.build();
onChanged();
} else {
accessLevelBuilder_.setMessage(builderForValue.build());
}
accessContextPolicyCase_ = 8;
return this;
}
/**
*
*
*
* Please also refer to the [access level user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
*
*
* .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
*/
public Builder mergeAccessLevel(com.google.identity.accesscontextmanager.v1.AccessLevel value) {
if (accessLevelBuilder_ == null) {
if (accessContextPolicyCase_ == 8
&& accessContextPolicy_
!= com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance()) {
accessContextPolicy_ =
com.google.identity.accesscontextmanager.v1.AccessLevel.newBuilder(
(com.google.identity.accesscontextmanager.v1.AccessLevel)
accessContextPolicy_)
.mergeFrom(value)
.buildPartial();
} else {
accessContextPolicy_ = value;
}
onChanged();
} else {
if (accessContextPolicyCase_ == 8) {
accessLevelBuilder_.mergeFrom(value);
} else {
accessLevelBuilder_.setMessage(value);
}
}
accessContextPolicyCase_ = 8;
return this;
}
/**
*
*
*
* Please also refer to the [access level user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
*
*
* .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
*/
public Builder clearAccessLevel() {
if (accessLevelBuilder_ == null) {
if (accessContextPolicyCase_ == 8) {
accessContextPolicyCase_ = 0;
accessContextPolicy_ = null;
onChanged();
}
} else {
if (accessContextPolicyCase_ == 8) {
accessContextPolicyCase_ = 0;
accessContextPolicy_ = null;
}
accessLevelBuilder_.clear();
}
return this;
}
/**
*
*
*
* Please also refer to the [access level user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
*
*
* .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
*/
public com.google.identity.accesscontextmanager.v1.AccessLevel.Builder getAccessLevelBuilder() {
return getAccessLevelFieldBuilder().getBuilder();
}
/**
*
*
*
* Please also refer to the [access level user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
*
*
* .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
*/
@java.lang.Override
public com.google.identity.accesscontextmanager.v1.AccessLevelOrBuilder
getAccessLevelOrBuilder() {
if ((accessContextPolicyCase_ == 8) && (accessLevelBuilder_ != null)) {
return accessLevelBuilder_.getMessageOrBuilder();
} else {
if (accessContextPolicyCase_ == 8) {
return (com.google.identity.accesscontextmanager.v1.AccessLevel) accessContextPolicy_;
}
return com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance();
}
}
/**
*
*
*
* Please also refer to the [access level user
* guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
*
*
* .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.identity.accesscontextmanager.v1.AccessLevel,
com.google.identity.accesscontextmanager.v1.AccessLevel.Builder,
com.google.identity.accesscontextmanager.v1.AccessLevelOrBuilder>
getAccessLevelFieldBuilder() {
if (accessLevelBuilder_ == null) {
if (!(accessContextPolicyCase_ == 8)) {
accessContextPolicy_ =
com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance();
}
accessLevelBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.identity.accesscontextmanager.v1.AccessLevel,
com.google.identity.accesscontextmanager.v1.AccessLevel.Builder,
com.google.identity.accesscontextmanager.v1.AccessLevelOrBuilder>(
(com.google.identity.accesscontextmanager.v1.AccessLevel) accessContextPolicy_,
getParentForChildren(),
isClean());
accessContextPolicy_ = null;
}
accessContextPolicyCase_ = 8;
onChanged();
return accessLevelBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.identity.accesscontextmanager.v1.ServicePerimeter,
com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder,
com.google.identity.accesscontextmanager.v1.ServicePerimeterOrBuilder>
servicePerimeterBuilder_;
/**
*
*
*
* Please also refer to the [service perimeter user
* guide](https://cloud.google.com/vpc-service-controls/docs/overview).
*
*
* .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9;
*
* @return Whether the servicePerimeter field is set.
*/
@java.lang.Override
public boolean hasServicePerimeter() {
return accessContextPolicyCase_ == 9;
}
/**
*
*
*
* Please also refer to the [service perimeter user
* guide](https://cloud.google.com/vpc-service-controls/docs/overview).
*
*
* .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9;
*
* @return The servicePerimeter.
*/
@java.lang.Override
public com.google.identity.accesscontextmanager.v1.ServicePerimeter getServicePerimeter() {
if (servicePerimeterBuilder_ == null) {
if (accessContextPolicyCase_ == 9) {
return (com.google.identity.accesscontextmanager.v1.ServicePerimeter)
accessContextPolicy_;
}
return com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance();
} else {
if (accessContextPolicyCase_ == 9) {
return servicePerimeterBuilder_.getMessage();
}
return com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance();
}
}
/**
*
*
*
* Please also refer to the [service perimeter user
* guide](https://cloud.google.com/vpc-service-controls/docs/overview).
*
*
* .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9;
*/
public Builder setServicePerimeter(
com.google.identity.accesscontextmanager.v1.ServicePerimeter value) {
if (servicePerimeterBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
accessContextPolicy_ = value;
onChanged();
} else {
servicePerimeterBuilder_.setMessage(value);
}
accessContextPolicyCase_ = 9;
return this;
}
/**
*
*
*
* Please also refer to the [service perimeter user
* guide](https://cloud.google.com/vpc-service-controls/docs/overview).
*
*
* .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9;
*/
public Builder setServicePerimeter(
com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder builderForValue) {
if (servicePerimeterBuilder_ == null) {
accessContextPolicy_ = builderForValue.build();
onChanged();
} else {
servicePerimeterBuilder_.setMessage(builderForValue.build());
}
accessContextPolicyCase_ = 9;
return this;
}
/**
*
*
*
* Please also refer to the [service perimeter user
* guide](https://cloud.google.com/vpc-service-controls/docs/overview).
*
*
* .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9;
*/
public Builder mergeServicePerimeter(
com.google.identity.accesscontextmanager.v1.ServicePerimeter value) {
if (servicePerimeterBuilder_ == null) {
if (accessContextPolicyCase_ == 9
&& accessContextPolicy_
!= com.google.identity.accesscontextmanager.v1.ServicePerimeter
.getDefaultInstance()) {
accessContextPolicy_ =
com.google.identity.accesscontextmanager.v1.ServicePerimeter.newBuilder(
(com.google.identity.accesscontextmanager.v1.ServicePerimeter)
accessContextPolicy_)
.mergeFrom(value)
.buildPartial();
} else {
accessContextPolicy_ = value;
}
onChanged();
} else {
if (accessContextPolicyCase_ == 9) {
servicePerimeterBuilder_.mergeFrom(value);
} else {
servicePerimeterBuilder_.setMessage(value);
}
}
accessContextPolicyCase_ = 9;
return this;
}
/**
*
*
*
* Please also refer to the [service perimeter user
* guide](https://cloud.google.com/vpc-service-controls/docs/overview).
*
*
* .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9;
*/
public Builder clearServicePerimeter() {
if (servicePerimeterBuilder_ == null) {
if (accessContextPolicyCase_ == 9) {
accessContextPolicyCase_ = 0;
accessContextPolicy_ = null;
onChanged();
}
} else {
if (accessContextPolicyCase_ == 9) {
accessContextPolicyCase_ = 0;
accessContextPolicy_ = null;
}
servicePerimeterBuilder_.clear();
}
return this;
}
/**
*
*
*
* Please also refer to the [service perimeter user
* guide](https://cloud.google.com/vpc-service-controls/docs/overview).
*
*
* .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9;
*/
public com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder
getServicePerimeterBuilder() {
return getServicePerimeterFieldBuilder().getBuilder();
}
/**
*
*
*
* Please also refer to the [service perimeter user
* guide](https://cloud.google.com/vpc-service-controls/docs/overview).
*
*
* .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9;
*/
@java.lang.Override
public com.google.identity.accesscontextmanager.v1.ServicePerimeterOrBuilder
getServicePerimeterOrBuilder() {
if ((accessContextPolicyCase_ == 9) && (servicePerimeterBuilder_ != null)) {
return servicePerimeterBuilder_.getMessageOrBuilder();
} else {
if (accessContextPolicyCase_ == 9) {
return (com.google.identity.accesscontextmanager.v1.ServicePerimeter)
accessContextPolicy_;
}
return com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance();
}
}
/**
*
*
*
* Please also refer to the [service perimeter user
* guide](https://cloud.google.com/vpc-service-controls/docs/overview).
*
*
* .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.identity.accesscontextmanager.v1.ServicePerimeter,
com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder,
com.google.identity.accesscontextmanager.v1.ServicePerimeterOrBuilder>
getServicePerimeterFieldBuilder() {
if (servicePerimeterBuilder_ == null) {
if (!(accessContextPolicyCase_ == 9)) {
accessContextPolicy_ =
com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance();
}
servicePerimeterBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.identity.accesscontextmanager.v1.ServicePerimeter,
com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder,
com.google.identity.accesscontextmanager.v1.ServicePerimeterOrBuilder>(
(com.google.identity.accesscontextmanager.v1.ServicePerimeter) accessContextPolicy_,
getParentForChildren(),
isClean());
accessContextPolicy_ = null;
}
accessContextPolicyCase_ = 9;
onChanged();
return servicePerimeterBuilder_;
}
private java.util.List orgPolicy_ =
java.util.Collections.emptyList();
private void ensureOrgPolicyIsMutable() {
if (!((bitField0_ & 0x00000100) != 0)) {
orgPolicy_ = new java.util.ArrayList(orgPolicy_);
bitField0_ |= 0x00000100;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.orgpolicy.v1.Policy,
com.google.cloud.orgpolicy.v1.Policy.Builder,
com.google.cloud.orgpolicy.v1.PolicyOrBuilder>
orgPolicyBuilder_;
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public java.util.List getOrgPolicyList() {
if (orgPolicyBuilder_ == null) {
return java.util.Collections.unmodifiableList(orgPolicy_);
} else {
return orgPolicyBuilder_.getMessageList();
}
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public int getOrgPolicyCount() {
if (orgPolicyBuilder_ == null) {
return orgPolicy_.size();
} else {
return orgPolicyBuilder_.getCount();
}
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public com.google.cloud.orgpolicy.v1.Policy getOrgPolicy(int index) {
if (orgPolicyBuilder_ == null) {
return orgPolicy_.get(index);
} else {
return orgPolicyBuilder_.getMessage(index);
}
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public Builder setOrgPolicy(int index, com.google.cloud.orgpolicy.v1.Policy value) {
if (orgPolicyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOrgPolicyIsMutable();
orgPolicy_.set(index, value);
onChanged();
} else {
orgPolicyBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public Builder setOrgPolicy(
int index, com.google.cloud.orgpolicy.v1.Policy.Builder builderForValue) {
if (orgPolicyBuilder_ == null) {
ensureOrgPolicyIsMutable();
orgPolicy_.set(index, builderForValue.build());
onChanged();
} else {
orgPolicyBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public Builder addOrgPolicy(com.google.cloud.orgpolicy.v1.Policy value) {
if (orgPolicyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOrgPolicyIsMutable();
orgPolicy_.add(value);
onChanged();
} else {
orgPolicyBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public Builder addOrgPolicy(int index, com.google.cloud.orgpolicy.v1.Policy value) {
if (orgPolicyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOrgPolicyIsMutable();
orgPolicy_.add(index, value);
onChanged();
} else {
orgPolicyBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public Builder addOrgPolicy(com.google.cloud.orgpolicy.v1.Policy.Builder builderForValue) {
if (orgPolicyBuilder_ == null) {
ensureOrgPolicyIsMutable();
orgPolicy_.add(builderForValue.build());
onChanged();
} else {
orgPolicyBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public Builder addOrgPolicy(
int index, com.google.cloud.orgpolicy.v1.Policy.Builder builderForValue) {
if (orgPolicyBuilder_ == null) {
ensureOrgPolicyIsMutable();
orgPolicy_.add(index, builderForValue.build());
onChanged();
} else {
orgPolicyBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public Builder addAllOrgPolicy(
java.lang.Iterable extends com.google.cloud.orgpolicy.v1.Policy> values) {
if (orgPolicyBuilder_ == null) {
ensureOrgPolicyIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, orgPolicy_);
onChanged();
} else {
orgPolicyBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public Builder clearOrgPolicy() {
if (orgPolicyBuilder_ == null) {
orgPolicy_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000100);
onChanged();
} else {
orgPolicyBuilder_.clear();
}
return this;
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public Builder removeOrgPolicy(int index) {
if (orgPolicyBuilder_ == null) {
ensureOrgPolicyIsMutable();
orgPolicy_.remove(index);
onChanged();
} else {
orgPolicyBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public com.google.cloud.orgpolicy.v1.Policy.Builder getOrgPolicyBuilder(int index) {
return getOrgPolicyFieldBuilder().getBuilder(index);
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public com.google.cloud.orgpolicy.v1.PolicyOrBuilder getOrgPolicyOrBuilder(int index) {
if (orgPolicyBuilder_ == null) {
return orgPolicy_.get(index);
} else {
return orgPolicyBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public java.util.List extends com.google.cloud.orgpolicy.v1.PolicyOrBuilder>
getOrgPolicyOrBuilderList() {
if (orgPolicyBuilder_ != null) {
return orgPolicyBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(orgPolicy_);
}
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public com.google.cloud.orgpolicy.v1.Policy.Builder addOrgPolicyBuilder() {
return getOrgPolicyFieldBuilder()
.addBuilder(com.google.cloud.orgpolicy.v1.Policy.getDefaultInstance());
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public com.google.cloud.orgpolicy.v1.Policy.Builder addOrgPolicyBuilder(int index) {
return getOrgPolicyFieldBuilder()
.addBuilder(index, com.google.cloud.orgpolicy.v1.Policy.getDefaultInstance());
}
/**
*
*
*
* A representation of an [organization
* policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
* There can be more than one organization policy with different constraints
* set on a given resource.
*
*
* repeated .google.cloud.orgpolicy.v1.Policy org_policy = 10;
*/
public java.util.List getOrgPolicyBuilderList() {
return getOrgPolicyFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.orgpolicy.v1.Policy,
com.google.cloud.orgpolicy.v1.Policy.Builder,
com.google.cloud.orgpolicy.v1.PolicyOrBuilder>
getOrgPolicyFieldBuilder() {
if (orgPolicyBuilder_ == null) {
orgPolicyBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.orgpolicy.v1.Policy,
com.google.cloud.orgpolicy.v1.Policy.Builder,
com.google.cloud.orgpolicy.v1.PolicyOrBuilder>(
orgPolicy_, ((bitField0_ & 0x00000100) != 0), getParentForChildren(), isClean());
orgPolicy_ = null;
}
return orgPolicyBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.asset.v1p2beta1.Asset)
}
// @@protoc_insertion_point(class_scope:google.cloud.asset.v1p2beta1.Asset)
private static final com.google.cloud.asset.v1p2beta1.Asset DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.asset.v1p2beta1.Asset();
}
public static com.google.cloud.asset.v1p2beta1.Asset getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Asset parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.asset.v1p2beta1.Asset getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}