# 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.ValidatorConfig do
  @moduledoc """
  Configuration for validator-related parameters on the beacon client, and for any GCP-managed validator client.

  ## Attributes

  *   `beaconFeeRecipient` (*type:* `String.t`, *default:* `nil`) - An Ethereum address which the beacon client will send fee rewards to if no recipient is configured in the validator client. See https://lighthouse-book.sigmaprime.io/suggested-fee-recipient.html or https://docs.prylabs.network/docs/execution-node/fee-recipient for examples of how this is used. Note that while this is often described as "suggested", as we run the execution node we can trust the execution node, and therefore this is considered enforced.
  *   `managedValidatorClient` (*type:* `boolean()`, *default:* `nil`) - Immutable. When true, deploys a GCP-managed validator client alongside the beacon client.
  *   `mevRelayUrls` (*type:* `list(String.t)`, *default:* `nil`) - URLs for MEV-relay services to use for block building. When set, a GCP-managed MEV-boost service is configured on the beacon client.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :beaconFeeRecipient => String.t() | nil,
          :managedValidatorClient => boolean() | nil,
          :mevRelayUrls => list(String.t()) | nil
        }

  field(:beaconFeeRecipient)
  field(:managedValidatorClient)
  field(:mevRelayUrls, type: :list)
end

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

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