{-# 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.CloudTrail.CreateEventDataStore
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a new event data store.
module Amazonka.CloudTrail.CreateEventDataStore
  ( -- * Creating a Request
    CreateEventDataStore (..),
    newCreateEventDataStore,

    -- * Request Lenses
    createEventDataStore_advancedEventSelectors,
    createEventDataStore_kmsKeyId,
    createEventDataStore_multiRegionEnabled,
    createEventDataStore_organizationEnabled,
    createEventDataStore_retentionPeriod,
    createEventDataStore_tagsList,
    createEventDataStore_terminationProtectionEnabled,
    createEventDataStore_name,

    -- * Destructuring the Response
    CreateEventDataStoreResponse (..),
    newCreateEventDataStoreResponse,

    -- * Response Lenses
    createEventDataStoreResponse_advancedEventSelectors,
    createEventDataStoreResponse_createdTimestamp,
    createEventDataStoreResponse_eventDataStoreArn,
    createEventDataStoreResponse_kmsKeyId,
    createEventDataStoreResponse_multiRegionEnabled,
    createEventDataStoreResponse_name,
    createEventDataStoreResponse_organizationEnabled,
    createEventDataStoreResponse_retentionPeriod,
    createEventDataStoreResponse_status,
    createEventDataStoreResponse_tagsList,
    createEventDataStoreResponse_terminationProtectionEnabled,
    createEventDataStoreResponse_updatedTimestamp,
    createEventDataStoreResponse_httpStatus,
  )
where

import Amazonka.CloudTrail.Types
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateEventDataStore' smart constructor.
data CreateEventDataStore = CreateEventDataStore'
  { -- | The advanced event selectors to use to select the events for the data
    -- store. For more information about how to use advanced event selectors,
    -- see
    -- <https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#creating-data-event-selectors-advanced Log events by using advanced event selectors>
    -- in the CloudTrail User Guide.
    CreateEventDataStore -> Maybe [AdvancedEventSelector]
advancedEventSelectors :: Prelude.Maybe [AdvancedEventSelector],
    -- | Specifies the KMS key ID to use to encrypt the events delivered by
    -- CloudTrail. The value can be an alias name prefixed by @alias\/@, a
    -- fully specified ARN to an alias, a fully specified ARN to a key, or a
    -- globally unique identifier.
    --
    -- Disabling or deleting the KMS key, or removing CloudTrail permissions on
    -- the key, prevents CloudTrail from logging events to the event data
    -- store, and prevents users from querying the data in the event data store
    -- that was encrypted with the key. After you associate an event data store
    -- with a KMS key, the KMS key cannot be removed or changed. Before you
    -- disable or delete a KMS key that you are using with an event data store,
    -- delete or back up your event data store.
    --
    -- CloudTrail also supports KMS multi-Region keys. For more information
    -- about multi-Region keys, see
    -- <https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html Using multi-Region keys>
    -- in the /Key Management Service Developer Guide/.
    --
    -- Examples:
    --
    -- -   @alias\/MyAliasName@
    --
    -- -   @arn:aws:kms:us-east-2:123456789012:alias\/MyAliasName@
    --
    -- -   @arn:aws:kms:us-east-2:123456789012:key\/12345678-1234-1234-1234-123456789012@
    --
    -- -   @12345678-1234-1234-1234-123456789012@
    CreateEventDataStore -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the event data store includes events from all regions,
    -- or only from the region in which the event data store is created.
    CreateEventDataStore -> Maybe Bool
multiRegionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether an event data store collects events logged for an
    -- organization in Organizations.
    CreateEventDataStore -> Maybe Bool
organizationEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The retention period of the event data store, in days. You can set a
    -- retention period of up to 2557 days, the equivalent of seven years.
    CreateEventDataStore -> Maybe Natural
retentionPeriod :: Prelude.Maybe Prelude.Natural,
    CreateEventDataStore -> Maybe [Tag]
tagsList :: Prelude.Maybe [Tag],
    -- | Specifies whether termination protection is enabled for the event data
    -- store. If termination protection is enabled, you cannot delete the event
    -- data store until termination protection is disabled.
    CreateEventDataStore -> Maybe Bool
terminationProtectionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The name of the event data store.
    CreateEventDataStore -> Text
name :: Prelude.Text
  }
  deriving (CreateEventDataStore -> CreateEventDataStore -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEventDataStore -> CreateEventDataStore -> Bool
$c/= :: CreateEventDataStore -> CreateEventDataStore -> Bool
== :: CreateEventDataStore -> CreateEventDataStore -> Bool
$c== :: CreateEventDataStore -> CreateEventDataStore -> Bool
Prelude.Eq, ReadPrec [CreateEventDataStore]
ReadPrec CreateEventDataStore
Int -> ReadS CreateEventDataStore
ReadS [CreateEventDataStore]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEventDataStore]
$creadListPrec :: ReadPrec [CreateEventDataStore]
readPrec :: ReadPrec CreateEventDataStore
$creadPrec :: ReadPrec CreateEventDataStore
readList :: ReadS [CreateEventDataStore]
$creadList :: ReadS [CreateEventDataStore]
readsPrec :: Int -> ReadS CreateEventDataStore
$creadsPrec :: Int -> ReadS CreateEventDataStore
Prelude.Read, Int -> CreateEventDataStore -> ShowS
[CreateEventDataStore] -> ShowS
CreateEventDataStore -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEventDataStore] -> ShowS
$cshowList :: [CreateEventDataStore] -> ShowS
show :: CreateEventDataStore -> String
$cshow :: CreateEventDataStore -> String
showsPrec :: Int -> CreateEventDataStore -> ShowS
$cshowsPrec :: Int -> CreateEventDataStore -> ShowS
Prelude.Show, forall x. Rep CreateEventDataStore x -> CreateEventDataStore
forall x. CreateEventDataStore -> Rep CreateEventDataStore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateEventDataStore x -> CreateEventDataStore
$cfrom :: forall x. CreateEventDataStore -> Rep CreateEventDataStore x
Prelude.Generic)

