{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.SecurityLake.Types.LakeConfigurationRequest
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SecurityLake.Types.LakeConfigurationRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityLake.Types.Region
import Amazonka.SecurityLake.Types.RetentionSetting

-- | Provides details of Amazon Security Lake configuration object.
--
-- /See:/ 'newLakeConfigurationRequest' smart constructor.
data LakeConfigurationRequest = LakeConfigurationRequest'
  { -- | The type of encryption key used by Amazon Security Lake to encrypt the
    -- Security Lake configuration object.
    LakeConfigurationRequest -> Maybe Text
encryptionKey :: Prelude.Maybe Prelude.Text,
    -- | Replication enables automatic, asynchronous copying of objects across
    -- Amazon S3 buckets. Amazon S3 buckets that are configured for object
    -- replication can be owned by the same Amazon Web Services account or by
    -- different accounts. You can replicate objects to a single destination
    -- bucket or to multiple destination buckets. The destination buckets can
    -- be in different Amazon Web Services Regions or within the same Region as
    -- the source bucket.
    --
    -- Set up one or more rollup Regions by providing the Region or Regions
    -- that should contribute to the central rollup Region.
    LakeConfigurationRequest -> Maybe [Region]
replicationDestinationRegions :: Prelude.Maybe [Region],
    -- | Replication settings for the Amazon S3 buckets. This parameter uses the
    -- Identity and Access Management (IAM) role you created that is managed by
    -- Security Lake, to ensure the replication setting is correct.
    LakeConfigurationRequest -> Maybe Text
replicationRoleArn :: Prelude.Maybe Prelude.Text,
    -- | Retention settings for the destination Amazon S3 buckets.
    LakeConfigurationRequest -> Maybe [RetentionSetting]
retentionSettings :: Prelude.Maybe [RetentionSetting],
    -- | A tag is a label that you assign to an Amazon Web Services resource.
    -- Each tag consists of a key and an optional value, both of which you
    -- define.
    LakeConfigurationRequest -> Maybe (HashMap Text Text)
tagsMap :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (LakeConfigurationRequest -> LakeConfigurationRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LakeConfigurationRequest -> LakeConfigurationRequest -> Bool
$c/= :: LakeConfigurationRequest -> LakeConfigurationRequest -> Bool
== :: LakeConfigurationRequest -> LakeConfigurationRequest -> Bool
$c== :: LakeConfigurationRequest -> LakeConfigurationRequest -> Bool
Prelude.Eq, ReadPrec [LakeConfigurationRequest]
ReadPrec LakeConfigurationRequest
Int -> ReadS LakeConfigurationRequest
ReadS [LakeConfigurationRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LakeConfigurationRequest]
$creadListPrec :: ReadPrec [LakeConfigurationRequest]
readPrec :: ReadPrec LakeConfigurationRequest
$creadPrec :: ReadPrec LakeConfigurationRequest
readList :: ReadS [LakeConfigurationRequest]
$creadList :: ReadS [LakeConfigurationRequest]
readsPrec :: Int -> ReadS LakeConfigurationRequest
$creadsPrec :: Int -> ReadS LakeConfigurationRequest
Prelude.Read, Int -> LakeConfigurationRequest -> ShowS
[LakeConfigurationRequest] -> ShowS
LakeConfigurationRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LakeConfigurationRequest] -> ShowS
$cshowList :: [LakeConfigurationRequest] -> ShowS
show :: LakeConfigurationRequest -> String
$cshow :: LakeConfigurationRequest -> String
showsPrec :: Int -> LakeConfigurationRequest -> ShowS
$cshowsPrec :: Int -> LakeConfigurationRequest -> ShowS
Prelude.Show, forall x.
Rep LakeConfigurationRequest x -> LakeConfigurationRequest
forall x.
LakeConfigurationRequest -> Rep LakeConfigurationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LakeConfigurationRequest x -> LakeConfigurationRequest
$cfrom :: forall x.
LakeConfigurationRequest -> Rep LakeConfigurationRequest x
Prelude.Generic)

-- |
-- Create a value of 'LakeConfigurationRequest' 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:
--
-- 'encryptionKey', 'lakeConfigurationRequest_encryptionKey' - The type of encryption key used by Amazon Security Lake to encrypt the
-- Security Lake configuration object.
--
-- 'replicationDestinationRegions', 'lakeConfigurationRequest_replicationDestinationRegions' - Replication enables automatic, asynchronous copying of objects across
-- Amazon S3 buckets. Amazon S3 buckets that are configured for object
-- replication can be owned by the same Amazon Web Services account or by
-- different accounts. You can replicate objects to a single destination
-- bucket or to multiple destination buckets. The destination buckets can
-- be in different Amazon Web Services Regions or within the same Region as
-- the source bucket.
--
-- Set up one or more rollup Regions by providing the Region or Regions
-- that should contribute to the central rollup Region.
--
-- 'replicationRoleArn', 'lakeConfigurationRequest_replicationRoleArn' - Replication settings for the Amazon S3 buckets. This parameter uses the
-- Identity and Access Management (IAM) role you created that is managed by
-- Security Lake, to ensure the replication setting is correct.
--
-- 'retentionSettings', 'lakeConfigurationRequest_retentionSettings' - Retention settings for the destination Amazon S3 buckets.
--
-- 'tagsMap', 'lakeConfigurationRequest_tagsMap' - A tag is a label that you assign to an Amazon Web Services resource.
-- Each tag consists of a key and an optional value, both of which you
-- define.
newLakeConfigurationRequest ::
  LakeConfigurationRequest
newLakeConfigurationRequest :: LakeConfigurationRequest
newLakeConfigurationRequest =
  LakeConfigurationRequest'
    { $sel:encryptionKey:LakeConfigurationRequest' :: Maybe Text
encryptionKey =
        forall a. Maybe a
Prelude.Nothing,
      $sel:replicationDestinationRegions:LakeConfigurationRequest' :: Maybe [Region]
replicationDestinationRegions = forall a. Maybe a
Prelude.Nothing,
      $sel:replicationRoleArn:LakeConfigurationRequest' :: Maybe Text
replicationRoleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:retentionSettings:LakeConfigurationRequest' :: Maybe [RetentionSetting]
retentionSettings = forall a. Maybe a
Prelude.Nothing,
      $sel:tagsMap:LakeConfigurationRequest' :: Maybe (HashMap Text Text)
tagsMap = forall a. Maybe a
Prelude.Nothing
    }

-- | The type of encryption key used by Amazon Security Lake to encrypt the
-- Security Lake configuration object.
lakeConfigurationRequest_encryptionKey :: Lens.Lens' LakeConfigurationRequest (Prelude.Maybe Prelude.Text)
lakeConfigurationRequest_encryptionKey :: Lens' LakeConfigurationRequest (Maybe Text)
lakeConfigurationRequest_encryptionKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LakeConfigurationRequest' {Maybe Text
encryptionKey :: Maybe Text
$sel:encryptionKey:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe Text
encryptionKey} -> Maybe Text
encryptionKey) (\s :: LakeConfigurationRequest
s@LakeConfigurationRequest' {} Maybe Text
a -> LakeConfigurationRequest
s {$sel:encryptionKey:LakeConfigurationRequest' :: Maybe Text
encryptionKey = Maybe Text
a} :: LakeConfigurationRequest)

