{-# 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.Firehose.StartDeliveryStreamEncryption
(
StartDeliveryStreamEncryption (..),
newStartDeliveryStreamEncryption,
startDeliveryStreamEncryption_deliveryStreamEncryptionConfigurationInput,
startDeliveryStreamEncryption_deliveryStreamName,
StartDeliveryStreamEncryptionResponse (..),
newStartDeliveryStreamEncryptionResponse,
startDeliveryStreamEncryptionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Firehose.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 StartDeliveryStreamEncryption = StartDeliveryStreamEncryption'
{
StartDeliveryStreamEncryption
-> Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput :: Prelude.Maybe DeliveryStreamEncryptionConfigurationInput,
StartDeliveryStreamEncryption -> Text
deliveryStreamName :: Prelude.Text
}
deriving (StartDeliveryStreamEncryption
-> StartDeliveryStreamEncryption -> Bool
(StartDeliveryStreamEncryption
-> StartDeliveryStreamEncryption -> Bool)
-> (StartDeliveryStreamEncryption
-> StartDeliveryStreamEncryption -> Bool)
-> Eq StartDeliveryStreamEncryption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartDeliveryStreamEncryption
-> StartDeliveryStreamEncryption -> Bool
$c/= :: StartDeliveryStreamEncryption
-> StartDeliveryStreamEncryption -> Bool
== :: StartDeliveryStreamEncryption
-> StartDeliveryStreamEncryption -> Bool
$c== :: StartDeliveryStreamEncryption
-> StartDeliveryStreamEncryption -> Bool
Prelude.Eq, ReadPrec [StartDeliveryStreamEncryption]
ReadPrec StartDeliveryStreamEncryption
Int -> ReadS StartDeliveryStreamEncryption
ReadS [StartDeliveryStreamEncryption]
(Int -> ReadS StartDeliveryStreamEncryption)
-> ReadS [StartDeliveryStreamEncryption]
-> ReadPrec StartDeliveryStreamEncryption
-> ReadPrec [StartDeliveryStreamEncryption]
-> Read StartDeliveryStreamEncryption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartDeliveryStreamEncryption]
$creadListPrec :: ReadPrec [StartDeliveryStreamEncryption]
readPrec :: ReadPrec StartDeliveryStreamEncryption
$creadPrec :: ReadPrec StartDeliveryStreamEncryption
readList :: ReadS [StartDeliveryStreamEncryption]
$creadList :: ReadS [StartDeliveryStreamEncryption]
readsPrec :: Int -> ReadS StartDeliveryStreamEncryption
$creadsPrec :: Int -> ReadS StartDeliveryStreamEncryption
Prelude.Read, Int -> StartDeliveryStreamEncryption -> ShowS
[StartDeliveryStreamEncryption] -> ShowS
StartDeliveryStreamEncryption -> String
(Int -> StartDeliveryStreamEncryption -> ShowS)
-> (StartDeliveryStreamEncryption -> String)
-> ([StartDeliveryStreamEncryption] -> ShowS)
-> Show StartDeliveryStreamEncryption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartDeliveryStreamEncryption] -> ShowS
$cshowList :: [StartDeliveryStreamEncryption] -> ShowS
show :: StartDeliveryStreamEncryption -> String
$cshow :: StartDeliveryStreamEncryption -> String
showsPrec :: Int -> StartDeliveryStreamEncryption -> ShowS
$cshowsPrec :: Int -> StartDeliveryStreamEncryption -> ShowS
Prelude.Show, (forall x.
StartDeliveryStreamEncryption
-> Rep StartDeliveryStreamEncryption x)
-> (forall x.
Rep StartDeliveryStreamEncryption x
-> StartDeliveryStreamEncryption)
-> Generic StartDeliveryStreamEncryption
forall x.
Rep StartDeliveryStreamEncryption x
-> StartDeliveryStreamEncryption
forall x.
StartDeliveryStreamEncryption
-> Rep StartDeliveryStreamEncryption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartDeliveryStreamEncryption x
-> StartDeliveryStreamEncryption
$cfrom :: forall x.
StartDeliveryStreamEncryption
-> Rep StartDeliveryStreamEncryption x
Prelude.Generic)
newStartDeliveryStreamEncryption ::
Prelude.Text ->
StartDeliveryStreamEncryption
newStartDeliveryStreamEncryption :: Text -> StartDeliveryStreamEncryption
newStartDeliveryStreamEncryption Text
pDeliveryStreamName_ =
StartDeliveryStreamEncryption' :: Maybe DeliveryStreamEncryptionConfigurationInput
-> Text -> StartDeliveryStreamEncryption
StartDeliveryStreamEncryption'
{ $sel:deliveryStreamEncryptionConfigurationInput:StartDeliveryStreamEncryption' :: Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput =
Maybe DeliveryStreamEncryptionConfigurationInput
forall a. Maybe a
Prelude.Nothing,
$sel:deliveryStreamName:StartDeliveryStreamEncryption' :: Text
deliveryStreamName = Text
pDeliveryStreamName_
}
startDeliveryStreamEncryption_deliveryStreamEncryptionConfigurationInput :: Lens.Lens' StartDeliveryStreamEncryption (Prelude.Maybe DeliveryStreamEncryptionConfigurationInput)
startDeliveryStreamEncryption_deliveryStreamEncryptionConfigurationInput :: (Maybe DeliveryStreamEncryptionConfigurationInput
-> f (Maybe DeliveryStreamEncryptionConfigurationInput))
-> StartDeliveryStreamEncryption -> f StartDeliveryStreamEncryption
startDeliveryStreamEncryption_deliveryStreamEncryptionConfigurationInput = (StartDeliveryStreamEncryption
-> Maybe DeliveryStreamEncryptionConfigurationInput)
-> (StartDeliveryStreamEncryption
-> Maybe DeliveryStreamEncryptionConfigurationInput
-> StartDeliveryStreamEncryption)
-> Lens
StartDeliveryStreamEncryption
StartDeliveryStreamEncryption
(Maybe DeliveryStreamEncryptionConfigurationInput)
(Maybe DeliveryStreamEncryptionConfigurationInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDeliveryStreamEncryption' {Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput :: Maybe DeliveryStreamEncryptionConfigurationInput
$sel:deliveryStreamEncryptionConfigurationInput:StartDeliveryStreamEncryption' :: StartDeliveryStreamEncryption
-> Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput} -> Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput) (\s :: StartDeliveryStreamEncryption
s@StartDeliveryStreamEncryption' {} Maybe DeliveryStreamEncryptionConfigurationInput
a -> StartDeliveryStreamEncryption
s {$sel:deliveryStreamEncryptionConfigurationInput:StartDeliveryStreamEncryption' :: Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput = Maybe DeliveryStreamEncryptionConfigurationInput
a} :: StartDeliveryStreamEncryption)
startDeliveryStreamEncryption_deliveryStreamName :: Lens.Lens' StartDeliveryStreamEncryption Prelude.Text
startDeliveryStreamEncryption_deliveryStreamName :: (Text -> f Text)
-> StartDeliveryStreamEncryption -> f StartDeliveryStreamEncryption
startDeliveryStreamEncryption_deliveryStreamName = (StartDeliveryStreamEncryption -> Text)
-> (StartDeliveryStreamEncryption
-> Text -> StartDeliveryStreamEncryption)
-> Lens
StartDeliveryStreamEncryption
StartDeliveryStreamEncryption
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDeliveryStreamEncryption' {Text
deliveryStreamName :: Text
$sel:deliveryStreamName:StartDeliveryStreamEncryption' :: StartDeliveryStreamEncryption -> Text
deliveryStreamName} -> Text
deliveryStreamName) (\s :: StartDeliveryStreamEncryption
s@StartDeliveryStreamEncryption' {} Text
a -> StartDeliveryStreamEncryption
s {$sel:deliveryStreamName:StartDeliveryStreamEncryption' :: Text
deliveryStreamName = Text
a} :: StartDeliveryStreamEncryption)
instance
Core.AWSRequest
StartDeliveryStreamEncryption
where
type
AWSResponse StartDeliveryStreamEncryption =
StartDeliveryStreamEncryptionResponse
request :: StartDeliveryStreamEncryption
-> Request StartDeliveryStreamEncryption
request = Service
-> StartDeliveryStreamEncryption
-> Request StartDeliveryStreamEncryption
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartDeliveryStreamEncryption
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartDeliveryStreamEncryption)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse StartDeliveryStreamEncryption))
-> Logger
-> Service
-> Proxy StartDeliveryStreamEncryption
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartDeliveryStreamEncryption)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> StartDeliveryStreamEncryptionResponse
StartDeliveryStreamEncryptionResponse'
(Int -> StartDeliveryStreamEncryptionResponse)
-> Either String Int
-> Either String StartDeliveryStreamEncryptionResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
StartDeliveryStreamEncryption
instance Prelude.NFData StartDeliveryStreamEncryption
instance Core.ToHeaders StartDeliveryStreamEncryption where
toHeaders :: StartDeliveryStreamEncryption -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartDeliveryStreamEncryption -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Firehose_20150804.StartDeliveryStreamEncryption" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON StartDeliveryStreamEncryption where
toJSON :: StartDeliveryStreamEncryption -> Value
toJSON StartDeliveryStreamEncryption' {Maybe DeliveryStreamEncryptionConfigurationInput
Text
deliveryStreamName :: Text
deliveryStreamEncryptionConfigurationInput :: Maybe DeliveryStreamEncryptionConfigurationInput
$sel:deliveryStreamName:StartDeliveryStreamEncryption' :: StartDeliveryStreamEncryption -> Text
$sel:deliveryStreamEncryptionConfigurationInput:StartDeliveryStreamEncryption' :: StartDeliveryStreamEncryption
-> Maybe DeliveryStreamEncryptionConfigurationInput
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ ( Text
"DeliveryStreamEncryptionConfigurationInput"
Text -> DeliveryStreamEncryptionConfigurationInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=
)
(DeliveryStreamEncryptionConfigurationInput -> Pair)
-> Maybe DeliveryStreamEncryptionConfigurationInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DeliveryStreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deliveryStreamName)
]
)
instance Core.ToPath StartDeliveryStreamEncryption where
toPath :: StartDeliveryStreamEncryption -> ByteString
toPath = ByteString -> StartDeliveryStreamEncryption -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartDeliveryStreamEncryption where
toQuery :: StartDeliveryStreamEncryption -> QueryString
toQuery = QueryString -> StartDeliveryStreamEncryption -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartDeliveryStreamEncryptionResponse = StartDeliveryStreamEncryptionResponse'
{
StartDeliveryStreamEncryptionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartDeliveryStreamEncryptionResponse
-> StartDeliveryStreamEncryptionResponse -> Bool
(StartDeliveryStreamEncryptionResponse
-> StartDeliveryStreamEncryptionResponse -> Bool)
-> (StartDeliveryStreamEncryptionResponse
-> StartDeliveryStreamEncryptionResponse -> Bool)
-> Eq StartDeliveryStreamEncryptionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartDeliveryStreamEncryptionResponse
-> StartDeliveryStreamEncryptionResponse -> Bool
$c/= :: StartDeliveryStreamEncryptionResponse
-> StartDeliveryStreamEncryptionResponse -> Bool
== :: StartDeliveryStreamEncryptionResponse
-> StartDeliveryStreamEncryptionResponse -> Bool
$c== :: StartDeliveryStreamEncryptionResponse
-> StartDeliveryStreamEncryptionResponse -> Bool
Prelude.Eq, ReadPrec [StartDeliveryStreamEncryptionResponse]
ReadPrec StartDeliveryStreamEncryptionResponse
Int -> ReadS StartDeliveryStreamEncryptionResponse
ReadS [StartDeliveryStreamEncryptionResponse]
(Int -> ReadS StartDeliveryStreamEncryptionResponse)
-> ReadS [StartDeliveryStreamEncryptionResponse]
-> ReadPrec StartDeliveryStreamEncryptionResponse
-> ReadPrec [StartDeliveryStreamEncryptionResponse]
-> Read StartDeliveryStreamEncryptionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartDeliveryStreamEncryptionResponse]
$creadListPrec :: ReadPrec [StartDeliveryStreamEncryptionResponse]
readPrec :: ReadPrec StartDeliveryStreamEncryptionResponse
$creadPrec :: ReadPrec StartDeliveryStreamEncryptionResponse
readList :: ReadS [StartDeliveryStreamEncryptionResponse]
$creadList :: ReadS [StartDeliveryStreamEncryptionResponse]
readsPrec :: Int -> ReadS StartDeliveryStreamEncryptionResponse
$creadsPrec :: Int -> ReadS StartDeliveryStreamEncryptionResponse
Prelude.Read, Int -> StartDeliveryStreamEncryptionResponse -> ShowS
[StartDeliveryStreamEncryptionResponse] -> ShowS
StartDeliveryStreamEncryptionResponse -> String
(Int -> StartDeliveryStreamEncryptionResponse -> ShowS)
-> (StartDeliveryStreamEncryptionResponse -> String)
-> ([StartDeliveryStreamEncryptionResponse] -> ShowS)
-> Show StartDeliveryStreamEncryptionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartDeliveryStreamEncryptionResponse] -> ShowS
$cshowList :: [StartDeliveryStreamEncryptionResponse] -> ShowS
show :: StartDeliveryStreamEncryptionResponse -> String
$cshow :: StartDeliveryStreamEncryptionResponse -> String
showsPrec :: Int -> StartDeliveryStreamEncryptionResponse -> ShowS
$cshowsPrec :: Int -> StartDeliveryStreamEncryptionResponse -> ShowS
Prelude.Show, (forall x.
StartDeliveryStreamEncryptionResponse
-> Rep StartDeliveryStreamEncryptionResponse x)
-> (forall x.
Rep StartDeliveryStreamEncryptionResponse x
-> StartDeliveryStreamEncryptionResponse)
-> Generic StartDeliveryStreamEncryptionResponse
forall x.
Rep StartDeliveryStreamEncryptionResponse x
-> StartDeliveryStreamEncryptionResponse
forall x.
StartDeliveryStreamEncryptionResponse
-> Rep StartDeliveryStreamEncryptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartDeliveryStreamEncryptionResponse x
-> StartDeliveryStreamEncryptionResponse
$cfrom :: forall x.
StartDeliveryStreamEncryptionResponse
-> Rep StartDeliveryStreamEncryptionResponse x
Prelude.Generic)
newStartDeliveryStreamEncryptionResponse ::
Prelude.Int ->
StartDeliveryStreamEncryptionResponse
newStartDeliveryStreamEncryptionResponse :: Int -> StartDeliveryStreamEncryptionResponse
newStartDeliveryStreamEncryptionResponse Int
pHttpStatus_ =
StartDeliveryStreamEncryptionResponse' :: Int -> StartDeliveryStreamEncryptionResponse
StartDeliveryStreamEncryptionResponse'
{ $sel:httpStatus:StartDeliveryStreamEncryptionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
startDeliveryStreamEncryptionResponse_httpStatus :: Lens.Lens' StartDeliveryStreamEncryptionResponse Prelude.Int
startDeliveryStreamEncryptionResponse_httpStatus :: (Int -> f Int)
-> StartDeliveryStreamEncryptionResponse
-> f StartDeliveryStreamEncryptionResponse
startDeliveryStreamEncryptionResponse_httpStatus = (StartDeliveryStreamEncryptionResponse -> Int)
-> (StartDeliveryStreamEncryptionResponse
-> Int -> StartDeliveryStreamEncryptionResponse)
-> Lens
StartDeliveryStreamEncryptionResponse
StartDeliveryStreamEncryptionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDeliveryStreamEncryptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartDeliveryStreamEncryptionResponse' :: StartDeliveryStreamEncryptionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartDeliveryStreamEncryptionResponse
s@StartDeliveryStreamEncryptionResponse' {} Int
a -> StartDeliveryStreamEncryptionResponse
s {$sel:httpStatus:StartDeliveryStreamEncryptionResponse' :: Int
httpStatus = Int
a} :: StartDeliveryStreamEncryptionResponse)
instance
Prelude.NFData
StartDeliveryStreamEncryptionResponse