# 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.AttackExposure do
  @moduledoc """
  An attack exposure contains the results of an attack path simulation run.

  ## Attributes

  *   `attackExposureResult` (*type:* `String.t`, *default:* `nil`) - The resource name of the attack path simulation result that contains the details regarding this attack exposure score. Example: `organizations/123/simulations/456/attackExposureResults/789`
  *   `exposedHighValueResourcesCount` (*type:* `integer()`, *default:* `nil`) - The number of high value resources that are exposed as a result of this finding.
  *   `exposedLowValueResourcesCount` (*type:* `integer()`, *default:* `nil`) - The number of high value resources that are exposed as a result of this finding.
  *   `exposedMediumValueResourcesCount` (*type:* `integer()`, *default:* `nil`) - The number of medium value resources that are exposed as a result of this finding.
  *   `latestCalculationTime` (*type:* `DateTime.t`, *default:* `nil`) - The most recent time the attack exposure was updated on this finding.
  *   `score` (*type:* `float()`, *default:* `nil`) - A number between 0 (inclusive) and infinity that represents how important this finding is to remediate. The higher the score, the more important it is to remediate.
  *   `state` (*type:* `String.t`, *default:* `nil`) - What state this AttackExposure is in. This captures whether or not an attack exposure has been calculated or not.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :attackExposureResult => String.t() | nil,
          :exposedHighValueResourcesCount => integer() | nil,
          :exposedLowValueResourcesCount => integer() | nil,
          :exposedMediumValueResourcesCount => integer() | nil,
          :latestCalculationTime => DateTime.t() | nil,
          :score => float() | nil,
          :state => String.t() | nil
        }

  field(:attackExposureResult)
  field(:exposedHighValueResourcesCount)
  field(:exposedLowValueResourcesCount)
  field(:exposedMediumValueResourcesCount)
  field(:latestCalculationTime, as: DateTime)
  field(:score)
  field(:state)
end

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

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