lib/google_api/container_analysis/v1/model/vulnerability_note.ex

# 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.ContainerAnalysis.V1.Model.VulnerabilityNote do
  @moduledoc """
  A security vulnerability that can be found in resources.

  ## Attributes

  *   `cvssScore` (*type:* `number()`, *default:* `nil`) - The CVSS score of this vulnerability. CVSS score is on a scale of 0 - 10 where 0 indicates low severity and 10 indicates high severity.
  *   `cvssV3` (*type:* `GoogleApi.ContainerAnalysis.V1.Model.CVSSv3.t`, *default:* `nil`) - The full description of the CVSSv3 for this vulnerability.
  *   `details` (*type:* `list(GoogleApi.ContainerAnalysis.V1.Model.Detail.t)`, *default:* `nil`) - Details of all known distros and packages affected by this vulnerability.
  *   `severity` (*type:* `String.t`, *default:* `nil`) - The note provider assigned severity of this vulnerability.
  *   `sourceUpdateTime` (*type:* `DateTime.t`, *default:* `nil`) - The time this information was last changed at the source. This is an upstream timestamp from the underlying information source - e.g. Ubuntu security tracker.
  *   `windowsDetails` (*type:* `list(GoogleApi.ContainerAnalysis.V1.Model.WindowsDetail.t)`, *default:* `nil`) - Windows details get their own format because the information format and model don't match a normal detail. Specifically Windows updates are done as patches, thus Windows vulnerabilities really are a missing package, rather than a package being at an incorrect version.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cvssScore => number() | nil,
          :cvssV3 => GoogleApi.ContainerAnalysis.V1.Model.CVSSv3.t() | nil,
          :details => list(GoogleApi.ContainerAnalysis.V1.Model.Detail.t()) | nil,
          :severity => String.t() | nil,
          :sourceUpdateTime => DateTime.t() | nil,
          :windowsDetails => list(GoogleApi.ContainerAnalysis.V1.Model.WindowsDetail.t()) | nil
        }

  field(:cvssScore)
  field(:cvssV3, as: GoogleApi.ContainerAnalysis.V1.Model.CVSSv3)
  field(:details, as: GoogleApi.ContainerAnalysis.V1.Model.Detail, type: :list)
  field(:severity)
  field(:sourceUpdateTime, as: DateTime)
  field(:windowsDetails, as: GoogleApi.ContainerAnalysis.V1.Model.WindowsDetail, type: :list)
end

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

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