{-# 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.GetEventDataStore
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns information about an event data store specified as either an ARN
-- or the ID portion of the ARN.
module Amazonka.CloudTrail.GetEventDataStore
  ( -- * Creating a Request
    GetEventDataStore (..),
    newGetEventDataStore,

    -- * Request Lenses
    getEventDataStore_eventDataStore,

    -- * Destructuring the Response
    GetEventDataStoreResponse (..),
    newGetEventDataStoreResponse,

    -- * Response Lenses
    getEventDataStoreResponse_advancedEventSelectors,
    getEventDataStoreResponse_createdTimestamp,
    getEventDataStoreResponse_eventDataStoreArn,
    getEventDataStoreResponse_kmsKeyId,
    getEventDataStoreResponse_multiRegionEnabled,
    getEventDataStoreResponse_name,
    getEventDataStoreResponse_organizationEnabled,
    getEventDataStoreResponse_retentionPeriod,
    getEventDataStoreResponse_status,
    getEventDataStoreResponse_terminationProtectionEnabled,
    getEventDataStoreResponse_updatedTimestamp,
    getEventDataStoreResponse_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:/ 'newGetEventDataStore' smart constructor.
data GetEventDataStore = GetEventDataStore'
  { -- | The ARN (or ID suffix of the ARN) of the event data store about which
    -- you want information.
    GetEventDataStore -> Text
eventDataStore :: Prelude.Text
  }
  deriving (GetEventDataStore -> GetEventDataStore -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEventDataStore -> GetEventDataStore -> Bool
$c/= :: GetEventDataStore -> GetEventDataStore -> Bool
== :: GetEventDataStore -> GetEventDataStore -> Bool
$c== :: GetEventDataStore -> GetEventDataStore -> Bool
Prelude.Eq, ReadPrec [GetEventDataStore]
ReadPrec GetEventDataStore
Int -> ReadS GetEventDataStore
ReadS [GetEventDataStore]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEventDataStore]
$creadListPrec :: ReadPrec [GetEventDataStore]
readPrec :: ReadPrec GetEventDataStore
$creadPrec :: ReadPrec GetEventDataStore
readList :: ReadS [GetEventDataStore]
$creadList :: ReadS [GetEventDataStore]
readsPrec :: Int -> ReadS GetEventDataStore
$creadsPrec :: Int -> ReadS GetEventDataStore
Prelude.Read, Int -> GetEventDataStore -> ShowS
[GetEventDataStore] -> ShowS
GetEventDataStore -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEventDataStore] -> ShowS
$cshowList :: [GetEventDataStore] -> ShowS
show :: GetEventDataStore -> String
$cshow :: GetEventDataStore -> String
showsPrec :: Int -> GetEventDataStore -> ShowS
$cshowsPrec :: Int -> GetEventDataStore -> ShowS
Prelude.Show, forall x. Rep GetEventDataStore x -> GetEventDataStore
forall x. GetEventDataStore -> Rep GetEventDataStore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetEventDataStore x -> GetEventDataStore
$cfrom :: forall x. GetEventDataStore -> Rep GetEventDataStore x
Prelude.Generic)

-- |
-- Create a value of 'GetEventDataStore' 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:
--
-- 'eventDataStore', 'getEventDataStore_eventDataStore' - The ARN (or ID suffix of the ARN) of the event data store about which
-- you want information.
newGetEventDataStore ::
  -- | 'eventDataStore'
  Prelude.Text ->
  GetEventDataStore
newGetEventDataStore :: Text -> GetEventDataStore
newGetEventDataStore Text
pEventDataStore_ =
  GetEventDataStore'
    { $sel:eventDataStore:GetEventDataStore' :: Text
eventDataStore =
        Text
pEventDataStore_
    }

-- | The ARN (or ID suffix of the ARN) of the event data store about which
-- you want information.
getEventDataStore_eventDataStore :: Lens.Lens' GetEventDataStore Prelude.Text
getEventDataStore_eventDataStore :: Lens' GetEventDataStore Text
getEventDataStore_eventDataStore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventDataStore' {Text
eventDataStore :: Text
$sel:eventDataStore:GetEventDataStore' :: GetEventDataStore -> Text
eventDataStore} -> Text
eventDataStore) (\s :: GetEventDataStore
s@GetEventDataStore' {} Text
a -> GetEventDataStore
s {$sel:eventDataStore:GetEventDataStore' :: Text
eventDataStore = Text
a} :: GetEventDataStore)

