{-# 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.IoT.SetV2LoggingLevel
(
SetV2LoggingLevel (..),
newSetV2LoggingLevel,
setV2LoggingLevel_logTarget,
setV2LoggingLevel_logLevel,
SetV2LoggingLevelResponse (..),
newSetV2LoggingLevelResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoT.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 SetV2LoggingLevel = SetV2LoggingLevel'
{
SetV2LoggingLevel -> LogTarget
logTarget :: LogTarget,
SetV2LoggingLevel -> LogLevel
logLevel :: LogLevel
}
deriving (SetV2LoggingLevel -> SetV2LoggingLevel -> Bool
(SetV2LoggingLevel -> SetV2LoggingLevel -> Bool)
-> (SetV2LoggingLevel -> SetV2LoggingLevel -> Bool)
-> Eq SetV2LoggingLevel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetV2LoggingLevel -> SetV2LoggingLevel -> Bool
$c/= :: SetV2LoggingLevel -> SetV2LoggingLevel -> Bool
== :: SetV2LoggingLevel -> SetV2LoggingLevel -> Bool
$c== :: SetV2LoggingLevel -> SetV2LoggingLevel -> Bool
Prelude.Eq, ReadPrec [SetV2LoggingLevel]
ReadPrec SetV2LoggingLevel
Int -> ReadS SetV2LoggingLevel
ReadS [SetV2LoggingLevel]
(Int -> ReadS SetV2LoggingLevel)
-> ReadS [SetV2LoggingLevel]
-> ReadPrec SetV2LoggingLevel
-> ReadPrec [SetV2LoggingLevel]
-> Read SetV2LoggingLevel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetV2LoggingLevel]
$creadListPrec :: ReadPrec [SetV2LoggingLevel]
readPrec :: ReadPrec SetV2LoggingLevel
$creadPrec :: ReadPrec SetV2LoggingLevel
readList :: ReadS [SetV2LoggingLevel]
$creadList :: ReadS [SetV2LoggingLevel]
readsPrec :: Int -> ReadS SetV2LoggingLevel
$creadsPrec :: Int -> ReadS SetV2LoggingLevel
Prelude.Read, Int -> SetV2LoggingLevel -> ShowS
[SetV2LoggingLevel] -> ShowS
SetV2LoggingLevel -> String
(Int -> SetV2LoggingLevel -> ShowS)
-> (SetV2LoggingLevel -> String)
-> ([SetV2LoggingLevel] -> ShowS)
-> Show SetV2LoggingLevel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetV2LoggingLevel] -> ShowS
$cshowList :: [SetV2LoggingLevel] -> ShowS
show :: SetV2LoggingLevel -> String
$cshow :: SetV2LoggingLevel -> String
showsPrec :: Int -> SetV2LoggingLevel -> ShowS
$cshowsPrec :: Int -> SetV2LoggingLevel -> ShowS
Prelude.Show, (forall x. SetV2LoggingLevel -> Rep SetV2LoggingLevel x)
-> (forall x. Rep SetV2LoggingLevel x -> SetV2LoggingLevel)
-> Generic SetV2LoggingLevel
forall x. Rep SetV2LoggingLevel x -> SetV2LoggingLevel
forall x. SetV2LoggingLevel -> Rep SetV2LoggingLevel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetV2LoggingLevel x -> SetV2LoggingLevel
$cfrom :: forall x. SetV2LoggingLevel -> Rep SetV2LoggingLevel x
Prelude.Generic)
newSetV2LoggingLevel ::
LogTarget ->
LogLevel ->
SetV2LoggingLevel
newSetV2LoggingLevel :: LogTarget -> LogLevel -> SetV2LoggingLevel
newSetV2LoggingLevel LogTarget
pLogTarget_ LogLevel
pLogLevel_ =
SetV2LoggingLevel' :: LogTarget -> LogLevel -> SetV2LoggingLevel
SetV2LoggingLevel'
{ $sel:logTarget:SetV2LoggingLevel' :: LogTarget
logTarget = LogTarget
pLogTarget_,
$sel:logLevel:SetV2LoggingLevel' :: LogLevel
logLevel = LogLevel
pLogLevel_
}
setV2LoggingLevel_logTarget :: Lens.Lens' SetV2LoggingLevel LogTarget
setV2LoggingLevel_logTarget :: (LogTarget -> f LogTarget)
-> SetV2LoggingLevel -> f SetV2LoggingLevel
setV2LoggingLevel_logTarget = (SetV2LoggingLevel -> LogTarget)
-> (SetV2LoggingLevel -> LogTarget -> SetV2LoggingLevel)
-> Lens SetV2LoggingLevel SetV2LoggingLevel LogTarget LogTarget
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetV2LoggingLevel' {LogTarget
logTarget :: LogTarget
$sel:logTarget:SetV2LoggingLevel' :: SetV2LoggingLevel -> LogTarget
logTarget} -> LogTarget
logTarget) (\s :: SetV2LoggingLevel
s@SetV2LoggingLevel' {} LogTarget
a -> SetV2LoggingLevel
s {$sel:logTarget:SetV2LoggingLevel' :: LogTarget
logTarget = LogTarget
a} :: SetV2LoggingLevel)
setV2LoggingLevel_logLevel :: Lens.Lens' SetV2LoggingLevel LogLevel
setV2LoggingLevel_logLevel :: (LogLevel -> f LogLevel)
-> SetV2LoggingLevel -> f SetV2LoggingLevel
setV2LoggingLevel_logLevel = (SetV2LoggingLevel -> LogLevel)
-> (SetV2LoggingLevel -> LogLevel -> SetV2LoggingLevel)
-> Lens SetV2LoggingLevel SetV2LoggingLevel LogLevel LogLevel
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetV2LoggingLevel' {LogLevel
logLevel :: LogLevel
$sel:logLevel:SetV2LoggingLevel' :: SetV2LoggingLevel -> LogLevel
logLevel} -> LogLevel
logLevel) (\s :: SetV2LoggingLevel
s@SetV2LoggingLevel' {} LogLevel
a -> SetV2LoggingLevel
s {$sel:logLevel:SetV2LoggingLevel' :: LogLevel
logLevel = LogLevel
a} :: SetV2LoggingLevel)
instance Core.AWSRequest SetV2LoggingLevel where
type
AWSResponse SetV2LoggingLevel =
SetV2LoggingLevelResponse
request :: SetV2LoggingLevel -> Request SetV2LoggingLevel
request = Service -> SetV2LoggingLevel -> Request SetV2LoggingLevel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SetV2LoggingLevel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetV2LoggingLevel)))
response =
AWSResponse SetV2LoggingLevel
-> Logger
-> Service
-> Proxy SetV2LoggingLevel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetV2LoggingLevel)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse SetV2LoggingLevel
SetV2LoggingLevelResponse
SetV2LoggingLevelResponse'
instance Prelude.Hashable SetV2LoggingLevel
instance Prelude.NFData SetV2LoggingLevel
instance Core.ToHeaders SetV2LoggingLevel where
toHeaders :: SetV2LoggingLevel -> [Header]
toHeaders = [Header] -> SetV2LoggingLevel -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON SetV2LoggingLevel where
toJSON :: SetV2LoggingLevel -> Value
toJSON SetV2LoggingLevel' {LogLevel
LogTarget
logLevel :: LogLevel
logTarget :: LogTarget
$sel:logLevel:SetV2LoggingLevel' :: SetV2LoggingLevel -> LogLevel
$sel:logTarget:SetV2LoggingLevel' :: SetV2LoggingLevel -> LogTarget
..} =
[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
"logTarget" Text -> LogTarget -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LogTarget
logTarget),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"logLevel" Text -> LogLevel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LogLevel
logLevel)
]
)
instance Core.ToPath SetV2LoggingLevel where
toPath :: SetV2LoggingLevel -> ByteString
toPath = ByteString -> SetV2LoggingLevel -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v2LoggingLevel"
instance Core.ToQuery SetV2LoggingLevel where
toQuery :: SetV2LoggingLevel -> QueryString
toQuery = QueryString -> SetV2LoggingLevel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SetV2LoggingLevelResponse = SetV2LoggingLevelResponse'
{
}
deriving (SetV2LoggingLevelResponse -> SetV2LoggingLevelResponse -> Bool
(SetV2LoggingLevelResponse -> SetV2LoggingLevelResponse -> Bool)
-> (SetV2LoggingLevelResponse -> SetV2LoggingLevelResponse -> Bool)
-> Eq SetV2LoggingLevelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetV2LoggingLevelResponse -> SetV2LoggingLevelResponse -> Bool
$c/= :: SetV2LoggingLevelResponse -> SetV2LoggingLevelResponse -> Bool
== :: SetV2LoggingLevelResponse -> SetV2LoggingLevelResponse -> Bool
$c== :: SetV2LoggingLevelResponse -> SetV2LoggingLevelResponse -> Bool
Prelude.Eq, ReadPrec [SetV2LoggingLevelResponse]
ReadPrec SetV2LoggingLevelResponse
Int -> ReadS SetV2LoggingLevelResponse
ReadS [SetV2LoggingLevelResponse]
(Int -> ReadS SetV2LoggingLevelResponse)
-> ReadS [SetV2LoggingLevelResponse]
-> ReadPrec SetV2LoggingLevelResponse
-> ReadPrec [SetV2LoggingLevelResponse]
-> Read SetV2LoggingLevelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetV2LoggingLevelResponse]
$creadListPrec :: ReadPrec [SetV2LoggingLevelResponse]
readPrec :: ReadPrec SetV2LoggingLevelResponse
$creadPrec :: ReadPrec SetV2LoggingLevelResponse
readList :: ReadS [SetV2LoggingLevelResponse]
$creadList :: ReadS [SetV2LoggingLevelResponse]
readsPrec :: Int -> ReadS SetV2LoggingLevelResponse
$creadsPrec :: Int -> ReadS SetV2LoggingLevelResponse
Prelude.Read, Int -> SetV2LoggingLevelResponse -> ShowS
[SetV2LoggingLevelResponse] -> ShowS
SetV2LoggingLevelResponse -> String
(Int -> SetV2LoggingLevelResponse -> ShowS)
-> (SetV2LoggingLevelResponse -> String)
-> ([SetV2LoggingLevelResponse] -> ShowS)
-> Show SetV2LoggingLevelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetV2LoggingLevelResponse] -> ShowS
$cshowList :: [SetV2LoggingLevelResponse] -> ShowS
show :: SetV2LoggingLevelResponse -> String
$cshow :: SetV2LoggingLevelResponse -> String
showsPrec :: Int -> SetV2LoggingLevelResponse -> ShowS
$cshowsPrec :: Int -> SetV2LoggingLevelResponse -> ShowS
Prelude.Show, (forall x.
SetV2LoggingLevelResponse -> Rep SetV2LoggingLevelResponse x)
-> (forall x.
Rep SetV2LoggingLevelResponse x -> SetV2LoggingLevelResponse)
-> Generic SetV2LoggingLevelResponse
forall x.
Rep SetV2LoggingLevelResponse x -> SetV2LoggingLevelResponse
forall x.
SetV2LoggingLevelResponse -> Rep SetV2LoggingLevelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetV2LoggingLevelResponse x -> SetV2LoggingLevelResponse
$cfrom :: forall x.
SetV2LoggingLevelResponse -> Rep SetV2LoggingLevelResponse x
Prelude.Generic)
newSetV2LoggingLevelResponse ::
SetV2LoggingLevelResponse
newSetV2LoggingLevelResponse :: SetV2LoggingLevelResponse
newSetV2LoggingLevelResponse =
SetV2LoggingLevelResponse
SetV2LoggingLevelResponse'
instance Prelude.NFData SetV2LoggingLevelResponse