{-# 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_streamARN,
startStreamEncryption_streamName,
startStreamEncryption_encryptionType,
startStreamEncryption_keyId,
StartStreamEncryptionResponse (..),
newStartStreamEncryptionResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kinesis.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StartStreamEncryption = StartStreamEncryption'
{
StartStreamEncryption -> Maybe Text
streamARN :: Prelude.Maybe Prelude.Text,
StartStreamEncryption -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
StartStreamEncryption -> EncryptionType
encryptionType :: EncryptionType,
StartStreamEncryption -> Text
keyId :: Prelude.Text
}
deriving (StartStreamEncryption -> StartStreamEncryption -> Bool
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]
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
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. 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 ::
EncryptionType ->
Prelude.Text ->
StartStreamEncryption
newStartStreamEncryption :: EncryptionType -> Text -> StartStreamEncryption
newStartStreamEncryption EncryptionType
pEncryptionType_ Text
pKeyId_ =
StartStreamEncryption'
{ $sel:streamARN:StartStreamEncryption' :: Maybe Text
streamARN = forall a. Maybe a
Prelude.Nothing,
$sel:streamName:StartStreamEncryption' :: Maybe Text
streamName = forall a. Maybe a
Prelude.Nothing,
$sel:encryptionType:StartStreamEncryption' :: EncryptionType
encryptionType = EncryptionType
pEncryptionType_,
$sel:keyId:StartStreamEncryption' :: Text
keyId = Text
pKeyId_
}
startStreamEncryption_streamARN :: Lens.Lens' StartStreamEncryption (Prelude.Maybe Prelude.Text)
startStreamEncryption_streamARN :: Lens' StartStreamEncryption (Maybe Text)
startStreamEncryption_streamARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStreamEncryption' {Maybe Text
streamARN :: Maybe Text
$sel:streamARN:StartStreamEncryption' :: StartStreamEncryption -> Maybe Text
streamARN} -> Maybe Text
streamARN) (\s :: StartStreamEncryption
s@StartStreamEncryption' {} Maybe Text
a -> StartStreamEncryption
s {$sel:streamARN:StartStreamEncryption' :: Maybe Text
streamARN = Maybe Text
a} :: StartStreamEncryption)
startStreamEncryption_streamName :: Lens.Lens' StartStreamEncryption (Prelude.Maybe Prelude.Text)
startStreamEncryption_streamName :: Lens' StartStreamEncryption (Maybe Text)
startStreamEncryption_streamName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartStreamEncryption' {Maybe Text
streamName :: Maybe Text
$sel:streamName:StartStreamEncryption' :: StartStreamEncryption -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: StartStreamEncryption
s@StartStreamEncryption' {} Maybe Text
a -> StartStreamEncryption
s {$sel:streamName:StartStreamEncryption' :: Maybe Text
streamName = Maybe Text
a} :: StartStreamEncryption)
startStreamEncryption_encryptionType :: Lens.Lens' StartStreamEncryption EncryptionType
startStreamEncryption_encryptionType :: Lens' StartStreamEncryption EncryptionType
startStreamEncryption_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 :: Lens' StartStreamEncryption Text
startStreamEncryption_keyId = 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 :: (Service -> Service)
-> StartStreamEncryption -> Request StartStreamEncryption
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 StartStreamEncryption
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartStreamEncryption)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull StartStreamEncryptionResponse
StartStreamEncryptionResponse'
instance Prelude.Hashable StartStreamEncryption where
hashWithSalt :: Int -> StartStreamEncryption -> Int
hashWithSalt Int
_salt StartStreamEncryption' {Maybe Text
Text
EncryptionType
keyId :: Text
encryptionType :: EncryptionType
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:keyId:StartStreamEncryption' :: StartStreamEncryption -> Text
$sel:encryptionType:StartStreamEncryption' :: StartStreamEncryption -> EncryptionType
$sel:streamName:StartStreamEncryption' :: StartStreamEncryption -> Maybe Text
$sel:streamARN:StartStreamEncryption' :: StartStreamEncryption -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
streamName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EncryptionType
encryptionType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
keyId
instance Prelude.NFData StartStreamEncryption where
rnf :: StartStreamEncryption -> ()
rnf StartStreamEncryption' {Maybe Text
Text
EncryptionType
keyId :: Text
encryptionType :: EncryptionType
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:keyId:StartStreamEncryption' :: StartStreamEncryption -> Text
$sel:encryptionType:StartStreamEncryption' :: StartStreamEncryption -> EncryptionType
$sel:streamName:StartStreamEncryption' :: StartStreamEncryption -> Maybe Text
$sel:streamARN:StartStreamEncryption' :: StartStreamEncryption -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
streamName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EncryptionType
encryptionType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
keyId
instance Data.ToHeaders StartStreamEncryption where
toHeaders :: StartStreamEncryption -> [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
"Kinesis_20131202.StartStreamEncryption" ::
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 StartStreamEncryption where
toJSON :: StartStreamEncryption -> Value
toJSON StartStreamEncryption' {Maybe Text
Text
EncryptionType
keyId :: Text
encryptionType :: EncryptionType
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:keyId:StartStreamEncryption' :: StartStreamEncryption -> Text
$sel:encryptionType:StartStreamEncryption' :: StartStreamEncryption -> EncryptionType
$sel:streamName:StartStreamEncryption' :: StartStreamEncryption -> Maybe Text
$sel:streamARN:StartStreamEncryption' :: StartStreamEncryption -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"StreamARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamARN,
(Key
"StreamName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamName,
forall a. a -> Maybe a
Prelude.Just
(Key
"EncryptionType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= EncryptionType
encryptionType),
forall a. a -> Maybe a
Prelude.Just (Key
"KeyId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
keyId)
]
)
instance Data.ToPath StartStreamEncryption where
toPath :: StartStreamEncryption -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StartStreamEncryption where
toQuery :: StartStreamEncryption -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StartStreamEncryptionResponse = StartStreamEncryptionResponse'
{
}
deriving (StartStreamEncryptionResponse
-> StartStreamEncryptionResponse -> Bool
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]
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
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.
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 where
rnf :: StartStreamEncryptionResponse -> ()
rnf StartStreamEncryptionResponse
_ = ()