# 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.AlloyDB.V1.Model.ImportClusterRequest do
  @moduledoc """
  Import cluster request.

  ## Attributes

  *   `csvImportOptions` (*type:* `GoogleApi.AlloyDB.V1.Model.CsvImportOptions.t`, *default:* `nil`) - Options for importing data in CSV format.
  *   `database` (*type:* `String.t`, *default:* `nil`) - Optional. Name of the database to which the import will be done. For import from SQL file, this is required only if the file does not specify a database. Note - Value provided should be the same as expected from `SELECT current_database();` and NOT as a resource reference.
  *   `gcsUri` (*type:* `String.t`, *default:* `nil`) - Required. The path to the file in Google Cloud Storage where the source file for import will be stored. The URI is in the form `gs://bucketName/fileName`.
  *   `sqlImportOptions` (*type:* `GoogleApi.AlloyDB.V1.Model.SqlImportOptions.t`, *default:* `nil`) - Options for importing data in SQL format.
  *   `user` (*type:* `String.t`, *default:* `nil`) - Optional. Database user to be used for importing the data. Note - Value provided should be the same as expected from `SELECT current_user;` and NOT as a resource reference.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :csvImportOptions => GoogleApi.AlloyDB.V1.Model.CsvImportOptions.t() | nil,
          :database => String.t() | nil,
          :gcsUri => String.t() | nil,
          :sqlImportOptions => GoogleApi.AlloyDB.V1.Model.SqlImportOptions.t() | nil,
          :user => String.t() | nil
        }

  field(:csvImportOptions, as: GoogleApi.AlloyDB.V1.Model.CsvImportOptions)
  field(:database)
  field(:gcsUri)
  field(:sqlImportOptions, as: GoogleApi.AlloyDB.V1.Model.SqlImportOptions)
  field(:user)
end

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

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