instance Core.AWSRequest GetEventDataStore where
  type
    AWSResponse GetEventDataStore =
      GetEventDataStoreResponse
  request :: (Service -> Service)
-> GetEventDataStore -> Request GetEventDataStore
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 GetEventDataStore
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetEventDataStore)))
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 Bool
-> Maybe POSIX
-> Int
-> GetEventDataStoreResponse
GetEventDataStoreResponse'
            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
"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 GetEventDataStore where
  hashWithSalt :: Int -> GetEventDataStore -> Int
hashWithSalt Int
_salt GetEventDataStore' {Text
eventDataStore :: Text
$sel:eventDataStore:GetEventDataStore' :: GetEventDataStore -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
eventDataStore

instance Prelude.NFData GetEventDataStore where
  rnf :: GetEventDataStore -> ()
rnf GetEventDataStore' {Text
eventDataStore :: Text
$sel:eventDataStore:GetEventDataStore' :: GetEventDataStore -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
eventDataStore

instance Data.ToHeaders GetEventDataStore where
  toHeaders :: GetEventDataStore -> 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.GetEventDataStore" ::
                          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 GetEventDataStore where
  toJSON :: GetEventDataStore -> Value
toJSON GetEventDataStore' {Text
eventDataStore :: Text
$sel:eventDataStore:GetEventDataStore' :: GetEventDataStore -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"EventDataStore" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
eventDataStore)
          ]
      )

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

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

