# 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.Batch.V1.Model.AttachedDisk do
  @moduledoc """
  A new or an existing persistent disk (PD) or a local ssd attached to a VM instance.

  ## Attributes

  *   `deviceName` (*type:* `String.t`, *default:* `nil`) - Device name that the guest operating system will see. It is used by Runnable.volumes field to mount disks. So please specify the device_name if you want Batch to help mount the disk, and it should match the device_name field in volumes.
  *   `existingDisk` (*type:* `String.t`, *default:* `nil`) - Name of an existing PD.
  *   `newDisk` (*type:* `GoogleApi.Batch.V1.Model.Disk.t`, *default:* `nil`) - 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :deviceName => String.t() | nil,
          :existingDisk => String.t() | nil,
          :newDisk => GoogleApi.Batch.V1.Model.Disk.t() | nil
        }

  field(:deviceName)
  field(:existingDisk)
  field(:newDisk, as: GoogleApi.Batch.V1.Model.Disk)
end

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

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