{-# 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.KMS.UpdatePrimaryRegion
(
UpdatePrimaryRegion (..),
newUpdatePrimaryRegion,
updatePrimaryRegion_keyId,
updatePrimaryRegion_primaryRegion,
UpdatePrimaryRegionResponse (..),
newUpdatePrimaryRegionResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KMS.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdatePrimaryRegion = UpdatePrimaryRegion'
{
UpdatePrimaryRegion -> Text
keyId :: Prelude.Text,
UpdatePrimaryRegion -> Text
primaryRegion :: Prelude.Text
}
deriving (UpdatePrimaryRegion -> UpdatePrimaryRegion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePrimaryRegion -> UpdatePrimaryRegion -> Bool
$c/= :: UpdatePrimaryRegion -> UpdatePrimaryRegion -> Bool
== :: UpdatePrimaryRegion -> UpdatePrimaryRegion -> Bool
$c== :: UpdatePrimaryRegion -> UpdatePrimaryRegion -> Bool
Prelude.Eq, ReadPrec [UpdatePrimaryRegion]
ReadPrec UpdatePrimaryRegion
Int -> ReadS UpdatePrimaryRegion
ReadS [UpdatePrimaryRegion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePrimaryRegion]
$creadListPrec :: ReadPrec [UpdatePrimaryRegion]
readPrec :: ReadPrec UpdatePrimaryRegion
$creadPrec :: ReadPrec UpdatePrimaryRegion
readList :: ReadS [UpdatePrimaryRegion]
$creadList :: ReadS [UpdatePrimaryRegion]
readsPrec :: Int -> ReadS UpdatePrimaryRegion
$creadsPrec :: Int -> ReadS UpdatePrimaryRegion
Prelude.Read, Int -> UpdatePrimaryRegion -> ShowS
[UpdatePrimaryRegion] -> ShowS
UpdatePrimaryRegion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePrimaryRegion] -> ShowS
$cshowList :: [UpdatePrimaryRegion] -> ShowS
show :: UpdatePrimaryRegion -> String
$cshow :: UpdatePrimaryRegion -> String
showsPrec :: Int -> UpdatePrimaryRegion -> ShowS
$cshowsPrec :: Int -> UpdatePrimaryRegion -> ShowS
Prelude.Show, forall x. Rep UpdatePrimaryRegion x -> UpdatePrimaryRegion
forall x. UpdatePrimaryRegion -> Rep UpdatePrimaryRegion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdatePrimaryRegion x -> UpdatePrimaryRegion
$cfrom :: forall x. UpdatePrimaryRegion -> Rep UpdatePrimaryRegion x
Prelude.Generic)
newUpdatePrimaryRegion ::
Prelude.Text ->
Prelude.Text ->
UpdatePrimaryRegion
newUpdatePrimaryRegion :: Text -> Text -> UpdatePrimaryRegion
newUpdatePrimaryRegion Text
pKeyId_ Text
pPrimaryRegion_ =
UpdatePrimaryRegion'
{ $sel:keyId:UpdatePrimaryRegion' :: Text
keyId = Text
pKeyId_,
$sel:primaryRegion:UpdatePrimaryRegion' :: Text
primaryRegion = Text
pPrimaryRegion_
}
updatePrimaryRegion_keyId :: Lens.Lens' UpdatePrimaryRegion Prelude.Text
updatePrimaryRegion_keyId :: Lens' UpdatePrimaryRegion Text
updatePrimaryRegion_keyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePrimaryRegion' {Text
keyId :: Text
$sel:keyId:UpdatePrimaryRegion' :: UpdatePrimaryRegion -> Text
keyId} -> Text
keyId) (\s :: UpdatePrimaryRegion
s@UpdatePrimaryRegion' {} Text
a -> UpdatePrimaryRegion
s {$sel:keyId:UpdatePrimaryRegion' :: Text
keyId = Text
a} :: UpdatePrimaryRegion)
updatePrimaryRegion_primaryRegion :: Lens.Lens' UpdatePrimaryRegion Prelude.Text
updatePrimaryRegion_primaryRegion :: Lens' UpdatePrimaryRegion Text
updatePrimaryRegion_primaryRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePrimaryRegion' {Text
primaryRegion :: Text
$sel:primaryRegion:UpdatePrimaryRegion' :: UpdatePrimaryRegion -> Text
primaryRegion} -> Text
primaryRegion) (\s :: UpdatePrimaryRegion
s@UpdatePrimaryRegion' {} Text
a -> UpdatePrimaryRegion
s {$sel:primaryRegion:UpdatePrimaryRegion' :: Text
primaryRegion = Text
a} :: UpdatePrimaryRegion)
instance Core.AWSRequest UpdatePrimaryRegion where
type
AWSResponse UpdatePrimaryRegion =
UpdatePrimaryRegionResponse
request :: (Service -> Service)
-> UpdatePrimaryRegion -> Request UpdatePrimaryRegion
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdatePrimaryRegion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePrimaryRegion)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull UpdatePrimaryRegionResponse
UpdatePrimaryRegionResponse'
instance Prelude.Hashable UpdatePrimaryRegion where
hashWithSalt :: Int -> UpdatePrimaryRegion -> Int
hashWithSalt Int
_salt UpdatePrimaryRegion' {Text
primaryRegion :: Text
keyId :: Text
$sel:primaryRegion:UpdatePrimaryRegion' :: UpdatePrimaryRegion -> Text
$sel:keyId:UpdatePrimaryRegion' :: UpdatePrimaryRegion -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
keyId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
primaryRegion
instance Prelude.NFData UpdatePrimaryRegion where
rnf :: UpdatePrimaryRegion -> ()
rnf UpdatePrimaryRegion' {Text
primaryRegion :: Text
keyId :: Text
$sel:primaryRegion:UpdatePrimaryRegion' :: UpdatePrimaryRegion -> Text
$sel:keyId:UpdatePrimaryRegion' :: UpdatePrimaryRegion -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
keyId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
primaryRegion
instance Data.ToHeaders UpdatePrimaryRegion where
toHeaders :: UpdatePrimaryRegion -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"TrentService.UpdatePrimaryRegion" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdatePrimaryRegion where
toJSON :: UpdatePrimaryRegion -> Value
toJSON UpdatePrimaryRegion' {Text
primaryRegion :: Text
keyId :: Text
$sel:primaryRegion:UpdatePrimaryRegion' :: UpdatePrimaryRegion -> Text
$sel:keyId:UpdatePrimaryRegion' :: UpdatePrimaryRegion -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"KeyId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
keyId),
forall a. a -> Maybe a
Prelude.Just
(Key
"PrimaryRegion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
primaryRegion)
]
)
instance Data.ToPath UpdatePrimaryRegion where
toPath :: UpdatePrimaryRegion -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdatePrimaryRegion where
toQuery :: UpdatePrimaryRegion -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdatePrimaryRegionResponse = UpdatePrimaryRegionResponse'
{
}
deriving (UpdatePrimaryRegionResponse -> UpdatePrimaryRegionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePrimaryRegionResponse -> UpdatePrimaryRegionResponse -> Bool
$c/= :: UpdatePrimaryRegionResponse -> UpdatePrimaryRegionResponse -> Bool
== :: UpdatePrimaryRegionResponse -> UpdatePrimaryRegionResponse -> Bool
$c== :: UpdatePrimaryRegionResponse -> UpdatePrimaryRegionResponse -> Bool
Prelude.Eq, ReadPrec [UpdatePrimaryRegionResponse]
ReadPrec UpdatePrimaryRegionResponse
Int -> ReadS UpdatePrimaryRegionResponse
ReadS [UpdatePrimaryRegionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePrimaryRegionResponse]
$creadListPrec :: ReadPrec [UpdatePrimaryRegionResponse]
readPrec :: ReadPrec UpdatePrimaryRegionResponse
$creadPrec :: ReadPrec UpdatePrimaryRegionResponse
readList :: ReadS [UpdatePrimaryRegionResponse]
$creadList :: ReadS [UpdatePrimaryRegionResponse]
readsPrec :: Int -> ReadS UpdatePrimaryRegionResponse
$creadsPrec :: Int -> ReadS UpdatePrimaryRegionResponse
Prelude.Read, Int -> UpdatePrimaryRegionResponse -> ShowS
[UpdatePrimaryRegionResponse] -> ShowS
UpdatePrimaryRegionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePrimaryRegionResponse] -> ShowS
$cshowList :: [UpdatePrimaryRegionResponse] -> ShowS
show :: UpdatePrimaryRegionResponse -> String
$cshow :: UpdatePrimaryRegionResponse -> String
showsPrec :: Int -> UpdatePrimaryRegionResponse -> ShowS
$cshowsPrec :: Int -> UpdatePrimaryRegionResponse -> ShowS
Prelude.Show, forall x.
Rep UpdatePrimaryRegionResponse x -> UpdatePrimaryRegionResponse
forall x.
UpdatePrimaryRegionResponse -> Rep UpdatePrimaryRegionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdatePrimaryRegionResponse x -> UpdatePrimaryRegionResponse
$cfrom :: forall x.
UpdatePrimaryRegionResponse -> Rep UpdatePrimaryRegionResponse x
Prelude.Generic)
newUpdatePrimaryRegionResponse ::
UpdatePrimaryRegionResponse
newUpdatePrimaryRegionResponse :: UpdatePrimaryRegionResponse
newUpdatePrimaryRegionResponse =
UpdatePrimaryRegionResponse
UpdatePrimaryRegionResponse'
instance Prelude.NFData UpdatePrimaryRegionResponse where
rnf :: UpdatePrimaryRegionResponse -> ()
rnf UpdatePrimaryRegionResponse
_ = ()