# 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.FactCheckTools.V1alpha1.Model.GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating do
  @moduledoc """
  Information about the claim rating.

  ## Attributes

  *   `bestRating` (*type:* `integer()`, *default:* `nil`) - For numeric ratings, the best value possible in the scale from worst to best. Corresponds to `ClaimReview.reviewRating.bestRating`.
  *   `imageUrl` (*type:* `String.t`, *default:* `nil`) - Corresponds to `ClaimReview.reviewRating.image`.
  *   `ratingExplanation` (*type:* `String.t`, *default:* `nil`) - Corresponds to `ClaimReview.reviewRating.ratingExplanation`.
  *   `ratingValue` (*type:* `integer()`, *default:* `nil`) - A numeric rating of this claim, in the range worstRating — bestRating inclusive. Corresponds to `ClaimReview.reviewRating.ratingValue`.
  *   `textualRating` (*type:* `String.t`, *default:* `nil`) - The truthfulness rating as a human-readible short word or phrase. Corresponds to `ClaimReview.reviewRating.alternateName`.
  *   `worstRating` (*type:* `integer()`, *default:* `nil`) - For numeric ratings, the worst value possible in the scale from worst to best. Corresponds to `ClaimReview.reviewRating.worstRating`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bestRating => integer() | nil,
          :imageUrl => String.t() | nil,
          :ratingExplanation => String.t() | nil,
          :ratingValue => integer() | nil,
          :textualRating => String.t() | nil,
          :worstRating => integer() | nil
        }

  field(:bestRating)
  field(:imageUrl)
  field(:ratingExplanation)
  field(:ratingValue)
  field(:textualRating)
  field(:worstRating)
end

defimpl Poison.Decoder,
  for: GoogleApi.FactCheckTools.V1alpha1.Model.GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating do
  def decode(value, options) do
    GoogleApi.FactCheckTools.V1alpha1.Model.GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.FactCheckTools.V1alpha1.Model.GoogleFactcheckingFactchecktoolsV1alpha1ClaimRating do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