-- |
-- Create a value of 'CreateEventDataStore' 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:
--
-- 'advancedEventSelectors', 'createEventDataStore_advancedEventSelectors' - The advanced event selectors to use to select the events for the data
-- store. For more information about how to use advanced event selectors,
-- see
-- <https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#creating-data-event-selectors-advanced Log events by using advanced event selectors>
-- in the CloudTrail User Guide.
--
-- 'kmsKeyId', 'createEventDataStore_kmsKeyId' - Specifies the KMS key ID to use to encrypt the events delivered by
-- CloudTrail. The value can be an alias name prefixed by @alias\/@, a
-- fully specified ARN to an alias, a fully specified ARN to a key, or a
-- globally unique identifier.
--
-- Disabling or deleting the KMS key, or removing CloudTrail permissions on
-- the key, prevents CloudTrail from logging events to the event data
-- store, and prevents users from querying the data in the event data store
-- that was encrypted with the key. After you associate an event data store
-- with a KMS key, the KMS key cannot be removed or changed. Before you
-- disable or delete a KMS key that you are using with an event data store,
-- delete or back up your event data store.
--
-- CloudTrail also supports KMS multi-Region keys. For more information
-- about multi-Region keys, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html Using multi-Region keys>
-- in the /Key Management Service Developer Guide/.
--
-- Examples:
--
-- -   @alias\/MyAliasName@
--
-- -   @arn:aws:kms:us-east-2:123456789012:alias\/MyAliasName@
--
-- -   @arn:aws:kms:us-east-2:123456789012:key\/12345678-1234-1234-1234-123456789012@
--
-- -   @12345678-1234-1234-1234-123456789012@
--
-- 'multiRegionEnabled', 'createEventDataStore_multiRegionEnabled' - Specifies whether the event data store includes events from all regions,
-- or only from the region in which the event data store is created.
--
-- 'organizationEnabled', 'createEventDataStore_organizationEnabled' - Specifies whether an event data store collects events logged for an
-- organization in Organizations.
--
-- 'retentionPeriod', 'createEventDataStore_retentionPeriod' - The retention period of the event data store, in days. You can set a
-- retention period of up to 2557 days, the equivalent of seven years.
--
-- 'tagsList', 'createEventDataStore_tagsList' - Undocumented member.
--
-- 'terminationProtectionEnabled', 'createEventDataStore_terminationProtectionEnabled' - Specifies whether termination protection is enabled for the event data
-- store. If termination protection is enabled, you cannot delete the event
-- data store until termination protection is disabled.
--
-- 'name', 'createEventDataStore_name' - The name of the event data store.
newCreateEventDataStore ::
  -- | 'name'
  Prelude.Text ->
  CreateEventDataStore
newCreateEventDataStore :: Text -> CreateEventDataStore
newCreateEventDataStore Text
pName_ =
  CreateEventDataStore'
    { $sel:advancedEventSelectors:CreateEventDataStore' :: Maybe [AdvancedEventSelector]
advancedEventSelectors =
        forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:CreateEventDataStore' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
      $sel:multiRegionEnabled:CreateEventDataStore' :: Maybe Bool
multiRegionEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:organizationEnabled:CreateEventDataStore' :: Maybe Bool
organizationEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:retentionPeriod:CreateEventDataStore' :: Maybe Natural
retentionPeriod = forall a. Maybe a
Prelude.Nothing,
      $sel:tagsList:CreateEventDataStore' :: Maybe [Tag]
tagsList = forall a. Maybe a
Prelude.Nothing,
      $sel:terminationProtectionEnabled:CreateEventDataStore' :: Maybe Bool
terminationProtectionEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateEventDataStore' :: Text
name = Text
pName_
    }

-- | The advanced event selectors to use to select the events for the data
-- store. For more information about how to use advanced event selectors,
-- see
-- <https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#creating-data-event-selectors-advanced Log events by using advanced event selectors>
-- in the CloudTrail User Guide.
createEventDataStore_advancedEventSelectors :: Lens.Lens' CreateEventDataStore (Prelude.Maybe [AdvancedEventSelector])
createEventDataStore_advancedEventSelectors :: Lens' CreateEventDataStore (Maybe [AdvancedEventSelector])
createEventDataStore_advancedEventSelectors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStore' {Maybe [AdvancedEventSelector]
advancedEventSelectors :: Maybe [AdvancedEventSelector]
$sel:advancedEventSelectors:CreateEventDataStore' :: CreateEventDataStore -> Maybe [AdvancedEventSelector]
advancedEventSelectors} -> Maybe [AdvancedEventSelector]
advancedEventSelectors) (\s :: CreateEventDataStore
s@CreateEventDataStore' {} Maybe [AdvancedEventSelector]
a -> CreateEventDataStore
s {$sel:advancedEventSelectors:CreateEventDataStore' :: Maybe [AdvancedEventSelector]
advancedEventSelectors = Maybe [AdvancedEventSelector]
a} :: CreateEventDataStore) 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

