# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.NetworkSecurity.V1.Model.GatewaySecurityPolicyRule do
  @moduledoc """
  The GatewaySecurityPolicyRule resource is in a nested collection within a GatewaySecurityPolicy and represents a traffic matching condition and associated action to perform.

  ## Attributes

  *   `applicationMatcher` (*type:* `String.t`, *default:* `nil`) - Optional. CEL expression for matching on L7/application level criteria.
  *   `basicProfile` (*type:* `String.t`, *default:* `nil`) - Required. Profile which tells what the primitive action should be.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the rule was created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. Free-text description of the resource.
  *   `enabled` (*type:* `boolean()`, *default:* `nil`) - Required. Whether the rule is enforced.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. Name of the resource. ame is the full resource name so projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule} rule should match the pattern: (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$).
  *   `priority` (*type:* `integer()`, *default:* `nil`) - Required. Priority of the rule. Lower number corresponds to higher precedence.
  *   `sessionMatcher` (*type:* `String.t`, *default:* `nil`) - Required. CEL expression for matching on session criteria.
  *   `tlsInspectionEnabled` (*type:* `boolean()`, *default:* `nil`) - Optional. Flag to enable TLS inspection of traffic matching on , can only be true if the parent GatewaySecurityPolicy references a TLSInspectionConfig.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when the rule was updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :applicationMatcher => String.t() | nil,
          :basicProfile => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :enabled => boolean() | nil,
          :name => String.t() | nil,
          :priority => integer() | nil,
          :sessionMatcher => String.t() | nil,
          :tlsInspectionEnabled => boolean() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:applicationMatcher)
  field(:basicProfile)
  field(:createTime, as: DateTime)
  field(:description)
  field(:enabled)
  field(:name)
  field(:priority)
  field(:sessionMatcher)
  field(:tlsInspectionEnabled)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.NetworkSecurity.V1.Model.GatewaySecurityPolicyRule do
  def decode(value, options) do
    GoogleApi.NetworkSecurity.V1.Model.GatewaySecurityPolicyRule.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.NetworkSecurity.V1.Model.GatewaySecurityPolicyRule do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
