# 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.GoogleCloudSecuritycenterV2Issue do
  @moduledoc """
  Security Command Center Issue.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the issue was created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - The description of the issue in Markdown format.
  *   `detection` (*type:* `String.t`, *default:* `nil`) - The finding category or rule name that generated the issue.
  *   `domains` (*type:* `list(GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueDomain.t)`, *default:* `nil`) - The domains of the issue.
  *   `exposureScore` (*type:* `float()`, *default:* `nil`) - The exposure score of the issue.
  *   `issueType` (*type:* `String.t`, *default:* `nil`) - The type of the issue.
  *   `lastObservationTime` (*type:* `DateTime.t`, *default:* `nil`) - The time the issue was last observed.
  *   `mute` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueMute.t`, *default:* `nil`) - The mute information of the issue.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. The name of the issue. Format: organizations/{organization}/locations/{location}/issues/{issue}
  *   `primaryResource` (*type:* `GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResource.t`, *default:* `nil`) - The primary resource associated with the issue.
  *   `relatedFindings` (*type:* `list(GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueFinding.t)`, *default:* `nil`) - The findings related to the issue.
  *   `remediations` (*type:* `list(String.t)`, *default:* `nil`) - Approaches to remediate the issue in Markdown format.
  *   `secondaryResources` (*type:* `list(GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResource.t)`, *default:* `nil`) - Additional resources associated with the issue.
  *   `securityContexts` (*type:* `list(GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueSecurityContext.t)`, *default:* `nil`) - The security context of the issue.
  *   `severity` (*type:* `String.t`, *default:* `nil`) - The severity of the issue.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The state of the issue.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the issue was last updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :detection => String.t() | nil,
          :domains =>
            list(GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueDomain.t())
            | nil,
          :exposureScore => float() | nil,
          :issueType => String.t() | nil,
          :lastObservationTime => DateTime.t() | nil,
          :mute =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueMute.t() | nil,
          :name => String.t() | nil,
          :primaryResource =>
            GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResource.t() | nil,
          :relatedFindings =>
            list(GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueFinding.t())
            | nil,
          :remediations => list(String.t()) | nil,
          :secondaryResources =>
            list(GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResource.t())
            | nil,
          :securityContexts =>
            list(
              GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueSecurityContext.t()
            )
            | nil,
          :severity => String.t() | nil,
          :state => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:description)
  field(:detection)

  field(:domains,
    as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueDomain,
    type: :list
  )

  field(:exposureScore)
  field(:issueType)
  field(:lastObservationTime, as: DateTime)
  field(:mute, as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueMute)
  field(:name)

  field(:primaryResource,
    as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResource
  )

  field(:relatedFindings,
    as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueFinding,
    type: :list
  )

  field(:remediations, type: :list)

  field(:secondaryResources,
    as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueResource,
    type: :list
  )

  field(:securityContexts,
    as: GoogleApi.SecurityCenter.V1.Model.GoogleCloudSecuritycenterV2IssueSecurityContext,
    type: :list
  )

  field(:severity)
  field(:state)
  field(:updateTime, as: DateTime)
end

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

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