# 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.GoogleCloudDataplexV1DataAttributeBinding do
  @moduledoc """
  DataAttributeBinding represents binding of attributes to resources. Eg: Bind 'CustomerInfo' entity with 'PII' attribute.

  ## Attributes

  *   `attributes` (*type:* `list(String.t)`, *default:* `nil`) - Optional. List of attributes to be associated with the resource, provided in the form: projects/{project}/locations/{location}/dataTaxonomies/{dataTaxonomy}/attributes/{data_attribute_id}
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the DataAttributeBinding was created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. Description of the DataAttributeBinding.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. User friendly display name.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. Etags must be used when calling the DeleteDataAttributeBinding and the UpdateDataAttributeBinding method.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. User-defined labels for the DataAttributeBinding.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The relative resource name of the Data Attribute Binding, of the form: projects/{project_number}/locations/{location}/dataAttributeBindings/{data_attribute_binding_id}
  *   `paths` (*type:* `list(GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataAttributeBindingPath.t)`, *default:* `nil`) - Optional. The list of paths for items within the associated resource (eg. columns and partitions within a table) along with attribute bindings.
  *   `resource` (*type:* `String.t`, *default:* `nil`) - Optional. Immutable. The resource name of the resource that is associated to attributes. Presently, only entity resource is supported in the form: projects/{project}/locations/{location}/lakes/{lake}/zones/{zone}/entities/{entity_id} Must belong in the same project and region as the attribute binding, and there can only exist one active binding for a resource.
  *   `uid` (*type:* `String.t`, *default:* `nil`) - Output only. System generated globally unique ID for the DataAttributeBinding. This ID will be different if the DataAttributeBinding is deleted and re-created with the same name.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the DataAttributeBinding was last updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :attributes => list(String.t()) | nil,
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :displayName => String.t() | nil,
          :etag => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :paths =>
            list(GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataAttributeBindingPath.t())
            | nil,
          :resource => String.t() | nil,
          :uid => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:attributes, type: :list)
  field(:createTime, as: DateTime)
  field(:description)
  field(:displayName)
  field(:etag)
  field(:labels, type: :map)
  field(:name)

  field(:paths,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1DataAttributeBindingPath,
    type: :list
  )

  field(:resource)
  field(:uid)
  field(:updateTime, as: DateTime)
end

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

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