-- | Specifies the KMS key ID to use to encrypt the events delivered by
-- CloudTrail. The value can be an alias name prefixed by @alias\/@, a
-- fully specified ARN to an alias, a fully specified ARN to a key, or a
-- globally unique identifier.
--
-- Disabling or deleting the KMS key, or removing CloudTrail permissions on
-- the key, prevents CloudTrail from logging events to the event data
-- store, and prevents users from querying the data in the event data store
-- that was encrypted with the key. After you associate an event data store
-- with a KMS key, the KMS key cannot be removed or changed. Before you
-- disable or delete a KMS key that you are using with an event data store,
-- delete or back up your event data store.
--
-- CloudTrail also supports KMS multi-Region keys. For more information
-- about multi-Region keys, see
-- <https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html Using multi-Region keys>
-- in the /Key Management Service Developer Guide/.
--
-- Examples:
--
-- -   @alias\/MyAliasName@
--
-- -   @arn:aws:kms:us-east-2:123456789012:alias\/MyAliasName@
--
-- -   @arn:aws:kms:us-east-2:123456789012:key\/12345678-1234-1234-1234-123456789012@
--
-- -   @12345678-1234-1234-1234-123456789012@
createEventDataStore_kmsKeyId :: Lens.Lens' CreateEventDataStore (Prelude.Maybe Prelude.Text)
createEventDataStore_kmsKeyId :: Lens' CreateEventDataStore (Maybe Text)
createEventDataStore_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStore' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:CreateEventDataStore' :: CreateEventDataStore -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: CreateEventDataStore
s@CreateEventDataStore' {} Maybe Text
a -> CreateEventDataStore
s {$sel:kmsKeyId:CreateEventDataStore' :: Maybe Text
kmsKeyId = Maybe Text
a} :: CreateEventDataStore)

-- | Specifies whether the event data store includes events from all regions,
-- or only from the region in which the event data store is created.
createEventDataStore_multiRegionEnabled :: Lens.Lens' CreateEventDataStore (Prelude.Maybe Prelude.Bool)
createEventDataStore_multiRegionEnabled :: Lens' CreateEventDataStore (Maybe Bool)
createEventDataStore_multiRegionEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStore' {Maybe Bool
multiRegionEnabled :: Maybe Bool
$sel:multiRegionEnabled:CreateEventDataStore' :: CreateEventDataStore -> Maybe Bool
multiRegionEnabled} -> Maybe Bool
multiRegionEnabled) (\s :: CreateEventDataStore
s@CreateEventDataStore' {} Maybe Bool
a -> CreateEventDataStore
s {$sel:multiRegionEnabled:CreateEventDataStore' :: Maybe Bool
multiRegionEnabled = Maybe Bool
a} :: CreateEventDataStore)

-- | Specifies whether an event data store collects events logged for an
-- organization in Organizations.
createEventDataStore_organizationEnabled :: Lens.Lens' CreateEventDataStore (Prelude.Maybe Prelude.Bool)
createEventDataStore_organizationEnabled :: Lens' CreateEventDataStore (Maybe Bool)
createEventDataStore_organizationEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStore' {Maybe Bool
organizationEnabled :: Maybe Bool
$sel:organizationEnabled:CreateEventDataStore' :: CreateEventDataStore -> Maybe Bool
organizationEnabled} -> Maybe Bool
organizationEnabled) (\s :: CreateEventDataStore
s@CreateEventDataStore' {} Maybe Bool
a -> CreateEventDataStore
s {$sel:organizationEnabled:CreateEventDataStore' :: Maybe Bool
organizationEnabled = Maybe Bool
a} :: CreateEventDataStore)

-- | The retention period of the event data store, in days. You can set a
-- retention period of up to 2557 days, the equivalent of seven years.
createEventDataStore_retentionPeriod :: Lens.Lens' CreateEventDataStore (Prelude.Maybe Prelude.Natural)
createEventDataStore_retentionPeriod :: Lens' CreateEventDataStore (Maybe Natural)
createEventDataStore_retentionPeriod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStore' {Maybe Natural
retentionPeriod :: Maybe Natural
$sel:retentionPeriod:CreateEventDataStore' :: CreateEventDataStore -> Maybe Natural
retentionPeriod} -> Maybe Natural
retentionPeriod) (\s :: CreateEventDataStore
s@CreateEventDataStore' {} Maybe Natural
a -> CreateEventDataStore
s {$sel:retentionPeriod:CreateEventDataStore' :: Maybe Natural
retentionPeriod = Maybe Natural
a} :: CreateEventDataStore)

-- | Undocumented member.
createEventDataStore_tagsList :: Lens.Lens' CreateEventDataStore (Prelude.Maybe [Tag])
createEventDataStore_tagsList :: Lens' CreateEventDataStore (Maybe [Tag])
createEventDataStore_tagsList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStore' {Maybe [Tag]
tagsList :: Maybe [Tag]
$sel:tagsList:CreateEventDataStore' :: CreateEventDataStore -> Maybe [Tag]
tagsList} -> Maybe [Tag]
tagsList) (\s :: CreateEventDataStore
s@CreateEventDataStore' {} Maybe [Tag]
a -> CreateEventDataStore
s {$sel:tagsList:CreateEventDataStore' :: Maybe [Tag]
tagsList = Maybe [Tag]
a} :: CreateEventDataStore) 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

-- | Specifies whether termination protection is enabled for the event data
-- store. If termination protection is enabled, you cannot delete the event
-- data store until termination protection is disabled.
createEventDataStore_terminationProtectionEnabled :: Lens.Lens' CreateEventDataStore (Prelude.Maybe Prelude.Bool)
createEventDataStore_terminationProtectionEnabled :: Lens' CreateEventDataStore (Maybe Bool)
createEventDataStore_terminationProtectionEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStore' {Maybe Bool
terminationProtectionEnabled :: Maybe Bool
$sel:terminationProtectionEnabled:CreateEventDataStore' :: CreateEventDataStore -> Maybe Bool
terminationProtectionEnabled} -> Maybe Bool
terminationProtectionEnabled) (\s :: CreateEventDataStore
s@CreateEventDataStore' {} Maybe Bool
a -> CreateEventDataStore
s {$sel:terminationProtectionEnabled:CreateEventDataStore' :: Maybe Bool
terminationProtectionEnabled = Maybe Bool
a} :: CreateEventDataStore)

