# 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.Admin.Directory_v1.Model.DirectoryChromeosdevicesCommand do
  @moduledoc """
  Information regarding a command that was issued to a device.

  ## Attributes

  *   `commandExpireTime` (*type:* `DateTime.t`, *default:* `nil`) - The time at which the command will expire. If the device doesn't execute the command within this time the command will become expired.
  *   `commandId` (*type:* `String.t`, *default:* `nil`) - Unique ID of a device command.
  *   `commandResult` (*type:* `GoogleApi.Admin.Directory_v1.Model.DirectoryChromeosdevicesCommandResult.t`, *default:* `nil`) - The result of the command execution.
  *   `issueTime` (*type:* `DateTime.t`, *default:* `nil`) - The timestamp when the command was issued by the admin.
  *   `payload` (*type:* `String.t`, *default:* `nil`) - The payload that the command specified, if any.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Indicates the command state.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of the command.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :commandExpireTime => DateTime.t() | nil,
          :commandId => String.t() | nil,
          :commandResult =>
            GoogleApi.Admin.Directory_v1.Model.DirectoryChromeosdevicesCommandResult.t() | nil,
          :issueTime => DateTime.t() | nil,
          :payload => String.t() | nil,
          :state => String.t() | nil,
          :type => String.t() | nil
        }

  field(:commandExpireTime, as: DateTime)
  field(:commandId)

  field(:commandResult,
    as: GoogleApi.Admin.Directory_v1.Model.DirectoryChromeosdevicesCommandResult
  )

  field(:issueTime, as: DateTime)
  field(:payload)
  field(:state)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.Admin.Directory_v1.Model.DirectoryChromeosdevicesCommand do
  def decode(value, options) do
    GoogleApi.Admin.Directory_v1.Model.DirectoryChromeosdevicesCommand.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Admin.Directory_v1.Model.DirectoryChromeosdevicesCommand do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
