# 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.SQLAdmin.V1beta4.Model.ImportContext do
  @moduledoc """
  Database instance import context.

  ## Attributes

  *   `bakImportOptions` (*type:* `GoogleApi.SQLAdmin.V1beta4.Model.ImportContextBakImportOptions.t`, *default:* `nil`) - Import parameters specific to SQL Server .BAK files
  *   `csvImportOptions` (*type:* `GoogleApi.SQLAdmin.V1beta4.Model.ImportContextCsvImportOptions.t`, *default:* `nil`) - Options for importing data as CSV.
  *   `database` (*type:* `String.t`, *default:* `nil`) - The target database for the import. If `fileType` is `SQL`, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. For entire instance parallel import operations, the database is overridden by the database name stored in subdirectory name. If `fileType` is `CSV`, one database must be specified.
  *   `fileType` (*type:* `String.t`, *default:* `nil`) - The file type for the specified uri. * `SQL`: The file contains SQL statements. * `CSV`: The file contains CSV data. * `BAK`: The file contains backup data for a SQL Server instance.
  *   `importUser` (*type:* `String.t`, *default:* `nil`) - The PostgreSQL user for this import operation. PostgreSQL instances only.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - This is always `sql#importContext`.
  *   `sqlImportOptions` (*type:* `GoogleApi.SQLAdmin.V1beta4.Model.ImportContextSqlImportOptions.t`, *default:* `nil`) - Optional. Options for importing data from SQL statements.
  *   `tdeImportOptions` (*type:* `GoogleApi.SQLAdmin.V1beta4.Model.ImportContextTdeImportOptions.t`, *default:* `nil`) - Optional. Import parameters specific to SQL Server .TDE files Import parameters specific to SQL Server TDE certificates
  *   `uri` (*type:* `String.t`, *default:* `nil`) - Path to the import file in Cloud Storage, in the form `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported when `fileType` is `SQL`. The instance must have write permissions to the bucket and read access to the file.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bakImportOptions =>
            GoogleApi.SQLAdmin.V1beta4.Model.ImportContextBakImportOptions.t() | nil,
          :csvImportOptions =>
            GoogleApi.SQLAdmin.V1beta4.Model.ImportContextCsvImportOptions.t() | nil,
          :database => String.t() | nil,
          :fileType => String.t() | nil,
          :importUser => String.t() | nil,
          :kind => String.t() | nil,
          :sqlImportOptions =>
            GoogleApi.SQLAdmin.V1beta4.Model.ImportContextSqlImportOptions.t() | nil,
          :tdeImportOptions =>
            GoogleApi.SQLAdmin.V1beta4.Model.ImportContextTdeImportOptions.t() | nil,
          :uri => String.t() | nil
        }

  field(:bakImportOptions, as: GoogleApi.SQLAdmin.V1beta4.Model.ImportContextBakImportOptions)
  field(:csvImportOptions, as: GoogleApi.SQLAdmin.V1beta4.Model.ImportContextCsvImportOptions)
  field(:database)
  field(:fileType)
  field(:importUser)
  field(:kind)
  field(:sqlImportOptions, as: GoogleApi.SQLAdmin.V1beta4.Model.ImportContextSqlImportOptions)
  field(:tdeImportOptions, as: GoogleApi.SQLAdmin.V1beta4.Model.ImportContextTdeImportOptions)
  field(:uri)
end

defimpl Poison.Decoder, for: GoogleApi.SQLAdmin.V1beta4.Model.ImportContext do
  def decode(value, options) do
    GoogleApi.SQLAdmin.V1beta4.Model.ImportContext.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.SQLAdmin.V1beta4.Model.ImportContext do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
