Class Resources.AdmissionRule.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Resources.AdmissionRule.Builder>
com.google.protos.google.cloud.binaryauthorization.v1.Resources.AdmissionRule.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Resources.AdmissionRuleOrBuilder, Cloneable
Enclosing class:
Resources.AdmissionRule

public static final class Resources.AdmissionRule.Builder extends com.google.protobuf.GeneratedMessage.Builder<Resources.AdmissionRule.Builder> implements Resources.AdmissionRuleOrBuilder
 An [admission rule][google.cloud.binaryauthorization.v1.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.v1.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.v1.AdmissionWhitelistPattern]
 are exempted from admission rules and will never block a pod creation.
 
Protobuf type google.cloud.binaryauthorization.v1.AdmissionRule
  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<Resources.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.GeneratedMessage.Builder<Resources.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.GeneratedMessage.Builder<Resources.AdmissionRule.Builder>
    • getDefaultInstanceForType

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

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

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

      public Resources.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<Resources.AdmissionRule.Builder>
    • mergeFrom

    • isInitialized

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

      public Resources.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<Resources.AdmissionRule.Builder>
      Throws:
      IOException
    • getEvaluationModeValue

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

      public Resources.AdmissionRule.Builder setEvaluationModeValue(int value)
       Required. How this admission rule will be evaluated.
       
      .google.cloud.binaryauthorization.v1.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 Resources.AdmissionRule.EvaluationMode getEvaluationMode()
       Required. How this admission rule will be evaluated.
       
      .google.cloud.binaryauthorization.v1.AdmissionRule.EvaluationMode evaluation_mode = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getEvaluationMode in interface Resources.AdmissionRuleOrBuilder
      Returns:
      The evaluationMode.
    • setEvaluationMode

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

      public Resources.AdmissionRule.Builder clearEvaluationMode()
       Required. How this admission rule will be evaluated.
       
      .google.cloud.binaryauthorization.v1.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 Resources.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 Resources.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 Resources.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 Resources.AdmissionRuleOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the requireAttestationsBy at the given index.
    • setRequireAttestationsBy

      public Resources.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 Resources.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 Resources.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 Resources.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 Resources.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.v1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getEnforcementModeValue in interface Resources.AdmissionRuleOrBuilder
      Returns:
      The enum numeric value on the wire for enforcementMode.
    • setEnforcementModeValue

      public Resources.AdmissionRule.Builder setEnforcementModeValue(int value)
       Required. The action when a pod creation is denied by the admission rule.
       
      .google.cloud.binaryauthorization.v1.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 Resources.AdmissionRule.EnforcementMode getEnforcementMode()
       Required. The action when a pod creation is denied by the admission rule.
       
      .google.cloud.binaryauthorization.v1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getEnforcementMode in interface Resources.AdmissionRuleOrBuilder
      Returns:
      The enforcementMode.
    • setEnforcementMode

       Required. The action when a pod creation is denied by the admission rule.
       
      .google.cloud.binaryauthorization.v1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The enforcementMode to set.
      Returns:
      This builder for chaining.
    • clearEnforcementMode

      public Resources.AdmissionRule.Builder clearEnforcementMode()
       Required. The action when a pod creation is denied by the admission rule.
       
      .google.cloud.binaryauthorization.v1.AdmissionRule.EnforcementMode enforcement_mode = 3 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.