{-# 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.Redshift.RotateEncryptionKey
(
RotateEncryptionKey (..),
newRotateEncryptionKey,
rotateEncryptionKey_clusterIdentifier,
RotateEncryptionKeyResponse (..),
newRotateEncryptionKeyResponse,
rotateEncryptionKeyResponse_cluster,
rotateEncryptionKeyResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RotateEncryptionKey = RotateEncryptionKey'
{
RotateEncryptionKey -> Text
clusterIdentifier :: Prelude.Text
}
deriving (RotateEncryptionKey -> RotateEncryptionKey -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RotateEncryptionKey -> RotateEncryptionKey -> Bool
$c/= :: RotateEncryptionKey -> RotateEncryptionKey -> Bool
== :: RotateEncryptionKey -> RotateEncryptionKey -> Bool
$c== :: RotateEncryptionKey -> RotateEncryptionKey -> Bool
Prelude.Eq, ReadPrec [RotateEncryptionKey]
ReadPrec RotateEncryptionKey
Int -> ReadS RotateEncryptionKey
ReadS [RotateEncryptionKey]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RotateEncryptionKey]
$creadListPrec :: ReadPrec [RotateEncryptionKey]
readPrec :: ReadPrec RotateEncryptionKey
$creadPrec :: ReadPrec RotateEncryptionKey
readList :: ReadS [RotateEncryptionKey]
$creadList :: ReadS [RotateEncryptionKey]
readsPrec :: Int -> ReadS RotateEncryptionKey
$creadsPrec :: Int -> ReadS RotateEncryptionKey
Prelude.Read, Int -> RotateEncryptionKey -> ShowS
[RotateEncryptionKey] -> ShowS
RotateEncryptionKey -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RotateEncryptionKey] -> ShowS
$cshowList :: [RotateEncryptionKey] -> ShowS
show :: RotateEncryptionKey -> String
$cshow :: RotateEncryptionKey -> String
showsPrec :: Int -> RotateEncryptionKey -> ShowS
$cshowsPrec :: Int -> RotateEncryptionKey -> ShowS
Prelude.Show, forall x. Rep RotateEncryptionKey x -> RotateEncryptionKey
forall x. RotateEncryptionKey -> Rep RotateEncryptionKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RotateEncryptionKey x -> RotateEncryptionKey
$cfrom :: forall x. RotateEncryptionKey -> Rep RotateEncryptionKey x
Prelude.Generic)
newRotateEncryptionKey ::
Prelude.Text ->
RotateEncryptionKey
newRotateEncryptionKey :: Text -> RotateEncryptionKey
newRotateEncryptionKey Text
pClusterIdentifier_ =
RotateEncryptionKey'
{ $sel:clusterIdentifier:RotateEncryptionKey' :: Text
clusterIdentifier =
Text
pClusterIdentifier_
}
rotateEncryptionKey_clusterIdentifier :: Lens.Lens' RotateEncryptionKey Prelude.Text
rotateEncryptionKey_clusterIdentifier :: Lens' RotateEncryptionKey Text
rotateEncryptionKey_clusterIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RotateEncryptionKey' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:RotateEncryptionKey' :: RotateEncryptionKey -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: RotateEncryptionKey
s@RotateEncryptionKey' {} Text
a -> RotateEncryptionKey
s {$sel:clusterIdentifier:RotateEncryptionKey' :: Text
clusterIdentifier = Text
a} :: RotateEncryptionKey)
instance Core.AWSRequest RotateEncryptionKey where
type
AWSResponse RotateEncryptionKey =
RotateEncryptionKeyResponse
request :: (Service -> Service)
-> RotateEncryptionKey -> Request RotateEncryptionKey
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy RotateEncryptionKey
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RotateEncryptionKey)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"RotateEncryptionKeyResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Cluster -> Int -> RotateEncryptionKeyResponse
RotateEncryptionKeyResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Cluster")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable RotateEncryptionKey where
hashWithSalt :: Int -> RotateEncryptionKey -> Int
hashWithSalt Int
_salt RotateEncryptionKey' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:RotateEncryptionKey' :: RotateEncryptionKey -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clusterIdentifier
instance Prelude.NFData RotateEncryptionKey where
rnf :: RotateEncryptionKey -> ()
rnf RotateEncryptionKey' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:RotateEncryptionKey' :: RotateEncryptionKey -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
clusterIdentifier
instance Data.ToHeaders RotateEncryptionKey where
toHeaders :: RotateEncryptionKey -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath RotateEncryptionKey where
toPath :: RotateEncryptionKey -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery RotateEncryptionKey where
toQuery :: RotateEncryptionKey -> QueryString
toQuery RotateEncryptionKey' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:RotateEncryptionKey' :: RotateEncryptionKey -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"RotateEncryptionKey" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"ClusterIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
clusterIdentifier
]
data RotateEncryptionKeyResponse = RotateEncryptionKeyResponse'
{ RotateEncryptionKeyResponse -> Maybe Cluster
cluster :: Prelude.Maybe Cluster,
RotateEncryptionKeyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RotateEncryptionKeyResponse -> RotateEncryptionKeyResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RotateEncryptionKeyResponse -> RotateEncryptionKeyResponse -> Bool
$c/= :: RotateEncryptionKeyResponse -> RotateEncryptionKeyResponse -> Bool
== :: RotateEncryptionKeyResponse -> RotateEncryptionKeyResponse -> Bool
$c== :: RotateEncryptionKeyResponse -> RotateEncryptionKeyResponse -> Bool
Prelude.Eq, ReadPrec [RotateEncryptionKeyResponse]
ReadPrec RotateEncryptionKeyResponse
Int -> ReadS RotateEncryptionKeyResponse
ReadS [RotateEncryptionKeyResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RotateEncryptionKeyResponse]
$creadListPrec :: ReadPrec [RotateEncryptionKeyResponse]
readPrec :: ReadPrec RotateEncryptionKeyResponse
$creadPrec :: ReadPrec RotateEncryptionKeyResponse
readList :: ReadS [RotateEncryptionKeyResponse]
$creadList :: ReadS [RotateEncryptionKeyResponse]
readsPrec :: Int -> ReadS RotateEncryptionKeyResponse
$creadsPrec :: Int -> ReadS RotateEncryptionKeyResponse
Prelude.Read, Int -> RotateEncryptionKeyResponse -> ShowS
[RotateEncryptionKeyResponse] -> ShowS
RotateEncryptionKeyResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RotateEncryptionKeyResponse] -> ShowS
$cshowList :: [RotateEncryptionKeyResponse] -> ShowS
show :: RotateEncryptionKeyResponse -> String
$cshow :: RotateEncryptionKeyResponse -> String
showsPrec :: Int -> RotateEncryptionKeyResponse -> ShowS
$cshowsPrec :: Int -> RotateEncryptionKeyResponse -> ShowS
Prelude.Show, forall x.
Rep RotateEncryptionKeyResponse x -> RotateEncryptionKeyResponse
forall x.
RotateEncryptionKeyResponse -> Rep RotateEncryptionKeyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RotateEncryptionKeyResponse x -> RotateEncryptionKeyResponse
$cfrom :: forall x.
RotateEncryptionKeyResponse -> Rep RotateEncryptionKeyResponse x
Prelude.Generic)
newRotateEncryptionKeyResponse ::
Prelude.Int ->
RotateEncryptionKeyResponse
newRotateEncryptionKeyResponse :: Int -> RotateEncryptionKeyResponse
newRotateEncryptionKeyResponse Int
pHttpStatus_ =
RotateEncryptionKeyResponse'
{ $sel:cluster:RotateEncryptionKeyResponse' :: Maybe Cluster
cluster =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RotateEncryptionKeyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
rotateEncryptionKeyResponse_cluster :: Lens.Lens' RotateEncryptionKeyResponse (Prelude.Maybe Cluster)
rotateEncryptionKeyResponse_cluster :: Lens' RotateEncryptionKeyResponse (Maybe Cluster)
rotateEncryptionKeyResponse_cluster = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RotateEncryptionKeyResponse' {Maybe Cluster
cluster :: Maybe Cluster
$sel:cluster:RotateEncryptionKeyResponse' :: RotateEncryptionKeyResponse -> Maybe Cluster
cluster} -> Maybe Cluster
cluster) (\s :: RotateEncryptionKeyResponse
s@RotateEncryptionKeyResponse' {} Maybe Cluster
a -> RotateEncryptionKeyResponse
s {$sel:cluster:RotateEncryptionKeyResponse' :: Maybe Cluster
cluster = Maybe Cluster
a} :: RotateEncryptionKeyResponse)
rotateEncryptionKeyResponse_httpStatus :: Lens.Lens' RotateEncryptionKeyResponse Prelude.Int
rotateEncryptionKeyResponse_httpStatus :: Lens' RotateEncryptionKeyResponse Int
rotateEncryptionKeyResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RotateEncryptionKeyResponse' {Int
httpStatus :: Int
$sel:httpStatus:RotateEncryptionKeyResponse' :: RotateEncryptionKeyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RotateEncryptionKeyResponse
s@RotateEncryptionKeyResponse' {} Int
a -> RotateEncryptionKeyResponse
s {$sel:httpStatus:RotateEncryptionKeyResponse' :: Int
httpStatus = Int
a} :: RotateEncryptionKeyResponse)
instance Prelude.NFData RotateEncryptionKeyResponse where
rnf :: RotateEncryptionKeyResponse -> ()
rnf RotateEncryptionKeyResponse' {Int
Maybe Cluster
httpStatus :: Int
cluster :: Maybe Cluster
$sel:httpStatus:RotateEncryptionKeyResponse' :: RotateEncryptionKeyResponse -> Int
$sel:cluster:RotateEncryptionKeyResponse' :: RotateEncryptionKeyResponse -> Maybe Cluster
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Cluster
cluster
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus