# 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.MachineImageTargetDetails do
  @moduledoc """
  The target details of the machine image resource that will be created by the image import job.

  ## Attributes

  *   `additionalLicenses` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Additional licenses to assign to the instance created by the machine image. Format: https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME Or https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. An optional description of the machine image.
  *   `encryption` (*type:* `GoogleApi.VMMigration.V1.Model.Encryption.t`, *default:* `nil`) - Immutable. The encryption to apply to the machine image.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. The labels to apply to the instance created by the machine image.
  *   `machineImageName` (*type:* `String.t`, *default:* `nil`) - Required. The name of the machine image to be created.
  *   `machineImageParametersOverrides` (*type:* `GoogleApi.VMMigration.V1.Model.MachineImageParametersOverrides.t`, *default:* `nil`) - Optional. Parameters overriding decisions based on the source machine image configurations.
  *   `networkInterfaces` (*type:* `list(GoogleApi.VMMigration.V1.Model.NetworkInterface.t)`, *default:* `nil`) - Optional. The network interfaces to create with the instance created by the machine image. Internal and external IP addresses are ignored for machine image import.
  *   `osAdaptationParameters` (*type:* `GoogleApi.VMMigration.V1.Model.ImageImportOsAdaptationParameters.t`, *default:* `nil`) - Optional. Use to set the parameters relevant for the OS adaptation process.
  *   `serviceAccount` (*type:* `GoogleApi.VMMigration.V1.Model.ServiceAccount.t`, *default:* `nil`) - Optional. The service account to assign to the instance created by the machine image.
  *   `shieldedInstanceConfig` (*type:* `GoogleApi.VMMigration.V1.Model.ShieldedInstanceConfig.t`, *default:* `nil`) - Optional. Shielded instance configuration.
  *   `singleRegionStorage` (*type:* `boolean()`, *default:* `nil`) - Optional. Set to true to set the machine image storageLocations to the single region of the import job. When false, the closest multi-region is selected.
  *   `skipOsAdaptation` (*type:* `GoogleApi.VMMigration.V1.Model.SkipOsAdaptation.t`, *default:* `nil`) - Optional. Use to skip OS adaptation process.
  *   `tags` (*type:* `list(String.t)`, *default:* `nil`) - Optional. The tags to apply to the instance created by the machine image.
  *   `targetProject` (*type:* `String.t`, *default:* `nil`) - Required. Reference to the TargetProject resource that represents the target project in which the imported machine image will be created.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :additionalLicenses => list(String.t()) | nil,
          :description => String.t() | nil,
          :encryption => GoogleApi.VMMigration.V1.Model.Encryption.t() | nil,
          :labels => map() | nil,
          :machineImageName => String.t() | nil,
          :machineImageParametersOverrides =>
            GoogleApi.VMMigration.V1.Model.MachineImageParametersOverrides.t() | nil,
          :networkInterfaces => list(GoogleApi.VMMigration.V1.Model.NetworkInterface.t()) | nil,
          :osAdaptationParameters =>
            GoogleApi.VMMigration.V1.Model.ImageImportOsAdaptationParameters.t() | nil,
          :serviceAccount => GoogleApi.VMMigration.V1.Model.ServiceAccount.t() | nil,
          :shieldedInstanceConfig =>
            GoogleApi.VMMigration.V1.Model.ShieldedInstanceConfig.t() | nil,
          :singleRegionStorage => boolean() | nil,
          :skipOsAdaptation => GoogleApi.VMMigration.V1.Model.SkipOsAdaptation.t() | nil,
          :tags => list(String.t()) | nil,
          :targetProject => String.t() | nil
        }

  field(:additionalLicenses, type: :list)
  field(:description)
  field(:encryption, as: GoogleApi.VMMigration.V1.Model.Encryption)
  field(:labels, type: :map)
  field(:machineImageName)

  field(:machineImageParametersOverrides,
    as: GoogleApi.VMMigration.V1.Model.MachineImageParametersOverrides
  )

  field(:networkInterfaces, as: GoogleApi.VMMigration.V1.Model.NetworkInterface, type: :list)

  field(:osAdaptationParameters,
    as: GoogleApi.VMMigration.V1.Model.ImageImportOsAdaptationParameters
  )

  field(:serviceAccount, as: GoogleApi.VMMigration.V1.Model.ServiceAccount)
  field(:shieldedInstanceConfig, as: GoogleApi.VMMigration.V1.Model.ShieldedInstanceConfig)
  field(:singleRegionStorage)
  field(:skipOsAdaptation, as: GoogleApi.VMMigration.V1.Model.SkipOsAdaptation)
  field(:tags, type: :list)
  field(:targetProject)
end

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

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