-- | Replication enables automatic, asynchronous copying of objects across
-- Amazon S3 buckets. Amazon S3 buckets that are configured for object
-- replication can be owned by the same Amazon Web Services account or by
-- different accounts. You can replicate objects to a single destination
-- bucket or to multiple destination buckets. The destination buckets can
-- be in different Amazon Web Services Regions or within the same Region as
-- the source bucket.
--
-- Set up one or more rollup Regions by providing the Region or Regions
-- that should contribute to the central rollup Region.
lakeConfigurationRequest_replicationDestinationRegions :: Lens.Lens' LakeConfigurationRequest (Prelude.Maybe [Region])
lakeConfigurationRequest_replicationDestinationRegions :: Lens' LakeConfigurationRequest (Maybe [Region])
lakeConfigurationRequest_replicationDestinationRegions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LakeConfigurationRequest' {Maybe [Region]
replicationDestinationRegions :: Maybe [Region]
$sel:replicationDestinationRegions:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe [Region]
replicationDestinationRegions} -> Maybe [Region]
replicationDestinationRegions) (\s :: LakeConfigurationRequest
s@LakeConfigurationRequest' {} Maybe [Region]
a -> LakeConfigurationRequest
s {$sel:replicationDestinationRegions:LakeConfigurationRequest' :: Maybe [Region]
replicationDestinationRegions = Maybe [Region]
a} :: LakeConfigurationRequest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Replication settings for the Amazon S3 buckets. This parameter uses the
-- Identity and Access Management (IAM) role you created that is managed by
-- Security Lake, to ensure the replication setting is correct.
lakeConfigurationRequest_replicationRoleArn :: Lens.Lens' LakeConfigurationRequest (Prelude.Maybe Prelude.Text)
lakeConfigurationRequest_replicationRoleArn :: Lens' LakeConfigurationRequest (Maybe Text)
lakeConfigurationRequest_replicationRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LakeConfigurationRequest' {Maybe Text
replicationRoleArn :: Maybe Text
$sel:replicationRoleArn:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe Text
replicationRoleArn} -> Maybe Text
replicationRoleArn) (\s :: LakeConfigurationRequest
s@LakeConfigurationRequest' {} Maybe Text
a -> LakeConfigurationRequest
s {$sel:replicationRoleArn:LakeConfigurationRequest' :: Maybe Text
replicationRoleArn = Maybe Text
a} :: LakeConfigurationRequest)

