# 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.DisplayVideo.V3.Model.TargetFrequency do
  @moduledoc """
  Setting that controls the average number of times the ads will show to the same person over a certain period of time.

  ## Attributes

  *   `targetCount` (*type:* `String.t`, *default:* `nil`) - The target number of times, on average, the ads will be shown to the same person in the timespan dictated by time_unit and time_unit_count.
  *   `timeUnit` (*type:* `String.t`, *default:* `nil`) - The unit of time in which the target frequency will be applied. The following time unit is applicable: * `TIME_UNIT_WEEKS`
  *   `timeUnitCount` (*type:* `integer()`, *default:* `nil`) - The number of time_unit the target frequency will last. The following restrictions apply based on the value of time_unit: * `TIME_UNIT_WEEKS` - must be 1
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :targetCount => String.t() | nil,
          :timeUnit => String.t() | nil,
          :timeUnitCount => integer() | nil
        }

  field(:targetCount)
  field(:timeUnit)
  field(:timeUnitCount)
end

defimpl Poison.Decoder, for: GoogleApi.DisplayVideo.V3.Model.TargetFrequency do
  def decode(value, options) do
    GoogleApi.DisplayVideo.V3.Model.TargetFrequency.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DisplayVideo.V3.Model.TargetFrequency do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
