{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTSiteWise.Types
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 key 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
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]
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
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.
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 key 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'
    { $sel:kmsKeyId:PutDefaultEncryptionConfiguration' :: Maybe Text
kmsKeyId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionType:PutDefaultEncryptionConfiguration' :: EncryptionType
encryptionType = EncryptionType
pEncryptionType_
    }

-- | The Key ID of the customer managed key used for KMS encryption. This is
-- required if you use @KMS_BASED_ENCRYPTION@.
putDefaultEncryptionConfiguration_kmsKeyId :: Lens.Lens' PutDefaultEncryptionConfiguration (Prelude.Maybe Prelude.Text)
putDefaultEncryptionConfiguration_kmsKeyId :: Lens' PutDefaultEncryptionConfiguration (Maybe Text)
putDefaultEncryptionConfiguration_kmsKeyId = 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 :: Lens' PutDefaultEncryptionConfiguration EncryptionType
putDefaultEncryptionConfiguration_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 :: (Service -> Service)
-> PutDefaultEncryptionConfiguration
-> Request PutDefaultEncryptionConfiguration
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 PutDefaultEncryptionConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse PutDefaultEncryptionConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"kmsKeyArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"encryptionType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"configurationStatus")
      )

instance
  Prelude.Hashable
    PutDefaultEncryptionConfiguration
  where
  hashWithSalt :: Int -> PutDefaultEncryptionConfiguration -> Int
hashWithSalt
    Int
_salt
    PutDefaultEncryptionConfiguration' {Maybe Text
EncryptionType
encryptionType :: EncryptionType
kmsKeyId :: Maybe Text
$sel:encryptionType:PutDefaultEncryptionConfiguration' :: PutDefaultEncryptionConfiguration -> EncryptionType
$sel:kmsKeyId:PutDefaultEncryptionConfiguration' :: PutDefaultEncryptionConfiguration -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EncryptionType
encryptionType

instance
  Prelude.NFData
    PutDefaultEncryptionConfiguration
  where
  rnf :: PutDefaultEncryptionConfiguration -> ()
rnf PutDefaultEncryptionConfiguration' {Maybe Text
EncryptionType
encryptionType :: EncryptionType
kmsKeyId :: Maybe Text
$sel:encryptionType:PutDefaultEncryptionConfiguration' :: PutDefaultEncryptionConfiguration -> EncryptionType
$sel:kmsKeyId:PutDefaultEncryptionConfiguration' :: PutDefaultEncryptionConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EncryptionType
encryptionType

instance
  Data.ToHeaders
    PutDefaultEncryptionConfiguration
  where
  toHeaders :: PutDefaultEncryptionConfiguration -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"kmsKeyId" 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
kmsKeyId,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"encryptionType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= EncryptionType
encryptionType)
          ]
      )

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

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

-- | /See:/ 'newPutDefaultEncryptionConfigurationResponse' smart constructor.
data PutDefaultEncryptionConfigurationResponse = PutDefaultEncryptionConfigurationResponse'
  { -- | The Key ARN of the KMS key 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
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]
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
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.
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 key 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'
      { $sel:kmsKeyArn:PutDefaultEncryptionConfigurationResponse' :: Maybe Text
kmsKeyArn =
          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 key used for KMS encryption if you use
-- @KMS_BASED_ENCRYPTION@.
putDefaultEncryptionConfigurationResponse_kmsKeyArn :: Lens.Lens' PutDefaultEncryptionConfigurationResponse (Prelude.Maybe Prelude.Text)
putDefaultEncryptionConfigurationResponse_kmsKeyArn :: Lens' PutDefaultEncryptionConfigurationResponse (Maybe Text)
putDefaultEncryptionConfigurationResponse_kmsKeyArn = 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 :: Lens' PutDefaultEncryptionConfigurationResponse Int
putDefaultEncryptionConfigurationResponse_httpStatus = 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 :: Lens' PutDefaultEncryptionConfigurationResponse EncryptionType
putDefaultEncryptionConfigurationResponse_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 :: Lens' PutDefaultEncryptionConfigurationResponse ConfigurationStatus
putDefaultEncryptionConfigurationResponse_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
  where
  rnf :: PutDefaultEncryptionConfigurationResponse -> ()
rnf PutDefaultEncryptionConfigurationResponse' {Int
Maybe Text
EncryptionType
ConfigurationStatus
configurationStatus :: ConfigurationStatus
encryptionType :: EncryptionType
httpStatus :: Int
kmsKeyArn :: Maybe Text
$sel:configurationStatus:PutDefaultEncryptionConfigurationResponse' :: PutDefaultEncryptionConfigurationResponse -> ConfigurationStatus
$sel:encryptionType:PutDefaultEncryptionConfigurationResponse' :: PutDefaultEncryptionConfigurationResponse -> EncryptionType
$sel:httpStatus:PutDefaultEncryptionConfigurationResponse' :: PutDefaultEncryptionConfigurationResponse -> Int
$sel:kmsKeyArn:PutDefaultEncryptionConfigurationResponse' :: PutDefaultEncryptionConfigurationResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      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 ConfigurationStatus
configurationStatus