lib/google_api/container_analysis/v1/model/vulnerability_occurrence.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.VulnerabilityOccurrence do
  @moduledoc """
  An occurrence of a severity vulnerability on a resource.

  ## Attributes

  *   `cvssScore` (*type:* `number()`, *default:* `nil`) - Output only. 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.CVSS.t`, *default:* `nil`) - The cvss v3 score for the vulnerability.
  *   `effectiveSeverity` (*type:* `String.t`, *default:* `nil`) - The distro assigned severity for this vulnerability when it is available, otherwise this is the note provider assigned severity. When there are multiple PackageIssues for this vulnerability, they can have different effective severities because some might be provided by the distro while others are provided by the language ecosystem for a language pack. For this reason, it is advised to use the effective severity on the PackageIssue level. In the case where multiple PackageIssues have differing effective severities, this field should be the highest severity for any of the PackageIssues.
  *   `fixAvailable` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether at least one of the affected packages has a fix available.
  *   `longDescription` (*type:* `String.t`, *default:* `nil`) - Output only. A detailed description of this vulnerability.
  *   `packageIssue` (*type:* `list(GoogleApi.ContainerAnalysis.V1.Model.PackageIssue.t)`, *default:* `nil`) - Required. The set of affected locations and their fixes (if available) within the associated resource.
  *   `relatedUrls` (*type:* `list(GoogleApi.ContainerAnalysis.V1.Model.RelatedUrl.t)`, *default:* `nil`) - Output only. URLs related to this vulnerability.
  *   `severity` (*type:* `String.t`, *default:* `nil`) - Output only. The note provider assigned severity of this vulnerability.
  *   `shortDescription` (*type:* `String.t`, *default:* `nil`) - Output only. A one sentence description of this vulnerability.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of package; whether native or non native (e.g., ruby gems, node.js packages, etc.).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cvssScore => number() | nil,
          :cvssv3 => GoogleApi.ContainerAnalysis.V1.Model.CVSS.t() | nil,
          :effectiveSeverity => String.t() | nil,
          :fixAvailable => boolean() | nil,
          :longDescription => String.t() | nil,
          :packageIssue => list(GoogleApi.ContainerAnalysis.V1.Model.PackageIssue.t()) | nil,
          :relatedUrls => list(GoogleApi.ContainerAnalysis.V1.Model.RelatedUrl.t()) | nil,
          :severity => String.t() | nil,
          :shortDescription => String.t() | nil,
          :type => String.t() | nil
        }

  field(:cvssScore)
  field(:cvssv3, as: GoogleApi.ContainerAnalysis.V1.Model.CVSS)
  field(:effectiveSeverity)
  field(:fixAvailable)
  field(:longDescription)
  field(:packageIssue, as: GoogleApi.ContainerAnalysis.V1.Model.PackageIssue, type: :list)
  field(:relatedUrls, as: GoogleApi.ContainerAnalysis.V1.Model.RelatedUrl, type: :list)
  field(:severity)
  field(:shortDescription)
  field(:type)
end

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

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