{-# 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.IoTSiteWise.DescribeLoggingOptions
(
DescribeLoggingOptions (..),
newDescribeLoggingOptions,
DescribeLoggingOptionsResponse (..),
newDescribeLoggingOptionsResponse,
describeLoggingOptionsResponse_httpStatus,
describeLoggingOptionsResponse_loggingOptions,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.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 DescribeLoggingOptions = DescribeLoggingOptions'
{
}
deriving (DescribeLoggingOptions -> DescribeLoggingOptions -> Bool
(DescribeLoggingOptions -> DescribeLoggingOptions -> Bool)
-> (DescribeLoggingOptions -> DescribeLoggingOptions -> Bool)
-> Eq DescribeLoggingOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLoggingOptions -> DescribeLoggingOptions -> Bool
$c/= :: DescribeLoggingOptions -> DescribeLoggingOptions -> Bool
== :: DescribeLoggingOptions -> DescribeLoggingOptions -> Bool
$c== :: DescribeLoggingOptions -> DescribeLoggingOptions -> Bool
Prelude.Eq, ReadPrec [DescribeLoggingOptions]
ReadPrec DescribeLoggingOptions
Int -> ReadS DescribeLoggingOptions
ReadS [DescribeLoggingOptions]
(Int -> ReadS DescribeLoggingOptions)
-> ReadS [DescribeLoggingOptions]
-> ReadPrec DescribeLoggingOptions
-> ReadPrec [DescribeLoggingOptions]
-> Read DescribeLoggingOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLoggingOptions]
$creadListPrec :: ReadPrec [DescribeLoggingOptions]
readPrec :: ReadPrec DescribeLoggingOptions
$creadPrec :: ReadPrec DescribeLoggingOptions
readList :: ReadS [DescribeLoggingOptions]
$creadList :: ReadS [DescribeLoggingOptions]
readsPrec :: Int -> ReadS DescribeLoggingOptions
$creadsPrec :: Int -> ReadS DescribeLoggingOptions
Prelude.Read, Int -> DescribeLoggingOptions -> ShowS
[DescribeLoggingOptions] -> ShowS
DescribeLoggingOptions -> String
(Int -> DescribeLoggingOptions -> ShowS)
-> (DescribeLoggingOptions -> String)
-> ([DescribeLoggingOptions] -> ShowS)
-> Show DescribeLoggingOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLoggingOptions] -> ShowS
$cshowList :: [DescribeLoggingOptions] -> ShowS
show :: DescribeLoggingOptions -> String
$cshow :: DescribeLoggingOptions -> String
showsPrec :: Int -> DescribeLoggingOptions -> ShowS
$cshowsPrec :: Int -> DescribeLoggingOptions -> ShowS
Prelude.Show, (forall x. DescribeLoggingOptions -> Rep DescribeLoggingOptions x)
-> (forall x.
Rep DescribeLoggingOptions x -> DescribeLoggingOptions)
-> Generic DescribeLoggingOptions
forall x. Rep DescribeLoggingOptions x -> DescribeLoggingOptions
forall x. DescribeLoggingOptions -> Rep DescribeLoggingOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeLoggingOptions x -> DescribeLoggingOptions
$cfrom :: forall x. DescribeLoggingOptions -> Rep DescribeLoggingOptions x
Prelude.Generic)
newDescribeLoggingOptions ::
DescribeLoggingOptions
newDescribeLoggingOptions :: DescribeLoggingOptions
newDescribeLoggingOptions = DescribeLoggingOptions
DescribeLoggingOptions'
instance Core.AWSRequest DescribeLoggingOptions where
type
AWSResponse DescribeLoggingOptions =
DescribeLoggingOptionsResponse
request :: DescribeLoggingOptions -> Request DescribeLoggingOptions
request = Service -> DescribeLoggingOptions -> Request DescribeLoggingOptions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeLoggingOptions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeLoggingOptions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeLoggingOptions))
-> Logger
-> Service
-> Proxy DescribeLoggingOptions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeLoggingOptions)))
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 ->
Int -> LoggingOptions -> DescribeLoggingOptionsResponse
DescribeLoggingOptionsResponse'
(Int -> LoggingOptions -> DescribeLoggingOptionsResponse)
-> Either String Int
-> Either String (LoggingOptions -> DescribeLoggingOptionsResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (LoggingOptions -> DescribeLoggingOptionsResponse)
-> Either String LoggingOptions
-> Either String DescribeLoggingOptionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Key -> Either String LoggingOptions
forall a. FromJSON a => Object -> Key -> Either String a
Core..:> Key
"loggingOptions")
)
instance Prelude.Hashable DescribeLoggingOptions
instance Prelude.NFData DescribeLoggingOptions
instance Core.ToHeaders DescribeLoggingOptions where
toHeaders :: DescribeLoggingOptions -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeLoggingOptions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DescribeLoggingOptions where
toPath :: DescribeLoggingOptions -> ByteString
toPath = ByteString -> DescribeLoggingOptions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/logging"
instance Core.ToQuery DescribeLoggingOptions where
toQuery :: DescribeLoggingOptions -> QueryString
toQuery = QueryString -> DescribeLoggingOptions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeLoggingOptionsResponse = DescribeLoggingOptionsResponse'
{
DescribeLoggingOptionsResponse -> Int
httpStatus :: Prelude.Int,
DescribeLoggingOptionsResponse -> LoggingOptions
loggingOptions :: LoggingOptions
}
deriving (DescribeLoggingOptionsResponse
-> DescribeLoggingOptionsResponse -> Bool
(DescribeLoggingOptionsResponse
-> DescribeLoggingOptionsResponse -> Bool)
-> (DescribeLoggingOptionsResponse
-> DescribeLoggingOptionsResponse -> Bool)
-> Eq DescribeLoggingOptionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLoggingOptionsResponse
-> DescribeLoggingOptionsResponse -> Bool
$c/= :: DescribeLoggingOptionsResponse
-> DescribeLoggingOptionsResponse -> Bool
== :: DescribeLoggingOptionsResponse
-> DescribeLoggingOptionsResponse -> Bool
$c== :: DescribeLoggingOptionsResponse
-> DescribeLoggingOptionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeLoggingOptionsResponse]
ReadPrec DescribeLoggingOptionsResponse
Int -> ReadS DescribeLoggingOptionsResponse
ReadS [DescribeLoggingOptionsResponse]
(Int -> ReadS DescribeLoggingOptionsResponse)
-> ReadS [DescribeLoggingOptionsResponse]
-> ReadPrec DescribeLoggingOptionsResponse
-> ReadPrec [DescribeLoggingOptionsResponse]
-> Read DescribeLoggingOptionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLoggingOptionsResponse]
$creadListPrec :: ReadPrec [DescribeLoggingOptionsResponse]
readPrec :: ReadPrec DescribeLoggingOptionsResponse
$creadPrec :: ReadPrec DescribeLoggingOptionsResponse
readList :: ReadS [DescribeLoggingOptionsResponse]
$creadList :: ReadS [DescribeLoggingOptionsResponse]
readsPrec :: Int -> ReadS DescribeLoggingOptionsResponse
$creadsPrec :: Int -> ReadS DescribeLoggingOptionsResponse
Prelude.Read, Int -> DescribeLoggingOptionsResponse -> ShowS
[DescribeLoggingOptionsResponse] -> ShowS
DescribeLoggingOptionsResponse -> String
(Int -> DescribeLoggingOptionsResponse -> ShowS)
-> (DescribeLoggingOptionsResponse -> String)
-> ([DescribeLoggingOptionsResponse] -> ShowS)
-> Show DescribeLoggingOptionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLoggingOptionsResponse] -> ShowS
$cshowList :: [DescribeLoggingOptionsResponse] -> ShowS
show :: DescribeLoggingOptionsResponse -> String
$cshow :: DescribeLoggingOptionsResponse -> String
showsPrec :: Int -> DescribeLoggingOptionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeLoggingOptionsResponse -> ShowS
Prelude.Show, (forall x.
DescribeLoggingOptionsResponse
-> Rep DescribeLoggingOptionsResponse x)
-> (forall x.
Rep DescribeLoggingOptionsResponse x
-> DescribeLoggingOptionsResponse)
-> Generic DescribeLoggingOptionsResponse
forall x.
Rep DescribeLoggingOptionsResponse x
-> DescribeLoggingOptionsResponse
forall x.
DescribeLoggingOptionsResponse
-> Rep DescribeLoggingOptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeLoggingOptionsResponse x
-> DescribeLoggingOptionsResponse
$cfrom :: forall x.
DescribeLoggingOptionsResponse
-> Rep DescribeLoggingOptionsResponse x
Prelude.Generic)
newDescribeLoggingOptionsResponse ::
Prelude.Int ->
LoggingOptions ->
DescribeLoggingOptionsResponse
newDescribeLoggingOptionsResponse :: Int -> LoggingOptions -> DescribeLoggingOptionsResponse
newDescribeLoggingOptionsResponse
Int
pHttpStatus_
LoggingOptions
pLoggingOptions_ =
DescribeLoggingOptionsResponse' :: Int -> LoggingOptions -> DescribeLoggingOptionsResponse
DescribeLoggingOptionsResponse'
{ $sel:httpStatus:DescribeLoggingOptionsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:loggingOptions:DescribeLoggingOptionsResponse' :: LoggingOptions
loggingOptions = LoggingOptions
pLoggingOptions_
}
describeLoggingOptionsResponse_httpStatus :: Lens.Lens' DescribeLoggingOptionsResponse Prelude.Int
describeLoggingOptionsResponse_httpStatus :: (Int -> f Int)
-> DescribeLoggingOptionsResponse
-> f DescribeLoggingOptionsResponse
describeLoggingOptionsResponse_httpStatus = (DescribeLoggingOptionsResponse -> Int)
-> (DescribeLoggingOptionsResponse
-> Int -> DescribeLoggingOptionsResponse)
-> Lens
DescribeLoggingOptionsResponse
DescribeLoggingOptionsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoggingOptionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeLoggingOptionsResponse' :: DescribeLoggingOptionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeLoggingOptionsResponse
s@DescribeLoggingOptionsResponse' {} Int
a -> DescribeLoggingOptionsResponse
s {$sel:httpStatus:DescribeLoggingOptionsResponse' :: Int
httpStatus = Int
a} :: DescribeLoggingOptionsResponse)
describeLoggingOptionsResponse_loggingOptions :: Lens.Lens' DescribeLoggingOptionsResponse LoggingOptions
describeLoggingOptionsResponse_loggingOptions :: (LoggingOptions -> f LoggingOptions)
-> DescribeLoggingOptionsResponse
-> f DescribeLoggingOptionsResponse
describeLoggingOptionsResponse_loggingOptions = (DescribeLoggingOptionsResponse -> LoggingOptions)
-> (DescribeLoggingOptionsResponse
-> LoggingOptions -> DescribeLoggingOptionsResponse)
-> Lens
DescribeLoggingOptionsResponse
DescribeLoggingOptionsResponse
LoggingOptions
LoggingOptions
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLoggingOptionsResponse' {LoggingOptions
loggingOptions :: LoggingOptions
$sel:loggingOptions:DescribeLoggingOptionsResponse' :: DescribeLoggingOptionsResponse -> LoggingOptions
loggingOptions} -> LoggingOptions
loggingOptions) (\s :: DescribeLoggingOptionsResponse
s@DescribeLoggingOptionsResponse' {} LoggingOptions
a -> DescribeLoggingOptionsResponse
s {$sel:loggingOptions:DescribeLoggingOptionsResponse' :: LoggingOptions
loggingOptions = LoggingOptions
a} :: DescribeLoggingOptionsResponse)
instance
Prelude.NFData
DescribeLoggingOptionsResponse