# 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.AdMob.V1.Model.AdUnit do
  @moduledoc """
  Describes an AdMob ad unit.

  ## Attributes

  *   `adFormat` (*type:* `String.t`, *default:* `nil`) - AdFormat of the ad unit. Possible values are as follows: "APP_OPEN" - App Open ad format. "BANNER" - Banner ad format. "BANNER_INTERSTITIAL" - Legacy format that can be used as either banner or interstitial. This format can no longer be created but can be targeted by mediation groups. "INTERSTITIAL" - A full screen ad. Supported ad types are "RICH_MEDIA" and "VIDEO". "NATIVE" - Native ad format. "REWARDED" - An ad that, once viewed, gets a callback verifying the view so that a reward can be given to the user. Supported ad types are "RICH_MEDIA" (interactive) and video where video can not be excluded. "REWARDED_INTERSTITIAL" - Rewarded Interstitial ad format. Only supports video ad type. See https://support.google.com/admob/answer/9884467.
  *   `adTypes` (*type:* `list(String.t)`, *default:* `nil`) - Ad media type supported by this ad unit. Possible values as follows: "RICH_MEDIA" - Text, image, and other non-video media. "VIDEO" - Video media.
  *   `adUnitId` (*type:* `String.t`, *default:* `nil`) - The externally visible ID of the ad unit which can be used to integrate with the AdMob SDK. This is a read only property. Example: ca-app-pub-9876543210987654/0123456789
  *   `appId` (*type:* `String.t`, *default:* `nil`) - The externally visible ID of the app this ad unit is associated with. Example: ca-app-pub-9876543210987654~0123456789
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The display name of the ad unit as shown in the AdMob UI, which is provided by the user. The maximum length allowed is 80 characters.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Resource name for this ad unit. Format is accounts/{publisher_id}/adUnits/{ad_unit_id_fragment} Example: accounts/pub-9876543210987654/adUnits/0123456789
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :adFormat => String.t() | nil,
          :adTypes => list(String.t()) | nil,
          :adUnitId => String.t() | nil,
          :appId => String.t() | nil,
          :displayName => String.t() | nil,
          :name => String.t() | nil
        }

  field(:adFormat)
  field(:adTypes, type: :list)
  field(:adUnitId)
  field(:appId)
  field(:displayName)
  field(:name)
end

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

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