# 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.GoogleCloudDatacatalogLineageV1Link do
  @moduledoc """
  Links represent the data flow between **source** (upstream) and **target** (downstream) assets in transformation pipelines. Links are created when LineageEvents record data transformation between related assets.

  ## Attributes

  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - The end of the last event establishing this link.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Immutable. The name of the link. Format: `projects/{project}/locations/{location}/links/{link}`.
  *   `source` (*type:* `GoogleApi.DataLineage.V1.Model.GoogleCloudDatacatalogLineageV1EntityReference.t`, *default:* `nil`) - The pointer to the entity that is the **source** of this link.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - The start of the first event establishing this link.
  *   `target` (*type:* `GoogleApi.DataLineage.V1.Model.GoogleCloudDatacatalogLineageV1EntityReference.t`, *default:* `nil`) - The pointer to the entity that is the **target** of this link.
  """

  use GoogleApi.Gax.ModelBase

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

  field(:endTime, as: DateTime)
  field(:name)

  field(:source, as: GoogleApi.DataLineage.V1.Model.GoogleCloudDatacatalogLineageV1EntityReference)

  field(:startTime, as: DateTime)

  field(:target, as: GoogleApi.DataLineage.V1.Model.GoogleCloudDatacatalogLineageV1EntityReference)
end

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

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