# 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.NetworkConnectivity.V1.Model.SpokeSummary do
  @moduledoc """
  Summarizes information about the spokes associated with a hub. The summary includes a count of spokes according to type and according to state. If any spokes are inactive, the summary also lists the reasons they are inactive, including a count for each reason.

  ## Attributes

  *   `spokeStateCounts` (*type:* `list(GoogleApi.NetworkConnectivity.V1.Model.SpokeStateCount.t)`, *default:* `nil`) - Output only. Counts the number of spokes that are in each state and associated with a given hub.
  *   `spokeStateReasonCounts` (*type:* `list(GoogleApi.NetworkConnectivity.V1.Model.SpokeStateReasonCount.t)`, *default:* `nil`) - Output only. Counts the number of spokes that are inactive for each possible reason and associated with a given hub.
  *   `spokeTypeCounts` (*type:* `list(GoogleApi.NetworkConnectivity.V1.Model.SpokeTypeCount.t)`, *default:* `nil`) - Output only. Counts the number of spokes of each type that are associated with a specific hub.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :spokeStateCounts =>
            list(GoogleApi.NetworkConnectivity.V1.Model.SpokeStateCount.t()) | nil,
          :spokeStateReasonCounts =>
            list(GoogleApi.NetworkConnectivity.V1.Model.SpokeStateReasonCount.t()) | nil,
          :spokeTypeCounts =>
            list(GoogleApi.NetworkConnectivity.V1.Model.SpokeTypeCount.t()) | nil
        }

  field(:spokeStateCounts, as: GoogleApi.NetworkConnectivity.V1.Model.SpokeStateCount, type: :list)

  field(:spokeStateReasonCounts,
    as: GoogleApi.NetworkConnectivity.V1.Model.SpokeStateReasonCount,
    type: :list
  )

  field(:spokeTypeCounts, as: GoogleApi.NetworkConnectivity.V1.Model.SpokeTypeCount, type: :list)
end

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

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