# 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.Connectors.V1.Model.ConnectionSchemaMetadata do
  @moduledoc """
  ConnectionSchemaMetadata is the singleton resource of each connection. It includes the entity and action names of runtime resources exposed by a connection backend.

  ## Attributes

  *   `actions` (*type:* `list(String.t)`, *default:* `nil`) - Output only. List of actions.
  *   `entities` (*type:* `list(String.t)`, *default:* `nil`) - Output only. List of entity names.
  *   `errorMessage` (*type:* `String.t`, *default:* `nil`) - Error message for users.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name. Format: projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata
  *   `refreshTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when the connection runtime schema refresh was triggered.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of runtime schema.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when the connection runtime schema was updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :actions => list(String.t()) | nil,
          :entities => list(String.t()) | nil,
          :errorMessage => String.t() | nil,
          :name => String.t() | nil,
          :refreshTime => DateTime.t() | nil,
          :state => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:actions, type: :list)
  field(:entities, type: :list)
  field(:errorMessage)
  field(:name)
  field(:refreshTime, as: DateTime)
  field(:state)
  field(:updateTime, as: DateTime)
end

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

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