# 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.ImageImport do
  @moduledoc """
  ImageImport describes the configuration of the image import to run.

  ## Attributes

  *   `cloudStorageUri` (*type:* `String.t`, *default:* `nil`) - Immutable. 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.
  *   `diskImageTargetDefaults` (*type:* `GoogleApi.VMMigration.V1.Model.DiskImageTargetDetails.t`, *default:* `nil`) - Immutable. Target details for importing a disk image, will be used by ImageImportJob.
  *   `encryption` (*type:* `GoogleApi.VMMigration.V1.Model.Encryption.t`, *default:* `nil`) - Immutable. The encryption details used by the image import process during the image adaptation for Compute Engine.
  *   `machineImageTargetDefaults` (*type:* `GoogleApi.VMMigration.V1.Model.MachineImageTargetDetails.t`, *default:* `nil`) - Immutable. Target details for importing a machine image, will be used by ImageImportJob.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource path of the ImageImport.
  *   `recentImageImportJobs` (*type:* `list(GoogleApi.VMMigration.V1.Model.ImageImportJob.t)`, *default:* `nil`) - Output only. The result of the most recent runs for this ImageImport. All jobs for this ImageImport can be listed via ListImageImportJobs.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cloudStorageUri => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :diskImageTargetDefaults =>
            GoogleApi.VMMigration.V1.Model.DiskImageTargetDetails.t() | nil,
          :encryption => GoogleApi.VMMigration.V1.Model.Encryption.t() | nil,
          :machineImageTargetDefaults =>
            GoogleApi.VMMigration.V1.Model.MachineImageTargetDetails.t() | nil,
          :name => String.t() | nil,
          :recentImageImportJobs => list(GoogleApi.VMMigration.V1.Model.ImageImportJob.t()) | nil
        }

  field(:cloudStorageUri)
  field(:createTime, as: DateTime)
  field(:diskImageTargetDefaults, as: GoogleApi.VMMigration.V1.Model.DiskImageTargetDetails)
  field(:encryption, as: GoogleApi.VMMigration.V1.Model.Encryption)
  field(:machineImageTargetDefaults, as: GoogleApi.VMMigration.V1.Model.MachineImageTargetDetails)
  field(:name)
  field(:recentImageImportJobs, as: GoogleApi.VMMigration.V1.Model.ImageImportJob, type: :list)
end

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

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