{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Kinesis.DisableEnhancedMonitoring
(
DisableEnhancedMonitoring (..),
newDisableEnhancedMonitoring,
disableEnhancedMonitoring_streamName,
disableEnhancedMonitoring_shardLevelMetrics,
EnhancedMonitoringOutput (..),
newEnhancedMonitoringOutput,
enhancedMonitoringOutput_desiredShardLevelMetrics,
enhancedMonitoringOutput_currentShardLevelMetrics,
enhancedMonitoringOutput_streamName,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Kinesis.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DisableEnhancedMonitoring = DisableEnhancedMonitoring'
{
DisableEnhancedMonitoring -> Text
streamName :: Prelude.Text,
DisableEnhancedMonitoring -> [MetricsName]
shardLevelMetrics :: [MetricsName]
}
deriving (DisableEnhancedMonitoring -> DisableEnhancedMonitoring -> Bool
(DisableEnhancedMonitoring -> DisableEnhancedMonitoring -> Bool)
-> (DisableEnhancedMonitoring -> DisableEnhancedMonitoring -> Bool)
-> Eq DisableEnhancedMonitoring
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableEnhancedMonitoring -> DisableEnhancedMonitoring -> Bool
$c/= :: DisableEnhancedMonitoring -> DisableEnhancedMonitoring -> Bool
== :: DisableEnhancedMonitoring -> DisableEnhancedMonitoring -> Bool
$c== :: DisableEnhancedMonitoring -> DisableEnhancedMonitoring -> Bool
Prelude.Eq, ReadPrec [DisableEnhancedMonitoring]
ReadPrec DisableEnhancedMonitoring
Int -> ReadS DisableEnhancedMonitoring
ReadS [DisableEnhancedMonitoring]
(Int -> ReadS DisableEnhancedMonitoring)
-> ReadS [DisableEnhancedMonitoring]
-> ReadPrec DisableEnhancedMonitoring
-> ReadPrec [DisableEnhancedMonitoring]
-> Read DisableEnhancedMonitoring
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisableEnhancedMonitoring]
$creadListPrec :: ReadPrec [DisableEnhancedMonitoring]
readPrec :: ReadPrec DisableEnhancedMonitoring
$creadPrec :: ReadPrec DisableEnhancedMonitoring
readList :: ReadS [DisableEnhancedMonitoring]
$creadList :: ReadS [DisableEnhancedMonitoring]
readsPrec :: Int -> ReadS DisableEnhancedMonitoring
$creadsPrec :: Int -> ReadS DisableEnhancedMonitoring
Prelude.Read, Int -> DisableEnhancedMonitoring -> ShowS
[DisableEnhancedMonitoring] -> ShowS
DisableEnhancedMonitoring -> String
(Int -> DisableEnhancedMonitoring -> ShowS)
-> (DisableEnhancedMonitoring -> String)
-> ([DisableEnhancedMonitoring] -> ShowS)
-> Show DisableEnhancedMonitoring
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableEnhancedMonitoring] -> ShowS
$cshowList :: [DisableEnhancedMonitoring] -> ShowS
show :: DisableEnhancedMonitoring -> String
$cshow :: DisableEnhancedMonitoring -> String
showsPrec :: Int -> DisableEnhancedMonitoring -> ShowS
$cshowsPrec :: Int -> DisableEnhancedMonitoring -> ShowS
Prelude.Show, (forall x.
DisableEnhancedMonitoring -> Rep DisableEnhancedMonitoring x)
-> (forall x.
Rep DisableEnhancedMonitoring x -> DisableEnhancedMonitoring)
-> Generic DisableEnhancedMonitoring
forall x.
Rep DisableEnhancedMonitoring x -> DisableEnhancedMonitoring
forall x.
DisableEnhancedMonitoring -> Rep DisableEnhancedMonitoring x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisableEnhancedMonitoring x -> DisableEnhancedMonitoring
$cfrom :: forall x.
DisableEnhancedMonitoring -> Rep DisableEnhancedMonitoring x
Prelude.Generic)
newDisableEnhancedMonitoring ::
Prelude.Text ->
DisableEnhancedMonitoring
newDisableEnhancedMonitoring :: Text -> DisableEnhancedMonitoring
newDisableEnhancedMonitoring Text
pStreamName_ =
DisableEnhancedMonitoring' :: Text -> [MetricsName] -> DisableEnhancedMonitoring
DisableEnhancedMonitoring'
{ $sel:streamName:DisableEnhancedMonitoring' :: Text
streamName =
Text
pStreamName_,
$sel:shardLevelMetrics:DisableEnhancedMonitoring' :: [MetricsName]
shardLevelMetrics = [MetricsName]
forall a. Monoid a => a
Prelude.mempty
}
disableEnhancedMonitoring_streamName :: Lens.Lens' DisableEnhancedMonitoring Prelude.Text
disableEnhancedMonitoring_streamName :: (Text -> f Text)
-> DisableEnhancedMonitoring -> f DisableEnhancedMonitoring
disableEnhancedMonitoring_streamName = (DisableEnhancedMonitoring -> Text)
-> (DisableEnhancedMonitoring -> Text -> DisableEnhancedMonitoring)
-> Lens
DisableEnhancedMonitoring DisableEnhancedMonitoring Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableEnhancedMonitoring' {Text
streamName :: Text
$sel:streamName:DisableEnhancedMonitoring' :: DisableEnhancedMonitoring -> Text
streamName} -> Text
streamName) (\s :: DisableEnhancedMonitoring
s@DisableEnhancedMonitoring' {} Text
a -> DisableEnhancedMonitoring
s {$sel:streamName:DisableEnhancedMonitoring' :: Text
streamName = Text
a} :: DisableEnhancedMonitoring)
disableEnhancedMonitoring_shardLevelMetrics :: Lens.Lens' DisableEnhancedMonitoring [MetricsName]
disableEnhancedMonitoring_shardLevelMetrics :: ([MetricsName] -> f [MetricsName])
-> DisableEnhancedMonitoring -> f DisableEnhancedMonitoring
disableEnhancedMonitoring_shardLevelMetrics = (DisableEnhancedMonitoring -> [MetricsName])
-> (DisableEnhancedMonitoring
-> [MetricsName] -> DisableEnhancedMonitoring)
-> Lens
DisableEnhancedMonitoring
DisableEnhancedMonitoring
[MetricsName]
[MetricsName]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisableEnhancedMonitoring' {[MetricsName]
shardLevelMetrics :: [MetricsName]
$sel:shardLevelMetrics:DisableEnhancedMonitoring' :: DisableEnhancedMonitoring -> [MetricsName]
shardLevelMetrics} -> [MetricsName]
shardLevelMetrics) (\s :: DisableEnhancedMonitoring
s@DisableEnhancedMonitoring' {} [MetricsName]
a -> DisableEnhancedMonitoring
s {$sel:shardLevelMetrics:DisableEnhancedMonitoring' :: [MetricsName]
shardLevelMetrics = [MetricsName]
a} :: DisableEnhancedMonitoring) (([MetricsName] -> f [MetricsName])
-> DisableEnhancedMonitoring -> f DisableEnhancedMonitoring)
-> (([MetricsName] -> f [MetricsName])
-> [MetricsName] -> f [MetricsName])
-> ([MetricsName] -> f [MetricsName])
-> DisableEnhancedMonitoring
-> f DisableEnhancedMonitoring
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([MetricsName] -> f [MetricsName])
-> [MetricsName] -> f [MetricsName]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DisableEnhancedMonitoring where
type
AWSResponse DisableEnhancedMonitoring =
EnhancedMonitoringOutput
request :: DisableEnhancedMonitoring -> Request DisableEnhancedMonitoring
request = Service
-> DisableEnhancedMonitoring -> Request DisableEnhancedMonitoring
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisableEnhancedMonitoring
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisableEnhancedMonitoring)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DisableEnhancedMonitoring))
-> Logger
-> Service
-> Proxy DisableEnhancedMonitoring
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisableEnhancedMonitoring)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> Object -> Either String EnhancedMonitoringOutput
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable DisableEnhancedMonitoring
instance Prelude.NFData DisableEnhancedMonitoring
instance Core.ToHeaders DisableEnhancedMonitoring where
toHeaders :: DisableEnhancedMonitoring -> ResponseHeaders
toHeaders =
ResponseHeaders -> DisableEnhancedMonitoring -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Kinesis_20131202.DisableEnhancedMonitoring" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DisableEnhancedMonitoring where
toJSON :: DisableEnhancedMonitoring -> Value
toJSON DisableEnhancedMonitoring' {[MetricsName]
Text
shardLevelMetrics :: [MetricsName]
streamName :: Text
$sel:shardLevelMetrics:DisableEnhancedMonitoring' :: DisableEnhancedMonitoring -> [MetricsName]
$sel:streamName:DisableEnhancedMonitoring' :: DisableEnhancedMonitoring -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
streamName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ShardLevelMetrics" Text -> [MetricsName] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [MetricsName]
shardLevelMetrics)
]
)
instance Core.ToPath DisableEnhancedMonitoring where
toPath :: DisableEnhancedMonitoring -> ByteString
toPath = ByteString -> DisableEnhancedMonitoring -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DisableEnhancedMonitoring where
toQuery :: DisableEnhancedMonitoring -> QueryString
toQuery = QueryString -> DisableEnhancedMonitoring -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty