{-# 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.Kinesis.Types.EnhancedMonitoringOutput
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Kinesis.Types.EnhancedMonitoringOutput where

import qualified Amazonka.Core as Core
import Amazonka.Kinesis.Types.MetricsName
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents the output for EnableEnhancedMonitoring and
-- DisableEnhancedMonitoring.
--
-- /See:/ 'newEnhancedMonitoringOutput' smart constructor.
data EnhancedMonitoringOutput = EnhancedMonitoringOutput'
  { -- | Represents the list of all the metrics that would be in the enhanced
    -- state after the operation.
    EnhancedMonitoringOutput -> Maybe [MetricsName]
desiredShardLevelMetrics :: Prelude.Maybe [MetricsName],
    -- | Represents the current state of the metrics that are in the enhanced
    -- state before the operation.
    EnhancedMonitoringOutput -> Maybe [MetricsName]
currentShardLevelMetrics :: Prelude.Maybe [MetricsName],
    -- | The name of the Kinesis data stream.
    EnhancedMonitoringOutput -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text
  }
  deriving (EnhancedMonitoringOutput -> EnhancedMonitoringOutput -> Bool
(EnhancedMonitoringOutput -> EnhancedMonitoringOutput -> Bool)
-> (EnhancedMonitoringOutput -> EnhancedMonitoringOutput -> Bool)
-> Eq EnhancedMonitoringOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnhancedMonitoringOutput -> EnhancedMonitoringOutput -> Bool
$c/= :: EnhancedMonitoringOutput -> EnhancedMonitoringOutput -> Bool
== :: EnhancedMonitoringOutput -> EnhancedMonitoringOutput -> Bool
$c== :: EnhancedMonitoringOutput -> EnhancedMonitoringOutput -> Bool
Prelude.Eq, ReadPrec [EnhancedMonitoringOutput]
ReadPrec EnhancedMonitoringOutput
Int -> ReadS EnhancedMonitoringOutput
ReadS [EnhancedMonitoringOutput]
(Int -> ReadS EnhancedMonitoringOutput)
-> ReadS [EnhancedMonitoringOutput]
-> ReadPrec EnhancedMonitoringOutput
-> ReadPrec [EnhancedMonitoringOutput]
-> Read EnhancedMonitoringOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnhancedMonitoringOutput]
$creadListPrec :: ReadPrec [EnhancedMonitoringOutput]
readPrec :: ReadPrec EnhancedMonitoringOutput
$creadPrec :: ReadPrec EnhancedMonitoringOutput
readList :: ReadS [EnhancedMonitoringOutput]
$creadList :: ReadS [EnhancedMonitoringOutput]
readsPrec :: Int -> ReadS EnhancedMonitoringOutput
$creadsPrec :: Int -> ReadS EnhancedMonitoringOutput
Prelude.Read, Int -> EnhancedMonitoringOutput -> ShowS
[EnhancedMonitoringOutput] -> ShowS
EnhancedMonitoringOutput -> String
(Int -> EnhancedMonitoringOutput -> ShowS)
-> (EnhancedMonitoringOutput -> String)
-> ([EnhancedMonitoringOutput] -> ShowS)
-> Show EnhancedMonitoringOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnhancedMonitoringOutput] -> ShowS
$cshowList :: [EnhancedMonitoringOutput] -> ShowS
show :: EnhancedMonitoringOutput -> String
$cshow :: EnhancedMonitoringOutput -> String
showsPrec :: Int -> EnhancedMonitoringOutput -> ShowS
$cshowsPrec :: Int -> EnhancedMonitoringOutput -> ShowS
Prelude.Show, (forall x.
 EnhancedMonitoringOutput -> Rep EnhancedMonitoringOutput x)
-> (forall x.
    Rep EnhancedMonitoringOutput x -> EnhancedMonitoringOutput)
-> Generic EnhancedMonitoringOutput
forall x.
Rep EnhancedMonitoringOutput x -> EnhancedMonitoringOutput
forall x.
EnhancedMonitoringOutput -> Rep EnhancedMonitoringOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnhancedMonitoringOutput x -> EnhancedMonitoringOutput
$cfrom :: forall x.
EnhancedMonitoringOutput -> Rep EnhancedMonitoringOutput x
Prelude.Generic)

