Class Policy.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Policy.Builder>
com.google.cloud.orgpolicy.v2.Policy.Builder
All Implemented Interfaces:
PolicyOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Policy

public static final class Policy.Builder extends com.google.protobuf.GeneratedMessage.Builder<Policy.Builder> implements PolicyOrBuilder
 Defines an organization policy which is used to specify constraints
 for configurations of Google Cloud resources.
 
Protobuf type google.cloud.orgpolicy.v2.Policy
  • 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<Policy.Builder>
    • clear

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

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

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

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

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

      public Policy.Builder mergeFrom(Policy other)
    • isInitialized

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

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

      public String getName()
       Immutable. The resource name of the policy. Must be one of the following
       forms, where `constraint_name` is the name of the constraint which this
       policy configures:
      
       * `projects/{project_number}/policies/{constraint_name}`
       * `folders/{folder_id}/policies/{constraint_name}`
       * `organizations/{organization_id}/policies/{constraint_name}`
      
       For example, `projects/123/policies/compute.disableSerialPortAccess`.
      
       Note: `projects/{project_id}/policies/{constraint_name}` is also an
       acceptable name for API requests, but responses will return the name using
       the equivalent project number.
       
      string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getName in interface PolicyOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Immutable. The resource name of the policy. Must be one of the following
       forms, where `constraint_name` is the name of the constraint which this
       policy configures:
      
       * `projects/{project_number}/policies/{constraint_name}`
       * `folders/{folder_id}/policies/{constraint_name}`
       * `organizations/{organization_id}/policies/{constraint_name}`
      
       For example, `projects/123/policies/compute.disableSerialPortAccess`.
      
       Note: `projects/{project_id}/policies/{constraint_name}` is also an
       acceptable name for API requests, but responses will return the name using
       the equivalent project number.
       
      string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getNameBytes in interface PolicyOrBuilder
      Returns:
      The bytes for name.
    • setName

      public Policy.Builder setName(String value)
       Immutable. The resource name of the policy. Must be one of the following
       forms, where `constraint_name` is the name of the constraint which this
       policy configures:
      
       * `projects/{project_number}/policies/{constraint_name}`
       * `folders/{folder_id}/policies/{constraint_name}`
       * `organizations/{organization_id}/policies/{constraint_name}`
      
       For example, `projects/123/policies/compute.disableSerialPortAccess`.
      
       Note: `projects/{project_id}/policies/{constraint_name}` is also an
       acceptable name for API requests, but responses will return the name using
       the equivalent project number.
       
      string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public Policy.Builder clearName()
       Immutable. The resource name of the policy. Must be one of the following
       forms, where `constraint_name` is the name of the constraint which this
       policy configures:
      
       * `projects/{project_number}/policies/{constraint_name}`
       * `folders/{folder_id}/policies/{constraint_name}`
       * `organizations/{organization_id}/policies/{constraint_name}`
      
       For example, `projects/123/policies/compute.disableSerialPortAccess`.
      
       Note: `projects/{project_id}/policies/{constraint_name}` is also an
       acceptable name for API requests, but responses will return the name using
       the equivalent project number.
       
      string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
      Returns:
      This builder for chaining.
    • setNameBytes

      public Policy.Builder setNameBytes(com.google.protobuf.ByteString value)
       Immutable. The resource name of the policy. Must be one of the following
       forms, where `constraint_name` is the name of the constraint which this
       policy configures:
      
       * `projects/{project_number}/policies/{constraint_name}`
       * `folders/{folder_id}/policies/{constraint_name}`
       * `organizations/{organization_id}/policies/{constraint_name}`
      
       For example, `projects/123/policies/compute.disableSerialPortAccess`.
      
       Note: `projects/{project_id}/policies/{constraint_name}` is also an
       acceptable name for API requests, but responses will return the name using
       the equivalent project number.
       
      string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • hasSpec

      public boolean hasSpec()
       Basic information about the organization policy.
       
      .google.cloud.orgpolicy.v2.PolicySpec spec = 2;
      Specified by:
      hasSpec in interface PolicyOrBuilder
      Returns:
      Whether the spec field is set.
    • getSpec

      public PolicySpec getSpec()
       Basic information about the organization policy.
       
      .google.cloud.orgpolicy.v2.PolicySpec spec = 2;
      Specified by:
      getSpec in interface PolicyOrBuilder
      Returns:
      The spec.
    • setSpec

      public Policy.Builder setSpec(PolicySpec value)
       Basic information about the organization policy.
       
      .google.cloud.orgpolicy.v2.PolicySpec spec = 2;
    • setSpec

      public Policy.Builder setSpec(PolicySpec.Builder builderForValue)
       Basic information about the organization policy.
       
      .google.cloud.orgpolicy.v2.PolicySpec spec = 2;
    • mergeSpec

      public Policy.Builder mergeSpec(PolicySpec value)
       Basic information about the organization policy.
       
      .google.cloud.orgpolicy.v2.PolicySpec spec = 2;
    • clearSpec

      public Policy.Builder clearSpec()
       Basic information about the organization policy.
       
      .google.cloud.orgpolicy.v2.PolicySpec spec = 2;
    • getSpecBuilder

      public PolicySpec.Builder getSpecBuilder()
       Basic information about the organization policy.
       
      .google.cloud.orgpolicy.v2.PolicySpec spec = 2;
    • getSpecOrBuilder

      public PolicySpecOrBuilder getSpecOrBuilder()
       Basic information about the organization policy.
       
      .google.cloud.orgpolicy.v2.PolicySpec spec = 2;
      Specified by:
      getSpecOrBuilder in interface PolicyOrBuilder
    • hasAlternate

      @Deprecated public boolean hasAlternate()
      Deprecated.
      google.cloud.orgpolicy.v2.Policy.alternate is deprecated. See google/cloud/orgpolicy/v2/orgpolicy.proto;l=271
       Deprecated.
       
      .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
      Specified by:
      hasAlternate in interface PolicyOrBuilder
      Returns:
      Whether the alternate field is set.
    • getAlternate

      @Deprecated public AlternatePolicySpec getAlternate()
      Deprecated.
      google.cloud.orgpolicy.v2.Policy.alternate is deprecated. See google/cloud/orgpolicy/v2/orgpolicy.proto;l=271
       Deprecated.
       
      .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
      Specified by:
      getAlternate in interface PolicyOrBuilder
      Returns:
      The alternate.
    • setAlternate

      @Deprecated public Policy.Builder setAlternate(AlternatePolicySpec value)
      Deprecated.
       Deprecated.
       
      .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
    • setAlternate

      @Deprecated public Policy.Builder setAlternate(AlternatePolicySpec.Builder builderForValue)
      Deprecated.
       Deprecated.
       
      .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
    • mergeAlternate

      @Deprecated public Policy.Builder mergeAlternate(AlternatePolicySpec value)
      Deprecated.
       Deprecated.
       
      .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
    • clearAlternate

      @Deprecated public Policy.Builder clearAlternate()
      Deprecated.
       Deprecated.
       
      .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
    • getAlternateBuilder

      @Deprecated public AlternatePolicySpec.Builder getAlternateBuilder()
      Deprecated.
       Deprecated.
       
      .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
    • getAlternateOrBuilder

      @Deprecated public AlternatePolicySpecOrBuilder getAlternateOrBuilder()
      Deprecated.
       Deprecated.
       
      .google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
      Specified by:
      getAlternateOrBuilder in interface PolicyOrBuilder
    • hasDryRunSpec

      public boolean hasDryRunSpec()
       Dry-run policy.
       Audit-only policy, can be used to monitor how the policy would have
       impacted the existing and future resources if it's enforced.
       
      .google.cloud.orgpolicy.v2.PolicySpec dry_run_spec = 4;
      Specified by:
      hasDryRunSpec in interface PolicyOrBuilder
      Returns:
      Whether the dryRunSpec field is set.
    • getDryRunSpec

      public PolicySpec getDryRunSpec()
       Dry-run policy.
       Audit-only policy, can be used to monitor how the policy would have
       impacted the existing and future resources if it's enforced.
       
      .google.cloud.orgpolicy.v2.PolicySpec dry_run_spec = 4;
      Specified by:
      getDryRunSpec in interface PolicyOrBuilder
      Returns:
      The dryRunSpec.
    • setDryRunSpec

      public Policy.Builder setDryRunSpec(PolicySpec value)
       Dry-run policy.
       Audit-only policy, can be used to monitor how the policy would have
       impacted the existing and future resources if it's enforced.
       
      .google.cloud.orgpolicy.v2.PolicySpec dry_run_spec = 4;
    • setDryRunSpec

      public Policy.Builder setDryRunSpec(PolicySpec.Builder builderForValue)
       Dry-run policy.
       Audit-only policy, can be used to monitor how the policy would have
       impacted the existing and future resources if it's enforced.
       
      .google.cloud.orgpolicy.v2.PolicySpec dry_run_spec = 4;
    • mergeDryRunSpec

      public Policy.Builder mergeDryRunSpec(PolicySpec value)
       Dry-run policy.
       Audit-only policy, can be used to monitor how the policy would have
       impacted the existing and future resources if it's enforced.
       
      .google.cloud.orgpolicy.v2.PolicySpec dry_run_spec = 4;
    • clearDryRunSpec

      public Policy.Builder clearDryRunSpec()
       Dry-run policy.
       Audit-only policy, can be used to monitor how the policy would have
       impacted the existing and future resources if it's enforced.
       
      .google.cloud.orgpolicy.v2.PolicySpec dry_run_spec = 4;
    • getDryRunSpecBuilder

      public PolicySpec.Builder getDryRunSpecBuilder()
       Dry-run policy.
       Audit-only policy, can be used to monitor how the policy would have
       impacted the existing and future resources if it's enforced.
       
      .google.cloud.orgpolicy.v2.PolicySpec dry_run_spec = 4;
    • getDryRunSpecOrBuilder

      public PolicySpecOrBuilder getDryRunSpecOrBuilder()
       Dry-run policy.
       Audit-only policy, can be used to monitor how the policy would have
       impacted the existing and future resources if it's enforced.
       
      .google.cloud.orgpolicy.v2.PolicySpec dry_run_spec = 4;
      Specified by:
      getDryRunSpecOrBuilder in interface PolicyOrBuilder
    • getEtag

      public String getEtag()
       Optional. An opaque tag indicating the current state of the policy, used
       for concurrency control. This 'etag' is computed by the server based on the
       value of other fields, and may be sent on update and delete requests to
       ensure the client has an up-to-date value before proceeding.
       
      string etag = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getEtag in interface PolicyOrBuilder
      Returns:
      The etag.
    • getEtagBytes

      public com.google.protobuf.ByteString getEtagBytes()
       Optional. An opaque tag indicating the current state of the policy, used
       for concurrency control. This 'etag' is computed by the server based on the
       value of other fields, and may be sent on update and delete requests to
       ensure the client has an up-to-date value before proceeding.
       
      string etag = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getEtagBytes in interface PolicyOrBuilder
      Returns:
      The bytes for etag.
    • setEtag

      public Policy.Builder setEtag(String value)
       Optional. An opaque tag indicating the current state of the policy, used
       for concurrency control. This 'etag' is computed by the server based on the
       value of other fields, and may be sent on update and delete requests to
       ensure the client has an up-to-date value before proceeding.
       
      string etag = 5 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The etag to set.
      Returns:
      This builder for chaining.
    • clearEtag

      public Policy.Builder clearEtag()
       Optional. An opaque tag indicating the current state of the policy, used
       for concurrency control. This 'etag' is computed by the server based on the
       value of other fields, and may be sent on update and delete requests to
       ensure the client has an up-to-date value before proceeding.
       
      string etag = 5 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • setEtagBytes

      public Policy.Builder setEtagBytes(com.google.protobuf.ByteString value)
       Optional. An opaque tag indicating the current state of the policy, used
       for concurrency control. This 'etag' is computed by the server based on the
       value of other fields, and may be sent on update and delete requests to
       ensure the client has an up-to-date value before proceeding.
       
      string etag = 5 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The bytes for etag to set.
      Returns:
      This builder for chaining.