Class AdmissionRule.Builder (1.79.0)

publicstaticfinalclass AdmissionRule.BuilderextendsGeneratedMessageV3.Builder<AdmissionRule.Builder>implementsAdmissionRuleOrBuilder

An admission rule specifies either that all container images used in a pod creation request must be attested to by one or more attestors, that all pod creations will be allowed, or that all pod creations will be denied.

Images matching an admission allowlist pattern are exempted from admission rules and will never block a pod creation.

Protobuf type google.cloud.binaryauthorization.v1beta1.AdmissionRule

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addAllRequireAttestationsBy(Iterable<String> values)

publicAdmissionRule.BuilderaddAllRequireAttestationsBy(Iterable<String>values)

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<String>

The requireAttestationsBy to add.

Returns
Type Description
AdmissionRule.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicAdmissionRule.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AdmissionRule.Builder
Overrides

addRequireAttestationsBy(String value)

publicAdmissionRule.BuilderaddRequireAttestationsBy(Stringvalue)

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The requireAttestationsBy to add.

Returns
Type Description
AdmissionRule.Builder

This builder for chaining.

addRequireAttestationsByBytes(ByteString value)

publicAdmissionRule.BuilderaddRequireAttestationsByBytes(ByteStringvalue)

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes of the requireAttestationsBy to add.

Returns
Type Description
AdmissionRule.Builder

This builder for chaining.

build()

publicAdmissionRulebuild()
Returns
Type Description
AdmissionRule

buildPartial()

publicAdmissionRulebuildPartial()
Returns
Type Description
AdmissionRule

clear()

publicAdmissionRule.Builderclear()
Returns
Type Description
AdmissionRule.Builder
Overrides

clearEnforcementMode()

publicAdmissionRule.BuilderclearEnforcementMode()

Required. The action when a pod creation is denied by the admission rule.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
AdmissionRule.Builder

This builder for chaining.

clearEvaluationMode()

publicAdmissionRule.BuilderclearEvaluationMode()

Required. How this admission rule will be evaluated.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
AdmissionRule.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

publicAdmissionRule.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
AdmissionRule.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicAdmissionRule.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
AdmissionRule.Builder
Overrides

clearRequireAttestationsBy()

publicAdmissionRule.BuilderclearRequireAttestationsBy()

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AdmissionRule.Builder

This builder for chaining.

clone()

publicAdmissionRule.Builderclone()
Returns
Type Description
AdmissionRule.Builder
Overrides

getDefaultInstanceForType()

publicAdmissionRulegetDefaultInstanceForType()
Returns
Type Description
AdmissionRule

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getEnforcementMode()

publicAdmissionRule.EnforcementModegetEnforcementMode()

Required. The action when a pod creation is denied by the admission rule.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
AdmissionRule.EnforcementMode

The enforcementMode.

getEnforcementModeValue()

publicintgetEnforcementModeValue()

Required. The action when a pod creation is denied by the admission rule.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The enum numeric value on the wire for enforcementMode.

getEvaluationMode()

publicAdmissionRule.EvaluationModegetEvaluationMode()

Required. How this admission rule will be evaluated.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
AdmissionRule.EvaluationMode

The evaluationMode.

getEvaluationModeValue()

publicintgetEvaluationModeValue()

Required. How this admission rule will be evaluated.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The enum numeric value on the wire for evaluationMode.

getRequireAttestationsBy(int index)

publicStringgetRequireAttestationsBy(intindex)

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The requireAttestationsBy at the given index.

getRequireAttestationsByBytes(int index)

publicByteStringgetRequireAttestationsByBytes(intindex)

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the requireAttestationsBy at the given index.

getRequireAttestationsByCount()

publicintgetRequireAttestationsByCount()

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The count of requireAttestationsBy.

getRequireAttestationsByList()

publicProtocolStringListgetRequireAttestationsByList()

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProtocolStringList

A list containing the requireAttestationsBy.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(AdmissionRule other)

publicAdmissionRule.BuildermergeFrom(AdmissionRuleother)
Parameter
Name Description
other AdmissionRule
Returns
Type Description
AdmissionRule.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicAdmissionRule.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AdmissionRule.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicAdmissionRule.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
AdmissionRule.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalAdmissionRule.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AdmissionRule.Builder
Overrides

setEnforcementMode(AdmissionRule.EnforcementMode value)

publicAdmissionRule.BuildersetEnforcementMode(AdmissionRule.EnforcementModevalue)

Required. The action when a pod creation is denied by the admission rule.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value AdmissionRule.EnforcementMode

The enforcementMode to set.

Returns
Type Description
AdmissionRule.Builder

This builder for chaining.

setEnforcementModeValue(int value)

publicAdmissionRule.BuildersetEnforcementModeValue(intvalue)

Required. The action when a pod creation is denied by the admission rule.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value int

The enum numeric value on the wire for enforcementMode to set.

Returns
Type Description
AdmissionRule.Builder

This builder for chaining.

setEvaluationMode(AdmissionRule.EvaluationMode value)

publicAdmissionRule.BuildersetEvaluationMode(AdmissionRule.EvaluationModevalue)

Required. How this admission rule will be evaluated.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value AdmissionRule.EvaluationMode

The evaluationMode to set.

Returns
Type Description
AdmissionRule.Builder

This builder for chaining.

setEvaluationModeValue(int value)

publicAdmissionRule.BuildersetEvaluationModeValue(intvalue)

Required. How this admission rule will be evaluated.

.google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value int

The enum numeric value on the wire for evaluationMode to set.

Returns
Type Description
AdmissionRule.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

publicAdmissionRule.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AdmissionRule.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

publicAdmissionRule.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
AdmissionRule.Builder
Overrides

setRequireAttestationsBy(int index, String value)

publicAdmissionRule.BuildersetRequireAttestationsBy(intindex,Stringvalue)

Optional. The resource names of the attestors that must attest to a container image, in the format projects/*/attestors/*. Each attestor must exist before a policy can reference it. To add an attestor to a policy the principal issuing the policy change request must be able to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.

repeated string require_attestations_by = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int

The index to set the value at.

value String

The requireAttestationsBy to set.

Returns
Type Description
AdmissionRule.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalAdmissionRule.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AdmissionRule.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.