Class ExplainedPolicy.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<ExplainedPolicy.Builder>
com.google.cloud.policysimulator.v1.ExplainedPolicy.Builder
All Implemented Interfaces:
ExplainedPolicyOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
ExplainedPolicy

public static final class ExplainedPolicy.Builder extends com.google.protobuf.GeneratedMessage.Builder<ExplainedPolicy.Builder> implements ExplainedPolicyOrBuilder
 Details about how a specific IAM [Policy][google.iam.v1.Policy] contributed
 to the access check.
 
Protobuf type google.cloud.policysimulator.v1.ExplainedPolicy
  • 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<ExplainedPolicy.Builder>
    • clear

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

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

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

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

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

      public ExplainedPolicy.Builder mergeFrom(ExplainedPolicy other)
    • isInitialized

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

      public ExplainedPolicy.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<ExplainedPolicy.Builder>
      Throws:
      IOException
    • getAccessValue

      public int getAccessValue()
       Indicates whether _this policy_ provides the specified permission to the
       specified principal for the specified resource.
      
       This field does _not_ indicate whether the principal actually has the
       permission for the resource. There might be another policy that overrides
       this policy. To determine whether the principal actually has the
       permission, use the `access` field in the
       [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.v3.TroubleshootIamPolicyResponse].
       
      .google.cloud.policysimulator.v1.AccessState access = 1;
      Specified by:
      getAccessValue in interface ExplainedPolicyOrBuilder
      Returns:
      The enum numeric value on the wire for access.
    • setAccessValue

      public ExplainedPolicy.Builder setAccessValue(int value)
       Indicates whether _this policy_ provides the specified permission to the
       specified principal for the specified resource.
      
       This field does _not_ indicate whether the principal actually has the
       permission for the resource. There might be another policy that overrides
       this policy. To determine whether the principal actually has the
       permission, use the `access` field in the
       [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.v3.TroubleshootIamPolicyResponse].
       
      .google.cloud.policysimulator.v1.AccessState access = 1;
      Parameters:
      value - The enum numeric value on the wire for access to set.
      Returns:
      This builder for chaining.
    • getAccess

      public AccessState getAccess()
       Indicates whether _this policy_ provides the specified permission to the
       specified principal for the specified resource.
      
       This field does _not_ indicate whether the principal actually has the
       permission for the resource. There might be another policy that overrides
       this policy. To determine whether the principal actually has the
       permission, use the `access` field in the
       [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.v3.TroubleshootIamPolicyResponse].
       
      .google.cloud.policysimulator.v1.AccessState access = 1;
      Specified by:
      getAccess in interface ExplainedPolicyOrBuilder
      Returns:
      The access.
    • setAccess

      public ExplainedPolicy.Builder setAccess(AccessState value)
       Indicates whether _this policy_ provides the specified permission to the
       specified principal for the specified resource.
      
       This field does _not_ indicate whether the principal actually has the
       permission for the resource. There might be another policy that overrides
       this policy. To determine whether the principal actually has the
       permission, use the `access` field in the
       [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.v3.TroubleshootIamPolicyResponse].
       
      .google.cloud.policysimulator.v1.AccessState access = 1;
      Parameters:
      value - The access to set.
      Returns:
      This builder for chaining.
    • clearAccess

      public ExplainedPolicy.Builder clearAccess()
       Indicates whether _this policy_ provides the specified permission to the
       specified principal for the specified resource.
      
       This field does _not_ indicate whether the principal actually has the
       permission for the resource. There might be another policy that overrides
       this policy. To determine whether the principal actually has the
       permission, use the `access` field in the
       [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.v3.TroubleshootIamPolicyResponse].
       
      .google.cloud.policysimulator.v1.AccessState access = 1;
      Returns:
      This builder for chaining.
    • getFullResourceName

      public String getFullResourceName()
       The full resource name that identifies the resource. For example,
       `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
      
       For examples of full resource names for Google Cloud services, see
       https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
       
      string full_resource_name = 2;
      Specified by:
      getFullResourceName in interface ExplainedPolicyOrBuilder
      Returns:
      The fullResourceName.
    • getFullResourceNameBytes

      public com.google.protobuf.ByteString getFullResourceNameBytes()
       The full resource name that identifies the resource. For example,
       `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
      
       For examples of full resource names for Google Cloud services, see
       https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
       
      string full_resource_name = 2;
      Specified by:
      getFullResourceNameBytes in interface ExplainedPolicyOrBuilder
      Returns:
      The bytes for fullResourceName.
    • setFullResourceName

      public ExplainedPolicy.Builder setFullResourceName(String value)
       The full resource name that identifies the resource. For example,
       `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
      
       For examples of full resource names for Google Cloud services, see
       https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
       
      string full_resource_name = 2;
      Parameters:
      value - The fullResourceName to set.
      Returns:
      This builder for chaining.
    • clearFullResourceName

      public ExplainedPolicy.Builder clearFullResourceName()
       The full resource name that identifies the resource. For example,
       `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
      
       For examples of full resource names for Google Cloud services, see
       https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
       
      string full_resource_name = 2;
      Returns:
      This builder for chaining.
    • setFullResourceNameBytes

      public ExplainedPolicy.Builder setFullResourceNameBytes(com.google.protobuf.ByteString value)
       The full resource name that identifies the resource. For example,
       `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/my-instance`.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
      
       For examples of full resource names for Google Cloud services, see
       https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
       
      string full_resource_name = 2;
      Parameters:
      value - The bytes for fullResourceName to set.
      Returns:
      This builder for chaining.
    • hasPolicy

      public boolean hasPolicy()
       The IAM policy attached to the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is empty.
       
      .google.iam.v1.Policy policy = 3;
      Specified by:
      hasPolicy in interface ExplainedPolicyOrBuilder
      Returns:
      Whether the policy field is set.
    • getPolicy

      public Policy getPolicy()
       The IAM policy attached to the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is empty.
       
      .google.iam.v1.Policy policy = 3;
      Specified by:
      getPolicy in interface ExplainedPolicyOrBuilder
      Returns:
      The policy.
    • setPolicy

      public ExplainedPolicy.Builder setPolicy(Policy value)
       The IAM policy attached to the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is empty.
       
      .google.iam.v1.Policy policy = 3;
    • setPolicy

      public ExplainedPolicy.Builder setPolicy(Policy.Builder builderForValue)
       The IAM policy attached to the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is empty.
       
      .google.iam.v1.Policy policy = 3;
    • mergePolicy

      public ExplainedPolicy.Builder mergePolicy(Policy value)
       The IAM policy attached to the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is empty.
       
      .google.iam.v1.Policy policy = 3;
    • clearPolicy

      public ExplainedPolicy.Builder clearPolicy()
       The IAM policy attached to the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is empty.
       
      .google.iam.v1.Policy policy = 3;
    • getPolicyBuilder

      public Policy.Builder getPolicyBuilder()
       The IAM policy attached to the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is empty.
       
      .google.iam.v1.Policy policy = 3;
    • getPolicyOrBuilder

      public PolicyOrBuilder getPolicyOrBuilder()
       The IAM policy attached to the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is empty.
       
      .google.iam.v1.Policy policy = 3;
      Specified by:
      getPolicyOrBuilder in interface ExplainedPolicyOrBuilder
    • getBindingExplanationsList

      public List<BindingExplanation> getBindingExplanationsList()
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
      Specified by:
      getBindingExplanationsList in interface ExplainedPolicyOrBuilder
    • getBindingExplanationsCount

      public int getBindingExplanationsCount()
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
      Specified by:
      getBindingExplanationsCount in interface ExplainedPolicyOrBuilder
    • getBindingExplanations

      public BindingExplanation getBindingExplanations(int index)
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
      Specified by:
      getBindingExplanations in interface ExplainedPolicyOrBuilder
    • setBindingExplanations

      public ExplainedPolicy.Builder setBindingExplanations(int index, BindingExplanation value)
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • setBindingExplanations

      public ExplainedPolicy.Builder setBindingExplanations(int index, BindingExplanation.Builder builderForValue)
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • addBindingExplanations

      public ExplainedPolicy.Builder addBindingExplanations(BindingExplanation value)
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • addBindingExplanations

      public ExplainedPolicy.Builder addBindingExplanations(int index, BindingExplanation value)
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • addBindingExplanations

      public ExplainedPolicy.Builder addBindingExplanations(BindingExplanation.Builder builderForValue)
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • addBindingExplanations

      public ExplainedPolicy.Builder addBindingExplanations(int index, BindingExplanation.Builder builderForValue)
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • addAllBindingExplanations

      public ExplainedPolicy.Builder addAllBindingExplanations(Iterable<? extends BindingExplanation> values)
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • clearBindingExplanations

      public ExplainedPolicy.Builder clearBindingExplanations()
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • removeBindingExplanations

      public ExplainedPolicy.Builder removeBindingExplanations(int index)
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • getBindingExplanationsBuilder

      public BindingExplanation.Builder getBindingExplanationsBuilder(int index)
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • getBindingExplanationsOrBuilder

      public BindingExplanationOrBuilder getBindingExplanationsOrBuilder(int index)
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
      Specified by:
      getBindingExplanationsOrBuilder in interface ExplainedPolicyOrBuilder
    • getBindingExplanationsOrBuilderList

      public List<? extends BindingExplanationOrBuilder> getBindingExplanationsOrBuilderList()
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
      Specified by:
      getBindingExplanationsOrBuilderList in interface ExplainedPolicyOrBuilder
    • addBindingExplanationsBuilder

      public BindingExplanation.Builder addBindingExplanationsBuilder()
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • addBindingExplanationsBuilder

      public BindingExplanation.Builder addBindingExplanationsBuilder(int index)
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • getBindingExplanationsBuilderList

      public List<BindingExplanation.Builder> getBindingExplanationsBuilderList()
       Details about how each binding in the policy affects the principal's
       ability, or inability, to use the permission for the resource.
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      repeated .google.cloud.policysimulator.v1.BindingExplanation binding_explanations = 4;
    • getRelevanceValue

      public int getRelevanceValue()
       The relevance of this policy to the overall determination in the
       [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.v3.TroubleshootIamPolicyResponse].
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 5;
      Specified by:
      getRelevanceValue in interface ExplainedPolicyOrBuilder
      Returns:
      The enum numeric value on the wire for relevance.
    • setRelevanceValue

      public ExplainedPolicy.Builder setRelevanceValue(int value)
       The relevance of this policy to the overall determination in the
       [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.v3.TroubleshootIamPolicyResponse].
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 5;
      Parameters:
      value - The enum numeric value on the wire for relevance to set.
      Returns:
      This builder for chaining.
    • getRelevance

      public HeuristicRelevance getRelevance()
       The relevance of this policy to the overall determination in the
       [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.v3.TroubleshootIamPolicyResponse].
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 5;
      Specified by:
      getRelevance in interface ExplainedPolicyOrBuilder
      Returns:
      The relevance.
    • setRelevance

      public ExplainedPolicy.Builder setRelevance(HeuristicRelevance value)
       The relevance of this policy to the overall determination in the
       [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.v3.TroubleshootIamPolicyResponse].
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 5;
      Parameters:
      value - The relevance to set.
      Returns:
      This builder for chaining.
    • clearRelevance

      public ExplainedPolicy.Builder clearRelevance()
       The relevance of this policy to the overall determination in the
       [TroubleshootIamPolicyResponse][google.cloud.policytroubleshooter.v3.TroubleshootIamPolicyResponse].
      
       If the user who created the
       [Replay][google.cloud.policysimulator.v1.Replay] does not have
       access to the policy, this field is omitted.
       
      .google.cloud.policysimulator.v1.HeuristicRelevance relevance = 5;
      Returns:
      This builder for chaining.