{-# 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.Backup.DescribeGlobalSettings
(
DescribeGlobalSettings (..),
newDescribeGlobalSettings,
DescribeGlobalSettingsResponse (..),
newDescribeGlobalSettingsResponse,
describeGlobalSettingsResponse_globalSettings,
describeGlobalSettingsResponse_lastUpdateTime,
describeGlobalSettingsResponse_httpStatus,
)
where
import Amazonka.Backup.Types
import qualified Amazonka.Core as Core
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 DescribeGlobalSettings = DescribeGlobalSettings'
{
}
deriving (DescribeGlobalSettings -> DescribeGlobalSettings -> Bool
(DescribeGlobalSettings -> DescribeGlobalSettings -> Bool)
-> (DescribeGlobalSettings -> DescribeGlobalSettings -> Bool)
-> Eq DescribeGlobalSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGlobalSettings -> DescribeGlobalSettings -> Bool
$c/= :: DescribeGlobalSettings -> DescribeGlobalSettings -> Bool
== :: DescribeGlobalSettings -> DescribeGlobalSettings -> Bool
$c== :: DescribeGlobalSettings -> DescribeGlobalSettings -> Bool
Prelude.Eq, ReadPrec [DescribeGlobalSettings]
ReadPrec DescribeGlobalSettings
Int -> ReadS DescribeGlobalSettings
ReadS [DescribeGlobalSettings]
(Int -> ReadS DescribeGlobalSettings)
-> ReadS [DescribeGlobalSettings]
-> ReadPrec DescribeGlobalSettings
-> ReadPrec [DescribeGlobalSettings]
-> Read DescribeGlobalSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGlobalSettings]
$creadListPrec :: ReadPrec [DescribeGlobalSettings]
readPrec :: ReadPrec DescribeGlobalSettings
$creadPrec :: ReadPrec DescribeGlobalSettings
readList :: ReadS [DescribeGlobalSettings]
$creadList :: ReadS [DescribeGlobalSettings]
readsPrec :: Int -> ReadS DescribeGlobalSettings
$creadsPrec :: Int -> ReadS DescribeGlobalSettings
Prelude.Read, Int -> DescribeGlobalSettings -> ShowS
[DescribeGlobalSettings] -> ShowS
DescribeGlobalSettings -> String
(Int -> DescribeGlobalSettings -> ShowS)
-> (DescribeGlobalSettings -> String)
-> ([DescribeGlobalSettings] -> ShowS)
-> Show DescribeGlobalSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGlobalSettings] -> ShowS
$cshowList :: [DescribeGlobalSettings] -> ShowS
show :: DescribeGlobalSettings -> String
$cshow :: DescribeGlobalSettings -> String
showsPrec :: Int -> DescribeGlobalSettings -> ShowS
$cshowsPrec :: Int -> DescribeGlobalSettings -> ShowS
Prelude.Show, (forall x. DescribeGlobalSettings -> Rep DescribeGlobalSettings x)
-> (forall x.
Rep DescribeGlobalSettings x -> DescribeGlobalSettings)
-> Generic DescribeGlobalSettings
forall x. Rep DescribeGlobalSettings x -> DescribeGlobalSettings
forall x. DescribeGlobalSettings -> Rep DescribeGlobalSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeGlobalSettings x -> DescribeGlobalSettings
$cfrom :: forall x. DescribeGlobalSettings -> Rep DescribeGlobalSettings x
Prelude.Generic)
newDescribeGlobalSettings ::
DescribeGlobalSettings
newDescribeGlobalSettings :: DescribeGlobalSettings
newDescribeGlobalSettings = DescribeGlobalSettings
DescribeGlobalSettings'
instance Core.AWSRequest DescribeGlobalSettings where
type
AWSResponse DescribeGlobalSettings =
DescribeGlobalSettingsResponse
request :: DescribeGlobalSettings -> Request DescribeGlobalSettings
request = Service -> DescribeGlobalSettings -> Request DescribeGlobalSettings
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeGlobalSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeGlobalSettings)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeGlobalSettings))
-> Logger
-> Service
-> Proxy DescribeGlobalSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeGlobalSettings)))
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 (HashMap Text Text)
-> Maybe POSIX -> Int -> DescribeGlobalSettingsResponse
DescribeGlobalSettingsResponse'
(Maybe (HashMap Text Text)
-> Maybe POSIX -> Int -> DescribeGlobalSettingsResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
String (Maybe POSIX -> Int -> DescribeGlobalSettingsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GlobalSettings" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Either
String (Maybe POSIX -> Int -> DescribeGlobalSettingsResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> DescribeGlobalSettingsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastUpdateTime")
Either String (Int -> DescribeGlobalSettingsResponse)
-> Either String Int
-> Either String DescribeGlobalSettingsResponse
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 DescribeGlobalSettings
instance Prelude.NFData DescribeGlobalSettings
instance Core.ToHeaders DescribeGlobalSettings where
toHeaders :: DescribeGlobalSettings -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeGlobalSettings -> 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 DescribeGlobalSettings where
toPath :: DescribeGlobalSettings -> ByteString
toPath = ByteString -> DescribeGlobalSettings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/global-settings"
instance Core.ToQuery DescribeGlobalSettings where
toQuery :: DescribeGlobalSettings -> QueryString
toQuery = QueryString -> DescribeGlobalSettings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeGlobalSettingsResponse = DescribeGlobalSettingsResponse'
{
DescribeGlobalSettingsResponse -> Maybe (HashMap Text Text)
globalSettings :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
DescribeGlobalSettingsResponse -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX,
DescribeGlobalSettingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeGlobalSettingsResponse
-> DescribeGlobalSettingsResponse -> Bool
(DescribeGlobalSettingsResponse
-> DescribeGlobalSettingsResponse -> Bool)
-> (DescribeGlobalSettingsResponse
-> DescribeGlobalSettingsResponse -> Bool)
-> Eq DescribeGlobalSettingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGlobalSettingsResponse
-> DescribeGlobalSettingsResponse -> Bool
$c/= :: DescribeGlobalSettingsResponse
-> DescribeGlobalSettingsResponse -> Bool
== :: DescribeGlobalSettingsResponse
-> DescribeGlobalSettingsResponse -> Bool
$c== :: DescribeGlobalSettingsResponse
-> DescribeGlobalSettingsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeGlobalSettingsResponse]
ReadPrec DescribeGlobalSettingsResponse
Int -> ReadS DescribeGlobalSettingsResponse
ReadS [DescribeGlobalSettingsResponse]
(Int -> ReadS DescribeGlobalSettingsResponse)
-> ReadS [DescribeGlobalSettingsResponse]
-> ReadPrec DescribeGlobalSettingsResponse
-> ReadPrec [DescribeGlobalSettingsResponse]
-> Read DescribeGlobalSettingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGlobalSettingsResponse]
$creadListPrec :: ReadPrec [DescribeGlobalSettingsResponse]
readPrec :: ReadPrec DescribeGlobalSettingsResponse
$creadPrec :: ReadPrec DescribeGlobalSettingsResponse
readList :: ReadS [DescribeGlobalSettingsResponse]
$creadList :: ReadS [DescribeGlobalSettingsResponse]
readsPrec :: Int -> ReadS DescribeGlobalSettingsResponse
$creadsPrec :: Int -> ReadS DescribeGlobalSettingsResponse
Prelude.Read, Int -> DescribeGlobalSettingsResponse -> ShowS
[DescribeGlobalSettingsResponse] -> ShowS
DescribeGlobalSettingsResponse -> String
(Int -> DescribeGlobalSettingsResponse -> ShowS)
-> (DescribeGlobalSettingsResponse -> String)
-> ([DescribeGlobalSettingsResponse] -> ShowS)
-> Show DescribeGlobalSettingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGlobalSettingsResponse] -> ShowS
$cshowList :: [DescribeGlobalSettingsResponse] -> ShowS
show :: DescribeGlobalSettingsResponse -> String
$cshow :: DescribeGlobalSettingsResponse -> String
showsPrec :: Int -> DescribeGlobalSettingsResponse -> ShowS
$cshowsPrec :: Int -> DescribeGlobalSettingsResponse -> ShowS
Prelude.Show, (forall x.
DescribeGlobalSettingsResponse
-> Rep DescribeGlobalSettingsResponse x)
-> (forall x.
Rep DescribeGlobalSettingsResponse x
-> DescribeGlobalSettingsResponse)
-> Generic DescribeGlobalSettingsResponse
forall x.
Rep DescribeGlobalSettingsResponse x
-> DescribeGlobalSettingsResponse
forall x.
DescribeGlobalSettingsResponse
-> Rep DescribeGlobalSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeGlobalSettingsResponse x
-> DescribeGlobalSettingsResponse
$cfrom :: forall x.
DescribeGlobalSettingsResponse
-> Rep DescribeGlobalSettingsResponse x
Prelude.Generic)
newDescribeGlobalSettingsResponse ::
Prelude.Int ->
DescribeGlobalSettingsResponse
newDescribeGlobalSettingsResponse :: Int -> DescribeGlobalSettingsResponse
newDescribeGlobalSettingsResponse Int
pHttpStatus_ =
DescribeGlobalSettingsResponse' :: Maybe (HashMap Text Text)
-> Maybe POSIX -> Int -> DescribeGlobalSettingsResponse
DescribeGlobalSettingsResponse'
{ $sel:globalSettings:DescribeGlobalSettingsResponse' :: Maybe (HashMap Text Text)
globalSettings =
Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdateTime:DescribeGlobalSettingsResponse' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeGlobalSettingsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeGlobalSettingsResponse_globalSettings :: Lens.Lens' DescribeGlobalSettingsResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
describeGlobalSettingsResponse_globalSettings :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DescribeGlobalSettingsResponse
-> f DescribeGlobalSettingsResponse
describeGlobalSettingsResponse_globalSettings = (DescribeGlobalSettingsResponse -> Maybe (HashMap Text Text))
-> (DescribeGlobalSettingsResponse
-> Maybe (HashMap Text Text) -> DescribeGlobalSettingsResponse)
-> Lens
DescribeGlobalSettingsResponse
DescribeGlobalSettingsResponse
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGlobalSettingsResponse' {Maybe (HashMap Text Text)
globalSettings :: Maybe (HashMap Text Text)
$sel:globalSettings:DescribeGlobalSettingsResponse' :: DescribeGlobalSettingsResponse -> Maybe (HashMap Text Text)
globalSettings} -> Maybe (HashMap Text Text)
globalSettings) (\s :: DescribeGlobalSettingsResponse
s@DescribeGlobalSettingsResponse' {} Maybe (HashMap Text Text)
a -> DescribeGlobalSettingsResponse
s {$sel:globalSettings:DescribeGlobalSettingsResponse' :: Maybe (HashMap Text Text)
globalSettings = Maybe (HashMap Text Text)
a} :: DescribeGlobalSettingsResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DescribeGlobalSettingsResponse
-> f DescribeGlobalSettingsResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DescribeGlobalSettingsResponse
-> f DescribeGlobalSettingsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeGlobalSettingsResponse_lastUpdateTime :: Lens.Lens' DescribeGlobalSettingsResponse (Prelude.Maybe Prelude.UTCTime)
describeGlobalSettingsResponse_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeGlobalSettingsResponse
-> f DescribeGlobalSettingsResponse
describeGlobalSettingsResponse_lastUpdateTime = (DescribeGlobalSettingsResponse -> Maybe POSIX)
-> (DescribeGlobalSettingsResponse
-> Maybe POSIX -> DescribeGlobalSettingsResponse)
-> Lens
DescribeGlobalSettingsResponse
DescribeGlobalSettingsResponse
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGlobalSettingsResponse' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:DescribeGlobalSettingsResponse' :: DescribeGlobalSettingsResponse -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: DescribeGlobalSettingsResponse
s@DescribeGlobalSettingsResponse' {} Maybe POSIX
a -> DescribeGlobalSettingsResponse
s {$sel:lastUpdateTime:DescribeGlobalSettingsResponse' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: DescribeGlobalSettingsResponse) ((Maybe POSIX -> f (Maybe POSIX))
-> DescribeGlobalSettingsResponse
-> f DescribeGlobalSettingsResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeGlobalSettingsResponse
-> f DescribeGlobalSettingsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
describeGlobalSettingsResponse_httpStatus :: Lens.Lens' DescribeGlobalSettingsResponse Prelude.Int
describeGlobalSettingsResponse_httpStatus :: (Int -> f Int)
-> DescribeGlobalSettingsResponse
-> f DescribeGlobalSettingsResponse
describeGlobalSettingsResponse_httpStatus = (DescribeGlobalSettingsResponse -> Int)
-> (DescribeGlobalSettingsResponse
-> Int -> DescribeGlobalSettingsResponse)
-> Lens
DescribeGlobalSettingsResponse
DescribeGlobalSettingsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGlobalSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeGlobalSettingsResponse' :: DescribeGlobalSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeGlobalSettingsResponse
s@DescribeGlobalSettingsResponse' {} Int
a -> DescribeGlobalSettingsResponse
s {$sel:httpStatus:DescribeGlobalSettingsResponse' :: Int
httpStatus = Int
a} :: DescribeGlobalSettingsResponse)
instance
Prelude.NFData
DescribeGlobalSettingsResponse