{-# 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.StopStreamEncryption
(
StopStreamEncryption (..),
newStopStreamEncryption,
stopStreamEncryption_streamName,
stopStreamEncryption_encryptionType,
stopStreamEncryption_keyId,
StopStreamEncryptionResponse (..),
newStopStreamEncryptionResponse,
)
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 StopStreamEncryption = StopStreamEncryption'
{
StopStreamEncryption -> Text
streamName :: Prelude.Text,
StopStreamEncryption -> EncryptionType
encryptionType :: EncryptionType,
StopStreamEncryption -> Text
keyId :: Prelude.Text
}
deriving (StopStreamEncryption -> StopStreamEncryption -> Bool
(StopStreamEncryption -> StopStreamEncryption -> Bool)
-> (StopStreamEncryption -> StopStreamEncryption -> Bool)
-> Eq StopStreamEncryption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopStreamEncryption -> StopStreamEncryption -> Bool
$c/= :: StopStreamEncryption -> StopStreamEncryption -> Bool
== :: StopStreamEncryption -> StopStreamEncryption -> Bool
$c== :: StopStreamEncryption -> StopStreamEncryption -> Bool
Prelude.Eq, ReadPrec [StopStreamEncryption]
ReadPrec StopStreamEncryption
Int -> ReadS StopStreamEncryption
ReadS [StopStreamEncryption]
(Int -> ReadS StopStreamEncryption)
-> ReadS [StopStreamEncryption]
-> ReadPrec StopStreamEncryption
-> ReadPrec [StopStreamEncryption]
-> Read StopStreamEncryption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopStreamEncryption]
$creadListPrec :: ReadPrec [StopStreamEncryption]
readPrec :: ReadPrec StopStreamEncryption
$creadPrec :: ReadPrec StopStreamEncryption
readList :: ReadS [StopStreamEncryption]
$creadList :: ReadS [StopStreamEncryption]
readsPrec :: Int -> ReadS StopStreamEncryption
$creadsPrec :: Int -> ReadS StopStreamEncryption
Prelude.Read, Int -> StopStreamEncryption -> ShowS
[StopStreamEncryption] -> ShowS
StopStreamEncryption -> String
(Int -> StopStreamEncryption -> ShowS)
-> (StopStreamEncryption -> String)
-> ([StopStreamEncryption] -> ShowS)
-> Show StopStreamEncryption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopStreamEncryption] -> ShowS
$cshowList :: [StopStreamEncryption] -> ShowS
show :: StopStreamEncryption -> String
$cshow :: StopStreamEncryption -> String
showsPrec :: Int -> StopStreamEncryption -> ShowS
$cshowsPrec :: Int -> StopStreamEncryption -> ShowS
Prelude.Show, (forall x. StopStreamEncryption -> Rep StopStreamEncryption x)
-> (forall x. Rep StopStreamEncryption x -> StopStreamEncryption)
-> Generic StopStreamEncryption
forall x. Rep StopStreamEncryption x -> StopStreamEncryption
forall x. StopStreamEncryption -> Rep StopStreamEncryption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopStreamEncryption x -> StopStreamEncryption
$cfrom :: forall x. StopStreamEncryption -> Rep StopStreamEncryption x
Prelude.Generic)
newStopStreamEncryption ::
Prelude.Text ->
EncryptionType ->
Prelude.Text ->
StopStreamEncryption
newStopStreamEncryption :: Text -> EncryptionType -> Text -> StopStreamEncryption
newStopStreamEncryption
Text
pStreamName_
EncryptionType
pEncryptionType_
Text
pKeyId_ =
StopStreamEncryption' :: Text -> EncryptionType -> Text -> StopStreamEncryption
StopStreamEncryption'
{ $sel:streamName:StopStreamEncryption' :: Text
streamName = Text
pStreamName_,
$sel:encryptionType:StopStreamEncryption' :: EncryptionType
encryptionType = EncryptionType
pEncryptionType_,
$sel:keyId:StopStreamEncryption' :: Text
keyId = Text
pKeyId_
}
stopStreamEncryption_streamName :: Lens.Lens' StopStreamEncryption Prelude.Text
stopStreamEncryption_streamName :: (Text -> f Text) -> StopStreamEncryption -> f StopStreamEncryption
stopStreamEncryption_streamName = (StopStreamEncryption -> Text)
-> (StopStreamEncryption -> Text -> StopStreamEncryption)
-> Lens StopStreamEncryption StopStreamEncryption Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopStreamEncryption' {Text
streamName :: Text
$sel:streamName:StopStreamEncryption' :: StopStreamEncryption -> Text
streamName} -> Text
streamName) (\s :: StopStreamEncryption
s@StopStreamEncryption' {} Text
a -> StopStreamEncryption
s {$sel:streamName:StopStreamEncryption' :: Text
streamName = Text
a} :: StopStreamEncryption)
stopStreamEncryption_encryptionType :: Lens.Lens' StopStreamEncryption EncryptionType
stopStreamEncryption_encryptionType :: (EncryptionType -> f EncryptionType)
-> StopStreamEncryption -> f StopStreamEncryption
stopStreamEncryption_encryptionType = (StopStreamEncryption -> EncryptionType)
-> (StopStreamEncryption -> EncryptionType -> StopStreamEncryption)
-> Lens
StopStreamEncryption
StopStreamEncryption
EncryptionType
EncryptionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopStreamEncryption' {EncryptionType
encryptionType :: EncryptionType
$sel:encryptionType:StopStreamEncryption' :: StopStreamEncryption -> EncryptionType
encryptionType} -> EncryptionType
encryptionType) (\s :: StopStreamEncryption
s@StopStreamEncryption' {} EncryptionType
a -> StopStreamEncryption
s {$sel:encryptionType:StopStreamEncryption' :: EncryptionType
encryptionType = EncryptionType
a} :: StopStreamEncryption)
stopStreamEncryption_keyId :: Lens.Lens' StopStreamEncryption Prelude.Text
stopStreamEncryption_keyId :: (Text -> f Text) -> StopStreamEncryption -> f StopStreamEncryption
stopStreamEncryption_keyId = (StopStreamEncryption -> Text)
-> (StopStreamEncryption -> Text -> StopStreamEncryption)
-> Lens StopStreamEncryption StopStreamEncryption Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopStreamEncryption' {Text
keyId :: Text
$sel:keyId:StopStreamEncryption' :: StopStreamEncryption -> Text
keyId} -> Text
keyId) (\s :: StopStreamEncryption
s@StopStreamEncryption' {} Text
a -> StopStreamEncryption
s {$sel:keyId:StopStreamEncryption' :: Text
keyId = Text
a} :: StopStreamEncryption)
instance Core.AWSRequest StopStreamEncryption where
type
AWSResponse StopStreamEncryption =
StopStreamEncryptionResponse
request :: StopStreamEncryption -> Request StopStreamEncryption
request = Service -> StopStreamEncryption -> Request StopStreamEncryption
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopStreamEncryption
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopStreamEncryption)))
response =
AWSResponse StopStreamEncryption
-> Logger
-> Service
-> Proxy StopStreamEncryption
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopStreamEncryption)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse StopStreamEncryption
StopStreamEncryptionResponse
StopStreamEncryptionResponse'
instance Prelude.Hashable StopStreamEncryption
instance Prelude.NFData StopStreamEncryption
instance Core.ToHeaders StopStreamEncryption where
toHeaders :: StopStreamEncryption -> [Header]
toHeaders =
[Header] -> StopStreamEncryption -> [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.StopStreamEncryption" ::
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 StopStreamEncryption where
toJSON :: StopStreamEncryption -> Value
toJSON StopStreamEncryption' {Text
EncryptionType
keyId :: Text
encryptionType :: EncryptionType
streamName :: Text
$sel:keyId:StopStreamEncryption' :: StopStreamEncryption -> Text
$sel:encryptionType:StopStreamEncryption' :: StopStreamEncryption -> EncryptionType
$sel:streamName:StopStreamEncryption' :: StopStreamEncryption -> 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 StopStreamEncryption where
toPath :: StopStreamEncryption -> ByteString
toPath = ByteString -> StopStreamEncryption -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopStreamEncryption where
toQuery :: StopStreamEncryption -> QueryString
toQuery = QueryString -> StopStreamEncryption -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopStreamEncryptionResponse = StopStreamEncryptionResponse'
{
}
deriving (StopStreamEncryptionResponse
-> StopStreamEncryptionResponse -> Bool
(StopStreamEncryptionResponse
-> StopStreamEncryptionResponse -> Bool)
-> (StopStreamEncryptionResponse
-> StopStreamEncryptionResponse -> Bool)
-> Eq StopStreamEncryptionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopStreamEncryptionResponse
-> StopStreamEncryptionResponse -> Bool
$c/= :: StopStreamEncryptionResponse
-> StopStreamEncryptionResponse -> Bool
== :: StopStreamEncryptionResponse
-> StopStreamEncryptionResponse -> Bool
$c== :: StopStreamEncryptionResponse
-> StopStreamEncryptionResponse -> Bool
Prelude.Eq, ReadPrec [StopStreamEncryptionResponse]
ReadPrec StopStreamEncryptionResponse
Int -> ReadS StopStreamEncryptionResponse
ReadS [StopStreamEncryptionResponse]
(Int -> ReadS StopStreamEncryptionResponse)
-> ReadS [StopStreamEncryptionResponse]
-> ReadPrec StopStreamEncryptionResponse
-> ReadPrec [StopStreamEncryptionResponse]
-> Read StopStreamEncryptionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopStreamEncryptionResponse]
$creadListPrec :: ReadPrec [StopStreamEncryptionResponse]
readPrec :: ReadPrec StopStreamEncryptionResponse
$creadPrec :: ReadPrec StopStreamEncryptionResponse
readList :: ReadS [StopStreamEncryptionResponse]
$creadList :: ReadS [StopStreamEncryptionResponse]
readsPrec :: Int -> ReadS StopStreamEncryptionResponse
$creadsPrec :: Int -> ReadS StopStreamEncryptionResponse
Prelude.Read, Int -> StopStreamEncryptionResponse -> ShowS
[StopStreamEncryptionResponse] -> ShowS
StopStreamEncryptionResponse -> String
(Int -> StopStreamEncryptionResponse -> ShowS)
-> (StopStreamEncryptionResponse -> String)
-> ([StopStreamEncryptionResponse] -> ShowS)
-> Show StopStreamEncryptionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopStreamEncryptionResponse] -> ShowS
$cshowList :: [StopStreamEncryptionResponse] -> ShowS
show :: StopStreamEncryptionResponse -> String
$cshow :: StopStreamEncryptionResponse -> String
showsPrec :: Int -> StopStreamEncryptionResponse -> ShowS
$cshowsPrec :: Int -> StopStreamEncryptionResponse -> ShowS
Prelude.Show, (forall x.
StopStreamEncryptionResponse -> Rep StopStreamEncryptionResponse x)
-> (forall x.
Rep StopStreamEncryptionResponse x -> StopStreamEncryptionResponse)
-> Generic StopStreamEncryptionResponse
forall x.
Rep StopStreamEncryptionResponse x -> StopStreamEncryptionResponse
forall x.
StopStreamEncryptionResponse -> Rep StopStreamEncryptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopStreamEncryptionResponse x -> StopStreamEncryptionResponse
$cfrom :: forall x.
StopStreamEncryptionResponse -> Rep StopStreamEncryptionResponse x
Prelude.Generic)
newStopStreamEncryptionResponse ::
StopStreamEncryptionResponse
newStopStreamEncryptionResponse :: StopStreamEncryptionResponse
newStopStreamEncryptionResponse =
StopStreamEncryptionResponse
StopStreamEncryptionResponse'
instance Prelude.NFData StopStreamEncryptionResponse