-- |
-- Create a value of 'EnhancedMonitoringOutput' 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:
--
-- 'desiredShardLevelMetrics', 'enhancedMonitoringOutput_desiredShardLevelMetrics' - Represents the list of all the metrics that would be in the enhanced
-- state after the operation.
--
-- 'currentShardLevelMetrics', 'enhancedMonitoringOutput_currentShardLevelMetrics' - Represents the current state of the metrics that are in the enhanced
-- state before the operation.
--
-- 'streamName', 'enhancedMonitoringOutput_streamName' - The name of the Kinesis data stream.
newEnhancedMonitoringOutput ::
  EnhancedMonitoringOutput
newEnhancedMonitoringOutput :: EnhancedMonitoringOutput
newEnhancedMonitoringOutput =
  EnhancedMonitoringOutput' :: Maybe [MetricsName]
-> Maybe [MetricsName] -> Maybe Text -> EnhancedMonitoringOutput
EnhancedMonitoringOutput'
    { $sel:desiredShardLevelMetrics:EnhancedMonitoringOutput' :: Maybe [MetricsName]
desiredShardLevelMetrics =
        Maybe [MetricsName]
forall a. Maybe a
Prelude.Nothing,
      $sel:currentShardLevelMetrics:EnhancedMonitoringOutput' :: Maybe [MetricsName]
currentShardLevelMetrics = Maybe [MetricsName]
forall a. Maybe a
Prelude.Nothing,
      $sel:streamName:EnhancedMonitoringOutput' :: Maybe Text
streamName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Represents the list of all the metrics that would be in the enhanced
-- state after the operation.
enhancedMonitoringOutput_desiredShardLevelMetrics :: Lens.Lens' EnhancedMonitoringOutput (Prelude.Maybe [MetricsName])
enhancedMonitoringOutput_desiredShardLevelMetrics :: (Maybe [MetricsName] -> f (Maybe [MetricsName]))
-> EnhancedMonitoringOutput -> f EnhancedMonitoringOutput
enhancedMonitoringOutput_desiredShardLevelMetrics = (EnhancedMonitoringOutput -> Maybe [MetricsName])
-> (EnhancedMonitoringOutput
    -> Maybe [MetricsName] -> EnhancedMonitoringOutput)
-> Lens
     EnhancedMonitoringOutput
     EnhancedMonitoringOutput
     (Maybe [MetricsName])
     (Maybe [MetricsName])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnhancedMonitoringOutput' {Maybe [MetricsName]
desiredShardLevelMetrics :: Maybe [MetricsName]
$sel:desiredShardLevelMetrics:EnhancedMonitoringOutput' :: EnhancedMonitoringOutput -> Maybe [MetricsName]
desiredShardLevelMetrics} -> Maybe [MetricsName]
desiredShardLevelMetrics) (\s :: EnhancedMonitoringOutput
s@EnhancedMonitoringOutput' {} Maybe [MetricsName]
a -> EnhancedMonitoringOutput
s {$sel:desiredShardLevelMetrics:EnhancedMonitoringOutput' :: Maybe [MetricsName]
desiredShardLevelMetrics = Maybe [MetricsName]
a} :: EnhancedMonitoringOutput) ((Maybe [MetricsName] -> f (Maybe [MetricsName]))
 -> EnhancedMonitoringOutput -> f EnhancedMonitoringOutput)
-> ((Maybe [MetricsName] -> f (Maybe [MetricsName]))
    -> Maybe [MetricsName] -> f (Maybe [MetricsName]))
-> (Maybe [MetricsName] -> f (Maybe [MetricsName]))
-> EnhancedMonitoringOutput
-> f EnhancedMonitoringOutput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [MetricsName] [MetricsName] [MetricsName] [MetricsName]
-> Iso
     (Maybe [MetricsName])
     (Maybe [MetricsName])
     (Maybe [MetricsName])
     (Maybe [MetricsName])
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 AnIso [MetricsName] [MetricsName] [MetricsName] [MetricsName]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Represents the current state of the metrics that are in the enhanced
-- state before the operation.
enhancedMonitoringOutput_currentShardLevelMetrics :: Lens.Lens' EnhancedMonitoringOutput (Prelude.Maybe [MetricsName])
enhancedMonitoringOutput_currentShardLevelMetrics :: (Maybe [MetricsName] -> f (Maybe [MetricsName]))
-> EnhancedMonitoringOutput -> f EnhancedMonitoringOutput
enhancedMonitoringOutput_currentShardLevelMetrics = (EnhancedMonitoringOutput -> Maybe [MetricsName])
-> (EnhancedMonitoringOutput
    -> Maybe [MetricsName] -> EnhancedMonitoringOutput)