-- | /See:/ 'newGetEventDataStoreResponse' smart constructor.
data GetEventDataStoreResponse = GetEventDataStoreResponse'
  { -- | The advanced event selectors used to select events for the data store.
    GetEventDataStoreResponse -> Maybe [AdvancedEventSelector]
advancedEventSelectors :: Prelude.Maybe [AdvancedEventSelector],
    -- | The timestamp of the event data store\'s creation.
    GetEventDataStoreResponse -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Data.POSIX,
    -- | The event data store Amazon Resource Number (ARN).
    GetEventDataStoreResponse -> 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@
    GetEventDataStoreResponse -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the event data store includes events from all regions,
    -- or only from the region in which it was created.
    GetEventDataStoreResponse -> Maybe Bool
multiRegionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The name of the event data store.
    GetEventDataStoreResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether an event data store is collecting logged events for an
    -- organization in Organizations.
    GetEventDataStoreResponse -> Maybe Bool
organizationEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The retention period of the event data store, in days.
    GetEventDataStoreResponse -> Maybe Natural
retentionPeriod :: Prelude.Maybe Prelude.Natural,
    -- | The status of an event data store. Values can be @ENABLED@ and
    -- @PENDING_DELETION@.
    GetEventDataStoreResponse -> Maybe EventDataStoreStatus
status :: Prelude.Maybe EventDataStoreStatus,
    -- | Indicates that termination protection is enabled.
    GetEventDataStoreResponse -> Maybe Bool
terminationProtectionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Shows the time that an event data store was updated, if applicable.
    -- @UpdatedTimestamp@ is always either the same or newer than the time
    -- shown in @CreatedTimestamp@.
    GetEventDataStoreResponse -> Maybe POSIX
updatedTimestamp :: Prelude.Maybe Data.POSIX,
    -- | The response's http status code.
    GetEventDataStoreResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetEventDataStoreResponse -> GetEventDataStoreResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEventDataStoreResponse -> GetEventDataStoreResponse -> Bool
$c/= :: GetEventDataStoreResponse -> GetEventDataStoreResponse -> Bool
== :: GetEventDataStoreResponse -> GetEventDataStoreResponse -> Bool
$c== :: GetEventDataStoreResponse -> GetEventDataStoreResponse -> Bool
Prelude.Eq, ReadPrec [GetEventDataStoreResponse]
ReadPrec GetEventDataStoreResponse
Int -> ReadS GetEventDataStoreResponse
ReadS [GetEventDataStoreResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEventDataStoreResponse]
$creadListPrec :: ReadPrec [GetEventDataStoreResponse]
readPrec :: ReadPrec GetEventDataStoreResponse
$creadPrec :: ReadPrec GetEventDataStoreResponse
readList :: ReadS [GetEventDataStoreResponse]
$creadList :: ReadS [GetEventDataStoreResponse]
readsPrec :: Int -> ReadS GetEventDataStoreResponse
$creadsPrec :: Int -> ReadS GetEventDataStoreResponse
Prelude.Read, Int -> GetEventDataStoreResponse -> ShowS
[GetEventDataStoreResponse] -> ShowS
GetEventDataStoreResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEventDataStoreResponse] -> ShowS
$cshowList :: [GetEventDataStoreResponse] -> ShowS
show :: GetEventDataStoreResponse -> String
$cshow :: GetEventDataStoreResponse -> String
showsPrec :: Int -> GetEventDataStoreResponse -> ShowS
$cshowsPrec :: Int -> GetEventDataStoreResponse -> ShowS
Prelude.Show, forall x.
Rep GetEventDataStoreResponse x -> GetEventDataStoreResponse
forall x.
GetEventDataStoreResponse -> Rep GetEventDataStoreResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEventDataStoreResponse x -> GetEventDataStoreResponse
$cfrom :: forall x.
GetEventDataStoreResponse -> Rep GetEventDataStoreResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetEventDataStoreResponse' 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', 'getEventDataStoreResponse_advancedEventSelectors' - The advanced event selectors used to select events for the data store.
--
-- 'createdTimestamp', 'getEventDataStoreResponse_createdTimestamp' - The timestamp of the event data store\'s creation.
--
-- 'eventDataStoreArn', 'getEventDataStoreResponse_eventDataStoreArn' - The event data store Amazon Resource Number (ARN).
--
-- 'kmsKeyId', 'getEventDataStoreResponse_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', 'getEventDataStoreResponse_multiRegionEnabled' - Indicates whether the event data store includes events from all regions,
-- or only from the region in which it was created.
--
-- 'name', 'getEventDataStoreResponse_name' - The name of the event data store.
--
-- 'organizationEnabled', 'getEventDataStoreResponse_organizationEnabled' - Indicates whether an event data store is collecting logged events for an
-- organization in Organizations.
--
-- 'retentionPeriod', 'getEventDataStoreResponse_retentionPeriod' - The retention period of the event data store, in days.
--
-- 'status', 'getEventDataStoreResponse_status' - The status of an event data store. Values can be @ENABLED@ and
-- @PENDING_DELETION@.
--
-- 'terminationProtectionEnabled', 'getEventDataStoreResponse_terminationProtectionEnabled' - Indicates that termination protection is enabled.
--
-- 'updatedTimestamp', 'getEventDataStoreResponse_updatedTimestamp' - Shows the time that an event data store was updated, if applicable.
-- @UpdatedTimestamp@ is always either the same or newer than the time
-- shown in @CreatedTimestamp@.
--
-- 'httpStatus', 'getEventDataStoreResponse_httpStatus' - The response's http status code.
newGetEventDataStoreResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetEventDataStoreResponse
newGetEventDataStoreResponse :: Int -> GetEventDataStoreResponse
newGetEventDataStoreResponse Int
pHttpStatus_ =
  GetEventDataStoreResponse'
    { $sel:advancedEventSelectors:GetEventDataStoreResponse' :: Maybe [AdvancedEventSelector]
advancedEventSelectors =
        forall a. Maybe a
Prelude.Nothing,
      $sel:createdTimestamp:GetEventDataStoreResponse' :: Maybe POSIX
createdTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:eventDataStoreArn:GetEventDataStoreResponse' :: Maybe Text
eventDataStoreArn = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:GetEventDataStoreResponse' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
      $sel:multiRegionEnabled:GetEventDataStoreResponse' :: Maybe Bool
multiRegionEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetEventDataStoreResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:organizationEnabled:GetEventDataStoreResponse' :: Maybe Bool
organizationEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:retentionPeriod:GetEventDataStoreResponse' :: Maybe Natural
retentionPeriod = forall a. Maybe a
Prelude.Nothing,
      $sel:status:GetEventDataStoreResponse' :: Maybe EventDataStoreStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:terminationProtectionEnabled:GetEventDataStoreResponse' :: Maybe Bool
terminationProtectionEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:updatedTimestamp:GetEventDataStoreResponse' :: Maybe POSIX
updatedTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetEventDataStoreResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The advanced event selectors used to select events for the data store.
getEventDataStoreResponse_advancedEventSelectors :: Lens.Lens' GetEventDataStoreResponse (Prelude.Maybe [AdvancedEventSelector])
getEventDataStoreResponse_advancedEventSelectors :: Lens' GetEventDataStoreResponse (Maybe [AdvancedEventSelector])
getEventDataStoreResponse_advancedEventSelectors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventDataStoreResponse' {Maybe [AdvancedEventSelector]
advancedEventSelectors :: Maybe [AdvancedEventSelector]
$sel:advancedEventSelectors:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe [AdvancedEventSelector]
advancedEventSelectors} -> Maybe [AdvancedEventSelector]
advancedEventSelectors) (\s :: GetEventDataStoreResponse
s@GetEventDataStoreResponse' {} Maybe [AdvancedEventSelector]
a -> GetEventDataStoreResponse
s {$sel:advancedEventSelectors:GetEventDataStoreResponse' :: Maybe [AdvancedEventSelector]
advancedEventSelectors = Maybe [AdvancedEventSelector]
a} :: GetEventDataStoreResponse) 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 of the event data store\'s creation.
getEventDataStoreResponse_createdTimestamp :: Lens.Lens' GetEventDataStoreResponse (Prelude.Maybe Prelude.UTCTime)
getEventDataStoreResponse_createdTimestamp :: Lens' GetEventDataStoreResponse (Maybe UTCTime)
getEventDataStoreResponse_createdTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventDataStoreResponse' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: GetEventDataStoreResponse
s@GetEventDataStoreResponse' {} Maybe POSIX
a -> GetEventDataStoreResponse
s {$sel:createdTimestamp:GetEventDataStoreResponse' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: GetEventDataStoreResponse) 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 event data store Amazon Resource Number (ARN).
getEventDataStoreResponse_eventDataStoreArn :: Lens.Lens' GetEventDataStoreResponse (Prelude.Maybe Prelude.Text)
getEventDataStoreResponse_eventDataStoreArn :: Lens' GetEventDataStoreResponse (Maybe Text)
getEventDataStoreResponse_eventDataStoreArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventDataStoreResponse' {Maybe Text
eventDataStoreArn :: Maybe Text
$sel:eventDataStoreArn:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe Text
eventDataStoreArn} -> Maybe Text
eventDataStoreArn) (\s :: GetEventDataStoreResponse
s@GetEventDataStoreResponse' {} Maybe Text
a -> GetEventDataStoreResponse
s {$sel:eventDataStoreArn:GetEventDataStoreResponse' :: Maybe Text
eventDataStoreArn = Maybe Text
a} :: GetEventDataStoreResponse)

