{-# 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.IoTSiteWise.PutDefaultEncryptionConfiguration
-- 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)
--
-- Sets the default encryption configuration for the Amazon Web Services
-- account. For more information, see
-- <https://docs.aws.amazon.com/iot-sitewise/latest/userguide/key-management.html Key management>
-- in the /IoT SiteWise User Guide/.
module Amazonka.IoTSiteWise.PutDefaultEncryptionConfiguration
  ( -- * Creating a Request
    PutDefaultEncryptionConfiguration (..),
    newPutDefaultEncryptionConfiguration,

    -- * Request Lenses
    putDefaultEncryptionConfiguration_kmsKeyId,
    putDefaultEncryptionConfiguration_encryptionType,

    -- * Destructuring the Response
    PutDefaultEncryptionConfigurationResponse (..),
    newPutDefaultEncryptionConfigurationResponse,

    -- * Response Lenses
    putDefaultEncryptionConfigurationResponse_kmsKeyArn,
    putDefaultEncryptionConfigurationResponse_httpStatus,
    putDefaultEncryptionConfigurationResponse_encryptionType,
    putDefaultEncryptionConfigurationResponse_configurationStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.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:/ 'newPutDefaultEncryptionConfiguration' smart constructor.
data PutDefaultEncryptionConfiguration = PutDefaultEncryptionConfiguration'
  { -- | The Key ID of the customer managed customer master key (CMK) used for
    -- KMS encryption. This is required if you use @KMS_BASED_ENCRYPTION@.
    PutDefaultEncryptionConfiguration -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The type of encryption used for the encryption configuration.
    PutDefaultEncryptionConfiguration -> EncryptionType
encryptionType :: EncryptionType
  }
  deriving (PutDefaultEncryptionConfiguration
-> PutDefaultEncryptionConfiguration -> Bool
(PutDefaultEncryptionConfiguration
 -> PutDefaultEncryptionConfiguration -> Bool)
-> (PutDefaultEncryptionConfiguration
    -> PutDefaultEncryptionConfiguration -> Bool)
-> Eq PutDefaultEncryptionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDefaultEncryptionConfiguration
-> PutDefaultEncryptionConfiguration -> Bool
$c/= :: PutDefaultEncryptionConfiguration
-> PutDefaultEncryptionConfiguration -> Bool
== :: PutDefaultEncryptionConfiguration
-> PutDefaultEncryptionConfiguration -> Bool
$c== :: PutDefaultEncryptionConfiguration
-> PutDefaultEncryptionConfiguration -> Bool
Prelude.Eq, ReadPrec [PutDefaultEncryptionConfiguration]
ReadPrec PutDefaultEncryptionConfiguration
Int -> ReadS PutDefaultEncryptionConfiguration
ReadS [PutDefaultEncryptionConfiguration]
(Int -> ReadS PutDefaultEncryptionConfiguration)
-> ReadS [PutDefaultEncryptionConfiguration]
-> ReadPrec PutDefaultEncryptionConfiguration
-> ReadPrec [PutDefaultEncryptionConfiguration]
-> Read PutDefaultEncryptionConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDefaultEncryptionConfiguration]
$creadListPrec :: ReadPrec [PutDefaultEncryptionConfiguration]
readPrec :: ReadPrec PutDefaultEncryptionConfiguration
$creadPrec :: ReadPrec PutDefaultEncryptionConfiguration
readList :: ReadS [PutDefaultEncryptionConfiguration]
$creadList :: ReadS [PutDefaultEncryptionConfiguration]
readsPrec :: Int -> ReadS PutDefaultEncryptionConfiguration
$creadsPrec :: Int -> ReadS PutDefaultEncryptionConfiguration
Prelude.Read, Int -> PutDefaultEncryptionConfiguration -> ShowS
[PutDefaultEncryptionConfiguration] -> ShowS
PutDefaultEncryptionConfiguration -> String
(Int -> PutDefaultEncryptionConfiguration -> ShowS)
-> (PutDefaultEncryptionConfiguration -> String)
-> ([PutDefaultEncryptionConfiguration] -> ShowS)
-> Show PutDefaultEncryptionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDefaultEncryptionConfiguration] -> ShowS
$cshowList :: [PutDefaultEncryptionConfiguration] -> ShowS
show :: PutDefaultEncryptionConfiguration -> String
$cshow :: PutDefaultEncryptionConfiguration -> String
showsPrec :: Int -> PutDefaultEncryptionConfiguration -> ShowS
$cshowsPrec :: Int -> PutDefaultEncryptionConfiguration -> ShowS
Prelude.Show, (forall x.
 PutDefaultEncryptionConfiguration
 -> Rep PutDefaultEncryptionConfiguration x)
