# 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.DayAndTimeAssignedTargetingOptionDetails do
  @moduledoc """
  Representation of a segment of time defined on a specific day of the week and with a start and end time. The time represented by `start_hour` must be before the time represented by `end_hour`.

  ## Attributes

  *   `dayOfWeek` (*type:* `String.t`, *default:* `nil`) - Required. The day of the week for this day and time targeting setting.
  *   `endHour` (*type:* `integer()`, *default:* `nil`) - Required. The end hour for day and time targeting. Must be between 1 (1 hour after start of day) and 24 (end of day).
  *   `startHour` (*type:* `integer()`, *default:* `nil`) - Required. The start hour for day and time targeting. Must be between 0 (start of day) and 23 (1 hour before end of day).
  *   `timeZoneResolution` (*type:* `String.t`, *default:* `nil`) - Required. The mechanism used to determine which timezone to use for this day and time targeting setting.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dayOfWeek => String.t() | nil,
          :endHour => integer() | nil,
          :startHour => integer() | nil,
          :timeZoneResolution => String.t() | nil
        }

  field(:dayOfWeek)
  field(:endHour)
  field(:startHour)
  field(:timeZoneResolution)
end

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

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