{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SSM.Types.InstanceAggregatedAssociationOverview
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSM.Types.InstanceAggregatedAssociationOverview where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Status information about the aggregated associations.
--
-- /See:/ 'newInstanceAggregatedAssociationOverview' smart constructor.
data InstanceAggregatedAssociationOverview = InstanceAggregatedAssociationOverview'
  { -- | Detailed status information about the aggregated associations.
    InstanceAggregatedAssociationOverview -> Maybe Text
detailedStatus :: Prelude.Maybe Prelude.Text,
    -- | The number of associations for the managed node(s).
    InstanceAggregatedAssociationOverview -> Maybe (HashMap Text Int)
instanceAssociationStatusAggregatedCount :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Int)
  }
  deriving (InstanceAggregatedAssociationOverview
-> InstanceAggregatedAssociationOverview -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceAggregatedAssociationOverview
-> InstanceAggregatedAssociationOverview -> Bool
$c/= :: InstanceAggregatedAssociationOverview
-> InstanceAggregatedAssociationOverview -> Bool
== :: InstanceAggregatedAssociationOverview
-> InstanceAggregatedAssociationOverview -> Bool
$c== :: InstanceAggregatedAssociationOverview
-> InstanceAggregatedAssociationOverview -> Bool
Prelude.Eq, ReadPrec [InstanceAggregatedAssociationOverview]
ReadPrec InstanceAggregatedAssociationOverview
Int -> ReadS InstanceAggregatedAssociationOverview
ReadS [InstanceAggregatedAssociationOverview]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceAggregatedAssociationOverview]
$creadListPrec :: ReadPrec [InstanceAggregatedAssociationOverview]
readPrec :: ReadPrec InstanceAggregatedAssociationOverview
$creadPrec :: ReadPrec InstanceAggregatedAssociationOverview
readList :: ReadS [InstanceAggregatedAssociationOverview]
$creadList :: ReadS [InstanceAggregatedAssociationOverview]
readsPrec :: Int -> ReadS InstanceAggregatedAssociationOverview
$creadsPrec :: Int -> ReadS InstanceAggregatedAssociationOverview
Prelude.Read, Int -> InstanceAggregatedAssociationOverview -> ShowS
[InstanceAggregatedAssociationOverview] -> ShowS
InstanceAggregatedAssociationOverview -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceAggregatedAssociationOverview] -> ShowS
$cshowList :: [InstanceAggregatedAssociationOverview] -> ShowS
show :: InstanceAggregatedAssociationOverview -> String
$cshow :: InstanceAggregatedAssociationOverview -> String
showsPrec :: Int -> InstanceAggregatedAssociationOverview -> ShowS
$cshowsPrec :: Int -> InstanceAggregatedAssociationOverview -> ShowS
Prelude.Show, forall x.
Rep InstanceAggregatedAssociationOverview x
-> InstanceAggregatedAssociationOverview
forall x.
InstanceAggregatedAssociationOverview
-> Rep InstanceAggregatedAssociationOverview x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InstanceAggregatedAssociationOverview x
-> InstanceAggregatedAssociationOverview
$cfrom :: forall x.
InstanceAggregatedAssociationOverview
-> Rep InstanceAggregatedAssociationOverview x
Prelude.Generic)

-- |
-- Create a value of 'InstanceAggregatedAssociationOverview' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'detailedStatus', 'instanceAggregatedAssociationOverview_detailedStatus' - Detailed status information about the aggregated associations.
--
-- 'instanceAssociationStatusAggregatedCount', 'instanceAggregatedAssociationOverview_instanceAssociationStatusAggregatedCount' - The number of associations for the managed node(s).
newInstanceAggregatedAssociationOverview ::
  InstanceAggregatedAssociationOverview
