# 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.AirQuality.V1.Model.AirQualityIndex do
  @moduledoc """
  The basic object for representing different air quality metrics. When brought together, these metrics provide a snapshot about the current air quality conditions. There are multiple indexes in the world serving different purposes and groups interested in measuring different aspects of air quality.

  ## Attributes

  *   `aqi` (*type:* `integer()`, *default:* `nil`) -  The index's numeric score. Examples: 10, 100. The value is not normalized and should only be interpreted in the context of its related air-quality index. For non-numeric indexes, this field will not be returned. Note: This field should be used for calculations, graph display, etc. For displaying the index score, you should use the AQI display field.
  *   `aqiDisplay` (*type:* `String.t`, *default:* `nil`) - Textual representation of the index numeric score, that may include prefix or suffix symbols, which usually represents the worst index score. Example: >100 or 10+. Note: This field should be used when you want to display the index score. For non-numeric indexes, this field is empty.
  *   `category` (*type:* `String.t`, *default:* `nil`) - Textual classification of the index numeric score interpretation. For example: "Excellent air quality".
  *   `code` (*type:* `String.t`, *default:* `nil`) - The index's code. This field represents the index for programming purposes by using snake case instead of spaces. Examples: "uaqi", "fra_atmo".
  *   `color` (*type:* `GoogleApi.AirQuality.V1.Model.Color.t`, *default:* `nil`) - The color used to represent the AQI numeric score.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - A human readable representation of the index name. Example: "AQI (US)"
  *   `dominantPollutant` (*type:* `String.t`, *default:* `nil`) - The chemical symbol of the dominant pollutant. For example: "CO".
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :aqi => integer() | nil,
          :aqiDisplay => String.t() | nil,
          :category => String.t() | nil,
          :code => String.t() | nil,
          :color => GoogleApi.AirQuality.V1.Model.Color.t() | nil,
          :displayName => String.t() | nil,
          :dominantPollutant => String.t() | nil
        }

  field(:aqi)
  field(:aqiDisplay)
  field(:category)
  field(:code)
  field(:color, as: GoogleApi.AirQuality.V1.Model.Color)
  field(:displayName)
  field(:dominantPollutant)
end

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

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