# 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.GoogleCloudDataplexV1DiscoveryEvent do
  @moduledoc """
  The payload associated with Discovery data processing.

  ## Attributes

  *   `action` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventActionDetails.t`, *default:* `nil`) - Details about the action associated with the event.
  *   `assetId` (*type:* `String.t`, *default:* `nil`) - The id of the associated asset.
  *   `config` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventConfigDetails.t`, *default:* `nil`) - Details about discovery configuration in effect.
  *   `dataLocation` (*type:* `String.t`, *default:* `nil`) - The data location associated with the event.
  *   `datascanId` (*type:* `String.t`, *default:* `nil`) - The id of the associated datascan for standalone discovery.
  *   `entity` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventEntityDetails.t`, *default:* `nil`) - Details about the entity associated with the event.
  *   `lakeId` (*type:* `String.t`, *default:* `nil`) - The id of the associated lake.
  *   `message` (*type:* `String.t`, *default:* `nil`) - The log message.
  *   `partition` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventPartitionDetails.t`, *default:* `nil`) - Details about the partition associated with the event.
  *   `table` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventTableDetails.t`, *default:* `nil`) - Details about the BigQuery table publishing associated with the event.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of the event being logged.
  *   `zoneId` (*type:* `String.t`, *default:* `nil`) - The id of the associated zone.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :action =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventActionDetails.t() | nil,
          :assetId => String.t() | nil,
          :config =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventConfigDetails.t() | nil,
          :dataLocation => String.t() | nil,
          :datascanId => String.t() | nil,
          :entity =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventEntityDetails.t() | nil,
          :lakeId => String.t() | nil,
          :message => String.t() | nil,
          :partition =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventPartitionDetails.t()
            | nil,
          :table =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventTableDetails.t() | nil,
          :type => String.t() | nil,
          :zoneId => String.t() | nil
        }

  field(:action, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventActionDetails)
  field(:assetId)
  field(:config, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventConfigDetails)
  field(:dataLocation)
  field(:datascanId)
  field(:entity, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventEntityDetails)
  field(:lakeId)
  field(:message)

  field(:partition,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventPartitionDetails
  )

  field(:table, as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DiscoveryEventTableDetails)
  field(:type)
  field(:zoneId)
end

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

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