-> (forall x.
    Rep PutDefaultEncryptionConfiguration x
    -> PutDefaultEncryptionConfiguration)
-> Generic PutDefaultEncryptionConfiguration
forall x.
Rep PutDefaultEncryptionConfiguration x
-> PutDefaultEncryptionConfiguration
forall x.
PutDefaultEncryptionConfiguration
-> Rep PutDefaultEncryptionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutDefaultEncryptionConfiguration x
-> PutDefaultEncryptionConfiguration
$cfrom :: forall x.
PutDefaultEncryptionConfiguration
-> Rep PutDefaultEncryptionConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'PutDefaultEncryptionConfiguration' 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:
--
-- 'kmsKeyId', 'putDefaultEncryptionConfiguration_kmsKeyId' - The Key ID of the customer managed customer master key (CMK) used for
-- KMS encryption. This is required if you use @KMS_BASED_ENCRYPTION@.
--
-- 'encryptionType', 'putDefaultEncryptionConfiguration_encryptionType' - The type of encryption used for the encryption configuration.
newPutDefaultEncryptionConfiguration ::
  -- | 'encryptionType'
  EncryptionType ->
  PutDefaultEncryptionConfiguration
newPutDefaultEncryptionConfiguration :: EncryptionType -> PutDefaultEncryptionConfiguration
newPutDefaultEncryptionConfiguration EncryptionType
pEncryptionType_ =
  PutDefaultEncryptionConfiguration' :: Maybe Text -> EncryptionType -> PutDefaultEncryptionConfiguration
PutDefaultEncryptionConfiguration'
    { $sel:kmsKeyId:PutDefaultEncryptionConfiguration' :: Maybe Text
kmsKeyId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionType:PutDefaultEncryptionConfiguration' :: EncryptionType
encryptionType = EncryptionType
pEncryptionType_
    }

-- | The Key ID of the customer managed customer master key (CMK) used for
-- KMS encryption. This is required if you use @KMS_BASED_ENCRYPTION@.
putDefaultEncryptionConfiguration_kmsKeyId :: Lens.Lens' PutDefaultEncryptionConfiguration (Prelude.Maybe Prelude.Text)
putDefaultEncryptionConfiguration_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> PutDefaultEncryptionConfiguration
-> f PutDefaultEncryptionConfiguration
putDefaultEncryptionConfiguration_kmsKeyId = (PutDefaultEncryptionConfiguration -> Maybe Text)
-> (PutDefaultEncryptionConfiguration
    -> Maybe Text -> PutDefaultEncryptionConfiguration)
-> Lens
     PutDefaultEncryptionConfiguration
     PutDefaultEncryptionConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDefaultEncryptionConfiguration' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:PutDefaultEncryptionConfiguration' :: PutDefaultEncryptionConfiguration -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: PutDefaultEncryptionConfiguration
s@PutDefaultEncryptionConfiguration' {} Maybe Text
a -> PutDefaultEncryptionConfiguration
s {$sel:kmsKeyId:PutDefaultEncryptionConfiguration' :: Maybe Text
kmsKeyId = Maybe Text
a} :: PutDefaultEncryptionConfiguration)

-- | The type of encryption used for the encryption configuration.
putDefaultEncryptionConfiguration_encryptionType :: Lens.Lens' PutDefaultEncryptionConfiguration EncryptionType
putDefaultEncryptionConfiguration_encryptionType :: (EncryptionType -> f EncryptionType)
-> PutDefaultEncryptionConfiguration
-> f PutDefaultEncryptionConfiguration
putDefaultEncryptionConfiguration_encryptionType = (PutDefaultEncryptionConfiguration -> EncryptionType)
-> (PutDefaultEncryptionConfiguration
    -> EncryptionType -> PutDefaultEncryptionConfiguration)
-> Lens
     PutDefaultEncryptionConfiguration
     PutDefaultEncryptionConfiguration
     EncryptionType
     EncryptionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDefaultEncryptionConfiguration' {EncryptionType
