{-# 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.DescribeRegionSettings
(
DescribeRegionSettings (..),
newDescribeRegionSettings,
DescribeRegionSettingsResponse (..),
newDescribeRegionSettingsResponse,
describeRegionSettingsResponse_resourceTypeOptInPreference,
describeRegionSettingsResponse_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 DescribeRegionSettings = DescribeRegionSettings'
{
}
deriving (DescribeRegionSettings -> DescribeRegionSettings -> Bool
(DescribeRegionSettings -> DescribeRegionSettings -> Bool)
-> (DescribeRegionSettings -> DescribeRegionSettings -> Bool)
-> Eq DescribeRegionSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRegionSettings -> DescribeRegionSettings -> Bool
$c/= :: DescribeRegionSettings -> DescribeRegionSettings -> Bool
== :: DescribeRegionSettings -> DescribeRegionSettings -> Bool
$c== :: DescribeRegionSettings -> DescribeRegionSettings -> Bool
Prelude.Eq, ReadPrec [DescribeRegionSettings]
ReadPrec DescribeRegionSettings
Int -> ReadS DescribeRegionSettings
ReadS [DescribeRegionSettings]
(Int -> ReadS DescribeRegionSettings)
-> ReadS [DescribeRegionSettings]
-> ReadPrec DescribeRegionSettings
-> ReadPrec [DescribeRegionSettings]
-> Read DescribeRegionSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRegionSettings]
$creadListPrec :: ReadPrec [DescribeRegionSettings]
readPrec :: ReadPrec DescribeRegionSettings
$creadPrec :: ReadPrec DescribeRegionSettings
readList :: ReadS [DescribeRegionSettings]
$creadList :: ReadS [DescribeRegionSettings]
readsPrec :: Int -> ReadS DescribeRegionSettings
$creadsPrec :: Int -> ReadS DescribeRegionSettings
Prelude.Read, Int -> DescribeRegionSettings -> ShowS
[DescribeRegionSettings] -> ShowS
DescribeRegionSettings -> String
(Int -> DescribeRegionSettings -> ShowS)
-> (DescribeRegionSettings -> String)
-> ([DescribeRegionSettings] -> ShowS)
-> Show DescribeRegionSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRegionSettings] -> ShowS
$cshowList :: [DescribeRegionSettings] -> ShowS
show :: DescribeRegionSettings -> String
$cshow :: DescribeRegionSettings -> String
showsPrec :: Int -> DescribeRegionSettings -> ShowS
$cshowsPrec :: Int -> DescribeRegionSettings -> ShowS
Prelude.Show, (forall x. DescribeRegionSettings -> Rep DescribeRegionSettings x)
-> (forall x.
Rep DescribeRegionSettings x -> DescribeRegionSettings)
-> Generic DescribeRegionSettings
forall x. Rep DescribeRegionSettings x -> DescribeRegionSettings
forall x. DescribeRegionSettings -> Rep DescribeRegionSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeRegionSettings x -> DescribeRegionSettings
$cfrom :: forall x. DescribeRegionSettings -> Rep DescribeRegionSettings x
Prelude.Generic)
newDescribeRegionSettings ::
DescribeRegionSettings
newDescribeRegionSettings :: DescribeRegionSettings
newDescribeRegionSettings = DescribeRegionSettings
DescribeRegionSettings'
instance Core.AWSRequest DescribeRegionSettings where
type
AWSResponse DescribeRegionSettings =
DescribeRegionSettingsResponse
request :: DescribeRegionSettings -> Request DescribeRegionSettings
request = Service -> DescribeRegionSettings -> Request DescribeRegionSettings
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeRegionSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeRegionSettings)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeRegionSettings))
-> Logger
-> Service
-> Proxy DescribeRegionSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeRegionSettings)))
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 Bool) -> Int -> DescribeRegionSettingsResponse
DescribeRegionSettingsResponse'
(Maybe (HashMap Text Bool)
-> Int -> DescribeRegionSettingsResponse)
-> Either String (Maybe (HashMap Text Bool))
-> Either String (Int -> DescribeRegionSettingsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Bool)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ResourceTypeOptInPreference"
Either String (Maybe (Maybe (HashMap Text Bool)))
-> Maybe (HashMap Text Bool)
-> Either String (Maybe (HashMap Text Bool))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Bool)
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DescribeRegionSettingsResponse)
-> Either String Int
-> Either String DescribeRegionSettingsResponse
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 DescribeRegionSettings
instance Prelude.NFData DescribeRegionSettings
instance Core.ToHeaders DescribeRegionSettings where
toHeaders :: DescribeRegionSettings -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeRegionSettings -> 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 DescribeRegionSettings where
toPath :: DescribeRegionSettings -> ByteString
toPath = ByteString -> DescribeRegionSettings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/account-settings"
instance Core.ToQuery DescribeRegionSettings where
toQuery :: DescribeRegionSettings -> QueryString
toQuery = QueryString -> DescribeRegionSettings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeRegionSettingsResponse = DescribeRegionSettingsResponse'
{
DescribeRegionSettingsResponse -> Maybe (HashMap Text Bool)
resourceTypeOptInPreference :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Bool),
DescribeRegionSettingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeRegionSettingsResponse
-> DescribeRegionSettingsResponse -> Bool
(DescribeRegionSettingsResponse
-> DescribeRegionSettingsResponse -> Bool)
-> (DescribeRegionSettingsResponse
-> DescribeRegionSettingsResponse -> Bool)
-> Eq DescribeRegionSettingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRegionSettingsResponse
-> DescribeRegionSettingsResponse -> Bool
$c/= :: DescribeRegionSettingsResponse
-> DescribeRegionSettingsResponse -> Bool
== :: DescribeRegionSettingsResponse
-> DescribeRegionSettingsResponse -> Bool
$c== :: DescribeRegionSettingsResponse
-> DescribeRegionSettingsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRegionSettingsResponse]
ReadPrec DescribeRegionSettingsResponse
Int -> ReadS DescribeRegionSettingsResponse
ReadS [DescribeRegionSettingsResponse]
(Int -> ReadS DescribeRegionSettingsResponse)
-> ReadS [DescribeRegionSettingsResponse]
-> ReadPrec DescribeRegionSettingsResponse
-> ReadPrec [DescribeRegionSettingsResponse]
-> Read DescribeRegionSettingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRegionSettingsResponse]
$creadListPrec :: ReadPrec [DescribeRegionSettingsResponse]
readPrec :: ReadPrec DescribeRegionSettingsResponse
$creadPrec :: ReadPrec DescribeRegionSettingsResponse
readList :: ReadS [DescribeRegionSettingsResponse]
$creadList :: ReadS [DescribeRegionSettingsResponse]
readsPrec :: Int -> ReadS DescribeRegionSettingsResponse
$creadsPrec :: Int -> ReadS DescribeRegionSettingsResponse
Prelude.Read, Int -> DescribeRegionSettingsResponse -> ShowS
[DescribeRegionSettingsResponse] -> ShowS
DescribeRegionSettingsResponse -> String
(Int -> DescribeRegionSettingsResponse -> ShowS)
-> (DescribeRegionSettingsResponse -> String)
-> ([DescribeRegionSettingsResponse] -> ShowS)
-> Show DescribeRegionSettingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRegionSettingsResponse] -> ShowS
$cshowList :: [DescribeRegionSettingsResponse] -> ShowS
show :: DescribeRegionSettingsResponse -> String
$cshow :: DescribeRegionSettingsResponse -> String
showsPrec :: Int -> DescribeRegionSettingsResponse -> ShowS
$cshowsPrec :: Int -> DescribeRegionSettingsResponse -> ShowS
Prelude.Show, (forall x.
DescribeRegionSettingsResponse
-> Rep DescribeRegionSettingsResponse x)
-> (forall x.
Rep DescribeRegionSettingsResponse x
-> DescribeRegionSettingsResponse)
-> Generic DescribeRegionSettingsResponse
forall x.
Rep DescribeRegionSettingsResponse x
-> DescribeRegionSettingsResponse
forall x.
DescribeRegionSettingsResponse
-> Rep DescribeRegionSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRegionSettingsResponse x
-> DescribeRegionSettingsResponse
$cfrom :: forall x.
DescribeRegionSettingsResponse
-> Rep DescribeRegionSettingsResponse x
Prelude.Generic)
newDescribeRegionSettingsResponse ::
Prelude.Int ->
DescribeRegionSettingsResponse
newDescribeRegionSettingsResponse :: Int -> DescribeRegionSettingsResponse
newDescribeRegionSettingsResponse Int
pHttpStatus_ =
DescribeRegionSettingsResponse' :: Maybe (HashMap Text Bool) -> Int -> DescribeRegionSettingsResponse
DescribeRegionSettingsResponse'
{ $sel:resourceTypeOptInPreference:DescribeRegionSettingsResponse' :: Maybe (HashMap Text Bool)
resourceTypeOptInPreference =
Maybe (HashMap Text Bool)
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeRegionSettingsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeRegionSettingsResponse_resourceTypeOptInPreference :: Lens.Lens' DescribeRegionSettingsResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Bool))
describeRegionSettingsResponse_resourceTypeOptInPreference :: (Maybe (HashMap Text Bool) -> f (Maybe (HashMap Text Bool)))
-> DescribeRegionSettingsResponse
-> f DescribeRegionSettingsResponse
describeRegionSettingsResponse_resourceTypeOptInPreference = (DescribeRegionSettingsResponse -> Maybe (HashMap Text Bool))
-> (DescribeRegionSettingsResponse
-> Maybe (HashMap Text Bool) -> DescribeRegionSettingsResponse)
-> Lens
DescribeRegionSettingsResponse
DescribeRegionSettingsResponse
(Maybe (HashMap Text Bool))
(Maybe (HashMap Text Bool))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRegionSettingsResponse' {Maybe (HashMap Text Bool)
resourceTypeOptInPreference :: Maybe (HashMap Text Bool)
$sel:resourceTypeOptInPreference:DescribeRegionSettingsResponse' :: DescribeRegionSettingsResponse -> Maybe (HashMap Text Bool)
resourceTypeOptInPreference} -> Maybe (HashMap Text Bool)
resourceTypeOptInPreference) (\s :: DescribeRegionSettingsResponse
s@DescribeRegionSettingsResponse' {} Maybe (HashMap Text Bool)
a -> DescribeRegionSettingsResponse
s {$sel:resourceTypeOptInPreference:DescribeRegionSettingsResponse' :: Maybe (HashMap Text Bool)
resourceTypeOptInPreference = Maybe (HashMap Text Bool)
a} :: DescribeRegionSettingsResponse) ((Maybe (HashMap Text Bool) -> f (Maybe (HashMap Text Bool)))
-> DescribeRegionSettingsResponse
-> f DescribeRegionSettingsResponse)
-> ((Maybe (HashMap Text Bool) -> f (Maybe (HashMap Text Bool)))
-> Maybe (HashMap Text Bool) -> f (Maybe (HashMap Text Bool)))
-> (Maybe (HashMap Text Bool) -> f (Maybe (HashMap Text Bool)))
-> DescribeRegionSettingsResponse
-> f DescribeRegionSettingsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Bool)
(HashMap Text Bool)
(HashMap Text Bool)
(HashMap Text Bool)
-> Iso
(Maybe (HashMap Text Bool))
(Maybe (HashMap Text Bool))
(Maybe (HashMap Text Bool))
(Maybe (HashMap Text Bool))
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 Bool)
(HashMap Text Bool)
(HashMap Text Bool)
(HashMap Text Bool)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeRegionSettingsResponse_httpStatus :: Lens.Lens' DescribeRegionSettingsResponse Prelude.Int
describeRegionSettingsResponse_httpStatus :: (Int -> f Int)
-> DescribeRegionSettingsResponse
-> f DescribeRegionSettingsResponse
describeRegionSettingsResponse_httpStatus = (DescribeRegionSettingsResponse -> Int)
-> (DescribeRegionSettingsResponse
-> Int -> DescribeRegionSettingsResponse)
-> Lens
DescribeRegionSettingsResponse
DescribeRegionSettingsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRegionSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeRegionSettingsResponse' :: DescribeRegionSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeRegionSettingsResponse
s@DescribeRegionSettingsResponse' {} Int
a -> DescribeRegionSettingsResponse
s {$sel:httpStatus:DescribeRegionSettingsResponse' :: Int
httpStatus = Int
a} :: DescribeRegionSettingsResponse)
instance
Prelude.NFData
DescribeRegionSettingsResponse