{-# 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.IoTWireless.PutResourceLogLevel
(
PutResourceLogLevel (..),
newPutResourceLogLevel,
putResourceLogLevel_resourceIdentifier,
putResourceLogLevel_resourceType,
putResourceLogLevel_logLevel,
PutResourceLogLevelResponse (..),
newPutResourceLogLevelResponse,
putResourceLogLevelResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTWireless.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutResourceLogLevel = PutResourceLogLevel'
{ PutResourceLogLevel -> Text
resourceIdentifier :: Prelude.Text,
PutResourceLogLevel -> Text
resourceType :: Prelude.Text,
PutResourceLogLevel -> LogLevel
logLevel :: LogLevel
}
deriving (PutResourceLogLevel -> PutResourceLogLevel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutResourceLogLevel -> PutResourceLogLevel -> Bool
$c/= :: PutResourceLogLevel -> PutResourceLogLevel -> Bool
== :: PutResourceLogLevel -> PutResourceLogLevel -> Bool
$c== :: PutResourceLogLevel -> PutResourceLogLevel -> Bool
Prelude.Eq, ReadPrec [PutResourceLogLevel]
ReadPrec PutResourceLogLevel
Int -> ReadS PutResourceLogLevel
ReadS [PutResourceLogLevel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutResourceLogLevel]
$creadListPrec :: ReadPrec [PutResourceLogLevel]
readPrec :: ReadPrec PutResourceLogLevel
$creadPrec :: ReadPrec PutResourceLogLevel
readList :: ReadS [PutResourceLogLevel]
$creadList :: ReadS [PutResourceLogLevel]
readsPrec :: Int -> ReadS PutResourceLogLevel
$creadsPrec :: Int -> ReadS PutResourceLogLevel
Prelude.Read, Int -> PutResourceLogLevel -> ShowS
[PutResourceLogLevel] -> ShowS
PutResourceLogLevel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutResourceLogLevel] -> ShowS
$cshowList :: [PutResourceLogLevel] -> ShowS
show :: PutResourceLogLevel -> String
$cshow :: PutResourceLogLevel -> String
showsPrec :: Int -> PutResourceLogLevel -> ShowS
$cshowsPrec :: Int -> PutResourceLogLevel -> ShowS
Prelude.Show, forall x. Rep PutResourceLogLevel x -> PutResourceLogLevel
forall x. PutResourceLogLevel -> Rep PutResourceLogLevel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutResourceLogLevel x -> PutResourceLogLevel
$cfrom :: forall x. PutResourceLogLevel -> Rep PutResourceLogLevel x
Prelude.Generic)
newPutResourceLogLevel ::
Prelude.Text ->
Prelude.Text ->
LogLevel ->
PutResourceLogLevel
newPutResourceLogLevel :: Text -> Text -> LogLevel -> PutResourceLogLevel
newPutResourceLogLevel
Text
pResourceIdentifier_
Text
pResourceType_
LogLevel
pLogLevel_ =
PutResourceLogLevel'
{ $sel:resourceIdentifier:PutResourceLogLevel' :: Text
resourceIdentifier =
Text
pResourceIdentifier_,
$sel:resourceType:PutResourceLogLevel' :: Text
resourceType = Text
pResourceType_,
$sel:logLevel:PutResourceLogLevel' :: LogLevel
logLevel = LogLevel
pLogLevel_
}
putResourceLogLevel_resourceIdentifier :: Lens.Lens' PutResourceLogLevel Prelude.Text
putResourceLogLevel_resourceIdentifier :: Lens' PutResourceLogLevel Text
putResourceLogLevel_resourceIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourceLogLevel' {Text
resourceIdentifier :: Text
$sel:resourceIdentifier:PutResourceLogLevel' :: PutResourceLogLevel -> Text
resourceIdentifier} -> Text
resourceIdentifier) (\s :: PutResourceLogLevel
s@PutResourceLogLevel' {} Text
a -> PutResourceLogLevel
s {$sel:resourceIdentifier:PutResourceLogLevel' :: Text
resourceIdentifier = Text
a} :: PutResourceLogLevel)
putResourceLogLevel_resourceType :: Lens.Lens' PutResourceLogLevel Prelude.Text
putResourceLogLevel_resourceType :: Lens' PutResourceLogLevel Text
putResourceLogLevel_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourceLogLevel' {Text
resourceType :: Text
$sel:resourceType:PutResourceLogLevel' :: PutResourceLogLevel -> Text
resourceType} -> Text
resourceType) (\s :: PutResourceLogLevel
s@PutResourceLogLevel' {} Text
a -> PutResourceLogLevel
s {$sel:resourceType:PutResourceLogLevel' :: Text
resourceType = Text
a} :: PutResourceLogLevel)
putResourceLogLevel_logLevel :: Lens.Lens' PutResourceLogLevel LogLevel
putResourceLogLevel_logLevel :: Lens' PutResourceLogLevel LogLevel
putResourceLogLevel_logLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourceLogLevel' {LogLevel
logLevel :: LogLevel
$sel:logLevel:PutResourceLogLevel' :: PutResourceLogLevel -> LogLevel
logLevel} -> LogLevel
logLevel) (\s :: PutResourceLogLevel
s@PutResourceLogLevel' {} LogLevel
a -> PutResourceLogLevel
s {$sel:logLevel:PutResourceLogLevel' :: LogLevel
logLevel = LogLevel
a} :: PutResourceLogLevel)
instance Core.AWSRequest PutResourceLogLevel where
type
AWSResponse PutResourceLogLevel =
PutResourceLogLevelResponse
request :: (Service -> Service)
-> PutResourceLogLevel -> Request PutResourceLogLevel
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutResourceLogLevel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutResourceLogLevel)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutResourceLogLevelResponse
PutResourceLogLevelResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutResourceLogLevel where
hashWithSalt :: Int -> PutResourceLogLevel -> Int
hashWithSalt Int
_salt PutResourceLogLevel' {Text
LogLevel
logLevel :: LogLevel
resourceType :: Text
resourceIdentifier :: Text
$sel:logLevel:PutResourceLogLevel' :: PutResourceLogLevel -> LogLevel
$sel:resourceType:PutResourceLogLevel' :: PutResourceLogLevel -> Text
$sel:resourceIdentifier:PutResourceLogLevel' :: PutResourceLogLevel -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LogLevel
logLevel
instance Prelude.NFData PutResourceLogLevel where
rnf :: PutResourceLogLevel -> ()
rnf PutResourceLogLevel' {Text
LogLevel
logLevel :: LogLevel
resourceType :: Text
resourceIdentifier :: Text
$sel:logLevel:PutResourceLogLevel' :: PutResourceLogLevel -> LogLevel
$sel:resourceType:PutResourceLogLevel' :: PutResourceLogLevel -> Text
$sel:resourceIdentifier:PutResourceLogLevel' :: PutResourceLogLevel -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
resourceIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LogLevel
logLevel
instance Data.ToHeaders PutResourceLogLevel where
toHeaders :: PutResourceLogLevel -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON PutResourceLogLevel where
toJSON :: PutResourceLogLevel -> Value
toJSON PutResourceLogLevel' {Text
LogLevel
logLevel :: LogLevel
resourceType :: Text
resourceIdentifier :: Text
$sel:logLevel:PutResourceLogLevel' :: PutResourceLogLevel -> LogLevel
$sel:resourceType:PutResourceLogLevel' :: PutResourceLogLevel -> Text
$sel:resourceIdentifier:PutResourceLogLevel' :: PutResourceLogLevel -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"LogLevel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= LogLevel
logLevel)]
)
instance Data.ToPath PutResourceLogLevel where
toPath :: PutResourceLogLevel -> ByteString
toPath PutResourceLogLevel' {Text
LogLevel
logLevel :: LogLevel
resourceType :: Text
resourceIdentifier :: Text
$sel:logLevel:PutResourceLogLevel' :: PutResourceLogLevel -> LogLevel
$sel:resourceType:PutResourceLogLevel' :: PutResourceLogLevel -> Text
$sel:resourceIdentifier:PutResourceLogLevel' :: PutResourceLogLevel -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/log-levels/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
resourceIdentifier]
instance Data.ToQuery PutResourceLogLevel where
toQuery :: PutResourceLogLevel -> QueryString
toQuery PutResourceLogLevel' {Text
LogLevel
logLevel :: LogLevel
resourceType :: Text
resourceIdentifier :: Text
$sel:logLevel:PutResourceLogLevel' :: PutResourceLogLevel -> LogLevel
$sel:resourceType:PutResourceLogLevel' :: PutResourceLogLevel -> Text
$sel:resourceIdentifier:PutResourceLogLevel' :: PutResourceLogLevel -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"resourceType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
resourceType]
data PutResourceLogLevelResponse = PutResourceLogLevelResponse'
{
PutResourceLogLevelResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutResourceLogLevelResponse -> PutResourceLogLevelResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutResourceLogLevelResponse -> PutResourceLogLevelResponse -> Bool
$c/= :: PutResourceLogLevelResponse -> PutResourceLogLevelResponse -> Bool
== :: PutResourceLogLevelResponse -> PutResourceLogLevelResponse -> Bool
$c== :: PutResourceLogLevelResponse -> PutResourceLogLevelResponse -> Bool
Prelude.Eq, ReadPrec [PutResourceLogLevelResponse]
ReadPrec PutResourceLogLevelResponse
Int -> ReadS PutResourceLogLevelResponse
ReadS [PutResourceLogLevelResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutResourceLogLevelResponse]
$creadListPrec :: ReadPrec [PutResourceLogLevelResponse]
readPrec :: ReadPrec PutResourceLogLevelResponse
$creadPrec :: ReadPrec PutResourceLogLevelResponse
readList :: ReadS [PutResourceLogLevelResponse]
$creadList :: ReadS [PutResourceLogLevelResponse]
readsPrec :: Int -> ReadS PutResourceLogLevelResponse
$creadsPrec :: Int -> ReadS PutResourceLogLevelResponse
Prelude.Read, Int -> PutResourceLogLevelResponse -> ShowS
[PutResourceLogLevelResponse] -> ShowS
PutResourceLogLevelResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutResourceLogLevelResponse] -> ShowS
$cshowList :: [PutResourceLogLevelResponse] -> ShowS
show :: PutResourceLogLevelResponse -> String
$cshow :: PutResourceLogLevelResponse -> String
showsPrec :: Int -> PutResourceLogLevelResponse -> ShowS
$cshowsPrec :: Int -> PutResourceLogLevelResponse -> ShowS
Prelude.Show, forall x.
Rep PutResourceLogLevelResponse x -> PutResourceLogLevelResponse
forall x.
PutResourceLogLevelResponse -> Rep PutResourceLogLevelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutResourceLogLevelResponse x -> PutResourceLogLevelResponse
$cfrom :: forall x.
PutResourceLogLevelResponse -> Rep PutResourceLogLevelResponse x
Prelude.Generic)
newPutResourceLogLevelResponse ::
Prelude.Int ->
PutResourceLogLevelResponse
newPutResourceLogLevelResponse :: Int -> PutResourceLogLevelResponse
newPutResourceLogLevelResponse Int
pHttpStatus_ =
PutResourceLogLevelResponse'
{ $sel:httpStatus:PutResourceLogLevelResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putResourceLogLevelResponse_httpStatus :: Lens.Lens' PutResourceLogLevelResponse Prelude.Int
putResourceLogLevelResponse_httpStatus :: Lens' PutResourceLogLevelResponse Int
putResourceLogLevelResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutResourceLogLevelResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutResourceLogLevelResponse' :: PutResourceLogLevelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutResourceLogLevelResponse
s@PutResourceLogLevelResponse' {} Int
a -> PutResourceLogLevelResponse
s {$sel:httpStatus:PutResourceLogLevelResponse' :: Int
httpStatus = Int
a} :: PutResourceLogLevelResponse)
instance Prelude.NFData PutResourceLogLevelResponse where
rnf :: PutResourceLogLevelResponse -> ()
rnf PutResourceLogLevelResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutResourceLogLevelResponse' :: PutResourceLogLevelResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus