# 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.PageSpeedOnline.V5.Model.LighthouseAuditResultV5 do
  @moduledoc """
  An audit's result object in a Lighthouse result.

  ## Attributes

  *   `description` (*type:* `String.t`, *default:* `nil`) - The description of the audit.
  *   `details` (*type:* `map()`, *default:* `nil`) - Freeform details section of the audit.
  *   `displayValue` (*type:* `String.t`, *default:* `nil`) - The value that should be displayed on the UI for this audit.
  *   `errorMessage` (*type:* `String.t`, *default:* `nil`) - An error message from a thrown error inside the audit.
  *   `explanation` (*type:* `String.t`, *default:* `nil`) - An explanation of the errors in the audit.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The audit's id.
  *   `metricSavings` (*type:* `GoogleApi.PageSpeedOnline.V5.Model.MetricSavings.t`, *default:* `nil`) - The metric savings of the audit.
  *   `numericUnit` (*type:* `String.t`, *default:* `nil`) - The unit of the numeric_value field. Used to format the numeric value for display.
  *   `numericValue` (*type:* `float()`, *default:* `nil`) - A numeric value that has a meaning specific to the audit, e.g. the number of nodes in the DOM or the timestamp of a specific load event. More information can be found in the audit details, if present.
  *   `score` (*type:* `any()`, *default:* `nil`) - The score of the audit, can be null.
  *   `scoreDisplayMode` (*type:* `String.t`, *default:* `nil`) - The enumerated score display mode.
  *   `title` (*type:* `String.t`, *default:* `nil`) - The human readable title.
  *   `warnings` (*type:* `any()`, *default:* `nil`) - Possible warnings that occurred in the audit, can be null.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :description => String.t() | nil,
          :details => map() | nil,
          :displayValue => String.t() | nil,
          :errorMessage => String.t() | nil,
          :explanation => String.t() | nil,
          :id => String.t() | nil,
          :metricSavings => GoogleApi.PageSpeedOnline.V5.Model.MetricSavings.t() | nil,
          :numericUnit => String.t() | nil,
          :numericValue => float() | nil,
          :score => any() | nil,
          :scoreDisplayMode => String.t() | nil,
          :title => String.t() | nil,
          :warnings => any() | nil
        }

  field(:description)
  field(:details, type: :map)
  field(:displayValue)
  field(:errorMessage)
  field(:explanation)
  field(:id)
  field(:metricSavings, as: GoogleApi.PageSpeedOnline.V5.Model.MetricSavings)
  field(:numericUnit)
  field(:numericValue)
  field(:score)
  field(:scoreDisplayMode)
  field(:title)
  field(:warnings)
end

defimpl Poison.Decoder, for: GoogleApi.PageSpeedOnline.V5.Model.LighthouseAuditResultV5 do
  def decode(value, options) do
    GoogleApi.PageSpeedOnline.V5.Model.LighthouseAuditResultV5.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.PageSpeedOnline.V5.Model.LighthouseAuditResultV5 do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
