# 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.Volume do
  @moduledoc """
  Volume describes a volume and parameters for it to be mounted to a VM.

  ## Attributes

  *   `deviceName` (*type:* `String.t`, *default:* `nil`) - Device name of an attached disk volume, which should align with a device_name specified by job.allocation_policy.instances[0].policy.disks[i].device_name or defined by the given instance template in job.allocation_policy.instances[0].instance_template.
  *   `gcs` (*type:* `GoogleApi.Batch.V1.Model.GCS.t`, *default:* `nil`) - A Google Cloud Storage (GCS) volume.
  *   `mountOptions` (*type:* `list(String.t)`, *default:* `nil`) - Mount options vary based on the type of storage volume: * For a Cloud Storage bucket, all the mount options provided by the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) are supported. * For an existing persistent disk, all mount options provided by the [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) except writing are supported. This is due to restrictions of [multi-writer mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). * For any other disk or a Network File System (NFS), all the mount options provided by the `mount` command are supported.
  *   `mountPath` (*type:* `String.t`, *default:* `nil`) - The mount path for the volume, e.g. /mnt/disks/share.
  *   `nfs` (*type:* `GoogleApi.Batch.V1.Model.NFS.t`, *default:* `nil`) - A Network File System (NFS) volume. For example, a Filestore file share.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :deviceName => String.t() | nil,
          :gcs => GoogleApi.Batch.V1.Model.GCS.t() | nil,
          :mountOptions => list(String.t()) | nil,
          :mountPath => String.t() | nil,
          :nfs => GoogleApi.Batch.V1.Model.NFS.t() | nil
        }

  field(:deviceName)
  field(:gcs, as: GoogleApi.Batch.V1.Model.GCS)
  field(:mountOptions, type: :list)
  field(:mountPath)
  field(:nfs, as: GoogleApi.Batch.V1.Model.NFS)
end

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

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