encryptionType :: EncryptionType
$sel:encryptionType:PutDefaultEncryptionConfiguration' :: PutDefaultEncryptionConfiguration -> EncryptionType
encryptionType} -> EncryptionType
encryptionType) (\s :: PutDefaultEncryptionConfiguration
s@PutDefaultEncryptionConfiguration' {} EncryptionType
a -> PutDefaultEncryptionConfiguration
s {$sel:encryptionType:PutDefaultEncryptionConfiguration' :: EncryptionType
encryptionType = EncryptionType
a} :: PutDefaultEncryptionConfiguration)

instance
  Core.AWSRequest
    PutDefaultEncryptionConfiguration
  where
  type
    AWSResponse PutDefaultEncryptionConfiguration =
      PutDefaultEncryptionConfigurationResponse
  request :: PutDefaultEncryptionConfiguration
-> Request PutDefaultEncryptionConfiguration
request = Service
-> PutDefaultEncryptionConfiguration
-> Request PutDefaultEncryptionConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutDefaultEncryptionConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse PutDefaultEncryptionConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PutDefaultEncryptionConfiguration))
-> Logger
-> Service
-> Proxy PutDefaultEncryptionConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse PutDefaultEncryptionConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Int
-> EncryptionType
-> ConfigurationStatus
-> PutDefaultEncryptionConfigurationResponse
PutDefaultEncryptionConfigurationResponse'
            (Maybe Text
 -> Int
 -> EncryptionType
 -> ConfigurationStatus
 -> PutDefaultEncryptionConfigurationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> EncryptionType
      -> ConfigurationStatus
      -> PutDefaultEncryptionConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"kmsKeyArn")
              Either
  String
  (Int
   -> EncryptionType
   -> ConfigurationStatus
   -> PutDefaultEncryptionConfigurationResponse)
-> Either String Int
-> Either
     String
     (EncryptionType
      -> ConfigurationStatus
      -> PutDefaultEncryptionConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => 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))
              Either
  String
  (EncryptionType
   -> ConfigurationStatus
   -> PutDefaultEncryptionConfigurationResponse)
-> Either String EncryptionType
-> Either
     String
     (ConfigurationStatus -> PutDefaultEncryptionConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String EncryptionType
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"encryptionType")
              Either
  String
  (ConfigurationStatus -> PutDefaultEncryptionConfigurationResponse)
-> Either String ConfigurationStatus
-> Either String PutDefaultEncryptionConfigurationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String ConfigurationStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"configurationStatus")
      )

instance
  Prelude.Hashable
    PutDefaultEncryptionConfiguration

instance
  Prelude.NFData
    PutDefaultEncryptionConfiguration

instance
  Core.ToHeaders
    PutDefaultEncryptionConfiguration
  where
  toHeaders :: PutDefaultEncryptionConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> PutDefaultEncryptionConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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
    PutDefaultEncryptionConfiguration
  where
  toJSON :: PutDefaultEncryptionConfiguration -> Value
toJSON PutDefaultEncryptionConfiguration' {Maybe Text
EncryptionType
encryptionType :: EncryptionType
kmsKeyId :: Maybe Text
$sel:encryptionType:PutDefaultEncryptionConfiguration' :: PutDefaultEncryptionConfiguration -> EncryptionType
$sel:kmsKeyId:PutDefaultEncryptionConfiguration' :: PutDefaultEncryptionConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"kmsKeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
            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)
          ]
      )

instance
  Core.ToPath
    PutDefaultEncryptionConfiguration
  where
  toPath :: PutDefaultEncryptionConfiguration -> ByteString
toPath =
    ByteString -> PutDefaultEncryptionConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/configuration/account/encryption"

instance
  Core.ToQuery
    PutDefaultEncryptionConfiguration
  where
  toQuery :: PutDefaultEncryptionConfiguration -> QueryString
