{-# 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 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 GetLoggingOptions = GetLoggingOptions'
{
}
deriving (GetLoggingOptions -> GetLoggingOptions -> Bool
(GetLoggingOptions -> GetLoggingOptions -> Bool)
-> (GetLoggingOptions -> GetLoggingOptions -> Bool)
-> Eq GetLoggingOptions
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]
(Int -> ReadS GetLoggingOptions)
-> ReadS [GetLoggingOptions]
-> ReadPrec GetLoggingOptions
-> ReadPrec [GetLoggingOptions]
-> Read 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
(Int -> GetLoggingOptions -> ShowS)
-> (GetLoggingOptions -> String)
-> ([GetLoggingOptions] -> ShowS)
-> Show GetLoggingOptions
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. GetLoggingOptions -> Rep GetLoggingOptions x)
-> (forall x. Rep GetLoggingOptions x -> GetLoggingOptions)
-> Generic GetLoggingOptions
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 :: GetLoggingOptions -> Request GetLoggingOptions
request = Service -> GetLoggingOptions -> Request GetLoggingOptions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetLoggingOptions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetLoggingOptions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetLoggingOptions))
-> Logger
-> Service
-> Proxy GetLoggingOptions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetLoggingOptions)))
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 ->
Maybe LogLevel -> Maybe Text -> Int -> GetLoggingOptionsResponse
GetLoggingOptionsResponse'
(Maybe LogLevel -> Maybe Text -> Int -> GetLoggingOptionsResponse)
-> Either String (Maybe LogLevel)
-> Either String (Maybe Text -> Int -> GetLoggingOptionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe LogLevel)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"logLevel")
Either String (Maybe Text -> Int -> GetLoggingOptionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetLoggingOptionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"roleArn")
Either String (Int -> GetLoggingOptionsResponse)
-> Either String Int -> Either String GetLoggingOptionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetLoggingOptions
instance Prelude.NFData GetLoggingOptions
instance Core.ToHeaders GetLoggingOptions where
toHeaders :: GetLoggingOptions -> ResponseHeaders
toHeaders = ResponseHeaders -> GetLoggingOptions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetLoggingOptions where
toPath :: GetLoggingOptions -> ByteString
toPath = ByteString -> GetLoggingOptions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/loggingOptions"
instance Core.ToQuery GetLoggingOptions where
toQuery :: GetLoggingOptions -> QueryString
toQuery = QueryString -> GetLoggingOptions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(GetLoggingOptionsResponse -> GetLoggingOptionsResponse -> Bool)
-> (GetLoggingOptionsResponse -> GetLoggingOptionsResponse -> Bool)
-> Eq GetLoggingOptionsResponse
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]
(Int -> ReadS GetLoggingOptionsResponse)
-> ReadS [GetLoggingOptionsResponse]
-> ReadPrec GetLoggingOptionsResponse
-> ReadPrec [GetLoggingOptionsResponse]
-> Read 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
(Int -> GetLoggingOptionsResponse -> ShowS)
-> (GetLoggingOptionsResponse -> String)
-> ([GetLoggingOptionsResponse] -> ShowS)
-> Show GetLoggingOptionsResponse
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.
GetLoggingOptionsResponse -> Rep GetLoggingOptionsResponse x)
-> (forall x.
Rep GetLoggingOptionsResponse x -> GetLoggingOptionsResponse)
-> Generic GetLoggingOptionsResponse
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' :: Maybe LogLevel -> Maybe Text -> Int -> GetLoggingOptionsResponse
GetLoggingOptionsResponse'
{ $sel:logLevel:GetLoggingOptionsResponse' :: Maybe LogLevel
logLevel =
Maybe LogLevel
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:GetLoggingOptionsResponse' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetLoggingOptionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getLoggingOptionsResponse_logLevel :: Lens.Lens' GetLoggingOptionsResponse (Prelude.Maybe LogLevel)
getLoggingOptionsResponse_logLevel :: (Maybe LogLevel -> f (Maybe LogLevel))
-> GetLoggingOptionsResponse -> f GetLoggingOptionsResponse
getLoggingOptionsResponse_logLevel = (GetLoggingOptionsResponse -> Maybe LogLevel)
-> (GetLoggingOptionsResponse
-> Maybe LogLevel -> GetLoggingOptionsResponse)
-> Lens
GetLoggingOptionsResponse
GetLoggingOptionsResponse
(Maybe LogLevel)
(Maybe 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 :: (Maybe Text -> f (Maybe Text))
-> GetLoggingOptionsResponse -> f GetLoggingOptionsResponse
getLoggingOptionsResponse_roleArn = (GetLoggingOptionsResponse -> Maybe Text)
-> (GetLoggingOptionsResponse
-> Maybe Text -> GetLoggingOptionsResponse)
-> Lens
GetLoggingOptionsResponse
GetLoggingOptionsResponse
(Maybe Text)
(Maybe Text)
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 :: (Int -> f Int)
-> GetLoggingOptionsResponse -> f GetLoggingOptionsResponse
getLoggingOptionsResponse_httpStatus = (GetLoggingOptionsResponse -> Int)
-> (GetLoggingOptionsResponse -> Int -> GetLoggingOptionsResponse)
-> Lens GetLoggingOptionsResponse GetLoggingOptionsResponse Int Int
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