# 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.Workstation do
  @moduledoc """
  A single instance of a developer workstation with its own persistent storage.

  ## Attributes

  *   `annotations` (*type:* `map()`, *default:* `nil`) - Optional. Client-specified annotations.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when this workstation was created.
  *   `deleteTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when this workstation was soft-deleted.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. Human-readable name for this workstation.
  *   `env` (*type:* `map()`, *default:* `nil`) - Optional. Environment variables passed to the workstation container's entrypoint.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - Optional. Checksum computed by the server. May be sent on update and delete requests to make sure that the client has an up-to-date value before proceeding.
  *   `host` (*type:* `String.t`, *default:* `nil`) - Output only. Host to which clients can send HTTPS traffic that will be received by the workstation. Authorized traffic will be received to the workstation as HTTP on port 80. To send traffic to a different port, clients may prefix the host with the destination port in the format `{port}-{host}`.
  *   `kmsKey` (*type:* `String.t`, *default:* `nil`) - Output only. The name of the Google Cloud KMS encryption key used to encrypt this workstation. The KMS key can only be configured in the WorkstationConfig. The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. [Labels](https://cloud.google.com/workstations/docs/label-resources) that are applied to the workstation and that are also propagated to the underlying Compute Engine resources.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. Full name of this workstation.
  *   `reconciling` (*type:* `boolean()`, *default:* `nil`) - Output only. Indicates whether this workstation is currently being updated to match its intended state.
  *   `runtimeHost` (*type:* `GoogleApi.Workstations.V1.Model.RuntimeHost.t`, *default:* `nil`) - Optional. Output only. Runtime host for the workstation when in STATE_RUNNING.
  *   `sourceWorkstation` (*type:* `String.t`, *default:* `nil`) - Optional. The source workstation from which this workstation's persistent directories were cloned on creation.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when this workstation was most recently successfully started, regardless of the workstation's initial state.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. Current state of the workstation.
  *   `uid` (*type:* `String.t`, *default:* `nil`) - Output only. A system-assigned unique identifier for this workstation.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time when this workstation was most recently updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :annotations => map() | nil,
          :createTime => DateTime.t() | nil,
          :deleteTime => DateTime.t() | nil,
          :displayName => String.t() | nil,
          :env => map() | nil,
          :etag => String.t() | nil,
          :host => String.t() | nil,
          :kmsKey => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :reconciling => boolean() | nil,
          :runtimeHost => GoogleApi.Workstations.V1.Model.RuntimeHost.t() | nil,
          :sourceWorkstation => String.t() | nil,
          :startTime => DateTime.t() | nil,
          :state => String.t() | nil,
          :uid => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:annotations, type: :map)
  field(:createTime, as: DateTime)
  field(:deleteTime, as: DateTime)
  field(:displayName)
  field(:env, type: :map)
  field(:etag)
  field(:host)
  field(:kmsKey)
  field(:labels, type: :map)
  field(:name)
  field(:reconciling)
  field(:runtimeHost, as: GoogleApi.Workstations.V1.Model.RuntimeHost)
  field(:sourceWorkstation)
  field(:startTime, as: DateTime)
  field(:state)
  field(:uid)
  field(:updateTime, as: DateTime)
end

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

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