-- | Retention settings for the destination Amazon S3 buckets.
lakeConfigurationRequest_retentionSettings :: Lens.Lens' LakeConfigurationRequest (Prelude.Maybe [RetentionSetting])
lakeConfigurationRequest_retentionSettings :: Lens' LakeConfigurationRequest (Maybe [RetentionSetting])
lakeConfigurationRequest_retentionSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LakeConfigurationRequest' {Maybe [RetentionSetting]
retentionSettings :: Maybe [RetentionSetting]
$sel:retentionSettings:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe [RetentionSetting]
retentionSettings} -> Maybe [RetentionSetting]
retentionSettings) (\s :: LakeConfigurationRequest
s@LakeConfigurationRequest' {} Maybe [RetentionSetting]
a -> LakeConfigurationRequest
s {$sel:retentionSettings:LakeConfigurationRequest' :: Maybe [RetentionSetting]
retentionSettings = Maybe [RetentionSetting]
a} :: LakeConfigurationRequest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A tag is a label that you assign to an Amazon Web Services resource.
-- Each tag consists of a key and an optional value, both of which you
-- define.
lakeConfigurationRequest_tagsMap :: Lens.Lens' LakeConfigurationRequest (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
lakeConfigurationRequest_tagsMap :: Lens' LakeConfigurationRequest (Maybe (HashMap Text Text))
lakeConfigurationRequest_tagsMap = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LakeConfigurationRequest' {Maybe (HashMap Text Text)
tagsMap :: Maybe (HashMap Text Text)
$sel:tagsMap:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe (HashMap Text Text)
tagsMap} -> Maybe (HashMap Text Text)
tagsMap) (\s :: LakeConfigurationRequest
s@LakeConfigurationRequest' {} Maybe (HashMap Text Text)
a -> LakeConfigurationRequest
s {$sel:tagsMap:LakeConfigurationRequest' :: Maybe (HashMap Text Text)
tagsMap = Maybe (HashMap Text Text)
a} :: LakeConfigurationRequest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.Hashable LakeConfigurationRequest where
  hashWithSalt :: Int -> LakeConfigurationRequest -> Int
hashWithSalt Int
_salt LakeConfigurationRequest' {Maybe [Region]
Maybe [RetentionSetting]
Maybe Text
Maybe (HashMap Text Text)
tagsMap :: Maybe (HashMap Text Text)
retentionSettings :: Maybe [RetentionSetting]
replicationRoleArn :: Maybe Text
replicationDestinationRegions :: Maybe [Region]
encryptionKey :: Maybe Text
$sel:tagsMap:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe (HashMap Text Text)
$sel:retentionSettings:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe [RetentionSetting]
$sel:replicationRoleArn:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe Text
$sel:replicationDestinationRegions:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe [Region]
$sel:encryptionKey:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
encryptionKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Region]
replicationDestinationRegions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
replicationRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RetentionSetting]
retentionSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tagsMap

instance Prelude.NFData LakeConfigurationRequest where
  rnf :: LakeConfigurationRequest -> ()
rnf LakeConfigurationRequest' {Maybe [Region]
Maybe [RetentionSetting]
Maybe Text
Maybe (HashMap Text Text)
tagsMap :: Maybe (HashMap Text Text)
retentionSettings :: Maybe [RetentionSetting]
replicationRoleArn :: Maybe Text
replicationDestinationRegions :: Maybe [Region]
encryptionKey :: Maybe Text
$sel:tagsMap:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe (HashMap Text Text)
$sel:retentionSettings:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe [RetentionSetting]
$sel:replicationRoleArn:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe Text
$sel:replicationDestinationRegions:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe [Region]
$sel:encryptionKey:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
encryptionKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Region]
replicationDestinationRegions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
replicationRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RetentionSetting]
retentionSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tagsMap

instance Data.ToJSON LakeConfigurationRequest where
  toJSON :: LakeConfigurationRequest -> Value
toJSON LakeConfigurationRequest' {Maybe [Region]
Maybe [RetentionSetting]
Maybe Text
Maybe (HashMap Text Text)
tagsMap :: Maybe (HashMap Text Text)
retentionSettings :: Maybe [RetentionSetting]
replicationRoleArn :: Maybe Text
replicationDestinationRegions :: Maybe [Region]
encryptionKey :: Maybe Text
$sel:tagsMap:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe (HashMap Text Text)
$sel:retentionSettings:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe [RetentionSetting]
$sel:replicationRoleArn:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe Text
$sel:replicationDestinationRegions:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe [Region]
$sel:encryptionKey:LakeConfigurationRequest' :: LakeConfigurationRequest -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"encryptionKey" 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
encryptionKey,
            (Key
"replicationDestinationRegions" 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 [Region]
replicationDestinationRegions,
            (Key
"replicationRoleArn" 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
replicationRoleArn,
            (Key
"retentionSettings" 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 [RetentionSetting]
retentionSettings,
            (Key
"tagsMap" 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 (HashMap Text Text)
tagsMap
          ]
      )