# 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.GoogleFactcheckingFactchecktoolsV1alpha1Claim do
  @moduledoc """
  Information about the claim.

  ## Attributes

  *   `claimDate` (*type:* `DateTime.t`, *default:* `nil`) - The date that the claim was made.
  *   `claimReview` (*type:* `list(GoogleApi.FactCheckTools.V1alpha1.Model.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview.t)`, *default:* `nil`) - One or more reviews of this claim (namely, a fact-checking article).
  *   `claimant` (*type:* `String.t`, *default:* `nil`) - A person or organization stating the claim. For instance, "John Doe".
  *   `text` (*type:* `String.t`, *default:* `nil`) - The claim text. For instance, "Crime has doubled in the last 2 years."
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :claimDate => DateTime.t() | nil,
          :claimReview =>
            list(
              GoogleApi.FactCheckTools.V1alpha1.Model.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview.t()
            )
            | nil,
          :claimant => String.t() | nil,
          :text => String.t() | nil
        }

  field(:claimDate, as: DateTime)

  field(:claimReview,
    as:
      GoogleApi.FactCheckTools.V1alpha1.Model.GoogleFactcheckingFactchecktoolsV1alpha1ClaimReview,
    type: :list
  )

  field(:claimant)
  field(:text)
end

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

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