Package com.google.cloud.orgpolicy.v2
Class PolicySpec.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<PolicySpec.Builder>
com.google.cloud.orgpolicy.v2.PolicySpec.Builder
- All Implemented Interfaces:
PolicySpecOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- PolicySpec
public static final class PolicySpec.Builder
extends com.google.protobuf.GeneratedMessage.Builder<PolicySpec.Builder>
implements PolicySpecOrBuilder
Defines a Google Cloud policy specification which is used to specify constraints for configurations of Google Cloud resources.Protobuf type
google.cloud.orgpolicy.v2.PolicySpec-
Method Summary
Modifier and TypeMethodDescriptionaddAllRules(Iterable<? extends PolicySpec.PolicyRule> values) In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetaddRules(int index, PolicySpec.PolicyRule value) In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetaddRules(int index, PolicySpec.PolicyRule.Builder builderForValue) In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetaddRules(PolicySpec.PolicyRule value) In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetaddRules(PolicySpec.PolicyRule.Builder builderForValue) In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetIn policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetaddRulesBuilder(int index) In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetbuild()clear()An opaque tag indicating the current version of the policySpec, used for concurrency control.Determines the inheritance behavior for this policy.Ignores policies set above this resource and restores the `constraint_default` enforcement behavior of the specific constraint at this resource.In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetOutput only.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorgetEtag()An opaque tag indicating the current version of the policySpec, used for concurrency control.com.google.protobuf.ByteStringAn opaque tag indicating the current version of the policySpec, used for concurrency control.booleanDetermines the inheritance behavior for this policy.booleangetReset()Ignores policies set above this resource and restores the `constraint_default` enforcement behavior of the specific constraint at this resource.getRules(int index) In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetgetRulesBuilder(int index) In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetIn policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetintIn policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetIn policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetgetRulesOrBuilder(int index) In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetList<? extends PolicySpec.PolicyRuleOrBuilder>In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetcom.google.protobuf.TimestampOutput only.com.google.protobuf.Timestamp.BuilderOutput only.com.google.protobuf.TimestampOrBuilderOutput only.booleanOutput only.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(PolicySpec other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeUpdateTime(com.google.protobuf.Timestamp value) Output only.removeRules(int index) In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetAn opaque tag indicating the current version of the policySpec, used for concurrency control.setEtagBytes(com.google.protobuf.ByteString value) An opaque tag indicating the current version of the policySpec, used for concurrency control.setInheritFromParent(boolean value) Determines the inheritance behavior for this policy.setReset(boolean value) Ignores policies set above this resource and restores the `constraint_default` enforcement behavior of the specific constraint at this resource.setRules(int index, PolicySpec.PolicyRule value) In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetsetRules(int index, PolicySpec.PolicyRule.Builder builderForValue) In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unsetsetUpdateTime(com.google.protobuf.Timestamp value) Output only.setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) Output only.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<PolicySpec.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<PolicySpec.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<PolicySpec.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<PolicySpec.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<PolicySpec.Builder>
-
mergeFrom
public PolicySpec.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<PolicySpec.Builder>- Throws:
IOException
-
getEtag
An opaque tag indicating the current version of the policySpec, used for concurrency control. This field is ignored if used in a `CreatePolicy` request. When the policy is returned from either a `GetPolicy` or a `ListPolicies` request, this `etag` indicates the version of the current policySpec to use when executing a read-modify-write loop. When the policy is returned from a `GetEffectivePolicy` request, the `etag` will be unset.
string etag = 1;- Specified by:
getEtagin interfacePolicySpecOrBuilder- Returns:
- The etag.
-
getEtagBytes
public com.google.protobuf.ByteString getEtagBytes()An opaque tag indicating the current version of the policySpec, used for concurrency control. This field is ignored if used in a `CreatePolicy` request. When the policy is returned from either a `GetPolicy` or a `ListPolicies` request, this `etag` indicates the version of the current policySpec to use when executing a read-modify-write loop. When the policy is returned from a `GetEffectivePolicy` request, the `etag` will be unset.
string etag = 1;- Specified by:
getEtagBytesin interfacePolicySpecOrBuilder- Returns:
- The bytes for etag.
-
setEtag
An opaque tag indicating the current version of the policySpec, used for concurrency control. This field is ignored if used in a `CreatePolicy` request. When the policy is returned from either a `GetPolicy` or a `ListPolicies` request, this `etag` indicates the version of the current policySpec to use when executing a read-modify-write loop. When the policy is returned from a `GetEffectivePolicy` request, the `etag` will be unset.
string etag = 1;- Parameters:
value- The etag to set.- Returns:
- This builder for chaining.
-
clearEtag
An opaque tag indicating the current version of the policySpec, used for concurrency control. This field is ignored if used in a `CreatePolicy` request. When the policy is returned from either a `GetPolicy` or a `ListPolicies` request, this `etag` indicates the version of the current policySpec to use when executing a read-modify-write loop. When the policy is returned from a `GetEffectivePolicy` request, the `etag` will be unset.
string etag = 1;- Returns:
- This builder for chaining.
-
setEtagBytes
An opaque tag indicating the current version of the policySpec, used for concurrency control. This field is ignored if used in a `CreatePolicy` request. When the policy is returned from either a `GetPolicy` or a `ListPolicies` request, this `etag` indicates the version of the current policySpec to use when executing a read-modify-write loop. When the policy is returned from a `GetEffectivePolicy` request, the `etag` will be unset.
string etag = 1;- Parameters:
value- The bytes for etag to set.- Returns:
- This builder for chaining.
-
hasUpdateTime
public boolean hasUpdateTime()Output only. The time stamp this was previously updated. This represents the last time a call to `CreatePolicy` or `UpdatePolicy` was made for that policy.
.google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
hasUpdateTimein interfacePolicySpecOrBuilder- Returns:
- Whether the updateTime field is set.
-
getUpdateTime
public com.google.protobuf.Timestamp getUpdateTime()Output only. The time stamp this was previously updated. This represents the last time a call to `CreatePolicy` or `UpdatePolicy` was made for that policy.
.google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getUpdateTimein interfacePolicySpecOrBuilder- Returns:
- The updateTime.
-
setUpdateTime
Output only. The time stamp this was previously updated. This represents the last time a call to `CreatePolicy` or `UpdatePolicy` was made for that policy.
.google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; -
setUpdateTime
Output only. The time stamp this was previously updated. This represents the last time a call to `CreatePolicy` or `UpdatePolicy` was made for that policy.
.google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; -
mergeUpdateTime
Output only. The time stamp this was previously updated. This represents the last time a call to `CreatePolicy` or `UpdatePolicy` was made for that policy.
.google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; -
clearUpdateTime
Output only. The time stamp this was previously updated. This represents the last time a call to `CreatePolicy` or `UpdatePolicy` was made for that policy.
.google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; -
getUpdateTimeBuilder
public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder()Output only. The time stamp this was previously updated. This represents the last time a call to `CreatePolicy` or `UpdatePolicy` was made for that policy.
.google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; -
getUpdateTimeOrBuilder
public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder()Output only. The time stamp this was previously updated. This represents the last time a call to `CreatePolicy` or `UpdatePolicy` was made for that policy.
.google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getUpdateTimeOrBuilderin interfacePolicySpecOrBuilder
-
getRulesList
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3;- Specified by:
getRulesListin interfacePolicySpecOrBuilder
-
getRulesCount
public int getRulesCount()In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3;- Specified by:
getRulesCountin interfacePolicySpecOrBuilder
-
getRules
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3;- Specified by:
getRulesin interfacePolicySpecOrBuilder
-
setRules
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
setRules
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
addRules
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
addRules
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
addRules
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
addRules
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
addAllRules
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
clearRules
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
removeRules
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
getRulesBuilder
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
getRulesOrBuilder
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3;- Specified by:
getRulesOrBuilderin interfacePolicySpecOrBuilder
-
getRulesOrBuilderList
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3;- Specified by:
getRulesOrBuilderListin interfacePolicySpecOrBuilder
-
addRulesBuilder
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
addRulesBuilder
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
getRulesBuilderList
In policies for boolean constraints, the following requirements apply: - There must be one and only one policy rule where condition is unset. - Boolean policy rules with conditions must set `enforced` to the opposite of the policy rule without a condition. - During policy evaluation, policy rules with conditions that are true for a target resource take precedence.
repeated .google.cloud.orgpolicy.v2.PolicySpec.PolicyRule rules = 3; -
getInheritFromParent
public boolean getInheritFromParent()Determines the inheritance behavior for this policy. If `inherit_from_parent` is true, policy rules set higher up in the hierarchy (up to the closest root) are inherited and present in the effective policy. If it is false, then no rules are inherited, and this policy becomes the new root for evaluation. This field can be set only for policies which configure list constraints.
bool inherit_from_parent = 4;- Specified by:
getInheritFromParentin interfacePolicySpecOrBuilder- Returns:
- The inheritFromParent.
-
setInheritFromParent
Determines the inheritance behavior for this policy. If `inherit_from_parent` is true, policy rules set higher up in the hierarchy (up to the closest root) are inherited and present in the effective policy. If it is false, then no rules are inherited, and this policy becomes the new root for evaluation. This field can be set only for policies which configure list constraints.
bool inherit_from_parent = 4;- Parameters:
value- The inheritFromParent to set.- Returns:
- This builder for chaining.
-
clearInheritFromParent
Determines the inheritance behavior for this policy. If `inherit_from_parent` is true, policy rules set higher up in the hierarchy (up to the closest root) are inherited and present in the effective policy. If it is false, then no rules are inherited, and this policy becomes the new root for evaluation. This field can be set only for policies which configure list constraints.
bool inherit_from_parent = 4;- Returns:
- This builder for chaining.
-
getReset
public boolean getReset()Ignores policies set above this resource and restores the `constraint_default` enforcement behavior of the specific constraint at this resource. This field can be set in policies for either list or boolean constraints. If set, `rules` must be empty and `inherit_from_parent` must be set to false.
bool reset = 5;- Specified by:
getResetin interfacePolicySpecOrBuilder- Returns:
- The reset.
-
setReset
Ignores policies set above this resource and restores the `constraint_default` enforcement behavior of the specific constraint at this resource. This field can be set in policies for either list or boolean constraints. If set, `rules` must be empty and `inherit_from_parent` must be set to false.
bool reset = 5;- Parameters:
value- The reset to set.- Returns:
- This builder for chaining.
-
clearReset
Ignores policies set above this resource and restores the `constraint_default` enforcement behavior of the specific constraint at this resource. This field can be set in policies for either list or boolean constraints. If set, `rules` must be empty and `inherit_from_parent` must be set to false.
bool reset = 5;- Returns:
- This builder for chaining.
-