-- | The name of the event data store.
createEventDataStore_name :: Lens.Lens' CreateEventDataStore Prelude.Text
createEventDataStore_name :: Lens' CreateEventDataStore Text
createEventDataStore_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStore' {Text
name :: Text
$sel:name:CreateEventDataStore' :: CreateEventDataStore -> Text
name} -> Text
name) (\s :: CreateEventDataStore
s@CreateEventDataStore' {} Text
a -> CreateEventDataStore
s {$sel:name:CreateEventDataStore' :: Text
name = Text
a} :: CreateEventDataStore)

instance Core.AWSRequest CreateEventDataStore where
  type
    AWSResponse CreateEventDataStore =
      CreateEventDataStoreResponse
  request :: (Service -> Service)
-> CreateEventDataStore -> Request CreateEventDataStore
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 CreateEventDataStore
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateEventDataStore)))
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 [AdvancedEventSelector]
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Natural
-> Maybe EventDataStoreStatus
-> Maybe [Tag]
-> Maybe Bool
-> Maybe POSIX
-> Int
-> CreateEventDataStoreResponse
CreateEventDataStoreResponse'
            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
"AdvancedEventSelectors"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreatedTimestamp")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"EventDataStoreArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"KmsKeyId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"MultiRegionEnabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"OrganizationEnabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RetentionPeriod")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TagsList" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TerminationProtectionEnabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"UpdatedTimestamp")
            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))
      )

instance Prelude.Hashable CreateEventDataStore where
  hashWithSalt :: Int -> CreateEventDataStore -> Int
hashWithSalt Int
_salt CreateEventDataStore' {Maybe Bool
Maybe Natural
Maybe [AdvancedEventSelector]
Maybe [Tag]
Maybe Text
Text
name :: Text
terminationProtectionEnabled :: Maybe Bool
tagsList :: Maybe [Tag]
retentionPeriod :: Maybe Natural
organizationEnabled :: Maybe Bool
multiRegionEnabled :: Maybe Bool
kmsKeyId :: Maybe Text
advancedEventSelectors :: Maybe [AdvancedEventSelector]
$sel:name:CreateEventDataStore' :: CreateEventDataStore -> Text
$sel:terminationProtectionEnabled:CreateEventDataStore' :: CreateEventDataStore -> Maybe Bool
$sel:tagsList:CreateEventDataStore' :: CreateEventDataStore -> Maybe [Tag]
$sel:retentionPeriod:CreateEventDataStore' :: CreateEventDataStore -> Maybe Natural
$sel:organizationEnabled:CreateEventDataStore' :: CreateEventDataStore -> Maybe Bool
$sel:multiRegionEnabled:CreateEventDataStore' :: CreateEventDataStore -> Maybe Bool
$sel:kmsKeyId:CreateEventDataStore' :: CreateEventDataStore -> Maybe Text
$sel:advancedEventSelectors:CreateEventDataStore' :: CreateEventDataStore -> Maybe [AdvancedEventSelector]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AdvancedEventSelector]
advancedEventSelectors
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
multiRegionEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
organizationEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
retentionPeriod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tagsList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
terminationProtectionEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData CreateEventDataStore where
  rnf :: CreateEventDataStore -> ()
rnf CreateEventDataStore' {Maybe Bool
Maybe Natural
Maybe [AdvancedEventSelector]
Maybe [Tag]
Maybe Text
Text
name :: Text
terminationProtectionEnabled :: Maybe Bool
tagsList :: Maybe [Tag]
retentionPeriod :: Maybe Natural
organizationEnabled :: Maybe Bool
multiRegionEnabled :: Maybe Bool
kmsKeyId :: Maybe Text
advancedEventSelectors :: Maybe [AdvancedEventSelector]
$sel:name:CreateEventDataStore' :: CreateEventDataStore -> Text
$sel:terminationProtectionEnabled:CreateEventDataStore' :: CreateEventDataStore -> Maybe Bool
$sel:tagsList:CreateEventDataStore' :: CreateEventDataStore -> Maybe [Tag]
$sel:retentionPeriod:CreateEventDataStore' :: CreateEventDataStore -> Maybe Natural
$sel:organizationEnabled:CreateEventDataStore' :: CreateEventDataStore -> Maybe Bool
$sel:multiRegionEnabled:CreateEventDataStore' :: CreateEventDataStore -> Maybe Bool
$sel:kmsKeyId:CreateEventDataStore' :: CreateEventDataStore -> Maybe Text
$sel:advancedEventSelectors:CreateEventDataStore' :: CreateEventDataStore -> Maybe [AdvancedEventSelector]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AdvancedEventSelector]
advancedEventSelectors
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe Bool
multiRegionEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
organizationEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
retentionPeriod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tagsList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
terminationProtectionEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

instance Data.ToHeaders CreateEventDataStore where
  toHeaders :: CreateEventDataStore -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.CreateEventDataStore" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateEventDataStore where
  toJSON :: CreateEventDataStore -> Value