-- | 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@
getEventDataStoreResponse_kmsKeyId :: Lens.Lens' GetEventDataStoreResponse (Prelude.Maybe Prelude.Text)
getEventDataStoreResponse_kmsKeyId :: Lens' GetEventDataStoreResponse (Maybe Text)
getEventDataStoreResponse_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventDataStoreResponse' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: GetEventDataStoreResponse
s@GetEventDataStoreResponse' {} Maybe Text
a -> GetEventDataStoreResponse
s {$sel:kmsKeyId:GetEventDataStoreResponse' :: Maybe Text
kmsKeyId = Maybe Text
a} :: GetEventDataStoreResponse)

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

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

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

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

-- | The status of an event data store. Values can be @ENABLED@ and
-- @PENDING_DELETION@.
getEventDataStoreResponse_status :: Lens.Lens' GetEventDataStoreResponse (Prelude.Maybe EventDataStoreStatus)
getEventDataStoreResponse_status :: Lens' GetEventDataStoreResponse (Maybe EventDataStoreStatus)
getEventDataStoreResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventDataStoreResponse' {Maybe EventDataStoreStatus
status :: Maybe EventDataStoreStatus
$sel:status:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe EventDataStoreStatus
status} -> Maybe EventDataStoreStatus
status) (\s :: GetEventDataStoreResponse
s@GetEventDataStoreResponse' {} Maybe EventDataStoreStatus
a -> GetEventDataStoreResponse
s {$sel:status:GetEventDataStoreResponse' :: Maybe EventDataStoreStatus
status = Maybe EventDataStoreStatus
a} :: GetEventDataStoreResponse)

