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.v1.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 a Cloud Organization `Policy` which is used to specify `Constraints`
 for configurations of Cloud Platform resources.
 
Protobuf type google.cloud.orgpolicy.v1.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
    • getPolicyTypeCase

      public Policy.PolicyTypeCase getPolicyTypeCase()
      Specified by:
      getPolicyTypeCase in interface PolicyOrBuilder
    • clearPolicyType

      public Policy.Builder clearPolicyType()
    • getVersion

      public int getVersion()
       Version of the `Policy`. Default version is 0;
       
      int32 version = 1;
      Specified by:
      getVersion in interface PolicyOrBuilder
      Returns:
      The version.
    • setVersion

      public Policy.Builder setVersion(int value)
       Version of the `Policy`. Default version is 0;
       
      int32 version = 1;
      Parameters:
      value - The version to set.
      Returns:
      This builder for chaining.
    • clearVersion

      public Policy.Builder clearVersion()
       Version of the `Policy`. Default version is 0;
       
      int32 version = 1;
      Returns:
      This builder for chaining.
    • getConstraint

      public String getConstraint()
       The name of the `Constraint` the `Policy` is configuring, for example,
       `constraints/serviceuser.services`.
      
       Immutable after creation.
       
      string constraint = 2;
      Specified by:
      getConstraint in interface PolicyOrBuilder
      Returns:
      The constraint.
    • getConstraintBytes

      public com.google.protobuf.ByteString getConstraintBytes()
       The name of the `Constraint` the `Policy` is configuring, for example,
       `constraints/serviceuser.services`.
      
       Immutable after creation.
       
      string constraint = 2;
      Specified by:
      getConstraintBytes in interface PolicyOrBuilder
      Returns:
      The bytes for constraint.
    • setConstraint

      public Policy.Builder setConstraint(String value)
       The name of the `Constraint` the `Policy` is configuring, for example,
       `constraints/serviceuser.services`.
      
       Immutable after creation.
       
      string constraint = 2;
      Parameters:
      value - The constraint to set.
      Returns:
      This builder for chaining.
    • clearConstraint

      public Policy.Builder clearConstraint()
       The name of the `Constraint` the `Policy` is configuring, for example,
       `constraints/serviceuser.services`.
      
       Immutable after creation.
       
      string constraint = 2;
      Returns:
      This builder for chaining.
    • setConstraintBytes

      public Policy.Builder setConstraintBytes(com.google.protobuf.ByteString value)
       The name of the `Constraint` the `Policy` is configuring, for example,
       `constraints/serviceuser.services`.
      
       Immutable after creation.
       
      string constraint = 2;
      Parameters:
      value - The bytes for constraint to set.
      Returns:
      This builder for chaining.
    • getEtag

      public com.google.protobuf.ByteString getEtag()
       An opaque tag indicating the current version of the `Policy`, used for
       concurrency control.
      
       When the `Policy` is returned from either a `GetPolicy` or a
       `ListOrgPolicy` request, this `etag` indicates the version of the current
       `Policy` to use when executing a read-modify-write loop.
      
       When the `Policy` is returned from a `GetEffectivePolicy` request, the
       `etag` will be unset.
      
       When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value
       that was returned from a `GetOrgPolicy` request as part of a
       read-modify-write loop for concurrency control. Not setting the `etag`in a
       `SetOrgPolicy` request will result in an unconditional write of the
       `Policy`.
       
      bytes etag = 3;
      Specified by:
      getEtag in interface PolicyOrBuilder
      Returns:
      The etag.
    • setEtag

      public Policy.Builder setEtag(com.google.protobuf.ByteString value)
       An opaque tag indicating the current version of the `Policy`, used for
       concurrency control.
      
       When the `Policy` is returned from either a `GetPolicy` or a
       `ListOrgPolicy` request, this `etag` indicates the version of the current
       `Policy` to use when executing a read-modify-write loop.
      
       When the `Policy` is returned from a `GetEffectivePolicy` request, the
       `etag` will be unset.
      
       When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value
       that was returned from a `GetOrgPolicy` request as part of a
       read-modify-write loop for concurrency control. Not setting the `etag`in a
       `SetOrgPolicy` request will result in an unconditional write of the
       `Policy`.
       
      bytes etag = 3;
      Parameters:
      value - The etag to set.
      Returns:
      This builder for chaining.
    • clearEtag

      public Policy.Builder clearEtag()
       An opaque tag indicating the current version of the `Policy`, used for
       concurrency control.
      
       When the `Policy` is returned from either a `GetPolicy` or a
       `ListOrgPolicy` request, this `etag` indicates the version of the current
       `Policy` to use when executing a read-modify-write loop.
      
       When the `Policy` is returned from a `GetEffectivePolicy` request, the
       `etag` will be unset.
      
       When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value
       that was returned from a `GetOrgPolicy` request as part of a
       read-modify-write loop for concurrency control. Not setting the `etag`in a
       `SetOrgPolicy` request will result in an unconditional write of the
       `Policy`.
       
      bytes etag = 3;
      Returns:
      This builder for chaining.
    • hasUpdateTime

      public boolean hasUpdateTime()
       The time stamp the `Policy` was previously updated. This is set by the
       server, not specified by the caller, and represents the last time a call to
       `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
       be ignored.
       
      .google.protobuf.Timestamp update_time = 4;
      Specified by:
      hasUpdateTime in interface PolicyOrBuilder
      Returns:
      Whether the updateTime field is set.
    • getUpdateTime

      public com.google.protobuf.Timestamp getUpdateTime()
       The time stamp the `Policy` was previously updated. This is set by the
       server, not specified by the caller, and represents the last time a call to
       `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
       be ignored.
       
      .google.protobuf.Timestamp update_time = 4;
      Specified by:
      getUpdateTime in interface PolicyOrBuilder
      Returns:
      The updateTime.
    • setUpdateTime

      public Policy.Builder setUpdateTime(com.google.protobuf.Timestamp value)
       The time stamp the `Policy` was previously updated. This is set by the
       server, not specified by the caller, and represents the last time a call to
       `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
       be ignored.
       
      .google.protobuf.Timestamp update_time = 4;
    • setUpdateTime

      public Policy.Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue)
       The time stamp the `Policy` was previously updated. This is set by the
       server, not specified by the caller, and represents the last time a call to
       `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
       be ignored.
       
      .google.protobuf.Timestamp update_time = 4;
    • mergeUpdateTime

      public Policy.Builder mergeUpdateTime(com.google.protobuf.Timestamp value)
       The time stamp the `Policy` was previously updated. This is set by the
       server, not specified by the caller, and represents the last time a call to
       `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
       be ignored.
       
      .google.protobuf.Timestamp update_time = 4;
    • clearUpdateTime

      public Policy.Builder clearUpdateTime()
       The time stamp the `Policy` was previously updated. This is set by the
       server, not specified by the caller, and represents the last time a call to
       `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
       be ignored.
       
      .google.protobuf.Timestamp update_time = 4;
    • getUpdateTimeBuilder

      public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder()
       The time stamp the `Policy` was previously updated. This is set by the
       server, not specified by the caller, and represents the last time a call to
       `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
       be ignored.
       
      .google.protobuf.Timestamp update_time = 4;
    • getUpdateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder()
       The time stamp the `Policy` was previously updated. This is set by the
       server, not specified by the caller, and represents the last time a call to
       `SetOrgPolicy` was made for that `Policy`. Any value set by the client will
       be ignored.
       
      .google.protobuf.Timestamp update_time = 4;
      Specified by:
      getUpdateTimeOrBuilder in interface PolicyOrBuilder
    • hasListPolicy

      public boolean hasListPolicy()
       List of values either allowed or disallowed.
       
      .google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;
      Specified by:
      hasListPolicy in interface PolicyOrBuilder
      Returns:
      Whether the listPolicy field is set.
    • getListPolicy

      public Policy.ListPolicy getListPolicy()
       List of values either allowed or disallowed.
       
      .google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;
      Specified by:
      getListPolicy in interface PolicyOrBuilder
      Returns:
      The listPolicy.
    • setListPolicy

      public Policy.Builder setListPolicy(Policy.ListPolicy value)
       List of values either allowed or disallowed.
       
      .google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;
    • setListPolicy

      public Policy.Builder setListPolicy(Policy.ListPolicy.Builder builderForValue)
       List of values either allowed or disallowed.
       
      .google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;
    • mergeListPolicy

      public Policy.Builder mergeListPolicy(Policy.ListPolicy value)
       List of values either allowed or disallowed.
       
      .google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;
    • clearListPolicy

      public Policy.Builder clearListPolicy()
       List of values either allowed or disallowed.
       
      .google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;
    • getListPolicyBuilder

      public Policy.ListPolicy.Builder getListPolicyBuilder()
       List of values either allowed or disallowed.
       
      .google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;
    • getListPolicyOrBuilder

      public Policy.ListPolicyOrBuilder getListPolicyOrBuilder()
       List of values either allowed or disallowed.
       
      .google.cloud.orgpolicy.v1.Policy.ListPolicy list_policy = 5;
      Specified by:
      getListPolicyOrBuilder in interface PolicyOrBuilder
    • hasBooleanPolicy

      public boolean hasBooleanPolicy()
       For boolean `Constraints`, whether to enforce the `Constraint` or not.
       
      .google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;
      Specified by:
      hasBooleanPolicy in interface PolicyOrBuilder
      Returns:
      Whether the booleanPolicy field is set.
    • getBooleanPolicy

      public Policy.BooleanPolicy getBooleanPolicy()
       For boolean `Constraints`, whether to enforce the `Constraint` or not.
       
      .google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;
      Specified by:
      getBooleanPolicy in interface PolicyOrBuilder
      Returns:
      The booleanPolicy.
    • setBooleanPolicy

      public Policy.Builder setBooleanPolicy(Policy.BooleanPolicy value)
       For boolean `Constraints`, whether to enforce the `Constraint` or not.
       
      .google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;
    • setBooleanPolicy

      public Policy.Builder setBooleanPolicy(Policy.BooleanPolicy.Builder builderForValue)
       For boolean `Constraints`, whether to enforce the `Constraint` or not.
       
      .google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;
    • mergeBooleanPolicy

      public Policy.Builder mergeBooleanPolicy(Policy.BooleanPolicy value)
       For boolean `Constraints`, whether to enforce the `Constraint` or not.
       
      .google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;
    • clearBooleanPolicy

      public Policy.Builder clearBooleanPolicy()
       For boolean `Constraints`, whether to enforce the `Constraint` or not.
       
      .google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;
    • getBooleanPolicyBuilder

      public Policy.BooleanPolicy.Builder getBooleanPolicyBuilder()
       For boolean `Constraints`, whether to enforce the `Constraint` or not.
       
      .google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;
    • getBooleanPolicyOrBuilder

      public Policy.BooleanPolicyOrBuilder getBooleanPolicyOrBuilder()
       For boolean `Constraints`, whether to enforce the `Constraint` or not.
       
      .google.cloud.orgpolicy.v1.Policy.BooleanPolicy boolean_policy = 6;
      Specified by:
      getBooleanPolicyOrBuilder in interface PolicyOrBuilder
    • hasRestoreDefault

      public boolean hasRestoreDefault()
       Restores the default behavior of the constraint; independent of
       `Constraint` type.
       
      .google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;
      Specified by:
      hasRestoreDefault in interface PolicyOrBuilder
      Returns:
      Whether the restoreDefault field is set.
    • getRestoreDefault

      public Policy.RestoreDefault getRestoreDefault()
       Restores the default behavior of the constraint; independent of
       `Constraint` type.
       
      .google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;
      Specified by:
      getRestoreDefault in interface PolicyOrBuilder
      Returns:
      The restoreDefault.
    • setRestoreDefault

      public Policy.Builder setRestoreDefault(Policy.RestoreDefault value)
       Restores the default behavior of the constraint; independent of
       `Constraint` type.
       
      .google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;
    • setRestoreDefault

      public Policy.Builder setRestoreDefault(Policy.RestoreDefault.Builder builderForValue)
       Restores the default behavior of the constraint; independent of
       `Constraint` type.
       
      .google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;
    • mergeRestoreDefault

      public Policy.Builder mergeRestoreDefault(Policy.RestoreDefault value)
       Restores the default behavior of the constraint; independent of
       `Constraint` type.
       
      .google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;
    • clearRestoreDefault

      public Policy.Builder clearRestoreDefault()
       Restores the default behavior of the constraint; independent of
       `Constraint` type.
       
      .google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;
    • getRestoreDefaultBuilder

      public Policy.RestoreDefault.Builder getRestoreDefaultBuilder()
       Restores the default behavior of the constraint; independent of
       `Constraint` type.
       
      .google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;
    • getRestoreDefaultOrBuilder

      public Policy.RestoreDefaultOrBuilder getRestoreDefaultOrBuilder()
       Restores the default behavior of the constraint; independent of
       `Constraint` type.
       
      .google.cloud.orgpolicy.v1.Policy.RestoreDefault restore_default = 7;
      Specified by:
      getRestoreDefaultOrBuilder in interface PolicyOrBuilder