toJSON CreateEventDataStore' {Maybe Bool
Maybe Natural
Maybe [AdvancedEventSelector]
Maybe [Tag]
Maybe Text
Text
name :: Text
terminationProtectionEnabled :: Maybe Bool
tagsList :: Maybe [Tag]
retentionPeriod :: Maybe Natural
organizationEnabled :: Maybe Bool
multiRegionEnabled :: Maybe Bool
kmsKeyId :: Maybe Text
advancedEventSelectors :: Maybe [AdvancedEventSelector]
$sel:name:CreateEventDataStore' :: CreateEventDataStore -> Text
$sel:terminationProtectionEnabled:CreateEventDataStore' :: CreateEventDataStore -> Maybe Bool
$sel:tagsList:CreateEventDataStore' :: CreateEventDataStore -> Maybe [Tag]
$sel:retentionPeriod:CreateEventDataStore' :: CreateEventDataStore -> Maybe Natural
$sel:organizationEnabled:CreateEventDataStore' :: CreateEventDataStore -> Maybe Bool
$sel:multiRegionEnabled:CreateEventDataStore' :: CreateEventDataStore -> Maybe Bool
$sel:kmsKeyId:CreateEventDataStore' :: CreateEventDataStore -> Maybe Text
$sel:advancedEventSelectors:CreateEventDataStore' :: CreateEventDataStore -> Maybe [AdvancedEventSelector]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AdvancedEventSelectors" 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 [AdvancedEventSelector]
advancedEventSelectors,
            (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,
            (Key
"MultiRegionEnabled" 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 Bool
multiRegionEnabled,
            (Key
"OrganizationEnabled" 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 Bool
organizationEnabled,
            (Key
"RetentionPeriod" 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 Natural
retentionPeriod,
            (Key
"TagsList" 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 [Tag]
tagsList,
            (Key
"TerminationProtectionEnabled" 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 Bool
terminationProtectionEnabled,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

instance Data.ToPath CreateEventDataStore where
  toPath :: CreateEventDataStore -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newCreateEventDataStoreResponse' smart constructor.
data CreateEventDataStoreResponse = CreateEventDataStoreResponse'
  { -- | The advanced event selectors that were used to select the events for the
    -- data store.
    CreateEventDataStoreResponse -> Maybe [AdvancedEventSelector]
advancedEventSelectors :: Prelude.Maybe [AdvancedEventSelector],
    -- | The timestamp that shows when the event data store was created.
    CreateEventDataStoreResponse -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Data.POSIX,
    -- | The ARN of the event data store.
    CreateEventDataStoreResponse -> Maybe Text
eventDataStoreArn :: Prelude.Maybe Prelude.Text,
    -- | Specifies the KMS key ID that encrypts the events delivered by
    -- CloudTrail. The value is a fully specified ARN to a KMS key in the
    -- following format.
    --
    -- @arn:aws:kms:us-east-2:123456789012:key\/12345678-1234-1234-1234-123456789012@
    CreateEventDataStoreResponse -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the event data store collects events from all regions,
    -- or only from the region in which it was created.
    CreateEventDataStoreResponse -> Maybe Bool
multiRegionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The name of the event data store.
    CreateEventDataStoreResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether an event data store is collecting logged events for an
    -- organization in Organizations.
    CreateEventDataStoreResponse -> Maybe Bool
organizationEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The retention period of an event data store, in days.
    CreateEventDataStoreResponse -> Maybe Natural
retentionPeriod :: Prelude.Maybe Prelude.Natural,
    -- | The status of event data store creation.
    CreateEventDataStoreResponse -> Maybe EventDataStoreStatus
status :: Prelude.Maybe EventDataStoreStatus,
    CreateEventDataStoreResponse -> Maybe [Tag]
tagsList :: Prelude.Maybe [Tag],
    -- | Indicates whether termination protection is enabled for the event data
    -- store.
    CreateEventDataStoreResponse -> Maybe Bool
terminationProtectionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The timestamp that shows when an event data store was updated, if
    -- applicable. @UpdatedTimestamp@ is always either the same or newer than
    -- the time shown in @CreatedTimestamp@.
    CreateEventDataStoreResponse -> Maybe POSIX
updatedTimestamp :: Prelude.Maybe Data.POSIX,
    -- | The response's http status code.
    CreateEventDataStoreResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateEventDataStoreResponse
-> CreateEventDataStoreResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEventDataStoreResponse
-> CreateEventDataStoreResponse -> Bool
$c/= :: CreateEventDataStoreResponse
-> CreateEventDataStoreResponse -> Bool
== :: CreateEventDataStoreResponse
-> CreateEventDataStoreResponse -> Bool
$c== :: CreateEventDataStoreResponse
-> CreateEventDataStoreResponse -> Bool
Prelude.Eq, ReadPrec [CreateEventDataStoreResponse]
ReadPrec CreateEventDataStoreResponse
Int -> ReadS CreateEventDataStoreResponse
ReadS [CreateEventDataStoreResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEventDataStoreResponse]
$creadListPrec :: ReadPrec [CreateEventDataStoreResponse]
readPrec :: ReadPrec CreateEventDataStoreResponse
$creadPrec :: ReadPrec CreateEventDataStoreResponse
readList :: ReadS [CreateEventDataStoreResponse]
$creadList :: ReadS [CreateEventDataStoreResponse]
readsPrec :: Int -> ReadS CreateEventDataStoreResponse
$creadsPrec :: Int -> ReadS CreateEventDataStoreResponse
Prelude.Read, Int -> CreateEventDataStoreResponse -> ShowS
[CreateEventDataStoreResponse] -> ShowS
CreateEventDataStoreResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEventDataStoreResponse] -> ShowS
$cshowList :: [CreateEventDataStoreResponse] -> ShowS
show :: CreateEventDataStoreResponse -> String
$cshow :: CreateEventDataStoreResponse -> String
showsPrec :: Int -> CreateEventDataStoreResponse -> ShowS
$cshowsPrec :: Int -> CreateEventDataStoreResponse -> ShowS
Prelude.Show, forall x.
Rep CreateEventDataStoreResponse x -> CreateEventDataStoreResponse
forall x.
CreateEventDataStoreResponse -> Rep CreateEventDataStoreResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateEventDataStoreResponse x -> CreateEventDataStoreResponse
$cfrom :: forall x.
CreateEventDataStoreResponse -> Rep CreateEventDataStoreResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateEventDataStoreResponse' 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:
--
-- 'advancedEventSelectors', 'createEventDataStoreResponse_advancedEventSelectors' - The advanced event selectors that were used to select the events for the
-- data store.
--
-- 'createdTimestamp', 'createEventDataStoreResponse_createdTimestamp' - The timestamp that shows when the event data store was created.
--
-- 'eventDataStoreArn', 'createEventDataStoreResponse_eventDataStoreArn' - The ARN of the event data store.
--
-- 'kmsKeyId', 'createEventDataStoreResponse_kmsKeyId' - Specifies the KMS key ID that encrypts the events delivered by
-- CloudTrail. The value is a fully specified ARN to a KMS key in the
-- following format.
--
-- @arn:aws:kms:us-east-2:123456789012:key\/12345678-1234-1234-1234-123456789012@
--
-- 'multiRegionEnabled', 'createEventDataStoreResponse_multiRegionEnabled' - Indicates whether the event data store collects events from all regions,
-- or only from the region in which it was created.
--
-- 'name', 'createEventDataStoreResponse_name' - The name of the event data store.
--
-- 'organizationEnabled', 'createEventDataStoreResponse_organizationEnabled' - Indicates whether an event data store is collecting logged events for an
-- organization in Organizations.
--
-- 'retentionPeriod', 'createEventDataStoreResponse_retentionPeriod' - The retention period of an event data store, in days.
--
-- 'status', 'createEventDataStoreResponse_status' - The status of event data store creation.
--
-- 'tagsList', 'createEventDataStoreResponse_tagsList' - Undocumented member.
--
-- 'terminationProtectionEnabled', 'createEventDataStoreResponse_terminationProtectionEnabled' - Indicates whether termination protection is enabled for the event data
-- store.
--
-- 'updatedTimestamp', 'createEventDataStoreResponse_updatedTimestamp' - The timestamp that shows when an event data store was updated, if
-- applicable. @UpdatedTimestamp@ is always either the same or newer than
-- the time shown in @CreatedTimestamp@.
--
-- 'httpStatus', 'createEventDataStoreResponse_httpStatus' - The response's http status code.
newCreateEventDataStoreResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateEventDataStoreResponse
newCreateEventDataStoreResponse :: Int -> CreateEventDataStoreResponse
newCreateEventDataStoreResponse Int
pHttpStatus_ =
  CreateEventDataStoreResponse'
    { $sel:advancedEventSelectors:CreateEventDataStoreResponse' :: Maybe [AdvancedEventSelector]
advancedEventSelectors =
        forall a. Maybe a
Prelude.Nothing,
      $sel:createdTimestamp:CreateEventDataStoreResponse' :: Maybe POSIX
createdTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:eventDataStoreArn:CreateEventDataStoreResponse' :: Maybe Text
eventDataStoreArn = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:CreateEventDataStoreResponse' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
      $sel:multiRegionEnabled:CreateEventDataStoreResponse' :: Maybe Bool
multiRegionEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateEventDataStoreResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:organizationEnabled:CreateEventDataStoreResponse' :: Maybe Bool
organizationEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:retentionPeriod:CreateEventDataStoreResponse' :: Maybe Natural
retentionPeriod = forall a. Maybe a
Prelude.Nothing,
      $sel:status:CreateEventDataStoreResponse' :: Maybe EventDataStoreStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:tagsList:CreateEventDataStoreResponse' :: Maybe [Tag]
tagsList = forall a. Maybe a
Prelude.Nothing,
      $sel:terminationProtectionEnabled:CreateEventDataStoreResponse' :: Maybe Bool
terminationProtectionEnabled =
        forall a. Maybe a
Prelude.Nothing,
      $sel:updatedTimestamp:CreateEventDataStoreResponse' :: Maybe POSIX
updatedTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateEventDataStoreResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The advanced event selectors that were used to select the events for the
-- data store.
createEventDataStoreResponse_advancedEventSelectors :: Lens.Lens' CreateEventDataStoreResponse (Prelude.Maybe [AdvancedEventSelector])
createEventDataStoreResponse_advancedEventSelectors :: Lens' CreateEventDataStoreResponse (Maybe [AdvancedEventSelector])
createEventDataStoreResponse_advancedEventSelectors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStoreResponse' {Maybe [AdvancedEventSelector]
advancedEventSelectors :: Maybe [AdvancedEventSelector]
$sel:advancedEventSelectors:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe [AdvancedEventSelector]
advancedEventSelectors} -> Maybe [AdvancedEventSelector]
advancedEventSelectors) (\s :: CreateEventDataStoreResponse
s@CreateEventDataStoreResponse' {} Maybe [AdvancedEventSelector]
a -> CreateEventDataStoreResponse
s {$sel:advancedEventSelectors:CreateEventDataStoreResponse' :: Maybe [AdvancedEventSelector]
advancedEventSelectors = Maybe [AdvancedEventSelector]
a} :: CreateEventDataStoreResponse) 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

-- | The timestamp that shows when the event data store was created.
createEventDataStoreResponse_createdTimestamp :: Lens.Lens' CreateEventDataStoreResponse (Prelude.Maybe Prelude.UTCTime)
createEventDataStoreResponse_createdTimestamp :: Lens' CreateEventDataStoreResponse (Maybe UTCTime)
createEventDataStoreResponse_createdTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStoreResponse' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: CreateEventDataStoreResponse
s@CreateEventDataStoreResponse' {} Maybe POSIX
a -> CreateEventDataStoreResponse
s {$sel:createdTimestamp:CreateEventDataStoreResponse' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: CreateEventDataStoreResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The ARN of the event data store.
createEventDataStoreResponse_eventDataStoreArn :: Lens.Lens' CreateEventDataStoreResponse (Prelude.Maybe Prelude.Text)
createEventDataStoreResponse_eventDataStoreArn :: Lens' CreateEventDataStoreResponse (Maybe Text)
createEventDataStoreResponse_eventDataStoreArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStoreResponse' {Maybe Text
eventDataStoreArn :: Maybe Text
$sel:eventDataStoreArn:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Text
eventDataStoreArn} -> Maybe Text
eventDataStoreArn) (\s :: CreateEventDataStoreResponse
s@CreateEventDataStoreResponse' {} Maybe Text
a -> CreateEventDataStoreResponse
s {$sel:eventDataStoreArn:CreateEventDataStoreResponse' :: Maybe Text
eventDataStoreArn = Maybe Text
a} :: CreateEventDataStoreResponse)

-- | Specifies the KMS key ID that encrypts the events delivered by
-- CloudTrail. The value is a fully specified ARN to a KMS key in the
-- following format.
--
-- @arn:aws:kms:us-east-2:123456789012:key\/12345678-1234-1234-1234-123456789012@
createEventDataStoreResponse_kmsKeyId :: Lens.Lens' CreateEventDataStoreResponse (Prelude.Maybe Prelude.Text)
createEventDataStoreResponse_kmsKeyId :: Lens' CreateEventDataStoreResponse (Maybe Text)
createEventDataStoreResponse_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStoreResponse' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: CreateEventDataStoreResponse
s@CreateEventDataStoreResponse' {} Maybe Text
a -> CreateEventDataStoreResponse
s {$sel:kmsKeyId:CreateEventDataStoreResponse' :: Maybe Text
kmsKeyId = Maybe Text
a} :: CreateEventDataStoreResponse)

-- | Indicates whether the event data store collects events from all regions,
-- or only from the region in which it was created.
createEventDataStoreResponse_multiRegionEnabled :: Lens.Lens' CreateEventDataStoreResponse (Prelude.Maybe Prelude.Bool)
createEventDataStoreResponse_multiRegionEnabled :: Lens' CreateEventDataStoreResponse (Maybe Bool)
createEventDataStoreResponse_multiRegionEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStoreResponse' {Maybe Bool
multiRegionEnabled :: Maybe Bool
$sel:multiRegionEnabled:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Bool
multiRegionEnabled} -> Maybe Bool
multiRegionEnabled) (\s :: CreateEventDataStoreResponse
s@CreateEventDataStoreResponse' {} Maybe Bool
a -> CreateEventDataStoreResponse
s {$sel:multiRegionEnabled:CreateEventDataStoreResponse' :: Maybe Bool
multiRegionEnabled = Maybe Bool
a} :: CreateEventDataStoreResponse)

-- | The name of the event data store.
createEventDataStoreResponse_name :: Lens.Lens' CreateEventDataStoreResponse (Prelude.Maybe Prelude.Text)
createEventDataStoreResponse_name :: Lens' CreateEventDataStoreResponse (Maybe Text)
createEventDataStoreResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStoreResponse' {Maybe Text
name :: Maybe Text
$sel:name:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateEventDataStoreResponse
s@CreateEventDataStoreResponse' {} Maybe Text
a -> CreateEventDataStoreResponse
s {$sel:name:CreateEventDataStoreResponse' :: Maybe Text
name = Maybe Text
a} :: CreateEventDataStoreResponse)

