{-# 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.GetLoggingOptions
(
GetLoggingOptions (..),
newGetLoggingOptions,
GetLoggingOptionsResponse (..),
newGetLoggingOptionsResponse,
getLoggingOptionsResponse_logLevel,
getLoggingOptionsResponse_roleArn,
getLoggingOptionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetLoggingOptions = GetLoggingOptions'
{
}
deriving (GetLoggingOptions -> GetLoggingOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLoggingOptions -> GetLoggingOptions -> Bool
$c/= :: GetLoggingOptions -> GetLoggingOptions -> Bool
== :: GetLoggingOptions -> GetLoggingOptions -> Bool
$c== :: GetLoggingOptions -> GetLoggingOptions -> Bool
Prelude.Eq, ReadPrec [GetLoggingOptions]
ReadPrec GetLoggingOptions
Int -> ReadS GetLoggingOptions
ReadS [GetLoggingOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLoggingOptions]
$creadListPrec :: ReadPrec [GetLoggingOptions]
readPrec :: ReadPrec GetLoggingOptions
$creadPrec :: ReadPrec GetLoggingOptions
readList :: ReadS [GetLoggingOptions]
$creadList :: ReadS [GetLoggingOptions]
readsPrec :: Int -> ReadS GetLoggingOptions
$creadsPrec :: Int -> ReadS GetLoggingOptions
Prelude.Read, Int -> GetLoggingOptions -> ShowS
[GetLoggingOptions] -> ShowS
GetLoggingOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLoggingOptions] -> ShowS
$cshowList :: [GetLoggingOptions] -> ShowS
show :: GetLoggingOptions -> String
$cshow :: GetLoggingOptions -> String
showsPrec :: Int -> GetLoggingOptions -> ShowS
$cshowsPrec :: Int -> GetLoggingOptions -> ShowS
Prelude.Show, forall x. Rep GetLoggingOptions x -> GetLoggingOptions
forall x. GetLoggingOptions -> Rep GetLoggingOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetLoggingOptions x -> GetLoggingOptions
$cfrom :: forall x. GetLoggingOptions -> Rep GetLoggingOptions x
Prelude.Generic)
newGetLoggingOptions ::
GetLoggingOptions
newGetLoggingOptions :: GetLoggingOptions
newGetLoggingOptions = GetLoggingOptions
GetLoggingOptions'
instance Core.AWSRequest GetLoggingOptions where
type
AWSResponse GetLoggingOptions =
GetLoggingOptionsResponse
request :: (Service -> Service)
-> GetLoggingOptions -> Request GetLoggingOptions
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetLoggingOptions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetLoggingOptions)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe LogLevel -> Maybe Text -> Int -> GetLoggingOptionsResponse
GetLoggingOptionsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"logLevel")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"roleArn")
forall (f :: * -> *) a b. Applicative f => 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 GetLoggingOptions where
hashWithSalt :: Int -> GetLoggingOptions -> Int
hashWithSalt Int
_salt GetLoggingOptions
_ =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()
instance Prelude.NFData GetLoggingOptions where
rnf :: GetLoggingOptions -> ()
rnf GetLoggingOptions
_ = ()
instance Data.ToHeaders GetLoggingOptions where
toHeaders :: GetLoggingOptions -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetLoggingOptions where
toPath :: GetLoggingOptions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/loggingOptions"
instance Data.ToQuery GetLoggingOptions where
toQuery :: GetLoggingOptions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetLoggingOptionsResponse = GetLoggingOptionsResponse'
{
GetLoggingOptionsResponse -> Maybe LogLevel
logLevel :: Prelude.Maybe LogLevel,
GetLoggingOptionsResponse -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
GetLoggingOptionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetLoggingOptionsResponse -> GetLoggingOptionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLoggingOptionsResponse -> GetLoggingOptionsResponse -> Bool
$c/= :: GetLoggingOptionsResponse -> GetLoggingOptionsResponse -> Bool
== :: GetLoggingOptionsResponse -> GetLoggingOptionsResponse -> Bool
$c== :: GetLoggingOptionsResponse -> GetLoggingOptionsResponse -> Bool
Prelude.Eq, ReadPrec [GetLoggingOptionsResponse]
ReadPrec GetLoggingOptionsResponse
Int -> ReadS GetLoggingOptionsResponse
ReadS [GetLoggingOptionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLoggingOptionsResponse]
$creadListPrec :: ReadPrec [GetLoggingOptionsResponse]
readPrec :: ReadPrec GetLoggingOptionsResponse
$creadPrec :: ReadPrec GetLoggingOptionsResponse
readList :: ReadS [GetLoggingOptionsResponse]
$creadList :: ReadS [GetLoggingOptionsResponse]
readsPrec :: Int -> ReadS GetLoggingOptionsResponse
$creadsPrec :: Int -> ReadS GetLoggingOptionsResponse
Prelude.Read, Int -> GetLoggingOptionsResponse -> ShowS
[GetLoggingOptionsResponse] -> ShowS
GetLoggingOptionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLoggingOptionsResponse] -> ShowS
$cshowList :: [GetLoggingOptionsResponse] -> ShowS
show :: GetLoggingOptionsResponse -> String
$cshow :: GetLoggingOptionsResponse -> String
showsPrec :: Int -> GetLoggingOptionsResponse -> ShowS
$cshowsPrec :: Int -> GetLoggingOptionsResponse -> ShowS
Prelude.Show, forall x.
Rep GetLoggingOptionsResponse x -> GetLoggingOptionsResponse
forall x.
GetLoggingOptionsResponse -> Rep GetLoggingOptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetLoggingOptionsResponse x -> GetLoggingOptionsResponse
$cfrom :: forall x.
GetLoggingOptionsResponse -> Rep GetLoggingOptionsResponse x
Prelude.Generic)
newGetLoggingOptionsResponse ::
Prelude.Int ->
GetLoggingOptionsResponse
newGetLoggingOptionsResponse :: Int -> GetLoggingOptionsResponse
newGetLoggingOptionsResponse Int
pHttpStatus_ =
GetLoggingOptionsResponse'
{ $sel:logLevel:GetLoggingOptionsResponse' :: Maybe LogLevel
logLevel =
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:GetLoggingOptionsResponse' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetLoggingOptionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getLoggingOptionsResponse_logLevel :: Lens.Lens' GetLoggingOptionsResponse (Prelude.Maybe LogLevel)
getLoggingOptionsResponse_logLevel :: Lens' GetLoggingOptionsResponse (Maybe LogLevel)
getLoggingOptionsResponse_logLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoggingOptionsResponse' {Maybe LogLevel
logLevel :: Maybe LogLevel
$sel:logLevel:GetLoggingOptionsResponse' :: GetLoggingOptionsResponse -> Maybe LogLevel
logLevel} -> Maybe LogLevel
logLevel) (\s :: GetLoggingOptionsResponse
s@GetLoggingOptionsResponse' {} Maybe LogLevel
a -> GetLoggingOptionsResponse
s {$sel:logLevel:GetLoggingOptionsResponse' :: Maybe LogLevel
logLevel = Maybe LogLevel
a} :: GetLoggingOptionsResponse)
getLoggingOptionsResponse_roleArn :: Lens.Lens' GetLoggingOptionsResponse (Prelude.Maybe Prelude.Text)
getLoggingOptionsResponse_roleArn :: Lens' GetLoggingOptionsResponse (Maybe Text)
getLoggingOptionsResponse_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoggingOptionsResponse' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:GetLoggingOptionsResponse' :: GetLoggingOptionsResponse -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: GetLoggingOptionsResponse
s@GetLoggingOptionsResponse' {} Maybe Text
a -> GetLoggingOptionsResponse
s {$sel:roleArn:GetLoggingOptionsResponse' :: Maybe Text
roleArn = Maybe Text
a} :: GetLoggingOptionsResponse)
getLoggingOptionsResponse_httpStatus :: Lens.Lens' GetLoggingOptionsResponse Prelude.Int
getLoggingOptionsResponse_httpStatus :: Lens' GetLoggingOptionsResponse Int
getLoggingOptionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoggingOptionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetLoggingOptionsResponse' :: GetLoggingOptionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetLoggingOptionsResponse
s@GetLoggingOptionsResponse' {} Int
a -> GetLoggingOptionsResponse
s {$sel:httpStatus:GetLoggingOptionsResponse' :: Int
httpStatus = Int
a} :: GetLoggingOptionsResponse)
instance Prelude.NFData GetLoggingOptionsResponse where
rnf :: GetLoggingOptionsResponse -> ()
rnf GetLoggingOptionsResponse' {Int
Maybe Text
Maybe LogLevel
httpStatus :: Int
roleArn :: Maybe Text
logLevel :: Maybe LogLevel
$sel:httpStatus:GetLoggingOptionsResponse' :: GetLoggingOptionsResponse -> Int
$sel:roleArn:GetLoggingOptionsResponse' :: GetLoggingOptionsResponse -> Maybe Text
$sel:logLevel:GetLoggingOptionsResponse' :: GetLoggingOptionsResponse -> Maybe LogLevel
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe LogLevel
logLevel
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus