# 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.GoogleCloudDataplexV1MetadataJobImportJobSpec do
  @moduledoc """
  Job specification for a metadata import job.You can run the following kinds of metadata import jobs: Full sync of entries with incremental import of their aspects. Supported for custom entries. Incremental import of aspects only. Supported for aspects that belong to custom entries and system entries. For custom entries, you can modify both optional aspects and required aspects. For system entries, you can modify optional aspects.

  ## Attributes

  *   `aspectSyncMode` (*type:* `String.t`, *default:* `nil`) - Required. The sync mode for aspects.
  *   `entrySyncMode` (*type:* `String.t`, *default:* `nil`) - Required. The sync mode for entries.
  *   `logLevel` (*type:* `String.t`, *default:* `nil`) - Optional. The level of logs to write to Cloud Logging for this job.Debug-level logs provide highly-detailed information for troubleshooting, but their increased verbosity could incur additional costs (https://cloud.google.com/stackdriver/pricing) that might not be merited for all jobs.If unspecified, defaults to INFO.
  *   `scope` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1MetadataJobImportJobSpecImportJobScope.t`, *default:* `nil`) - Required. A boundary on the scope of impact that the metadata import job can have.
  *   `sourceCreateTime` (*type:* `DateTime.t`, *default:* `nil`) - Optional. The time when the process that created the metadata import files began.
  *   `sourceStorageUri` (*type:* `String.t`, *default:* `nil`) - Optional. The URI of a Cloud Storage bucket or folder (beginning with gs:// and ending with /) that contains the metadata import files for this job.A metadata import file defines the values to set for each of the entries and aspects in a metadata job. For more information about how to create a metadata import file and the file requirements, see Metadata import file (https://cloud.google.com/dataplex/docs/import-metadata#metadata-import-file).You can provide multiple metadata import files in the same metadata job. The bucket or folder must contain at least one metadata import file, in JSON Lines format (either .json or .jsonl file extension).In FULL entry sync mode, don't save the metadata import file in a folder named SOURCE_STORAGE_URI/deletions/.Caution: If the metadata import file contains no data, all entries and aspects that belong to the job's scope are deleted.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :aspectSyncMode => String.t() | nil,
          :entrySyncMode => String.t() | nil,
          :logLevel => String.t() | nil,
          :scope =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1MetadataJobImportJobSpecImportJobScope.t()
            | nil,
          :sourceCreateTime => DateTime.t() | nil,
          :sourceStorageUri => String.t() | nil
        }

  field(:aspectSyncMode)
  field(:entrySyncMode)
  field(:logLevel)

  field(:scope,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1MetadataJobImportJobSpecImportJobScope
  )

  field(:sourceCreateTime, as: DateTime)
  field(:sourceStorageUri)
end

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

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