newInstanceAggregatedAssociationOverview :: InstanceAggregatedAssociationOverview
newInstanceAggregatedAssociationOverview =
  InstanceAggregatedAssociationOverview'
    { $sel:detailedStatus:InstanceAggregatedAssociationOverview' :: Maybe Text
detailedStatus =
        forall a. Maybe a
Prelude.Nothing,
      $sel:instanceAssociationStatusAggregatedCount:InstanceAggregatedAssociationOverview' :: Maybe (HashMap Text Int)
instanceAssociationStatusAggregatedCount =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Detailed status information about the aggregated associations.
instanceAggregatedAssociationOverview_detailedStatus :: Lens.Lens' InstanceAggregatedAssociationOverview (Prelude.Maybe Prelude.Text)
instanceAggregatedAssociationOverview_detailedStatus :: Lens' InstanceAggregatedAssociationOverview (Maybe Text)
instanceAggregatedAssociationOverview_detailedStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAggregatedAssociationOverview' {Maybe Text
detailedStatus :: Maybe Text
$sel:detailedStatus:InstanceAggregatedAssociationOverview' :: InstanceAggregatedAssociationOverview -> Maybe Text
detailedStatus} -> Maybe Text
detailedStatus) (\s :: InstanceAggregatedAssociationOverview
s@InstanceAggregatedAssociationOverview' {} Maybe Text
a -> InstanceAggregatedAssociationOverview
s {$sel:detailedStatus:InstanceAggregatedAssociationOverview' :: Maybe Text
detailedStatus = Maybe Text
a} :: InstanceAggregatedAssociationOverview)

-- | The number of associations for the managed node(s).
instanceAggregatedAssociationOverview_instanceAssociationStatusAggregatedCount :: Lens.Lens' InstanceAggregatedAssociationOverview (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Int))
instanceAggregatedAssociationOverview_instanceAssociationStatusAggregatedCount :: Lens'
  InstanceAggregatedAssociationOverview (Maybe (HashMap Text Int))
instanceAggregatedAssociationOverview_instanceAssociationStatusAggregatedCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceAggregatedAssociationOverview' {Maybe (HashMap Text Int)
instanceAssociationStatusAggregatedCount :: Maybe (HashMap Text Int)
$sel:instanceAssociationStatusAggregatedCount:InstanceAggregatedAssociationOverview' :: InstanceAggregatedAssociationOverview -> Maybe (HashMap Text Int)
instanceAssociationStatusAggregatedCount} -> Maybe (HashMap Text Int)
instanceAssociationStatusAggregatedCount) (\s :: InstanceAggregatedAssociationOverview
s@InstanceAggregatedAssociationOverview' {} Maybe (HashMap Text Int)
a -> InstanceAggregatedAssociationOverview
s {$sel:instanceAssociationStatusAggregatedCount:InstanceAggregatedAssociationOverview' :: Maybe (HashMap Text Int)
instanceAssociationStatusAggregatedCount = Maybe (HashMap Text Int)
a} :: InstanceAggregatedAssociationOverview) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Data.FromJSON
    InstanceAggregatedAssociationOverview
  where
  parseJSON :: Value -> Parser InstanceAggregatedAssociationOverview
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"InstanceAggregatedAssociationOverview"
      ( \Object
x ->
          Maybe Text
-> Maybe (HashMap Text Int)
-> InstanceAggregatedAssociationOverview
InstanceAggregatedAssociationOverview'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DetailedStatus")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"InstanceAssociationStatusAggregatedCount"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance
  Prelude.Hashable
    InstanceAggregatedAssociationOverview
  where
  hashWithSalt :: Int -> InstanceAggregatedAssociationOverview -> Int
hashWithSalt
    Int
_salt
    InstanceAggregatedAssociationOverview' {Maybe Text
Maybe (HashMap Text Int)
instanceAssociationStatusAggregatedCount :: Maybe (HashMap Text Int)
detailedStatus :: Maybe Text
$sel:instanceAssociationStatusAggregatedCount:InstanceAggregatedAssociationOverview' :: InstanceAggregatedAssociationOverview -> Maybe (HashMap Text Int)
$sel:detailedStatus:InstanceAggregatedAssociationOverview' :: InstanceAggregatedAssociationOverview -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
detailedStatus
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Int)
instanceAssociationStatusAggregatedCount

instance
  Prelude.NFData
    InstanceAggregatedAssociationOverview
  where
  rnf :: InstanceAggregatedAssociationOverview -> ()
rnf InstanceAggregatedAssociationOverview' {Maybe Text
Maybe (HashMap Text Int)
instanceAssociationStatusAggregatedCount :: Maybe (HashMap Text Int)
detailedStatus :: Maybe Text
$sel:instanceAssociationStatusAggregatedCount:InstanceAggregatedAssociationOverview' :: InstanceAggregatedAssociationOverview -> Maybe (HashMap Text Int)
$sel:detailedStatus:InstanceAggregatedAssociationOverview' :: InstanceAggregatedAssociationOverview -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
detailedStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Int)
instanceAssociationStatusAggregatedCount