# 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.GKEOnPrem.V1.Model.BareMetalBgpPeerConfig do
  @moduledoc """
  BareMetalBgpPeerConfig represents configuration parameters for a Border Gateway Protocol (BGP) peer.

  ## Attributes

  *   `asn` (*type:* `String.t`, *default:* `nil`) - Required. BGP autonomous system number (ASN) for the network that contains the external peer device.
  *   `controlPlaneNodes` (*type:* `list(String.t)`, *default:* `nil`) - The IP address of the control plane node that connects to the external peer. If you don't specify any control plane nodes, all control plane nodes can connect to the external peer. If you specify one or more IP addresses, only the nodes specified participate in peering sessions.
  *   `ipAddress` (*type:* `String.t`, *default:* `nil`) - Required. The IP address of the external peer device.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :asn => String.t() | nil,
          :controlPlaneNodes => list(String.t()) | nil,
          :ipAddress => String.t() | nil
        }

  field(:asn)
  field(:controlPlaneNodes, type: :list)
  field(:ipAddress)
end

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

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