# 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.GoogleCloudDataplexV1AspectType do
  @moduledoc """
  AspectType is a template for creating Aspects, and represents the JSON-schema for a given Entry, for example, BigQuery Table Schema.

  ## Attributes

  *   `authorization` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1AspectTypeAuthorization.t`, *default:* `nil`) - Immutable. Defines the Authorization for this type.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the AspectType was created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. Description of the AspectType.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. User friendly display name.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - The service computes this checksum. The client may send it on update and delete requests to ensure it has an up-to-date value before proceeding.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. User-defined labels for the AspectType.
  *   `metadataTemplate` (*type:* `GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1AspectTypeMetadataTemplate.t`, *default:* `nil`) - Required. MetadataTemplate of the aspect.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The relative resource name of the AspectType, of the form: projects/{project_number}/locations/{location_id}/aspectTypes/{aspect_type_id}.
  *   `transferStatus` (*type:* `String.t`, *default:* `nil`) - Output only. Denotes the transfer status of the Aspect Type. It is unspecified for Aspect Types created from Dataplex API.
  *   `uid` (*type:* `String.t`, *default:* `nil`) - Output only. System generated globally unique ID for the AspectType. If you delete and recreate the AspectType with the same name, then this ID will be different.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the AspectType was last updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :authorization =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1AspectTypeAuthorization.t() | nil,
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :displayName => String.t() | nil,
          :etag => String.t() | nil,
          :labels => map() | nil,
          :metadataTemplate =>
            GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1AspectTypeMetadataTemplate.t() | nil,
          :name => String.t() | nil,
          :transferStatus => String.t() | nil,
          :uid => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:authorization,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1AspectTypeAuthorization
  )

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

  field(:metadataTemplate,
    as: GoogleApi.Dataplex.V1.Model.GoogleCloudDataplexV1AspectTypeMetadataTemplate
  )

  field(:name)
  field(:transferStatus)
  field(:uid)
  field(:updateTime, as: DateTime)
end

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

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