{-# 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.Kinesis.StartStreamEncryption
(
StartStreamEncryption (..),
newStartStreamEncryption,
startStreamEncryption_streamName,
startStreamEncryption_encryptionType,
startStreamEncryption_keyId,
StartStreamEncryptionResponse (..),
newStartStreamEncryptionResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Kinesis.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 StartStreamEncryption = StartStreamEncryption'
{
StartStreamEncryption -> Text
streamName :: Prelude.Text,
StartStreamEncryption -> EncryptionType
encryptionType :: EncryptionType,
StartStreamEncryption -> Text
keyId :: Prelude.Text
}
deriving (StartStreamEncryption -> StartStreamEncryption -> Bool
(StartStreamEncryption -> StartStreamEncryption -> Bool)
-> (StartStreamEncryption -> StartStreamEncryption -> Bool)
-> Eq StartStreamEncryption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartStreamEncryption -> StartStreamEncryption -> Bool
$c/= :: StartStreamEncryption -> StartStreamEncryption -> Bool
== :: StartStreamEncryption -> StartStreamEncryption -> Bool
$c== :: StartStreamEncryption -> StartStreamEncryption -> Bool
Prelude.Eq, ReadPrec [StartStreamEncryption]
ReadPrec StartStreamEncryption
Int -> ReadS StartStreamEncryption
ReadS [StartStreamEncryption]
(Int -> ReadS StartStreamEncryption)
-> ReadS [StartStreamEncryption]
-> ReadPrec StartStreamEncryption
-> ReadPrec [StartStreamEncryption]
-> Read StartStreamEncryption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartStreamEncryption]
$creadListPrec :: ReadPrec [StartStreamEncryption]
readPrec :: ReadPrec StartStreamEncryption
$creadPrec :: ReadPrec StartStreamEncryption
readList :: ReadS [StartStreamEncryption]
$creadList :: ReadS [StartStreamEncryption]
readsPrec :: Int -> ReadS StartStreamEncryption
$creadsPrec :: Int -> ReadS StartStreamEncryption
Prelude.Read, Int -> StartStreamEncryption -> ShowS
[StartStreamEncryption] -> ShowS
StartStreamEncryption -> String
(Int -> StartStreamEncryption -> ShowS)
-> (StartStreamEncryption -> String)
-> ([StartStreamEncryption] -> ShowS)
-> Show StartStreamEncryption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartStreamEncryption] -> ShowS
$cshowList :: [StartStreamEncryption] -> ShowS
show :: StartStreamEncryption -> String
$cshow :: StartStreamEncryption -> String
showsPrec :: Int -> StartStreamEncryption -> ShowS
$cshowsPrec :: Int -> StartStreamEncryption -> ShowS
Prelude.Show, (forall x. StartStreamEncryption -> Rep StartStreamEncryption x)
-> (forall x. Rep StartStreamEncryption x -> StartStreamEncryption)
-> Generic StartStreamEncryption
forall x. Rep StartStreamEncryption x -> StartStreamEncryption
forall x. StartStreamEncryption -> Rep StartStreamEncryption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartStreamEncryption x -> StartStreamEncryption
$cfrom :: forall x. StartStreamEncryption -> Rep StartStreamEncryption x
Prelude.Generic)
newStartStreamEncryption ::
Prelude.Text ->
EncryptionType ->
Prelude.Text ->
StartStreamEncryption
newStartStreamEncryption :: Text -> EncryptionType -> Text -> StartStreamEncryption
newStartStreamEncryption
Text
pStreamName_
EncryptionType
pEncryptionType_
Text
pKeyId_ =
StartStreamEncryption' :: Text -> EncryptionType -> Text -> StartStreamEncryption
StartStreamEncryption'
{ $sel:streamName:StartStreamEncryption' :: Text
streamName = Text
pStreamName_,
$sel:encryptionType:StartStreamEncryption' :: EncryptionType
encryptionType = EncryptionType
pEncryptionType_,
$sel:keyId:StartStreamEncryption' :: Text
keyId = Text
pKeyId_
}
startStreamEncryption_streamName :: Lens.Lens' StartStreamEncryption Prelude.Text
startStreamEncryption_streamName :: (Text -> f Text)
-> StartStreamEncryption -> f StartStreamEncryption
startStreamEncryption_streamName = (StartStreamEncryption -> Text)
-> (StartStreamEncryption -> Text -> StartStreamEncryption)
-> Lens StartStreamEncryption StartStreamEncryption Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStreamEncryption' {Text
streamName :: Text
$sel:streamName:StartStreamEncryption' :: StartStreamEncryption -> Text
streamName} -> Text
streamName) (\s :: StartStreamEncryption
s@StartStreamEncryption' {} Text
a -> StartStreamEncryption
s {$sel:streamName:StartStreamEncryption' :: Text
streamName = Text
a} :: StartStreamEncryption)
startStreamEncryption_encryptionType :: Lens.Lens' StartStreamEncryption EncryptionType
startStreamEncryption_encryptionType :: (EncryptionType -> f EncryptionType)
-> StartStreamEncryption -> f StartStreamEncryption
startStreamEncryption_encryptionType = (StartStreamEncryption -> EncryptionType)
-> (StartStreamEncryption
-> EncryptionType -> StartStreamEncryption)
-> Lens
StartStreamEncryption
StartStreamEncryption
EncryptionType
EncryptionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStreamEncryption' {EncryptionType
encryptionType :: EncryptionType
$sel:encryptionType:StartStreamEncryption' :: StartStreamEncryption -> EncryptionType
encryptionType} -> EncryptionType
encryptionType) (\s :: StartStreamEncryption
s@StartStreamEncryption' {} EncryptionType
a -> StartStreamEncryption
s {$sel:encryptionType:StartStreamEncryption' :: EncryptionType
encryptionType = EncryptionType
a} :: StartStreamEncryption)
startStreamEncryption_keyId :: Lens.Lens' StartStreamEncryption Prelude.Text
startStreamEncryption_keyId :: (Text -> f Text)
-> StartStreamEncryption -> f StartStreamEncryption
startStreamEncryption_keyId = (StartStreamEncryption -> Text)
-> (StartStreamEncryption -> Text -> StartStreamEncryption)
-> Lens StartStreamEncryption StartStreamEncryption Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStreamEncryption' {Text
keyId :: Text
$sel:keyId:StartStreamEncryption' :: StartStreamEncryption -> Text
keyId} -> Text
keyId) (\s :: StartStreamEncryption
s@StartStreamEncryption' {} Text
a -> StartStreamEncryption
s {$sel:keyId:StartStreamEncryption' :: Text
keyId = Text
a} :: StartStreamEncryption)
instance Core.AWSRequest StartStreamEncryption where
type
AWSResponse StartStreamEncryption =
StartStreamEncryptionResponse
request :: StartStreamEncryption -> Request StartStreamEncryption
request = Service -> StartStreamEncryption -> Request StartStreamEncryption
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartStreamEncryption
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartStreamEncryption)))
response =
AWSResponse StartStreamEncryption
-> Logger
-> Service
-> Proxy StartStreamEncryption
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartStreamEncryption)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse StartStreamEncryption
StartStreamEncryptionResponse
StartStreamEncryptionResponse'
instance Prelude.Hashable StartStreamEncryption
instance Prelude.NFData StartStreamEncryption
instance Core.ToHeaders StartStreamEncryption where
toHeaders :: StartStreamEncryption -> [Header]
toHeaders =
[Header] -> StartStreamEncryption -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"Kinesis_20131202.StartStreamEncryption" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON StartStreamEncryption where
toJSON :: StartStreamEncryption -> Value
toJSON StartStreamEncryption' {Text
EncryptionType
keyId :: Text
encryptionType :: EncryptionType
streamName :: Text
$sel:keyId:StartStreamEncryption' :: StartStreamEncryption -> Text
$sel:encryptionType:StartStreamEncryption' :: StartStreamEncryption -> EncryptionType
$sel:streamName:StartStreamEncryption' :: StartStreamEncryption -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
streamName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"EncryptionType" Text -> EncryptionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= EncryptionType
encryptionType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"KeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
keyId)
]
)
instance Core.ToPath StartStreamEncryption where
toPath :: StartStreamEncryption -> ByteString
toPath = ByteString -> StartStreamEncryption -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartStreamEncryption where
toQuery :: StartStreamEncryption -> QueryString
toQuery = QueryString -> StartStreamEncryption -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartStreamEncryptionResponse = StartStreamEncryptionResponse'
{
}
deriving (StartStreamEncryptionResponse
-> StartStreamEncryptionResponse -> Bool
(StartStreamEncryptionResponse
-> StartStreamEncryptionResponse -> Bool)
-> (StartStreamEncryptionResponse
-> StartStreamEncryptionResponse -> Bool)
-> Eq StartStreamEncryptionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartStreamEncryptionResponse
-> StartStreamEncryptionResponse -> Bool
$c/= :: StartStreamEncryptionResponse
-> StartStreamEncryptionResponse -> Bool
== :: StartStreamEncryptionResponse
-> StartStreamEncryptionResponse -> Bool
$c== :: StartStreamEncryptionResponse
-> StartStreamEncryptionResponse -> Bool
Prelude.Eq, ReadPrec [StartStreamEncryptionResponse]
ReadPrec StartStreamEncryptionResponse
Int -> ReadS StartStreamEncryptionResponse
ReadS [StartStreamEncryptionResponse]
(Int -> ReadS StartStreamEncryptionResponse)
-> ReadS [StartStreamEncryptionResponse]
-> ReadPrec StartStreamEncryptionResponse
-> ReadPrec [StartStreamEncryptionResponse]
-> Read StartStreamEncryptionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartStreamEncryptionResponse]
$creadListPrec :: ReadPrec [StartStreamEncryptionResponse]
readPrec :: ReadPrec StartStreamEncryptionResponse
$creadPrec :: ReadPrec StartStreamEncryptionResponse
readList :: ReadS [StartStreamEncryptionResponse]
$creadList :: ReadS [StartStreamEncryptionResponse]
readsPrec :: Int -> ReadS StartStreamEncryptionResponse
$creadsPrec :: Int -> ReadS StartStreamEncryptionResponse
Prelude.Read, Int -> StartStreamEncryptionResponse -> ShowS
[StartStreamEncryptionResponse] -> ShowS
StartStreamEncryptionResponse -> String
(Int -> StartStreamEncryptionResponse -> ShowS)
-> (StartStreamEncryptionResponse -> String)
-> ([StartStreamEncryptionResponse] -> ShowS)
-> Show StartStreamEncryptionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartStreamEncryptionResponse] -> ShowS
$cshowList :: [StartStreamEncryptionResponse] -> ShowS
show :: StartStreamEncryptionResponse -> String
$cshow :: StartStreamEncryptionResponse -> String
showsPrec :: Int -> StartStreamEncryptionResponse -> ShowS
$cshowsPrec :: Int -> StartStreamEncryptionResponse -> ShowS
Prelude.Show, (forall x.
StartStreamEncryptionResponse
-> Rep StartStreamEncryptionResponse x)
-> (forall x.
Rep StartStreamEncryptionResponse x
-> StartStreamEncryptionResponse)
-> Generic StartStreamEncryptionResponse
forall x.
Rep StartStreamEncryptionResponse x
-> StartStreamEncryptionResponse
forall x.
StartStreamEncryptionResponse
-> Rep StartStreamEncryptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartStreamEncryptionResponse x
-> StartStreamEncryptionResponse
$cfrom :: forall x.
StartStreamEncryptionResponse
-> Rep StartStreamEncryptionResponse x
Prelude.Generic)
newStartStreamEncryptionResponse ::
StartStreamEncryptionResponse
newStartStreamEncryptionResponse :: StartStreamEncryptionResponse
newStartStreamEncryptionResponse =
StartStreamEncryptionResponse
StartStreamEncryptionResponse'
instance Prelude.NFData StartStreamEncryptionResponse