# 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.BlockchainNodeEngine.V1.Model.BlockchainNode do
  @moduledoc """
  A representation of a blockchain node.

  ## Attributes

  *   `blockchainType` (*type:* `String.t`, *default:* `nil`) - Immutable. The blockchain type of the node.
  *   `connectionInfo` (*type:* `GoogleApi.BlockchainNodeEngine.V1.Model.ConnectionInfo.t`, *default:* `nil`) - Output only. The connection information used to interact with a blockchain node.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp at which the blockchain node was first created.
  *   `ethereumDetails` (*type:* `GoogleApi.BlockchainNodeEngine.V1.Model.EthereumDetails.t`, *default:* `nil`) - Ethereum-specific blockchain node details.
  *   `labels` (*type:* `map()`, *default:* `nil`) - User-provided key-value pairs.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The fully qualified name of the blockchain node. e.g. `projects/my-project/locations/us-central1/blockchainNodes/my-node`.
  *   `privateServiceConnectEnabled` (*type:* `boolean()`, *default:* `nil`) - Optional. When true, the node is only accessible via Private Service Connect; no public endpoints are exposed. Otherwise, the node is only accessible via public endpoints. Warning: Private Service Connect enabled nodes may require a manual migration effort to remain compatible with future versions of the product. If this feature is enabled, you will be notified of these changes along with any required action to avoid disruption. See https://cloud.google.com/vpc/docs/private-service-connect.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. A status representing the state of the node.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp at which the blockchain node was last updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :blockchainType => String.t() | nil,
          :connectionInfo => GoogleApi.BlockchainNodeEngine.V1.Model.ConnectionInfo.t() | nil,
          :createTime => DateTime.t() | nil,
          :ethereumDetails => GoogleApi.BlockchainNodeEngine.V1.Model.EthereumDetails.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :privateServiceConnectEnabled => boolean() | nil,
          :state => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:blockchainType)
  field(:connectionInfo, as: GoogleApi.BlockchainNodeEngine.V1.Model.ConnectionInfo)
  field(:createTime, as: DateTime)
  field(:ethereumDetails, as: GoogleApi.BlockchainNodeEngine.V1.Model.EthereumDetails)
  field(:labels, type: :map)
  field(:name)
  field(:privateServiceConnectEnabled)
  field(:state)
  field(:updateTime, as: DateTime)
end

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

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