Class AuthzPolicy

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.networksecurity.v1.AuthzPolicy
All Implemented Interfaces:
AuthzPolicyOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class AuthzPolicy extends com.google.protobuf.GeneratedMessage implements AuthzPolicyOrBuilder
 `AuthzPolicy` is a resource that allows to forward traffic to a
 callout backend designed to scan the traffic for security purposes.
 
Protobuf type google.cloud.networksecurity.v1.AuthzPolicy
See Also:
  • Field Details

  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage
    • getName

      public String getName()
       Required. Identifier. Name of the `AuthzPolicy` resource in the following
       format:
       `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
       
      string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER];
      Specified by:
      getName in interface AuthzPolicyOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Required. Identifier. Name of the `AuthzPolicy` resource in the following
       format:
       `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`.
       
      string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER];
      Specified by:
      getNameBytes in interface AuthzPolicyOrBuilder
      Returns:
      The bytes for name.
    • hasCreateTime

      public boolean hasCreateTime()
       Output only. The timestamp when the resource was created.
       
      .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasCreateTime in interface AuthzPolicyOrBuilder
      Returns:
      Whether the createTime field is set.
    • getCreateTime

      public com.google.protobuf.Timestamp getCreateTime()
       Output only. The timestamp when the resource was created.
       
      .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTime in interface AuthzPolicyOrBuilder
      Returns:
      The createTime.
    • getCreateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder()
       Output only. The timestamp when the resource was created.
       
      .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTimeOrBuilder in interface AuthzPolicyOrBuilder
    • hasUpdateTime

      public boolean hasUpdateTime()
       Output only. The timestamp when the resource was updated.
       
      .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasUpdateTime in interface AuthzPolicyOrBuilder
      Returns:
      Whether the updateTime field is set.
    • getUpdateTime

      public com.google.protobuf.Timestamp getUpdateTime()
       Output only. The timestamp when the resource was updated.
       
      .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getUpdateTime in interface AuthzPolicyOrBuilder
      Returns:
      The updateTime.
    • getUpdateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder()
       Output only. The timestamp when the resource was updated.
       
      .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getUpdateTimeOrBuilder in interface AuthzPolicyOrBuilder
    • getDescription

      public String getDescription()
       Optional. A human-readable description of the resource.
       
      string description = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDescription in interface AuthzPolicyOrBuilder
      Returns:
      The description.
    • getDescriptionBytes

      public com.google.protobuf.ByteString getDescriptionBytes()
       Optional. A human-readable description of the resource.
       
      string description = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDescriptionBytes in interface AuthzPolicyOrBuilder
      Returns:
      The bytes for description.
    • getLabelsCount

      public int getLabelsCount()
      Description copied from interface: AuthzPolicyOrBuilder
       Optional. Set of labels associated with the `AuthzPolicy` resource.
      
       The format must comply with [the following
       requirements](/compute/docs/labeling-resources#requirements).
       
      map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getLabelsCount in interface AuthzPolicyOrBuilder
    • containsLabels

      public boolean containsLabels(String key)
       Optional. Set of labels associated with the `AuthzPolicy` resource.
      
       The format must comply with [the following
       requirements](/compute/docs/labeling-resources#requirements).
       
      map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      containsLabels in interface AuthzPolicyOrBuilder
    • getLabels

      @Deprecated public Map<String,String> getLabels()
      Deprecated.
      Use getLabelsMap() instead.
      Specified by:
      getLabels in interface AuthzPolicyOrBuilder
    • getLabelsMap

      public Map<String,String> getLabelsMap()
       Optional. Set of labels associated with the `AuthzPolicy` resource.
      
       The format must comply with [the following
       requirements](/compute/docs/labeling-resources#requirements).
       
      map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getLabelsMap in interface AuthzPolicyOrBuilder
    • getLabelsOrDefault

      public String getLabelsOrDefault(String key, String defaultValue)
       Optional. Set of labels associated with the `AuthzPolicy` resource.
      
       The format must comply with [the following
       requirements](/compute/docs/labeling-resources#requirements).
       
      map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getLabelsOrDefault in interface AuthzPolicyOrBuilder
    • getLabelsOrThrow

      public String getLabelsOrThrow(String key)
       Optional. Set of labels associated with the `AuthzPolicy` resource.
      
       The format must comply with [the following
       requirements](/compute/docs/labeling-resources#requirements).
       
      map<string, string> labels = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getLabelsOrThrow in interface AuthzPolicyOrBuilder
    • hasTarget

      public boolean hasTarget()
       Required. Specifies the set of resources to which this policy should be
       applied to.
       
      .google.cloud.networksecurity.v1.AuthzPolicy.Target target = 6 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      hasTarget in interface AuthzPolicyOrBuilder
      Returns:
      Whether the target field is set.
    • getTarget

      public AuthzPolicy.Target getTarget()
       Required. Specifies the set of resources to which this policy should be
       applied to.
       
      .google.cloud.networksecurity.v1.AuthzPolicy.Target target = 6 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getTarget in interface AuthzPolicyOrBuilder
      Returns:
      The target.
    • getTargetOrBuilder

      public AuthzPolicy.TargetOrBuilder getTargetOrBuilder()
       Required. Specifies the set of resources to which this policy should be
       applied to.
       
      .google.cloud.networksecurity.v1.AuthzPolicy.Target target = 6 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getTargetOrBuilder in interface AuthzPolicyOrBuilder
    • getHttpRulesList

      public List<AuthzPolicy.AuthzRule> getHttpRulesList()
       Optional. A list of authorization HTTP rules to match against the incoming
       request. A policy match occurs when at least one HTTP rule matches the
       request or when no HTTP rules are specified in the policy.
       At least one HTTP Rule is required for Allow or Deny Action. Limited
       to 5 rules.
       
      repeated .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule http_rules = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getHttpRulesList in interface AuthzPolicyOrBuilder
    • getHttpRulesOrBuilderList

      public List<? extends AuthzPolicy.AuthzRuleOrBuilder> getHttpRulesOrBuilderList()
       Optional. A list of authorization HTTP rules to match against the incoming
       request. A policy match occurs when at least one HTTP rule matches the
       request or when no HTTP rules are specified in the policy.
       At least one HTTP Rule is required for Allow or Deny Action. Limited
       to 5 rules.
       
      repeated .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule http_rules = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getHttpRulesOrBuilderList in interface AuthzPolicyOrBuilder
    • getHttpRulesCount

      public int getHttpRulesCount()
       Optional. A list of authorization HTTP rules to match against the incoming
       request. A policy match occurs when at least one HTTP rule matches the
       request or when no HTTP rules are specified in the policy.
       At least one HTTP Rule is required for Allow or Deny Action. Limited
       to 5 rules.
       
      repeated .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule http_rules = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getHttpRulesCount in interface AuthzPolicyOrBuilder
    • getHttpRules

      public AuthzPolicy.AuthzRule getHttpRules(int index)
       Optional. A list of authorization HTTP rules to match against the incoming
       request. A policy match occurs when at least one HTTP rule matches the
       request or when no HTTP rules are specified in the policy.
       At least one HTTP Rule is required for Allow or Deny Action. Limited
       to 5 rules.
       
      repeated .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule http_rules = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getHttpRules in interface AuthzPolicyOrBuilder
    • getHttpRulesOrBuilder

      public AuthzPolicy.AuthzRuleOrBuilder getHttpRulesOrBuilder(int index)
       Optional. A list of authorization HTTP rules to match against the incoming
       request. A policy match occurs when at least one HTTP rule matches the
       request or when no HTTP rules are specified in the policy.
       At least one HTTP Rule is required for Allow or Deny Action. Limited
       to 5 rules.
       
      repeated .google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule http_rules = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getHttpRulesOrBuilder in interface AuthzPolicyOrBuilder
    • getActionValue

      public int getActionValue()
       Required. Can be one of `ALLOW`, `DENY`, `CUSTOM`.
      
       When the action is `CUSTOM`, `customProvider` must be specified.
      
       When the action is `ALLOW`, only requests matching the policy will
       be allowed.
      
       When the action is `DENY`, only requests matching the policy will be
       denied.
      
       When a request arrives, the policies are evaluated in the following order:
      
       1. If there is a `CUSTOM` policy that matches the request, the `CUSTOM`
       policy is evaluated using the custom authorization providers and the
       request is denied if the provider rejects the request.
      
       2. If there are any `DENY` policies that match the request, the request
       is denied.
      
       3. If there are no `ALLOW` policies for the resource or if any of the
       `ALLOW` policies match the request, the request is allowed.
      
       4. Else the request is denied by default if none of the configured
       AuthzPolicies with `ALLOW` action match the request.
       
      .google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction action = 8 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getActionValue in interface AuthzPolicyOrBuilder
      Returns:
      The enum numeric value on the wire for action.
    • getAction

      public AuthzPolicy.AuthzAction getAction()
       Required. Can be one of `ALLOW`, `DENY`, `CUSTOM`.
      
       When the action is `CUSTOM`, `customProvider` must be specified.
      
       When the action is `ALLOW`, only requests matching the policy will
       be allowed.
      
       When the action is `DENY`, only requests matching the policy will be
       denied.
      
       When a request arrives, the policies are evaluated in the following order:
      
       1. If there is a `CUSTOM` policy that matches the request, the `CUSTOM`
       policy is evaluated using the custom authorization providers and the
       request is denied if the provider rejects the request.
      
       2. If there are any `DENY` policies that match the request, the request
       is denied.
      
       3. If there are no `ALLOW` policies for the resource or if any of the
       `ALLOW` policies match the request, the request is allowed.
      
       4. Else the request is denied by default if none of the configured
       AuthzPolicies with `ALLOW` action match the request.
       
      .google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction action = 8 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getAction in interface AuthzPolicyOrBuilder
      Returns:
      The action.
    • hasCustomProvider

      public boolean hasCustomProvider()
       Optional. Required if the action is `CUSTOM`. Allows delegating
       authorization decisions to Cloud IAP or to Service Extensions. One of
       `cloudIap` or `authzExtension` must be specified.
       
      .google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider custom_provider = 10 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasCustomProvider in interface AuthzPolicyOrBuilder
      Returns:
      Whether the customProvider field is set.
    • getCustomProvider

      public AuthzPolicy.CustomProvider getCustomProvider()
       Optional. Required if the action is `CUSTOM`. Allows delegating
       authorization decisions to Cloud IAP or to Service Extensions. One of
       `cloudIap` or `authzExtension` must be specified.
       
      .google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider custom_provider = 10 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getCustomProvider in interface AuthzPolicyOrBuilder
      Returns:
      The customProvider.
    • getCustomProviderOrBuilder

      public AuthzPolicy.CustomProviderOrBuilder getCustomProviderOrBuilder()
       Optional. Required if the action is `CUSTOM`. Allows delegating
       authorization decisions to Cloud IAP or to Service Extensions. One of
       `cloudIap` or `authzExtension` must be specified.
       
      .google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider custom_provider = 10 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getCustomProviderOrBuilder in interface AuthzPolicyOrBuilder
    • getPolicyProfileValue

      public int getPolicyProfileValue()
       Optional. Immutable. Defines the type of authorization being performed.
       If not specified, `REQUEST_AUTHZ` is applied. This field cannot be changed
       once AuthzPolicy is created.
       
      .google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile policy_profile = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getPolicyProfileValue in interface AuthzPolicyOrBuilder
      Returns:
      The enum numeric value on the wire for policyProfile.
    • getPolicyProfile

      public AuthzPolicy.PolicyProfile getPolicyProfile()
       Optional. Immutable. Defines the type of authorization being performed.
       If not specified, `REQUEST_AUTHZ` is applied. This field cannot be changed
       once AuthzPolicy is created.
       
      .google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile policy_profile = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getPolicyProfile in interface AuthzPolicyOrBuilder
      Returns:
      The policyProfile.
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • 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.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • 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 AuthzPolicy parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

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

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

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

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

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

      public static AuthzPolicy parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static AuthzPolicy parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static AuthzPolicy parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static AuthzPolicy parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static AuthzPolicy parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

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

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

      public static AuthzPolicy.Builder newBuilder()
    • newBuilder

      public static AuthzPolicy.Builder newBuilder(AuthzPolicy prototype)
    • toBuilder

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

      protected AuthzPolicy.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static AuthzPolicy getDefaultInstance()
    • parser

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

      public com.google.protobuf.Parser<AuthzPolicy> 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.GeneratedMessage
    • getDefaultInstanceForType

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