# 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.SQLAdmin.V1.Model.PoolNodeConfig do
  @moduledoc """
  Details of a single node of a read pool.

  ## Attributes

  *   `dnsName` (*type:* `String.t`, *default:* `nil`) - Output only. The DNS name of the node.
  *   `dnsNames` (*type:* `list(GoogleApi.SQLAdmin.V1.Model.DnsNameMapping.t)`, *default:* `nil`) - Output only. The list of DNS names used by this node.
  *   `gceZone` (*type:* `String.t`, *default:* `nil`) - Output only. The serving zone of the node.
  *   `ipAddresses` (*type:* `list(GoogleApi.SQLAdmin.V1.Model.IpMapping.t)`, *default:* `nil`) - Output only. Mappings containing IP addresses that can be used to connect to the node.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The name of the node, to be used for retrieving metrics and logs for the node.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The current state of the node.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dnsName => String.t() | nil,
          :dnsNames => list(GoogleApi.SQLAdmin.V1.Model.DnsNameMapping.t()) | nil,
          :gceZone => String.t() | nil,
          :ipAddresses => list(GoogleApi.SQLAdmin.V1.Model.IpMapping.t()) | nil,
          :name => String.t() | nil,
          :state => String.t() | nil
        }

  field(:dnsName)
  field(:dnsNames, as: GoogleApi.SQLAdmin.V1.Model.DnsNameMapping, type: :list)
  field(:gceZone)
  field(:ipAddresses, as: GoogleApi.SQLAdmin.V1.Model.IpMapping, type: :list)
  field(:name)
  field(:state)
end

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

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