Class Policy

  • All Implemented Interfaces:
    PolicyOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class Policy
    extends com.google.protobuf.GeneratedMessageV3
    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
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Policy.BooleanPolicy
      Used in `policy_type` to specify how `boolean_policy` will behave at this resource.
      static interface  Policy.BooleanPolicyOrBuilder  
      static class  Policy.Builder
      Defines a Cloud Organization `Policy` which is used to specify `Constraints` for configurations of Cloud Platform resources.
      static class  Policy.ListPolicy
      Used in `policy_type` to specify how `list_policy` behaves at this resource.
      static interface  Policy.ListPolicyOrBuilder  
      static class  Policy.PolicyTypeCase  
      static class  Policy.RestoreDefault
      Ignores policies set above this resource and restores the `constraint_default` enforcement behavior of the specific `Constraint` at this resource.
      static interface  Policy.RestoreDefaultOrBuilder  
      • Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3

        com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,​BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,​BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
      • Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

        com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • 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
      • getVersion

        public int getVersion()
         Version of the `Policy`. Default version is 0;
         
        int32 version = 1;
        Specified by:
        getVersion in interface PolicyOrBuilder
        Returns:
        The version.
      • 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.
      • 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.
      • 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.
      • 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.
      • 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.
      • 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.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static Policy parseFrom​(ByteBuffer data)
                                throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Policy parseFrom​(ByteBuffer data,
                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Policy parseFrom​(com.google.protobuf.ByteString data)
                                throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Policy parseFrom​(com.google.protobuf.ByteString data,
                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Policy parseFrom​(byte[] data)
                                throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Policy parseFrom​(byte[] data,
                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Policy parseFrom​(com.google.protobuf.CodedInputStream input,
                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                throws IOException
        Throws:
        IOException
      • newBuilderForType

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

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

        protected Policy.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static Policy getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<Policy> parser()
      • getParserForType

        public com.google.protobuf.Parser<Policy> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

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