# 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.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1DetailedLeadReport do
  @moduledoc """
  A Detailed Lead Report of a lead identified by their lead id and contains consumer, account, monetization, and lead data.

  ## Attributes

  *   `accountId` (*type:* `String.t`, *default:* `nil`) - Identifies account that received the lead.
  *   `aggregatorInfo` (*type:* `GoogleApi.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1AggregatorInfo.t`, *default:* `nil`) - Aggregator specific information related to the lead.
  *   `bookingLead` (*type:* `GoogleApi.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1BookingLead.t`, *default:* `nil`) - More information associated to only booking leads.
  *   `businessName` (*type:* `String.t`, *default:* `nil`) - Business name associated to the account.
  *   `chargeStatus` (*type:* `String.t`, *default:* `nil`) - Whether the lead has been charged.
  *   `currencyCode` (*type:* `String.t`, *default:* `nil`) - Currency code.
  *   `disputeStatus` (*type:* `String.t`, *default:* `nil`) - Dispute status related to the lead.
  *   `geo` (*type:* `String.t`, *default:* `nil`) - Location of the associated account's home city.
  *   `googleAdsLeadId` (*type:* `String.t`, *default:* `nil`) - Unique identifier of a Detailed Lead Report.
  *   `leadCategory` (*type:* `String.t`, *default:* `nil`) - Lead category (e.g. hvac, plumber)
  *   `leadCreationTimestamp` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp of when the lead was created.
  *   `leadId` (*type:* `String.t`, *default:* `nil`) - Deprecated in favor of google_ads_lead_id. Unique identifier of a Detailed Lead Report.
  *   `leadPrice` (*type:* `float()`, *default:* `nil`) - Price of the lead (available only after it has been charged).
  *   `leadType` (*type:* `String.t`, *default:* `nil`) - Lead type.
  *   `messageLead` (*type:* `GoogleApi.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1MessageLead.t`, *default:* `nil`) - More information associated to only message leads.
  *   `phoneLead` (*type:* `GoogleApi.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1PhoneLead.t`, *default:* `nil`) - More information associated to only phone leads.
  *   `timezone` (*type:* `GoogleApi.LocalServices.V1.Model.GoogleTypeTimeZone.t`, *default:* `nil`) - Timezone of the particular provider associated to a lead.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accountId => String.t() | nil,
          :aggregatorInfo =>
            GoogleApi.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1AggregatorInfo.t()
            | nil,
          :bookingLead =>
            GoogleApi.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1BookingLead.t()
            | nil,
          :businessName => String.t() | nil,
          :chargeStatus => String.t() | nil,
          :currencyCode => String.t() | nil,
          :disputeStatus => String.t() | nil,
          :geo => String.t() | nil,
          :googleAdsLeadId => String.t() | nil,
          :leadCategory => String.t() | nil,
          :leadCreationTimestamp => DateTime.t() | nil,
          :leadId => String.t() | nil,
          :leadPrice => float() | nil,
          :leadType => String.t() | nil,
          :messageLead =>
            GoogleApi.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1MessageLead.t()
            | nil,
          :phoneLead =>
            GoogleApi.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1PhoneLead.t()
            | nil,
          :timezone => GoogleApi.LocalServices.V1.Model.GoogleTypeTimeZone.t() | nil
        }

  field(:accountId)

  field(:aggregatorInfo,
    as: GoogleApi.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1AggregatorInfo
  )

  field(:bookingLead,
    as: GoogleApi.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1BookingLead
  )

  field(:businessName)
  field(:chargeStatus)
  field(:currencyCode)
  field(:disputeStatus)
  field(:geo)
  field(:googleAdsLeadId)
  field(:leadCategory)
  field(:leadCreationTimestamp, as: DateTime)
  field(:leadId)
  field(:leadPrice)
  field(:leadType)

  field(:messageLead,
    as: GoogleApi.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1MessageLead
  )

  field(:phoneLead,
    as: GoogleApi.LocalServices.V1.Model.GoogleAdsHomeservicesLocalservicesV1PhoneLead
  )

  field(:timezone, as: GoogleApi.LocalServices.V1.Model.GoogleTypeTimeZone)
end

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

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