# 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.TrafficDirector.V3.Model.PerXdsConfig do
  @moduledoc """
  Detailed config (per xDS) with status. [#next-free-field: 8]

  ## Attributes

  *   `clientStatus` (*type:* `String.t`, *default:* `nil`) - Client config status is populated by xDS clients. Will not be present if the CSDS server is an xDS server. No matter what the client config status is, xDS clients should always dump the most recent accepted xDS config. .. attention:: This field is deprecated. Use :ref:`ClientResourceStatus ` for per-resource config status instead.
  *   `clusterConfig` (*type:* `GoogleApi.TrafficDirector.V3.Model.ClustersConfigDump.t`, *default:* `nil`) - 
  *   `endpointConfig` (*type:* `GoogleApi.TrafficDirector.V3.Model.EndpointsConfigDump.t`, *default:* `nil`) - 
  *   `listenerConfig` (*type:* `GoogleApi.TrafficDirector.V3.Model.ListenersConfigDump.t`, *default:* `nil`) - 
  *   `routeConfig` (*type:* `GoogleApi.TrafficDirector.V3.Model.RoutesConfigDump.t`, *default:* `nil`) - 
  *   `scopedRouteConfig` (*type:* `GoogleApi.TrafficDirector.V3.Model.ScopedRoutesConfigDump.t`, *default:* `nil`) - 
  *   `status` (*type:* `String.t`, *default:* `nil`) - Config status generated by management servers. Will not be present if the CSDS server is an xDS client.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :clientStatus => String.t() | nil,
          :clusterConfig => GoogleApi.TrafficDirector.V3.Model.ClustersConfigDump.t() | nil,
          :endpointConfig => GoogleApi.TrafficDirector.V3.Model.EndpointsConfigDump.t() | nil,
          :listenerConfig => GoogleApi.TrafficDirector.V3.Model.ListenersConfigDump.t() | nil,
          :routeConfig => GoogleApi.TrafficDirector.V3.Model.RoutesConfigDump.t() | nil,
          :scopedRouteConfig =>
            GoogleApi.TrafficDirector.V3.Model.ScopedRoutesConfigDump.t() | nil,
          :status => String.t() | nil
        }

  field(:clientStatus)
  field(:clusterConfig, as: GoogleApi.TrafficDirector.V3.Model.ClustersConfigDump)
  field(:endpointConfig, as: GoogleApi.TrafficDirector.V3.Model.EndpointsConfigDump)
  field(:listenerConfig, as: GoogleApi.TrafficDirector.V3.Model.ListenersConfigDump)
  field(:routeConfig, as: GoogleApi.TrafficDirector.V3.Model.RoutesConfigDump)
  field(:scopedRouteConfig, as: GoogleApi.TrafficDirector.V3.Model.ScopedRoutesConfigDump)
  field(:status)
end

defimpl Poison.Decoder, for: GoogleApi.TrafficDirector.V3.Model.PerXdsConfig do
  def decode(value, options) do
    GoogleApi.TrafficDirector.V3.Model.PerXdsConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.TrafficDirector.V3.Model.PerXdsConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
