# 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.Dataplex.V1.Model.GoogleCloudDataplexV1TaskSparkTaskConfig do
  @moduledoc """
  User-specified config for running a Spark task.

  ## Attributes

  *   `archiveUris` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Cloud Storage URIs of archives to be extracted into the working directory of each executor. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.
  *   `fileUris` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Cloud Storage URIs of files to be placed in the working directory of each executor.
  *   `infrastructureSpec` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1TaskInfrastructureSpec.t`, *default:* `nil`) - Optional. Infrastructure specification for the execution.
  *   `mainClass` (*type:* `String.t`, *default:* `nil`) - The name of the driver's main class. The jar file that contains the class must be in the default CLASSPATH or specified in jar_file_uris. The execution args are passed in as a sequence of named process arguments (--key=value).
  *   `mainJarFileUri` (*type:* `String.t`, *default:* `nil`) - The Cloud Storage URI of the jar file that contains the main class. The execution args are passed in as a sequence of named process arguments (--key=value).
  *   `pythonScriptFile` (*type:* `String.t`, *default:* `nil`) - The Gcloud Storage URI of the main Python file to use as the driver. Must be a .py file. The execution args are passed in as a sequence of named process arguments (--key=value).
  *   `sqlScript` (*type:* `String.t`, *default:* `nil`) - The query text. The execution args are used to declare a set of script variables (set key="value";).
  *   `sqlScriptFile` (*type:* `String.t`, *default:* `nil`) - A reference to a query file. This should be the Cloud Storage URI of the query file. The execution args are used to declare a set of script variables (set key="value";).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :archiveUris => list(String.t()) | nil,
          :fileUris => list(String.t()) | nil,
          :infrastructureSpec =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1TaskInfrastructureSpec.t() | nil,
          :mainClass => String.t() | nil,
          :mainJarFileUri => String.t() | nil,
          :pythonScriptFile => String.t() | nil,
          :sqlScript => String.t() | nil,
          :sqlScriptFile => String.t() | nil
        }

  field(:archiveUris, type: :list)
  field(:fileUris, type: :list)

  field(:infrastructureSpec,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1TaskInfrastructureSpec
  )

  field(:mainClass)
  field(:mainJarFileUri)
  field(:pythonScriptFile)
  field(:sqlScript)
  field(:sqlScriptFile)
end

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

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