toQuery = QueryString -> PutDefaultEncryptionConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newPutDefaultEncryptionConfigurationResponse' smart constructor.
data PutDefaultEncryptionConfigurationResponse = PutDefaultEncryptionConfigurationResponse'
  { -- | The Key ARN of the KMS CMK used for KMS encryption if you use
    -- @KMS_BASED_ENCRYPTION@.
    PutDefaultEncryptionConfigurationResponse -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    PutDefaultEncryptionConfigurationResponse -> Int
httpStatus :: Prelude.Int,
    -- | The type of encryption used for the encryption configuration.
    PutDefaultEncryptionConfigurationResponse -> EncryptionType
encryptionType :: EncryptionType,
    -- | The status of the account configuration. This contains the
    -- @ConfigurationState@. If there is an error, it also contains the
    -- @ErrorDetails@.
    PutDefaultEncryptionConfigurationResponse -> ConfigurationStatus
configurationStatus :: ConfigurationStatus
  }
  deriving (PutDefaultEncryptionConfigurationResponse
-> PutDefaultEncryptionConfigurationResponse -> Bool
(PutDefaultEncryptionConfigurationResponse
 -> PutDefaultEncryptionConfigurationResponse -> Bool)
-> (PutDefaultEncryptionConfigurationResponse
    -> PutDefaultEncryptionConfigurationResponse -> Bool)
-> Eq PutDefaultEncryptionConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDefaultEncryptionConfigurationResponse
-> PutDefaultEncryptionConfigurationResponse -> Bool
$c/= :: PutDefaultEncryptionConfigurationResponse
-> PutDefaultEncryptionConfigurationResponse -> Bool
== :: PutDefaultEncryptionConfigurationResponse
-> PutDefaultEncryptionConfigurationResponse -> Bool
$c== :: PutDefaultEncryptionConfigurationResponse
-> PutDefaultEncryptionConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [PutDefaultEncryptionConfigurationResponse]
ReadPrec PutDefaultEncryptionConfigurationResponse
Int -> ReadS PutDefaultEncryptionConfigurationResponse
ReadS [PutDefaultEncryptionConfigurationResponse]
(Int -> ReadS PutDefaultEncryptionConfigurationResponse)
-> ReadS [PutDefaultEncryptionConfigurationResponse]
-> ReadPrec PutDefaultEncryptionConfigurationResponse
-> ReadPrec [PutDefaultEncryptionConfigurationResponse]
-> Read PutDefaultEncryptionConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDefaultEncryptionConfigurationResponse]
$creadListPrec :: ReadPrec [PutDefaultEncryptionConfigurationResponse]
readPrec :: ReadPrec PutDefaultEncryptionConfigurationResponse
$creadPrec :: ReadPrec PutDefaultEncryptionConfigurationResponse
readList :: ReadS [PutDefaultEncryptionConfigurationResponse]
$creadList :: ReadS [PutDefaultEncryptionConfigurationResponse]
readsPrec :: Int -> ReadS PutDefaultEncryptionConfigurationResponse
$creadsPrec :: Int -> ReadS PutDefaultEncryptionConfigurationResponse
Prelude.Read, Int -> PutDefaultEncryptionConfigurationResponse -> ShowS
[PutDefaultEncryptionConfigurationResponse] -> ShowS
PutDefaultEncryptionConfigurationResponse -> String
(Int -> PutDefaultEncryptionConfigurationResponse -> ShowS)
-> (PutDefaultEncryptionConfigurationResponse -> String)
-> ([PutDefaultEncryptionConfigurationResponse] -> ShowS)
-> Show PutDefaultEncryptionConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDefaultEncryptionConfigurationResponse] -> ShowS
$cshowList :: [PutDefaultEncryptionConfigurationResponse] -> ShowS
show :: PutDefaultEncryptionConfigurationResponse -> String
$cshow :: PutDefaultEncryptionConfigurationResponse -> String
showsPrec :: Int -> PutDefaultEncryptionConfigurationResponse -> ShowS
$cshowsPrec :: Int -> PutDefaultEncryptionConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 PutDefaultEncryptionConfigurationResponse
 -> Rep PutDefaultEncryptionConfigurationResponse x)
-> (forall x.
    Rep PutDefaultEncryptionConfigurationResponse x
    -> PutDefaultEncryptionConfigurationResponse)
