Class 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.GeneratedMessageV3.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 Detail

      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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
      • clone

        public Policy.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<Policy.Builder>
      • setField

        public Policy.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                       Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<Policy.Builder>
      • clearField

        public Policy.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Policy.Builder>
      • clearOneof

        public Policy.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Policy.Builder>
      • setRepeatedField

        public Policy.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                               int index,
                                               Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Policy.Builder>
      • addRepeatedField

        public Policy.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                               Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Policy.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>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.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
      • 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;
      • 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;
      • 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;
      • setUnknownFields

        public final Policy.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Policy.Builder>
      • mergeUnknownFields

        public final Policy.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Policy.Builder>