-- | Indicates whether an event data store is collecting logged events for an
-- organization in Organizations.
createEventDataStoreResponse_organizationEnabled :: Lens.Lens' CreateEventDataStoreResponse (Prelude.Maybe Prelude.Bool)
createEventDataStoreResponse_organizationEnabled :: Lens' CreateEventDataStoreResponse (Maybe Bool)
createEventDataStoreResponse_organizationEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStoreResponse' {Maybe Bool
organizationEnabled :: Maybe Bool
$sel:organizationEnabled:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Bool
organizationEnabled} -> Maybe Bool
organizationEnabled) (\s :: CreateEventDataStoreResponse
s@CreateEventDataStoreResponse' {} Maybe Bool
a -> CreateEventDataStoreResponse
s {$sel:organizationEnabled:CreateEventDataStoreResponse' :: Maybe Bool
organizationEnabled = Maybe Bool
a} :: CreateEventDataStoreResponse)

-- | The retention period of an event data store, in days.
createEventDataStoreResponse_retentionPeriod :: Lens.Lens' CreateEventDataStoreResponse (Prelude.Maybe Prelude.Natural)
createEventDataStoreResponse_retentionPeriod :: Lens' CreateEventDataStoreResponse (Maybe Natural)
createEventDataStoreResponse_retentionPeriod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStoreResponse' {Maybe Natural
retentionPeriod :: Maybe Natural
$sel:retentionPeriod:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Natural
retentionPeriod} -> Maybe Natural
retentionPeriod) (\s :: CreateEventDataStoreResponse
s@CreateEventDataStoreResponse' {} Maybe Natural
a -> CreateEventDataStoreResponse
s {$sel:retentionPeriod:CreateEventDataStoreResponse' :: Maybe Natural
retentionPeriod = Maybe Natural
a} :: CreateEventDataStoreResponse)

