{-# 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_streamARN,
stopStreamEncryption_streamName,
stopStreamEncryption_encryptionType,
stopStreamEncryption_keyId,
StopStreamEncryptionResponse (..),
newStopStreamEncryptionResponse,
)
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 StopStreamEncryption = StopStreamEncryption'
{
StopStreamEncryption -> Maybe Text
streamARN :: Prelude.Maybe Prelude.Text,
StopStreamEncryption -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
StopStreamEncryption -> EncryptionType
encryptionType :: EncryptionType,
StopStreamEncryption -> Text
keyId :: Prelude.Text
}
deriving (StopStreamEncryption -> StopStreamEncryption -> Bool
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]
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
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. 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 ::
EncryptionType ->
Prelude.Text ->
StopStreamEncryption
newStopStreamEncryption :: EncryptionType -> Text -> StopStreamEncryption
newStopStreamEncryption EncryptionType
pEncryptionType_ Text
pKeyId_ =
StopStreamEncryption'
{ $sel:streamARN:StopStreamEncryption' :: Maybe Text
streamARN = forall a. Maybe a
Prelude.Nothing,
$sel:streamName:StopStreamEncryption' :: Maybe Text
streamName = forall a. Maybe a
Prelude.Nothing,
$sel:encryptionType:StopStreamEncryption' :: EncryptionType
encryptionType = EncryptionType
pEncryptionType_,
$sel:keyId:StopStreamEncryption' :: Text
keyId = Text
pKeyId_
}
stopStreamEncryption_streamARN :: Lens.Lens' StopStreamEncryption (Prelude.Maybe Prelude.Text)
stopStreamEncryption_streamARN :: Lens' StopStreamEncryption (Maybe Text)
stopStreamEncryption_streamARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopStreamEncryption' {Maybe Text
streamARN :: Maybe Text
$sel:streamARN:StopStreamEncryption' :: StopStreamEncryption -> Maybe Text
streamARN} -> Maybe Text
streamARN) (\s :: StopStreamEncryption
s@StopStreamEncryption' {} Maybe Text
a -> StopStreamEncryption
s {$sel:streamARN:StopStreamEncryption' :: Maybe Text
streamARN = Maybe Text
a} :: StopStreamEncryption)
stopStreamEncryption_streamName :: Lens.Lens' StopStreamEncryption (Prelude.Maybe Prelude.Text)
stopStreamEncryption_streamName :: Lens' StopStreamEncryption (Maybe Text)
stopStreamEncryption_streamName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopStreamEncryption' {Maybe Text
streamName :: Maybe Text
$sel:streamName:StopStreamEncryption' :: StopStreamEncryption -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: StopStreamEncryption
s@StopStreamEncryption' {} Maybe Text
a -> StopStreamEncryption
s {$sel:streamName:StopStreamEncryption' :: Maybe Text
streamName = Maybe Text
a} :: StopStreamEncryption)
stopStreamEncryption_encryptionType :: Lens.Lens' StopStreamEncryption EncryptionType
stopStreamEncryption_encryptionType :: Lens' StopStreamEncryption EncryptionType
stopStreamEncryption_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 :: Lens' StopStreamEncryption Text
stopStreamEncryption_keyId = 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 :: (Service -> Service)
-> StopStreamEncryption -> Request StopStreamEncryption
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 StopStreamEncryption
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopStreamEncryption)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull StopStreamEncryptionResponse
StopStreamEncryptionResponse'
instance Prelude.Hashable StopStreamEncryption where
hashWithSalt :: Int -> StopStreamEncryption -> Int
hashWithSalt Int
_salt StopStreamEncryption' {Maybe Text
Text
EncryptionType
keyId :: Text
encryptionType :: EncryptionType
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:keyId:StopStreamEncryption' :: StopStreamEncryption -> Text
$sel:encryptionType:StopStreamEncryption' :: StopStreamEncryption -> EncryptionType
$sel:streamName:StopStreamEncryption' :: StopStreamEncryption -> Maybe Text
$sel:streamARN:StopStreamEncryption' :: StopStreamEncryption -> 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 StopStreamEncryption where
rnf :: StopStreamEncryption -> ()
rnf StopStreamEncryption' {Maybe Text
Text
EncryptionType
keyId :: Text
encryptionType :: EncryptionType
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:keyId:StopStreamEncryption' :: StopStreamEncryption -> Text
$sel:encryptionType:StopStreamEncryption' :: StopStreamEncryption -> EncryptionType
$sel:streamName:StopStreamEncryption' :: StopStreamEncryption -> Maybe Text
$sel:streamARN:StopStreamEncryption' :: StopStreamEncryption -> 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 StopStreamEncryption where
toHeaders :: StopStreamEncryption -> [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.StopStreamEncryption" ::
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 StopStreamEncryption where
toJSON :: StopStreamEncryption -> Value
toJSON StopStreamEncryption' {Maybe Text
Text
EncryptionType
keyId :: Text
encryptionType :: EncryptionType
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:keyId:StopStreamEncryption' :: StopStreamEncryption -> Text
$sel:encryptionType:StopStreamEncryption' :: StopStreamEncryption -> EncryptionType
$sel:streamName:StopStreamEncryption' :: StopStreamEncryption -> Maybe Text
$sel:streamARN:StopStreamEncryption' :: StopStreamEncryption -> 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 StopStreamEncryption where
toPath :: StopStreamEncryption -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StopStreamEncryption where
toQuery :: StopStreamEncryption -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopStreamEncryptionResponse = StopStreamEncryptionResponse'
{
}
deriving (StopStreamEncryptionResponse
-> StopStreamEncryptionResponse -> Bool
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]
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
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.
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 where
rnf :: StopStreamEncryptionResponse -> ()
rnf StopStreamEncryptionResponse
_ = ()