Class Rule.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Rule.Builder>
com.google.devtools.artifactregistry.v1.Rule.Builder
All Implemented Interfaces:
RuleOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Rule

public static final class Rule.Builder extends com.google.protobuf.GeneratedMessage.Builder<Rule.Builder> implements RuleOrBuilder
 A rule defines the deny or allow action of the operation it applies to and
 the conditions required for the rule to apply. You can set one rule for an
 entire repository and one rule for each package within.
 
Protobuf type google.devtools.artifactregistry.v1.Rule
  • 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<Rule.Builder>
    • clear

      public Rule.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<Rule.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<Rule.Builder>
    • getDefaultInstanceForType

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

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

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

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

      public Rule.Builder mergeFrom(Rule other)
    • isInitialized

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

      public Rule.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<Rule.Builder>
      Throws:
      IOException
    • getName

      public String getName()
       The name of the rule, for example:
       `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`.
       
      string name = 1;
      Specified by:
      getName in interface RuleOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       The name of the rule, for example:
       `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`.
       
      string name = 1;
      Specified by:
      getNameBytes in interface RuleOrBuilder
      Returns:
      The bytes for name.
    • setName

      public Rule.Builder setName(String value)
       The name of the rule, for example:
       `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`.
       
      string name = 1;
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public Rule.Builder clearName()
       The name of the rule, for example:
       `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`.
       
      string name = 1;
      Returns:
      This builder for chaining.
    • setNameBytes

      public Rule.Builder setNameBytes(com.google.protobuf.ByteString value)
       The name of the rule, for example:
       `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`.
       
      string name = 1;
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getActionValue

      public int getActionValue()
       The action this rule takes.
       
      .google.devtools.artifactregistry.v1.Rule.Action action = 2;
      Specified by:
      getActionValue in interface RuleOrBuilder
      Returns:
      The enum numeric value on the wire for action.
    • setActionValue

      public Rule.Builder setActionValue(int value)
       The action this rule takes.
       
      .google.devtools.artifactregistry.v1.Rule.Action action = 2;
      Parameters:
      value - The enum numeric value on the wire for action to set.
      Returns:
      This builder for chaining.
    • getAction

      public Rule.Action getAction()
       The action this rule takes.
       
      .google.devtools.artifactregistry.v1.Rule.Action action = 2;
      Specified by:
      getAction in interface RuleOrBuilder
      Returns:
      The action.
    • setAction

      public Rule.Builder setAction(Rule.Action value)
       The action this rule takes.
       
      .google.devtools.artifactregistry.v1.Rule.Action action = 2;
      Parameters:
      value - The action to set.
      Returns:
      This builder for chaining.
    • clearAction

      public Rule.Builder clearAction()
       The action this rule takes.
       
      .google.devtools.artifactregistry.v1.Rule.Action action = 2;
      Returns:
      This builder for chaining.
    • getOperationValue

      public int getOperationValue()
      .google.devtools.artifactregistry.v1.Rule.Operation operation = 3;
      Specified by:
      getOperationValue in interface RuleOrBuilder
      Returns:
      The enum numeric value on the wire for operation.
    • setOperationValue

      public Rule.Builder setOperationValue(int value)
      .google.devtools.artifactregistry.v1.Rule.Operation operation = 3;
      Parameters:
      value - The enum numeric value on the wire for operation to set.
      Returns:
      This builder for chaining.
    • getOperation

      public Rule.Operation getOperation()
      .google.devtools.artifactregistry.v1.Rule.Operation operation = 3;
      Specified by:
      getOperation in interface RuleOrBuilder
      Returns:
      The operation.
    • setOperation

      public Rule.Builder setOperation(Rule.Operation value)
      .google.devtools.artifactregistry.v1.Rule.Operation operation = 3;
      Parameters:
      value - The operation to set.
      Returns:
      This builder for chaining.
    • clearOperation

      public Rule.Builder clearOperation()
      .google.devtools.artifactregistry.v1.Rule.Operation operation = 3;
      Returns:
      This builder for chaining.
    • hasCondition

      public boolean hasCondition()
       Optional. A CEL expression for conditions that must be met in order for the
       rule to apply. If not provided, the rule matches all objects.
       
      .google.type.Expr condition = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasCondition in interface RuleOrBuilder
      Returns:
      Whether the condition field is set.
    • getCondition

      public Expr getCondition()
       Optional. A CEL expression for conditions that must be met in order for the
       rule to apply. If not provided, the rule matches all objects.
       
      .google.type.Expr condition = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getCondition in interface RuleOrBuilder
      Returns:
      The condition.
    • setCondition

      public Rule.Builder setCondition(Expr value)
       Optional. A CEL expression for conditions that must be met in order for the
       rule to apply. If not provided, the rule matches all objects.
       
      .google.type.Expr condition = 4 [(.google.api.field_behavior) = OPTIONAL];
    • setCondition

      public Rule.Builder setCondition(Expr.Builder builderForValue)
       Optional. A CEL expression for conditions that must be met in order for the
       rule to apply. If not provided, the rule matches all objects.
       
      .google.type.Expr condition = 4 [(.google.api.field_behavior) = OPTIONAL];
    • mergeCondition

      public Rule.Builder mergeCondition(Expr value)
       Optional. A CEL expression for conditions that must be met in order for the
       rule to apply. If not provided, the rule matches all objects.
       
      .google.type.Expr condition = 4 [(.google.api.field_behavior) = OPTIONAL];
    • clearCondition

      public Rule.Builder clearCondition()
       Optional. A CEL expression for conditions that must be met in order for the
       rule to apply. If not provided, the rule matches all objects.
       
      .google.type.Expr condition = 4 [(.google.api.field_behavior) = OPTIONAL];
    • getConditionBuilder

      public Expr.Builder getConditionBuilder()
       Optional. A CEL expression for conditions that must be met in order for the
       rule to apply. If not provided, the rule matches all objects.
       
      .google.type.Expr condition = 4 [(.google.api.field_behavior) = OPTIONAL];
    • getConditionOrBuilder

      public ExprOrBuilder getConditionOrBuilder()
       Optional. A CEL expression for conditions that must be met in order for the
       rule to apply. If not provided, the rule matches all objects.
       
      .google.type.Expr condition = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getConditionOrBuilder in interface RuleOrBuilder
    • getPackageId

      public String getPackageId()
       The package ID the rule applies to.
       If empty, this rule applies to all packages inside the repository.
       
      string package_id = 5;
      Specified by:
      getPackageId in interface RuleOrBuilder
      Returns:
      The packageId.
    • getPackageIdBytes

      public com.google.protobuf.ByteString getPackageIdBytes()
       The package ID the rule applies to.
       If empty, this rule applies to all packages inside the repository.
       
      string package_id = 5;
      Specified by:
      getPackageIdBytes in interface RuleOrBuilder
      Returns:
      The bytes for packageId.
    • setPackageId

      public Rule.Builder setPackageId(String value)
       The package ID the rule applies to.
       If empty, this rule applies to all packages inside the repository.
       
      string package_id = 5;
      Parameters:
      value - The packageId to set.
      Returns:
      This builder for chaining.
    • clearPackageId

      public Rule.Builder clearPackageId()
       The package ID the rule applies to.
       If empty, this rule applies to all packages inside the repository.
       
      string package_id = 5;
      Returns:
      This builder for chaining.
    • setPackageIdBytes

      public Rule.Builder setPackageIdBytes(com.google.protobuf.ByteString value)
       The package ID the rule applies to.
       If empty, this rule applies to all packages inside the repository.
       
      string package_id = 5;
      Parameters:
      value - The bytes for packageId to set.
      Returns:
      This builder for chaining.