-- | The status of event data store creation.
createEventDataStoreResponse_status :: Lens.Lens' CreateEventDataStoreResponse (Prelude.Maybe EventDataStoreStatus)
createEventDataStoreResponse_status :: Lens' CreateEventDataStoreResponse (Maybe EventDataStoreStatus)
createEventDataStoreResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStoreResponse' {Maybe EventDataStoreStatus
status :: Maybe EventDataStoreStatus
$sel:status:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe EventDataStoreStatus
status} -> Maybe EventDataStoreStatus
status) (\s :: CreateEventDataStoreResponse
s@CreateEventDataStoreResponse' {} Maybe EventDataStoreStatus
a -> CreateEventDataStoreResponse
s {$sel:status:CreateEventDataStoreResponse' :: Maybe EventDataStoreStatus
status = Maybe EventDataStoreStatus
a} :: CreateEventDataStoreResponse)

-- | Undocumented member.
createEventDataStoreResponse_tagsList :: Lens.Lens' CreateEventDataStoreResponse (Prelude.Maybe [Tag])
createEventDataStoreResponse_tagsList :: Lens' CreateEventDataStoreResponse (Maybe [Tag])
createEventDataStoreResponse_tagsList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStoreResponse' {Maybe [Tag]
tagsList :: Maybe [Tag]
$sel:tagsList:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe [Tag]
tagsList} -> Maybe [Tag]
tagsList) (\s :: CreateEventDataStoreResponse
s@CreateEventDataStoreResponse' {} Maybe [Tag]
a -> CreateEventDataStoreResponse
s {$sel:tagsList:CreateEventDataStoreResponse' :: Maybe [Tag]
tagsList = Maybe [Tag]
a} :: CreateEventDataStoreResponse) 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

