# 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.CloudDeploy.V1.Model.OneTimeWindow do
  @moduledoc """
  One-time window within which actions are restricted. For example, blocking actions over New Year's Eve from December 31st at 5pm to January 1st at 9am.

  ## Attributes

  *   `endDate` (*type:* `GoogleApi.CloudDeploy.V1.Model.Date.t`, *default:* `nil`) - Required. End date.
  *   `endTime` (*type:* `GoogleApi.CloudDeploy.V1.Model.TimeOfDay.t`, *default:* `nil`) - Required. End time (exclusive). You may use 24:00 for the end of the day.
  *   `startDate` (*type:* `GoogleApi.CloudDeploy.V1.Model.Date.t`, *default:* `nil`) - Required. Start date.
  *   `startTime` (*type:* `GoogleApi.CloudDeploy.V1.Model.TimeOfDay.t`, *default:* `nil`) - Required. Start time (inclusive). Use 00:00 for the beginning of the day.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :endDate => GoogleApi.CloudDeploy.V1.Model.Date.t() | nil,
          :endTime => GoogleApi.CloudDeploy.V1.Model.TimeOfDay.t() | nil,
          :startDate => GoogleApi.CloudDeploy.V1.Model.Date.t() | nil,
          :startTime => GoogleApi.CloudDeploy.V1.Model.TimeOfDay.t() | nil
        }

  field(:endDate, as: GoogleApi.CloudDeploy.V1.Model.Date)
  field(:endTime, as: GoogleApi.CloudDeploy.V1.Model.TimeOfDay)
  field(:startDate, as: GoogleApi.CloudDeploy.V1.Model.Date)
  field(:startTime, as: GoogleApi.CloudDeploy.V1.Model.TimeOfDay)
end

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

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