# 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.DataLineage.V1.Model.GoogleCloudDatacatalogLineageV1LineageEvent do
  @moduledoc """
  A lineage event represents an operation on assets. Within the operation, the data flows from the source to the target defined in the links field.

  ## Attributes

  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Optional. The end of the transformation which resulted in this lineage event. For streaming scenarios, it should be the end of the period from which the lineage is being reported.
  *   `links` (*type:* `list(GoogleApi.DataLineage.V1.Model.GoogleCloudDatacatalogLineageV1EventLink.t)`, *default:* `nil`) - Optional. List of source-target pairs. Can't contain more than 100 tuples.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Immutable. The resource name of the lineage event. Format: `projects/{project}/locations/{location}/processes/{process}/runs/{run}/lineageEvents/{lineage_event}`. Can be specified or auto-assigned. {lineage_event} must be not longer than 200 characters and only contain characters in a set: `a-zA-Z0-9_-:.`
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Required. The beginning of the transformation which resulted in this lineage event. For streaming scenarios, it should be the beginning of the period from which the lineage is being reported.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :endTime => DateTime.t() | nil,
          :links =>
            list(GoogleApi.DataLineage.V1.Model.GoogleCloudDatacatalogLineageV1EventLink.t())
            | nil,
          :name => String.t() | nil,
          :startTime => DateTime.t() | nil
        }

  field(:endTime, as: DateTime)

  field(:links,
    as: GoogleApi.DataLineage.V1.Model.GoogleCloudDatacatalogLineageV1EventLink,
    type: :list
  )

  field(:name)
  field(:startTime, as: DateTime)
end

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

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