-> Generic PutDefaultEncryptionConfigurationResponse
forall x.
Rep PutDefaultEncryptionConfigurationResponse x
-> PutDefaultEncryptionConfigurationResponse
forall x.
PutDefaultEncryptionConfigurationResponse
-> Rep PutDefaultEncryptionConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutDefaultEncryptionConfigurationResponse x
-> PutDefaultEncryptionConfigurationResponse
$cfrom :: forall x.
PutDefaultEncryptionConfigurationResponse
-> Rep PutDefaultEncryptionConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutDefaultEncryptionConfigurationResponse' 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:
--
-- 'kmsKeyArn', 'putDefaultEncryptionConfigurationResponse_kmsKeyArn' - The Key ARN of the KMS CMK used for KMS encryption if you use
-- @KMS_BASED_ENCRYPTION@.
--
-- 'httpStatus', 'putDefaultEncryptionConfigurationResponse_httpStatus' - The response's http status code.
--
-- 'encryptionType', 'putDefaultEncryptionConfigurationResponse_encryptionType' - The type of encryption used for the encryption configuration.
--
-- 'configurationStatus', 'putDefaultEncryptionConfigurationResponse_configurationStatus' - The status of the account configuration. This contains the
-- @ConfigurationState@. If there is an error, it also contains the
-- @ErrorDetails@.
newPutDefaultEncryptionConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'encryptionType'
  EncryptionType ->
  -- | 'configurationStatus'
  ConfigurationStatus ->
  PutDefaultEncryptionConfigurationResponse
newPutDefaultEncryptionConfigurationResponse :: Int
-> EncryptionType
-> ConfigurationStatus
-> PutDefaultEncryptionConfigurationResponse
newPutDefaultEncryptionConfigurationResponse
  Int
pHttpStatus_
  EncryptionType
pEncryptionType_
  ConfigurationStatus
pConfigurationStatus_ =
    PutDefaultEncryptionConfigurationResponse' :: Maybe Text
-> Int
-> EncryptionType
-> ConfigurationStatus
-> PutDefaultEncryptionConfigurationResponse
PutDefaultEncryptionConfigurationResponse'
      { $sel:kmsKeyArn:PutDefaultEncryptionConfigurationResponse' :: Maybe Text
kmsKeyArn =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:PutDefaultEncryptionConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:encryptionType:PutDefaultEncryptionConfigurationResponse' :: EncryptionType
encryptionType =
          EncryptionType
pEncryptionType_,
        $sel:configurationStatus:PutDefaultEncryptionConfigurationResponse' :: ConfigurationStatus
configurationStatus =
          ConfigurationStatus
pConfigurationStatus_
      }

-- | The Key ARN of the KMS CMK used for KMS encryption if you use
-- @KMS_BASED_ENCRYPTION@.
putDefaultEncryptionConfigurationResponse_kmsKeyArn :: Lens.Lens' PutDefaultEncryptionConfigurationResponse (Prelude.Maybe Prelude.Text)
putDefaultEncryptionConfigurationResponse_kmsKeyArn :: (Maybe Text -> f (Maybe Text))
-> PutDefaultEncryptionConfigurationResponse
-> f PutDefaultEncryptionConfigurationResponse
putDefaultEncryptionConfigurationResponse_kmsKeyArn = (PutDefaultEncryptionConfigurationResponse -> Maybe Text)
-> (PutDefaultEncryptionConfigurationResponse
    -> Maybe Text -> PutDefaultEncryptionConfigurationResponse)
-> Lens
     PutDefaultEncryptionConfigurationResponse
     PutDefaultEncryptionConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDefaultEncryptionConfigurationResponse' {Maybe Text
kmsKeyArn :: Maybe Text
$sel:kmsKeyArn:PutDefaultEncryptionConfigurationResponse' :: PutDefaultEncryptionConfigurationResponse -> Maybe Text
kmsKeyArn} -> Maybe Text
kmsKeyArn) (\s :: PutDefaultEncryptionConfigurationResponse
s@PutDefaultEncryptionConfigurationResponse' {} Maybe Text
a -> PutDefaultEncryptionConfigurationResponse
s {$sel:kmsKeyArn:PutDefaultEncryptionConfigurationResponse' :: Maybe Text
kmsKeyArn = Maybe Text
a} :: PutDefaultEncryptionConfigurationResponse)

-- | The response's http status code.
putDefaultEncryptionConfigurationResponse_httpStatus :: Lens.Lens' PutDefaultEncryptionConfigurationResponse Prelude.Int
putDefaultEncryptionConfigurationResponse_httpStatus :: (Int -> f Int)
-> PutDefaultEncryptionConfigurationResponse
-> f PutDefaultEncryptionConfigurationResponse
putDefaultEncryptionConfigurationResponse_httpStatus = (PutDefaultEncryptionConfigurationResponse -> Int)
-> (PutDefaultEncryptionConfigurationResponse
    -> Int -> PutDefaultEncryptionConfigurationResponse)
