# 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.Dataplex.V1.Model.GoogleCloudDataplexV1SessionEvent do
  @moduledoc """
  These messages contain information about sessions within an environment. The monitored resource is 'Environment'.

  ## Attributes

  *   `eventSucceeded` (*type:* `boolean()`, *default:* `nil`) - The status of the event.
  *   `fastStartupEnabled` (*type:* `boolean()`, *default:* `nil`) - If the session is associated with an environment with fast startup enabled, and was created before being assigned to a user.
  *   `message` (*type:* `String.t`, *default:* `nil`) - The log message.
  *   `query` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1SessionEventQueryDetail.t`, *default:* `nil`) - The execution details of the query.
  *   `sessionId` (*type:* `String.t`, *default:* `nil`) - Unique identifier for the session.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of the event.
  *   `unassignedDuration` (*type:* `String.t`, *default:* `nil`) - The idle duration of a warm pooled session before it is assigned to user.
  *   `userId` (*type:* `String.t`, *default:* `nil`) - The information about the user that created the session. It will be the email address of the user.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :eventSucceeded => boolean() | nil,
          :fastStartupEnabled => boolean() | nil,
          :message => String.t() | nil,
          :query =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1SessionEventQueryDetail.t() | nil,
          :sessionId => String.t() | nil,
          :type => String.t() | nil,
          :unassignedDuration => String.t() | nil,
          :userId => String.t() | nil
        }

  field(:eventSucceeded)
  field(:fastStartupEnabled)
  field(:message)
  field(:query, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1SessionEventQueryDetail)
  field(:sessionId)
  field(:type)
  field(:unassignedDuration)
  field(:userId)
end

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

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