# 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.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2CloudArmor do
  @moduledoc """
  Fields related to Google Cloud Armor findings.

  ## Attributes

  *   `adaptiveProtection` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2AdaptiveProtection.t`, *default:* `nil`) - Information about potential Layer 7 DDoS attacks identified by [Google Cloud Armor Adaptive Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
  *   `attack` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2Attack.t`, *default:* `nil`) - Information about DDoS attack volume and classification.
  *   `duration` (*type:* `String.t`, *default:* `nil`) - Duration of attack from the start until the current moment (updated every 5 minutes).
  *   `requests` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2Requests.t`, *default:* `nil`) - Information about incoming requests evaluated by [Google Cloud Armor security policies](https://cloud.google.com/armor/docs/security-policy-overview).
  *   `securityPolicy` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2SecurityPolicy.t`, *default:* `nil`) - Information about the [Google Cloud Armor security policy](https://cloud.google.com/armor/docs/security-policy-overview) relevant to the finding.
  *   `threatVector` (*type:* `String.t`, *default:* `nil`) - Distinguish between volumetric & protocol DDoS attack and application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS attacks, or "L_7" for Layer 7 DDoS attacks.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :adaptiveProtection =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2AdaptiveProtection.t()
            | nil,
          :attack =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2Attack.t() | nil,
          :duration => String.t() | nil,
          :requests =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2Requests.t() | nil,
          :securityPolicy =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2SecurityPolicy.t() | nil,
          :threatVector => String.t() | nil
        }

  field(:adaptiveProtection,
    as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2AdaptiveProtection
  )

  field(:attack, as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2Attack)
  field(:duration)
  field(:requests, as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2Requests)

  field(:securityPolicy,
    as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2SecurityPolicy
  )

  field(:threatVector)
end

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

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