-> Lens
     EnhancedMonitoringOutput
     EnhancedMonitoringOutput
     (Maybe [MetricsName])
     (Maybe [MetricsName])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnhancedMonitoringOutput' {Maybe [MetricsName]
currentShardLevelMetrics :: Maybe [MetricsName]
$sel:currentShardLevelMetrics:EnhancedMonitoringOutput' :: EnhancedMonitoringOutput -> Maybe [MetricsName]
currentShardLevelMetrics} -> Maybe [MetricsName]
currentShardLevelMetrics) (\s :: EnhancedMonitoringOutput
s@EnhancedMonitoringOutput' {} Maybe [MetricsName]
a -> EnhancedMonitoringOutput
s {$sel:currentShardLevelMetrics:EnhancedMonitoringOutput' :: Maybe [MetricsName]
currentShardLevelMetrics = Maybe [MetricsName]
a} :: EnhancedMonitoringOutput) ((Maybe [MetricsName] -> f (Maybe [MetricsName]))
 -> EnhancedMonitoringOutput -> f EnhancedMonitoringOutput)
-> ((Maybe [MetricsName] -> f (Maybe [MetricsName]))
    -> Maybe [MetricsName] -> f (Maybe [MetricsName]))
-> (Maybe [MetricsName] -> f (Maybe [MetricsName]))
-> EnhancedMonitoringOutput
-> f EnhancedMonitoringOutput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [MetricsName] [MetricsName] [MetricsName] [MetricsName]
-> Iso
     (Maybe [MetricsName])
     (Maybe [MetricsName])
     (Maybe [MetricsName])
     (Maybe [MetricsName])
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 AnIso [MetricsName] [MetricsName] [MetricsName] [MetricsName]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the Kinesis data stream.
enhancedMonitoringOutput_streamName :: Lens.Lens' EnhancedMonitoringOutput (Prelude.Maybe Prelude.Text)
enhancedMonitoringOutput_streamName :: (Maybe Text -> f (Maybe Text))
-> EnhancedMonitoringOutput -> f EnhancedMonitoringOutput
enhancedMonitoringOutput_streamName = (EnhancedMonitoringOutput -> Maybe Text)
-> (EnhancedMonitoringOutput
    -> Maybe Text -> EnhancedMonitoringOutput)
-> Lens
     EnhancedMonitoringOutput
     EnhancedMonitoringOutput
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnhancedMonitoringOutput' {Maybe Text
streamName :: Maybe Text
$sel:streamName:EnhancedMonitoringOutput' :: EnhancedMonitoringOutput -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: EnhancedMonitoringOutput
s@EnhancedMonitoringOutput' {} Maybe Text
a -> EnhancedMonitoringOutput
s {$sel:streamName:EnhancedMonitoringOutput' :: Maybe Text
streamName = Maybe Text
a} :: EnhancedMonitoringOutput)

instance Core.FromJSON EnhancedMonitoringOutput where
  parseJSON :: Value -> Parser EnhancedMonitoringOutput
parseJSON =
    String
-> (Object -> Parser EnhancedMonitoringOutput)
-> Value
-> Parser EnhancedMonitoringOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EnhancedMonitoringOutput"
      ( \Object
x ->
          Maybe [MetricsName]
-> Maybe [MetricsName] -> Maybe Text -> EnhancedMonitoringOutput
EnhancedMonitoringOutput'
            (Maybe [MetricsName]
 -> Maybe [MetricsName] -> Maybe Text -> EnhancedMonitoringOutput)
-> Parser (Maybe [MetricsName])
-> Parser
     (Maybe [MetricsName] -> Maybe Text -> EnhancedMonitoringOutput)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [MetricsName]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DesiredShardLevelMetrics"
                            Parser (Maybe (Maybe [MetricsName]))
-> Maybe [MetricsName] -> Parser (Maybe [MetricsName])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MetricsName]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [MetricsName] -> Maybe Text -> EnhancedMonitoringOutput)
-> Parser (Maybe [MetricsName])
-> Parser (Maybe Text -> EnhancedMonitoringOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [MetricsName]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CurrentShardLevelMetrics"
                            Parser (Maybe (Maybe [MetricsName]))
-> Maybe [MetricsName] -> Parser (Maybe [MetricsName])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MetricsName]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> EnhancedMonitoringOutput)
-> Parser (Maybe Text) -> Parser EnhancedMonitoringOutput
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StreamName")
      )

instance Prelude.Hashable EnhancedMonitoringOutput

instance Prelude.NFData EnhancedMonitoringOutput