-- | Indicates whether termination protection is enabled for the event data
-- store.
createEventDataStoreResponse_terminationProtectionEnabled :: Lens.Lens' CreateEventDataStoreResponse (Prelude.Maybe Prelude.Bool)
createEventDataStoreResponse_terminationProtectionEnabled :: Lens' CreateEventDataStoreResponse (Maybe Bool)
createEventDataStoreResponse_terminationProtectionEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStoreResponse' {Maybe Bool
terminationProtectionEnabled :: Maybe Bool
$sel:terminationProtectionEnabled:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Bool
terminationProtectionEnabled} -> Maybe Bool
terminationProtectionEnabled) (\s :: CreateEventDataStoreResponse
s@CreateEventDataStoreResponse' {} Maybe Bool
a -> CreateEventDataStoreResponse
s {$sel:terminationProtectionEnabled:CreateEventDataStoreResponse' :: Maybe Bool
terminationProtectionEnabled = Maybe Bool
a} :: CreateEventDataStoreResponse)

-- | The timestamp that shows when an event data store was updated, if
-- applicable. @UpdatedTimestamp@ is always either the same or newer than
-- the time shown in @CreatedTimestamp@.
createEventDataStoreResponse_updatedTimestamp :: Lens.Lens' CreateEventDataStoreResponse (Prelude.Maybe Prelude.UTCTime)
createEventDataStoreResponse_updatedTimestamp :: Lens' CreateEventDataStoreResponse (Maybe UTCTime)
createEventDataStoreResponse_updatedTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventDataStoreResponse' {Maybe POSIX
updatedTimestamp :: Maybe POSIX
$sel:updatedTimestamp:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe POSIX
updatedTimestamp} -> Maybe POSIX
updatedTimestamp) (\s :: CreateEventDataStoreResponse
s@CreateEventDataStoreResponse' {} Maybe POSIX
a -> CreateEventDataStoreResponse
s {$sel:updatedTimestamp:CreateEventDataStoreResponse' :: Maybe POSIX
updatedTimestamp = Maybe POSIX
a} :: CreateEventDataStoreResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

instance Prelude.NFData CreateEventDataStoreResponse where
  rnf :: CreateEventDataStoreResponse -> ()
rnf CreateEventDataStoreResponse' {Int
Maybe Bool
Maybe Natural
Maybe [AdvancedEventSelector]
Maybe [Tag]
Maybe Text
Maybe POSIX
Maybe EventDataStoreStatus
httpStatus :: Int
updatedTimestamp :: Maybe POSIX
terminationProtectionEnabled :: Maybe Bool
tagsList :: Maybe [Tag]
status :: Maybe EventDataStoreStatus
retentionPeriod :: Maybe Natural
organizationEnabled :: Maybe Bool
name :: Maybe Text
multiRegionEnabled :: Maybe Bool
kmsKeyId :: Maybe Text
eventDataStoreArn :: Maybe Text
createdTimestamp :: Maybe POSIX
advancedEventSelectors :: Maybe [AdvancedEventSelector]
$sel:httpStatus:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Int
$sel:updatedTimestamp:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe POSIX
$sel:terminationProtectionEnabled:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Bool
$sel:tagsList:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe [Tag]
$sel:status:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe EventDataStoreStatus
$sel:retentionPeriod:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Natural
$sel:organizationEnabled:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Bool
$sel:name:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Text
$sel:multiRegionEnabled:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Bool
$sel:kmsKeyId:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Text
$sel:eventDataStoreArn:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe Text
$sel:createdTimestamp:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe POSIX
$sel:advancedEventSelectors:CreateEventDataStoreResponse' :: CreateEventDataStoreResponse -> Maybe [AdvancedEventSelector]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AdvancedEventSelector]
advancedEventSelectors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eventDataStoreArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe Bool
multiRegionEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
organizationEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
retentionPeriod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EventDataStoreStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tagsList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
terminationProtectionEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
updatedTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus