# 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.ImageImportJob do
  @moduledoc """
  ImageImportJob describes the progress and result of an image import.

  ## Attributes

  *   `cloudStorageUri` (*type:* `String.t`, *default:* `nil`) - Output only. The path to the Cloud Storage file from which the image should be imported.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the image import was created (as an API call, not when it was actually created in the target).
  *   `createdResources` (*type:* `list(String.t)`, *default:* `nil`) - Output only. The resource paths of the resources created by the image import job.
  *   `diskImageTargetDetails` (*type:* `GoogleApi.VMMigration.V1.Model.DiskImageTargetDetails.t`, *default:* `nil`) - Output only. Target details used to import a disk image.
  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the image import was ended.
  *   `errors` (*type:* `list(GoogleApi.VMMigration.V1.Model.Status.t)`, *default:* `nil`) - Output only. Provides details on the error that led to the image import state in case of an error.
  *   `machineImageTargetDetails` (*type:* `GoogleApi.VMMigration.V1.Model.MachineImageTargetDetails.t`, *default:* `nil`) - Output only. Target details used to import a machine image.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource path of the ImageImportJob.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The state of the image import.
  *   `steps` (*type:* `list(GoogleApi.VMMigration.V1.Model.ImageImportStep.t)`, *default:* `nil`) - Output only. The image import steps list representing its progress.
  *   `warnings` (*type:* `list(GoogleApi.VMMigration.V1.Model.MigrationWarning.t)`, *default:* `nil`) - Output only. Warnings that occurred during the image import.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cloudStorageUri => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :createdResources => list(String.t()) | nil,
          :diskImageTargetDetails =>
            GoogleApi.VMMigration.V1.Model.DiskImageTargetDetails.t() | nil,
          :endTime => DateTime.t() | nil,
          :errors => list(GoogleApi.VMMigration.V1.Model.Status.t()) | nil,
          :machineImageTargetDetails =>
            GoogleApi.VMMigration.V1.Model.MachineImageTargetDetails.t() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil,
          :steps => list(GoogleApi.VMMigration.V1.Model.ImageImportStep.t()) | nil,
          :warnings => list(GoogleApi.VMMigration.V1.Model.MigrationWarning.t()) | nil
        }

  field(:cloudStorageUri)
  field(:createTime, as: DateTime)
  field(:createdResources, type: :list)
  field(:diskImageTargetDetails, as: GoogleApi.VMMigration.V1.Model.DiskImageTargetDetails)
  field(:endTime, as: DateTime)
  field(:errors, as: GoogleApi.VMMigration.V1.Model.Status, type: :list)
  field(:machineImageTargetDetails, as: GoogleApi.VMMigration.V1.Model.MachineImageTargetDetails)
  field(:name)
  field(:state)
  field(:steps, as: GoogleApi.VMMigration.V1.Model.ImageImportStep, type: :list)
  field(:warnings, as: GoogleApi.VMMigration.V1.Model.MigrationWarning, type: :list)
end

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

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