# 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.V2beta1.Model.NativeContent do
  @moduledoc """
  Native content for a creative.

  ## Attributes

  *   `advertiserName` (*type:* `String.t`, *default:* `nil`) - The name of the advertiser or sponsor, to be displayed in the ad creative.
  *   `appIcon` (*type:* `GoogleApi.AdExchangeBuyer.V2beta1.Model.Image.t`, *default:* `nil`) - The app icon, for app download ads.
  *   `body` (*type:* `String.t`, *default:* `nil`) - A long description of the ad.
  *   `callToAction` (*type:* `String.t`, *default:* `nil`) - A label for the button that the user is supposed to click.
  *   `clickLinkUrl` (*type:* `String.t`, *default:* `nil`) - The URL that the browser/SDK will load when the user clicks the ad.
  *   `clickTrackingUrl` (*type:* `String.t`, *default:* `nil`) - The URL to use for click tracking.
  *   `headline` (*type:* `String.t`, *default:* `nil`) - A short title for the ad.
  *   `image` (*type:* `GoogleApi.AdExchangeBuyer.V2beta1.Model.Image.t`, *default:* `nil`) - A large image.
  *   `logo` (*type:* `GoogleApi.AdExchangeBuyer.V2beta1.Model.Image.t`, *default:* `nil`) - A smaller image, for the advertiser's logo.
  *   `priceDisplayText` (*type:* `String.t`, *default:* `nil`) - The price of the promoted app including currency info.
  *   `starRating` (*type:* `float()`, *default:* `nil`) - The app rating in the app store. Must be in the range [0-5].
  *   `storeUrl` (*type:* `String.t`, *default:* `nil`) - The URL to the app store to purchase/download the promoted app.
  *   `videoUrl` (*type:* `String.t`, *default:* `nil`) - The URL to fetch a native video ad.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :advertiserName => String.t() | nil,
          :appIcon => GoogleApi.AdExchangeBuyer.V2beta1.Model.Image.t() | nil,
          :body => String.t() | nil,
          :callToAction => String.t() | nil,
          :clickLinkUrl => String.t() | nil,
          :clickTrackingUrl => String.t() | nil,
          :headline => String.t() | nil,
          :image => GoogleApi.AdExchangeBuyer.V2beta1.Model.Image.t() | nil,
          :logo => GoogleApi.AdExchangeBuyer.V2beta1.Model.Image.t() | nil,
          :priceDisplayText => String.t() | nil,
          :starRating => float() | nil,
          :storeUrl => String.t() | nil,
          :videoUrl => String.t() | nil
        }

  field(:advertiserName)
  field(:appIcon, as: GoogleApi.AdExchangeBuyer.V2beta1.Model.Image)
  field(:body)
  field(:callToAction)
  field(:clickLinkUrl)
  field(:clickTrackingUrl)
  field(:headline)
  field(:image, as: GoogleApi.AdExchangeBuyer.V2beta1.Model.Image)
  field(:logo, as: GoogleApi.AdExchangeBuyer.V2beta1.Model.Image)
  field(:priceDisplayText)
  field(:starRating)
  field(:storeUrl)
  field(:videoUrl)
end

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

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