# 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.VMMigration.V1.Model.UtilizationReport do
  @moduledoc """
  Utilization report details the utilization (CPU, memory, etc.) of selected source VMs.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the report was created (this refers to the time of the request, not the time the report creation completed).
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The report display name, as assigned by the user.
  *   `error` (*type:* `GoogleApi.VMMigration.V1.Model.Status.t`, *default:* `nil`) - Output only. Provides details on the state of the report in case of an error.
  *   `frameEndTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The point in time when the time frame ends. Notice that the time frame is counted backwards. For instance if the "frame_end_time" value is 2021/01/20 and the time frame is WEEK then the report covers the week between 2021/01/20 and 2021/01/14.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The report unique name.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. Current state of the report.
  *   `stateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the state was last set.
  *   `timeFrame` (*type:* `String.t`, *default:* `nil`) - Time frame of the report.
  *   `vmCount` (*type:* `integer()`, *default:* `nil`) - Output only. Total number of VMs included in the report.
  *   `vms` (*type:* `list(GoogleApi.VMMigration.V1.Model.VmUtilizationInfo.t)`, *default:* `nil`) - List of utilization information per VM. When sent as part of the request, the "vm_id" field is used in order to specify which VMs to include in the report. In that case all other fields are ignored.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :displayName => String.t() | nil,
          :error => GoogleApi.VMMigration.V1.Model.Status.t() | nil,
          :frameEndTime => DateTime.t() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil,
          :stateTime => DateTime.t() | nil,
          :timeFrame => String.t() | nil,
          :vmCount => integer() | nil,
          :vms => list(GoogleApi.VMMigration.V1.Model.VmUtilizationInfo.t()) | nil
        }

  field(:createTime, as: DateTime)
  field(:displayName)
  field(:error, as: GoogleApi.VMMigration.V1.Model.Status)
  field(:frameEndTime, as: DateTime)
  field(:name)
  field(:state)
  field(:stateTime, as: DateTime)
  field(:timeFrame)
  field(:vmCount)
  field(:vms, as: GoogleApi.VMMigration.V1.Model.VmUtilizationInfo, type: :list)
end

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

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