-> Lens
     PutDefaultEncryptionConfigurationResponse
     PutDefaultEncryptionConfigurationResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDefaultEncryptionConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutDefaultEncryptionConfigurationResponse' :: PutDefaultEncryptionConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutDefaultEncryptionConfigurationResponse
s@PutDefaultEncryptionConfigurationResponse' {} Int
a -> PutDefaultEncryptionConfigurationResponse
s {$sel:httpStatus:PutDefaultEncryptionConfigurationResponse' :: Int
httpStatus = Int
a} :: PutDefaultEncryptionConfigurationResponse)

-- | The type of encryption used for the encryption configuration.
putDefaultEncryptionConfigurationResponse_encryptionType :: Lens.Lens' PutDefaultEncryptionConfigurationResponse EncryptionType
putDefaultEncryptionConfigurationResponse_encryptionType :: (EncryptionType -> f EncryptionType)
-> PutDefaultEncryptionConfigurationResponse
-> f PutDefaultEncryptionConfigurationResponse
putDefaultEncryptionConfigurationResponse_encryptionType = (PutDefaultEncryptionConfigurationResponse -> EncryptionType)
-> (PutDefaultEncryptionConfigurationResponse
    -> EncryptionType -> PutDefaultEncryptionConfigurationResponse)
-> Lens
     PutDefaultEncryptionConfigurationResponse
     PutDefaultEncryptionConfigurationResponse
     EncryptionType
     EncryptionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDefaultEncryptionConfigurationResponse' {EncryptionType
encryptionType :: EncryptionType
$sel:encryptionType:PutDefaultEncryptionConfigurationResponse' :: PutDefaultEncryptionConfigurationResponse -> EncryptionType
encryptionType} -> EncryptionType
encryptionType) (\s :: PutDefaultEncryptionConfigurationResponse
s@PutDefaultEncryptionConfigurationResponse' {} EncryptionType
a -> PutDefaultEncryptionConfigurationResponse
s {$sel:encryptionType:PutDefaultEncryptionConfigurationResponse' :: EncryptionType
encryptionType = EncryptionType
a} :: PutDefaultEncryptionConfigurationResponse)

-- | The status of the account configuration. This contains the
-- @ConfigurationState@. If there is an error, it also contains the
-- @ErrorDetails@.
putDefaultEncryptionConfigurationResponse_configurationStatus :: Lens.Lens' PutDefaultEncryptionConfigurationResponse ConfigurationStatus
putDefaultEncryptionConfigurationResponse_configurationStatus :: (ConfigurationStatus -> f ConfigurationStatus)
-> PutDefaultEncryptionConfigurationResponse
-> f PutDefaultEncryptionConfigurationResponse
putDefaultEncryptionConfigurationResponse_configurationStatus = (PutDefaultEncryptionConfigurationResponse -> ConfigurationStatus)
-> (PutDefaultEncryptionConfigurationResponse
    -> ConfigurationStatus
    -> PutDefaultEncryptionConfigurationResponse)
-> Lens
     PutDefaultEncryptionConfigurationResponse
     PutDefaultEncryptionConfigurationResponse
     ConfigurationStatus
     ConfigurationStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDefaultEncryptionConfigurationResponse' {ConfigurationStatus
configurationStatus :: ConfigurationStatus
$sel:configurationStatus:PutDefaultEncryptionConfigurationResponse' :: PutDefaultEncryptionConfigurationResponse -> ConfigurationStatus
configurationStatus} -> ConfigurationStatus
configurationStatus) (\s :: PutDefaultEncryptionConfigurationResponse
s@PutDefaultEncryptionConfigurationResponse' {} ConfigurationStatus
a -> PutDefaultEncryptionConfigurationResponse
s {$sel:configurationStatus:PutDefaultEncryptionConfigurationResponse' :: ConfigurationStatus
configurationStatus = ConfigurationStatus
a} :: PutDefaultEncryptionConfigurationResponse)

instance
  Prelude.NFData
    PutDefaultEncryptionConfigurationResponse