# 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.Workstations.V1.Model.GenerateAccessTokenRequest do
  @moduledoc """
  Request message for GenerateAccessToken.

  ## Attributes

  *   `expireTime` (*type:* `DateTime.t`, *default:* `nil`) - Desired expiration time of the access token. This value must be at most 24 hours in the future. If a value is not specified, the token's expiration time will be set to a default value of 1 hour in the future.
  *   `port` (*type:* `integer()`, *default:* `nil`) - Optional. Port for which the access token should be generated. If specified, the generated access token grants access only to the specified port of the workstation. If specified, values must be within the range [1 - 65535]. If not specified, the generated access token grants access to all ports of the workstation.
  *   `ttl` (*type:* `String.t`, *default:* `nil`) - Desired lifetime duration of the access token. This value must be at most 24 hours. If a value is not specified, the token's lifetime will be set to a default value of 1 hour.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :expireTime => DateTime.t() | nil,
          :port => integer() | nil,
          :ttl => String.t() | nil
        }

  field(:expireTime, as: DateTime)
  field(:port)
  field(:ttl)
end

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

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