-- | Indicates that termination protection is enabled.
getEventDataStoreResponse_terminationProtectionEnabled :: Lens.Lens' GetEventDataStoreResponse (Prelude.Maybe Prelude.Bool)
getEventDataStoreResponse_terminationProtectionEnabled :: Lens' GetEventDataStoreResponse (Maybe Bool)
getEventDataStoreResponse_terminationProtectionEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventDataStoreResponse' {Maybe Bool
terminationProtectionEnabled :: Maybe Bool
$sel:terminationProtectionEnabled:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe Bool
terminationProtectionEnabled} -> Maybe Bool
terminationProtectionEnabled) (\s :: GetEventDataStoreResponse
s@GetEventDataStoreResponse' {} Maybe Bool
a -> GetEventDataStoreResponse
s {$sel:terminationProtectionEnabled:GetEventDataStoreResponse' :: Maybe Bool
terminationProtectionEnabled = Maybe Bool
a} :: GetEventDataStoreResponse)

-- | Shows the time that an event data store was updated, if applicable.
-- @UpdatedTimestamp@ is always either the same or newer than the time
-- shown in @CreatedTimestamp@.
getEventDataStoreResponse_updatedTimestamp :: Lens.Lens' GetEventDataStoreResponse (Prelude.Maybe Prelude.UTCTime)
getEventDataStoreResponse_updatedTimestamp :: Lens' GetEventDataStoreResponse (Maybe UTCTime)
getEventDataStoreResponse_updatedTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventDataStoreResponse' {Maybe POSIX
updatedTimestamp :: Maybe POSIX
$sel:updatedTimestamp:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe POSIX
updatedTimestamp} -> Maybe POSIX
updatedTimestamp) (\s :: GetEventDataStoreResponse
s@GetEventDataStoreResponse' {} Maybe POSIX
a -> GetEventDataStoreResponse
s {$sel:updatedTimestamp:GetEventDataStoreResponse' :: Maybe POSIX
updatedTimestamp = Maybe POSIX
a} :: GetEventDataStoreResponse) 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.
getEventDataStoreResponse_httpStatus :: Lens.Lens' GetEventDataStoreResponse Prelude.Int
getEventDataStoreResponse_httpStatus :: Lens' GetEventDataStoreResponse Int
getEventDataStoreResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventDataStoreResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetEventDataStoreResponse
s@GetEventDataStoreResponse' {} Int
a -> GetEventDataStoreResponse
s {$sel:httpStatus:GetEventDataStoreResponse' :: Int
httpStatus = Int
a} :: GetEventDataStoreResponse)

instance Prelude.NFData GetEventDataStoreResponse where
  rnf :: GetEventDataStoreResponse -> ()
rnf GetEventDataStoreResponse' {Int
Maybe Bool
Maybe Natural
Maybe [AdvancedEventSelector]
Maybe Text
Maybe POSIX
Maybe EventDataStoreStatus
httpStatus :: Int
updatedTimestamp :: Maybe POSIX
terminationProtectionEnabled :: Maybe Bool
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:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Int
$sel:updatedTimestamp:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe POSIX
$sel:terminationProtectionEnabled:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe Bool
$sel:status:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe EventDataStoreStatus
$sel:retentionPeriod:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe Natural
$sel:organizationEnabled:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe Bool
$sel:name:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe Text
$sel:multiRegionEnabled:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe Bool
$sel:kmsKeyId:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe Text
$sel:eventDataStoreArn:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe Text
$sel:createdTimestamp:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> Maybe POSIX
$sel:advancedEventSelectors:GetEventDataStoreResponse' :: GetEventDataStoreResponse -> 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 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