Class AdmissionRule.Builder

  • All Implemented Interfaces:
    AdmissionRuleOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    AdmissionRule

    public static final class AdmissionRule.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>
    implements AdmissionRuleOrBuilder
     An [admission rule][google.cloud.binaryauthorization.v1beta1.AdmissionRule] specifies either that all container images
     used in a pod creation request must be attested to by one or more
     [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], that all pod creations will be allowed, or that all
     pod creations will be denied.
    
     Images matching an [admission allowlist pattern][google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern]
     are exempted from admission rules and will never block a pod creation.
     
    Protobuf type google.cloud.binaryauthorization.v1beta1.AdmissionRule
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>
      • clear

        public AdmissionRule.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>
      • getDefaultInstanceForType

        public AdmissionRule getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public AdmissionRule build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public AdmissionRule buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public AdmissionRule.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>
      • setField

        public AdmissionRule.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                              Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>
      • clearField

        public AdmissionRule.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>
      • clearOneof

        public AdmissionRule.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>
      • setRepeatedField

        public AdmissionRule.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                      int index,
                                                      Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>
      • addRepeatedField

        public AdmissionRule.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                      Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>
      • mergeFrom

        public AdmissionRule.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<AdmissionRule.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>
      • mergeFrom

        public AdmissionRule.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                        throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<AdmissionRule.Builder>
        Throws:
        IOException
      • getEvaluationModeValue

        public int getEvaluationModeValue()
         Required. How this admission rule will be evaluated.
         
        .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getEvaluationModeValue in interface AdmissionRuleOrBuilder
        Returns:
        The enum numeric value on the wire for evaluationMode.
      • setEvaluationModeValue

        public AdmissionRule.Builder setEvaluationModeValue​(int value)
         Required. How this admission rule will be evaluated.
         
        .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];
        Parameters:
        value - The enum numeric value on the wire for evaluationMode to set.
        Returns:
        This builder for chaining.
      • getEvaluationMode

        public AdmissionRule.EvaluationMode getEvaluationMode()
         Required. How this admission rule will be evaluated.
         
        .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getEvaluationMode in interface AdmissionRuleOrBuilder
        Returns:
        The evaluationMode.
      • setEvaluationMode

        public AdmissionRule.Builder setEvaluationMode​(AdmissionRule.EvaluationMode value)
         Required. How this admission rule will be evaluated.
         
        .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];
        Parameters:
        value - The evaluationMode to set.
        Returns:
        This builder for chaining.
      • clearEvaluationMode

        public AdmissionRule.Builder clearEvaluationMode()
         Required. How this admission rule will be evaluated.
         
        .google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];
        Returns:
        This builder for chaining.
      • getRequireAttestationsByList

        public com.google.protobuf.ProtocolStringList getRequireAttestationsByList()
         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];
        Specified by:
        getRequireAttestationsByList in interface AdmissionRuleOrBuilder
        Returns:
        A list containing the requireAttestationsBy.
      • getRequireAttestationsByCount

        public int getRequireAttestationsByCount()
         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];
        Specified by:
        getRequireAttestationsByCount in interface AdmissionRuleOrBuilder
        Returns:
        The count of requireAttestationsBy.
      • getRequireAttestationsBy

        public String getRequireAttestationsBy​(int index)
         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];
        Specified by:
        getRequireAttestationsBy in interface AdmissionRuleOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The requireAttestationsBy at the given index.
      • getRequireAttestationsByBytes

        public com.google.protobuf.ByteString getRequireAttestationsByBytes​(int index)
         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];
        Specified by:
        getRequireAttestationsByBytes in interface AdmissionRuleOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the requireAttestationsBy at the given index.
      • setRequireAttestationsBy

        public AdmissionRule.Builder setRequireAttestationsBy​(int index,
                                                              String value)
         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:
        index - The index to set the value at.
        value - The requireAttestationsBy to set.
        Returns:
        This builder for chaining.
      • addRequireAttestationsBy

        public AdmissionRule.Builder addRequireAttestationsBy​(String value)
         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:
        value - The requireAttestationsBy to add.
        Returns:
        This builder for chaining.
      • addAllRequireAttestationsBy

        public AdmissionRule.Builder addAllRequireAttestationsBy​(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];
        Parameters:
        values - The requireAttestationsBy to add.
        Returns:
        This builder for chaining.
      • clearRequireAttestationsBy

        public AdmissionRule.Builder clearRequireAttestationsBy()
         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:
        This builder for chaining.
      • addRequireAttestationsByBytes

        public AdmissionRule.Builder addRequireAttestationsByBytes​(com.google.protobuf.ByteString value)
         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:
        value - The bytes of the requireAttestationsBy to add.
        Returns:
        This builder for chaining.
      • getEnforcementModeValue

        public int getEnforcementModeValue()
         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];
        Specified by:
        getEnforcementModeValue in interface AdmissionRuleOrBuilder
        Returns:
        The enum numeric value on the wire for enforcementMode.
      • setEnforcementModeValue

        public AdmissionRule.Builder setEnforcementModeValue​(int value)
         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];
        Parameters:
        value - The enum numeric value on the wire for enforcementMode to set.
        Returns:
        This builder for chaining.
      • getEnforcementMode

        public AdmissionRule.EnforcementMode getEnforcementMode()
         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];
        Specified by:
        getEnforcementMode in interface AdmissionRuleOrBuilder
        Returns:
        The enforcementMode.
      • setEnforcementMode

        public AdmissionRule.Builder setEnforcementMode​(AdmissionRule.EnforcementMode value)
         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];
        Parameters:
        value - The enforcementMode to set.
        Returns:
        This builder for chaining.
      • clearEnforcementMode

        public AdmissionRule.Builder clearEnforcementMode()
         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:
        This builder for chaining.
      • setUnknownFields

        public final AdmissionRule.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>
      • mergeUnknownFields

        public final AdmissionRule.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<AdmissionRule.Builder>