# Generated by `mix github.gen` from docs/github-api/api.github.com.json. # Do not edit by hand; re-run the task instead. defmodule Noizu.Github.DependabotAlertSecurityAdvisory do @moduledoc false defstruct [ :classification, :cve_id, :cvss, :cvss_severities, :cwes, :description, :epss, :ghsa_id, :identifiers, :published_at, :references, :severity, :summary, :updated_at, :vulnerabilities, :withdrawn_at ] def from_json(json, headers \\ []) def from_json(nil, _headers), do: nil def from_json(list, headers) when is_list(list) do Enum.map(list, &from_json(&1, headers)) end def from_json(json, _headers) when is_map(json) do %__MODULE__{ classification: Map.get(json, :classification), cve_id: Map.get(json, :cve_id), cvss: Map.get(json, :cvss), cvss_severities: Noizu.Github.CvssSeverities.from_json(Map.get(json, :cvss_severities)), cwes: Map.get(json, :cwes), description: Map.get(json, :description), epss: Noizu.Github.SecurityAdvisoryEpss.from_json(Map.get(json, :epss)), ghsa_id: Map.get(json, :ghsa_id), identifiers: Map.get(json, :identifiers), published_at: Map.get(json, :published_at), references: Map.get(json, :references), severity: Map.get(json, :severity), summary: Map.get(json, :summary), updated_at: Map.get(json, :updated_at), vulnerabilities: Enum.map( Map.get(json, :vulnerabilities) || [], &Noizu.Github.DependabotAlertSecurityVulnerability.from_json(&1) ), withdrawn_at: Map.get(json, :withdrawn_at) } end def from_json(other, _headers), do: other end