{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Firehose.StartDeliveryStreamEncryption
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Enables server-side encryption (SSE) for the delivery stream.
--
-- This operation is asynchronous. It returns immediately. When you invoke
-- it, Kinesis Data Firehose first sets the encryption status of the stream
-- to @ENABLING@, and then to @ENABLED@. The encryption status of a
-- delivery stream is the @Status@ property in
-- DeliveryStreamEncryptionConfiguration. If the operation fails, the
-- encryption status changes to @ENABLING_FAILED@. You can continue to read
-- and write data to your delivery stream while the encryption status is
-- @ENABLING@, but the data is not encrypted. It can take up to 5 seconds
-- after the encryption status changes to @ENABLED@ before all records
-- written to the delivery stream are encrypted. To find out whether a
-- record or a batch of records was encrypted, check the response elements
-- PutRecordOutput$Encrypted and PutRecordBatchOutput$Encrypted,
-- respectively.
--
-- To check the encryption status of a delivery stream, use
-- DescribeDeliveryStream.
--
-- Even if encryption is currently enabled for a delivery stream, you can
-- still invoke this operation on it to change the ARN of the CMK or both
-- its type and ARN. If you invoke this method to change the CMK, and the
-- old CMK is of type @CUSTOMER_MANAGED_CMK@, Kinesis Data Firehose
-- schedules the grant it had on the old CMK for retirement. If the new CMK
-- is of type @CUSTOMER_MANAGED_CMK@, Kinesis Data Firehose creates a grant
-- that enables it to use the new CMK to encrypt and decrypt data and to
-- manage the grant.
--
-- If a delivery stream already has encryption enabled and then you invoke
-- this operation to change the ARN of the CMK or both its type and ARN and
-- you get @ENABLING_FAILED@, this only means that the attempt to change
-- the CMK failed. In this case, encryption remains enabled with the old
-- CMK.
--
-- If the encryption status of your delivery stream is @ENABLING_FAILED@,
-- you can invoke this operation again with a valid CMK. The CMK must be
-- enabled and the key policy mustn\'t explicitly deny the permission for
-- Kinesis Data Firehose to invoke KMS encrypt and decrypt operations.
--
-- You can enable SSE for a delivery stream only if it\'s a delivery stream
-- that uses @DirectPut@ as its source.
--
-- The @StartDeliveryStreamEncryption@ and @StopDeliveryStreamEncryption@
-- operations have a combined limit of 25 calls per delivery stream per 24
-- hours. For example, you reach the limit if you call
-- @StartDeliveryStreamEncryption@ 13 times and
-- @StopDeliveryStreamEncryption@ 12 times for the same delivery stream in
-- a 24-hour period.
module Amazonka.Firehose.StartDeliveryStreamEncryption
  ( -- * Creating a Request
    StartDeliveryStreamEncryption (..),
    newStartDeliveryStreamEncryption,

    -- * Request Lenses
    startDeliveryStreamEncryption_deliveryStreamEncryptionConfigurationInput,
    startDeliveryStreamEncryption_deliveryStreamName,

    -- * Destructuring the Response
    StartDeliveryStreamEncryptionResponse (..),
    newStartDeliveryStreamEncryptionResponse,

    -- * Response Lenses
    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

-- | /See:/ 'newStartDeliveryStreamEncryption' smart constructor.
data StartDeliveryStreamEncryption = StartDeliveryStreamEncryption'
  { -- | Used to specify the type and Amazon Resource Name (ARN) of the KMS key
    -- needed for Server-Side Encryption (SSE).
    StartDeliveryStreamEncryption
-> Maybe DeliveryStreamEncryptionConfigurationInput
deliveryStreamEncryptionConfigurationInput :: Prelude.Maybe DeliveryStreamEncryptionConfigurationInput,
    -- | The name of the delivery stream for which you want to enable server-side
    -- encryption (SSE).
    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)

-- |
-- Create a value of 'StartDeliveryStreamEncryption' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'deliveryStreamEncryptionConfigurationInput', 'startDeliveryStreamEncryption_deliveryStreamEncryptionConfigurationInput' - Used to specify the type and Amazon Resource Name (ARN) of the KMS key
-- needed for Server-Side Encryption (SSE).
--
-- 'deliveryStreamName', 'startDeliveryStreamEncryption_deliveryStreamName' - The name of the delivery stream for which you want to enable server-side
-- encryption (SSE).
newStartDeliveryStreamEncryption ::
  -- | 'deliveryStreamName'
  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_
    }

-- | Used to specify the type and Amazon Resource Name (ARN) of the KMS key
-- needed for Server-Side Encryption (SSE).
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)

-- | The name of the delivery stream for which you want to enable server-side
-- encryption (SSE).
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

-- | /See:/ 'newStartDeliveryStreamEncryptionResponse' smart constructor.
data StartDeliveryStreamEncryptionResponse = StartDeliveryStreamEncryptionResponse'
  { -- | The response's http status code.
    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)

-- |
-- Create a value of 'StartDeliveryStreamEncryptionResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'startDeliveryStreamEncryptionResponse_httpStatus' - The response's http status code.
newStartDeliveryStreamEncryptionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartDeliveryStreamEncryptionResponse
newStartDeliveryStreamEncryptionResponse :: Int -> StartDeliveryStreamEncryptionResponse
newStartDeliveryStreamEncryptionResponse Int
pHttpStatus_ =
  StartDeliveryStreamEncryptionResponse' :: Int -> StartDeliveryStreamEncryptionResponse
StartDeliveryStreamEncryptionResponse'
    { $sel:httpStatus:StartDeliveryStreamEncryptionResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
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