# 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.AdExchangeBuyer.V14.Model.DealTerms do
  @moduledoc """


  ## Attributes

  *   `brandingType` (*type:* `String.t`, *default:* `nil`) - Visibility of the URL in bid requests.
  *   `crossListedExternalDealIdType` (*type:* `String.t`, *default:* `nil`) - Indicates that this ExternalDealId exists under at least two different AdxInventoryDeals. Currently, the only case that the same ExternalDealId will exist is programmatic cross sell case.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Description for the proposed terms of the deal.
  *   `estimatedGrossSpend` (*type:* `GoogleApi.AdExchangeBuyer.V14.Model.Price.t`, *default:* `nil`) - Non-binding estimate of the estimated gross spend for this deal Can be set by buyer or seller.
  *   `estimatedImpressionsPerDay` (*type:* `String.t`, *default:* `nil`) - Non-binding estimate of the impressions served per day Can be set by buyer or seller.
  *   `guaranteedFixedPriceTerms` (*type:* `GoogleApi.AdExchangeBuyer.V14.Model.DealTermsGuaranteedFixedPriceTerms.t`, *default:* `nil`) - The terms for guaranteed fixed price deals.
  *   `nonGuaranteedAuctionTerms` (*type:* `GoogleApi.AdExchangeBuyer.V14.Model.DealTermsNonGuaranteedAuctionTerms.t`, *default:* `nil`) - The terms for non-guaranteed auction deals.
  *   `nonGuaranteedFixedPriceTerms` (*type:* `GoogleApi.AdExchangeBuyer.V14.Model.DealTermsNonGuaranteedFixedPriceTerms.t`, *default:* `nil`) - The terms for non-guaranteed fixed price deals.
  *   `rubiconNonGuaranteedTerms` (*type:* `GoogleApi.AdExchangeBuyer.V14.Model.DealTermsRubiconNonGuaranteedTerms.t`, *default:* `nil`) - The terms for rubicon non-guaranteed deals.
  *   `sellerTimeZone` (*type:* `String.t`, *default:* `nil`) - For deals with Cost Per Day billing, defines the timezone used to mark the boundaries of a day (buyer-readonly)
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :brandingType => String.t() | nil,
          :crossListedExternalDealIdType => String.t() | nil,
          :description => String.t() | nil,
          :estimatedGrossSpend => GoogleApi.AdExchangeBuyer.V14.Model.Price.t() | nil,
          :estimatedImpressionsPerDay => String.t() | nil,
          :guaranteedFixedPriceTerms =>
            GoogleApi.AdExchangeBuyer.V14.Model.DealTermsGuaranteedFixedPriceTerms.t() | nil,
          :nonGuaranteedAuctionTerms =>
            GoogleApi.AdExchangeBuyer.V14.Model.DealTermsNonGuaranteedAuctionTerms.t() | nil,
          :nonGuaranteedFixedPriceTerms =>
            GoogleApi.AdExchangeBuyer.V14.Model.DealTermsNonGuaranteedFixedPriceTerms.t() | nil,
          :rubiconNonGuaranteedTerms =>
            GoogleApi.AdExchangeBuyer.V14.Model.DealTermsRubiconNonGuaranteedTerms.t() | nil,
          :sellerTimeZone => String.t() | nil
        }

  field(:brandingType)
  field(:crossListedExternalDealIdType)
  field(:description)
  field(:estimatedGrossSpend, as: GoogleApi.AdExchangeBuyer.V14.Model.Price)
  field(:estimatedImpressionsPerDay)

  field(:guaranteedFixedPriceTerms,
    as: GoogleApi.AdExchangeBuyer.V14.Model.DealTermsGuaranteedFixedPriceTerms
  )

  field(:nonGuaranteedAuctionTerms,
    as: GoogleApi.AdExchangeBuyer.V14.Model.DealTermsNonGuaranteedAuctionTerms
  )

  field(:nonGuaranteedFixedPriceTerms,
    as: GoogleApi.AdExchangeBuyer.V14.Model.DealTermsNonGuaranteedFixedPriceTerms
  )

  field(:rubiconNonGuaranteedTerms,
    as: GoogleApi.AdExchangeBuyer.V14.Model.DealTermsRubiconNonGuaranteedTerms
  )

  field(:sellerTimeZone)
end

defimpl Poison.Decoder, for: GoogleApi.AdExchangeBuyer.V14.Model.DealTerms do
  def decode(value, options) do
    GoogleApi.AdExchangeBuyer.V14.Model.DealTerms.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AdExchangeBuyer.V14.Model.DealTerms do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
