{-# 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.SecurityHub.Types.AwsCloudTrailTrailDetails
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SecurityHub.Types.AwsCloudTrailTrailDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides details about a CloudTrail trail.
--
-- /See:/ 'newAwsCloudTrailTrailDetails' smart constructor.
data AwsCloudTrailTrailDetails = AwsCloudTrailTrailDetails'
  { -- | Indicates whether CloudTrail log file validation is enabled.
    AwsCloudTrailTrailDetails -> Maybe Bool
logFileValidationEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The ARN of the trail.
    AwsCloudTrailTrailDetails -> Maybe Text
trailArn :: Prelude.Maybe Prelude.Text,
    -- | The S3 key prefix. The key prefix is added after the name of the S3
    -- bucket where the log files are published.
    AwsCloudTrailTrailDetails -> Maybe Text
s3KeyPrefix :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the SNS topic that is used for notifications of log file
    -- delivery.
    AwsCloudTrailTrailDetails -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the SNS topic that is used for notifications of log file
    -- delivery.
    AwsCloudTrailTrailDetails -> Maybe Text
snsTopicName :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the log group that CloudTrail logs are delivered to.
    AwsCloudTrailTrailDetails -> Maybe Text
cloudWatchLogsLogGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The KMS key ID to use to encrypt the logs.
    AwsCloudTrailTrailDetails -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The Region where the trail was created.
    AwsCloudTrailTrailDetails -> Maybe Text
homeRegion :: Prelude.Maybe Prelude.Text,
    -- | The name of the trail.
    AwsCloudTrailTrailDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the trail publishes events from global services such
    -- as IAM to the log files.
    AwsCloudTrailTrailDetails -> Maybe Bool
includeGlobalServiceEvents :: Prelude.Maybe Prelude.Bool,
    -- | Indicates whether the trail has custom event selectors.
    AwsCloudTrailTrailDetails -> Maybe Bool
hasCustomEventSelectors :: Prelude.Maybe Prelude.Bool,
    -- | Whether the trail is created for all accounts in an organization in
    -- Organizations, or only for the current Amazon Web Services account.
    AwsCloudTrailTrailDetails -> Maybe Bool
isOrganizationTrail :: Prelude.Maybe Prelude.Bool,
    -- | The ARN of the role that the CloudWatch Events endpoint assumes when it
    -- writes to the log group.
    AwsCloudTrailTrailDetails -> Maybe Text
cloudWatchLogsRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the S3 bucket where the log files are published.
    AwsCloudTrailTrailDetails -> Maybe Text
s3BucketName :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the trail applies only to the current Region or to all
    -- Regions.
    AwsCloudTrailTrailDetails -> Maybe Bool
isMultiRegionTrail :: Prelude.Maybe Prelude.Bool
  }
  deriving (AwsCloudTrailTrailDetails -> AwsCloudTrailTrailDetails -> Bool
(AwsCloudTrailTrailDetails -> AwsCloudTrailTrailDetails -> Bool)
-> (AwsCloudTrailTrailDetails -> AwsCloudTrailTrailDetails -> Bool)
-> Eq AwsCloudTrailTrailDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsCloudTrailTrailDetails -> AwsCloudTrailTrailDetails -> Bool
$c/= :: AwsCloudTrailTrailDetails -> AwsCloudTrailTrailDetails -> Bool
== :: AwsCloudTrailTrailDetails -> AwsCloudTrailTrailDetails -> Bool
$c== :: AwsCloudTrailTrailDetails -> AwsCloudTrailTrailDetails -> Bool
Prelude.Eq, ReadPrec [AwsCloudTrailTrailDetails]
ReadPrec AwsCloudTrailTrailDetails
Int -> ReadS AwsCloudTrailTrailDetails
ReadS [AwsCloudTrailTrailDetails]
(Int -> ReadS AwsCloudTrailTrailDetails)
-> ReadS [AwsCloudTrailTrailDetails]
-> ReadPrec AwsCloudTrailTrailDetails
-> ReadPrec [AwsCloudTrailTrailDetails]
-> Read AwsCloudTrailTrailDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsCloudTrailTrailDetails]
$creadListPrec :: ReadPrec [AwsCloudTrailTrailDetails]
readPrec :: ReadPrec AwsCloudTrailTrailDetails
$creadPrec :: ReadPrec AwsCloudTrailTrailDetails
readList :: ReadS [AwsCloudTrailTrailDetails]
$creadList :: ReadS [AwsCloudTrailTrailDetails]
readsPrec :: Int -> ReadS AwsCloudTrailTrailDetails
$creadsPrec :: Int -> ReadS AwsCloudTrailTrailDetails
Prelude.Read, Int -> AwsCloudTrailTrailDetails -> ShowS
[AwsCloudTrailTrailDetails] -> ShowS
AwsCloudTrailTrailDetails -> String
(Int -> AwsCloudTrailTrailDetails -> ShowS)
-> (AwsCloudTrailTrailDetails -> String)
-> ([AwsCloudTrailTrailDetails] -> ShowS)
-> Show AwsCloudTrailTrailDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsCloudTrailTrailDetails] -> ShowS
$cshowList :: [AwsCloudTrailTrailDetails] -> ShowS
show :: AwsCloudTrailTrailDetails -> String
$cshow :: AwsCloudTrailTrailDetails -> String
showsPrec :: Int -> AwsCloudTrailTrailDetails -> ShowS
$cshowsPrec :: Int -> AwsCloudTrailTrailDetails -> ShowS
Prelude.Show, (forall x.
 AwsCloudTrailTrailDetails -> Rep AwsCloudTrailTrailDetails x)
-> (forall x.
    Rep AwsCloudTrailTrailDetails x -> AwsCloudTrailTrailDetails)
-> Generic AwsCloudTrailTrailDetails
forall x.
Rep AwsCloudTrailTrailDetails x -> AwsCloudTrailTrailDetails
forall x.
AwsCloudTrailTrailDetails -> Rep AwsCloudTrailTrailDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsCloudTrailTrailDetails x -> AwsCloudTrailTrailDetails
$cfrom :: forall x.
AwsCloudTrailTrailDetails -> Rep AwsCloudTrailTrailDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsCloudTrailTrailDetails' 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:
--
-- 'logFileValidationEnabled', 'awsCloudTrailTrailDetails_logFileValidationEnabled' - Indicates whether CloudTrail log file validation is enabled.
--
-- 'trailArn', 'awsCloudTrailTrailDetails_trailArn' - The ARN of the trail.
--
-- 's3KeyPrefix', 'awsCloudTrailTrailDetails_s3KeyPrefix' - The S3 key prefix. The key prefix is added after the name of the S3
-- bucket where the log files are published.
--
-- 'snsTopicArn', 'awsCloudTrailTrailDetails_snsTopicArn' - The ARN of the SNS topic that is used for notifications of log file
-- delivery.
--
-- 'snsTopicName', 'awsCloudTrailTrailDetails_snsTopicName' - The name of the SNS topic that is used for notifications of log file
-- delivery.
--
-- 'cloudWatchLogsLogGroupArn', 'awsCloudTrailTrailDetails_cloudWatchLogsLogGroupArn' - The ARN of the log group that CloudTrail logs are delivered to.
--
-- 'kmsKeyId', 'awsCloudTrailTrailDetails_kmsKeyId' - The KMS key ID to use to encrypt the logs.
--
-- 'homeRegion', 'awsCloudTrailTrailDetails_homeRegion' - The Region where the trail was created.
--
-- 'name', 'awsCloudTrailTrailDetails_name' - The name of the trail.
--
-- 'includeGlobalServiceEvents', 'awsCloudTrailTrailDetails_includeGlobalServiceEvents' - Indicates whether the trail publishes events from global services such
-- as IAM to the log files.
--
-- 'hasCustomEventSelectors', 'awsCloudTrailTrailDetails_hasCustomEventSelectors' - Indicates whether the trail has custom event selectors.
--
-- 'isOrganizationTrail', 'awsCloudTrailTrailDetails_isOrganizationTrail' - Whether the trail is created for all accounts in an organization in
-- Organizations, or only for the current Amazon Web Services account.
--
-- 'cloudWatchLogsRoleArn', 'awsCloudTrailTrailDetails_cloudWatchLogsRoleArn' - The ARN of the role that the CloudWatch Events endpoint assumes when it
-- writes to the log group.
--
-- 's3BucketName', 'awsCloudTrailTrailDetails_s3BucketName' - The name of the S3 bucket where the log files are published.
--
-- 'isMultiRegionTrail', 'awsCloudTrailTrailDetails_isMultiRegionTrail' - Indicates whether the trail applies only to the current Region or to all
-- Regions.
newAwsCloudTrailTrailDetails ::
  AwsCloudTrailTrailDetails
newAwsCloudTrailTrailDetails :: AwsCloudTrailTrailDetails
newAwsCloudTrailTrailDetails =
  AwsCloudTrailTrailDetails' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> AwsCloudTrailTrailDetails
AwsCloudTrailTrailDetails'
    { $sel:logFileValidationEnabled:AwsCloudTrailTrailDetails' :: Maybe Bool
logFileValidationEnabled =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:trailArn:AwsCloudTrailTrailDetails' :: Maybe Text
trailArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:s3KeyPrefix:AwsCloudTrailTrailDetails' :: Maybe Text
s3KeyPrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:snsTopicArn:AwsCloudTrailTrailDetails' :: Maybe Text
snsTopicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:snsTopicName:AwsCloudTrailTrailDetails' :: Maybe Text
snsTopicName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudWatchLogsLogGroupArn:AwsCloudTrailTrailDetails' :: Maybe Text
cloudWatchLogsLogGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:AwsCloudTrailTrailDetails' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:homeRegion:AwsCloudTrailTrailDetails' :: Maybe Text
homeRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AwsCloudTrailTrailDetails' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:includeGlobalServiceEvents:AwsCloudTrailTrailDetails' :: Maybe Bool
includeGlobalServiceEvents = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:hasCustomEventSelectors:AwsCloudTrailTrailDetails' :: Maybe Bool
hasCustomEventSelectors = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:isOrganizationTrail:AwsCloudTrailTrailDetails' :: Maybe Bool
isOrganizationTrail = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudWatchLogsRoleArn:AwsCloudTrailTrailDetails' :: Maybe Text
cloudWatchLogsRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:s3BucketName:AwsCloudTrailTrailDetails' :: Maybe Text
s3BucketName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isMultiRegionTrail:AwsCloudTrailTrailDetails' :: Maybe Bool
isMultiRegionTrail = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether CloudTrail log file validation is enabled.
awsCloudTrailTrailDetails_logFileValidationEnabled :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Bool)
awsCloudTrailTrailDetails_logFileValidationEnabled :: (Maybe Bool -> f (Maybe Bool))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_logFileValidationEnabled = (AwsCloudTrailTrailDetails -> Maybe Bool)
-> (AwsCloudTrailTrailDetails
    -> Maybe Bool -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Bool
logFileValidationEnabled :: Maybe Bool
$sel:logFileValidationEnabled:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Bool
logFileValidationEnabled} -> Maybe Bool
logFileValidationEnabled) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Bool
a -> AwsCloudTrailTrailDetails
s {$sel:logFileValidationEnabled:AwsCloudTrailTrailDetails' :: Maybe Bool
logFileValidationEnabled = Maybe Bool
a} :: AwsCloudTrailTrailDetails)

-- | The ARN of the trail.
awsCloudTrailTrailDetails_trailArn :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Text)
awsCloudTrailTrailDetails_trailArn :: (Maybe Text -> f (Maybe Text))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_trailArn = (AwsCloudTrailTrailDetails -> Maybe Text)
-> (AwsCloudTrailTrailDetails
    -> Maybe Text -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Text
trailArn :: Maybe Text
$sel:trailArn:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
trailArn} -> Maybe Text
trailArn) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Text
a -> AwsCloudTrailTrailDetails
s {$sel:trailArn:AwsCloudTrailTrailDetails' :: Maybe Text
trailArn = Maybe Text
a} :: AwsCloudTrailTrailDetails)

-- | The S3 key prefix. The key prefix is added after the name of the S3
-- bucket where the log files are published.
awsCloudTrailTrailDetails_s3KeyPrefix :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Text)
awsCloudTrailTrailDetails_s3KeyPrefix :: (Maybe Text -> f (Maybe Text))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_s3KeyPrefix = (AwsCloudTrailTrailDetails -> Maybe Text)
-> (AwsCloudTrailTrailDetails
    -> Maybe Text -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Text
s3KeyPrefix :: Maybe Text
$sel:s3KeyPrefix:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
s3KeyPrefix} -> Maybe Text
s3KeyPrefix) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Text
a -> AwsCloudTrailTrailDetails
s {$sel:s3KeyPrefix:AwsCloudTrailTrailDetails' :: Maybe Text
s3KeyPrefix = Maybe Text
a} :: AwsCloudTrailTrailDetails)

-- | The ARN of the SNS topic that is used for notifications of log file
-- delivery.
awsCloudTrailTrailDetails_snsTopicArn :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Text)
awsCloudTrailTrailDetails_snsTopicArn :: (Maybe Text -> f (Maybe Text))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_snsTopicArn = (AwsCloudTrailTrailDetails -> Maybe Text)
-> (AwsCloudTrailTrailDetails
    -> Maybe Text -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Text
snsTopicArn :: Maybe Text
$sel:snsTopicArn:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
snsTopicArn} -> Maybe Text
snsTopicArn) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Text
a -> AwsCloudTrailTrailDetails
s {$sel:snsTopicArn:AwsCloudTrailTrailDetails' :: Maybe Text
snsTopicArn = Maybe Text
a} :: AwsCloudTrailTrailDetails)

-- | The name of the SNS topic that is used for notifications of log file
-- delivery.
awsCloudTrailTrailDetails_snsTopicName :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Text)
awsCloudTrailTrailDetails_snsTopicName :: (Maybe Text -> f (Maybe Text))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_snsTopicName = (AwsCloudTrailTrailDetails -> Maybe Text)
-> (AwsCloudTrailTrailDetails
    -> Maybe Text -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Text
snsTopicName :: Maybe Text
$sel:snsTopicName:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
snsTopicName} -> Maybe Text
snsTopicName) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Text
a -> AwsCloudTrailTrailDetails
s {$sel:snsTopicName:AwsCloudTrailTrailDetails' :: Maybe Text
snsTopicName = Maybe Text
a} :: AwsCloudTrailTrailDetails)

-- | The ARN of the log group that CloudTrail logs are delivered to.
awsCloudTrailTrailDetails_cloudWatchLogsLogGroupArn :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Text)
awsCloudTrailTrailDetails_cloudWatchLogsLogGroupArn :: (Maybe Text -> f (Maybe Text))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_cloudWatchLogsLogGroupArn = (AwsCloudTrailTrailDetails -> Maybe Text)
-> (AwsCloudTrailTrailDetails
    -> Maybe Text -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Text
cloudWatchLogsLogGroupArn :: Maybe Text
$sel:cloudWatchLogsLogGroupArn:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
cloudWatchLogsLogGroupArn} -> Maybe Text
cloudWatchLogsLogGroupArn) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Text
a -> AwsCloudTrailTrailDetails
s {$sel:cloudWatchLogsLogGroupArn:AwsCloudTrailTrailDetails' :: Maybe Text
cloudWatchLogsLogGroupArn = Maybe Text
a} :: AwsCloudTrailTrailDetails)

-- | The KMS key ID to use to encrypt the logs.
awsCloudTrailTrailDetails_kmsKeyId :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Text)
awsCloudTrailTrailDetails_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_kmsKeyId = (AwsCloudTrailTrailDetails -> Maybe Text)
-> (AwsCloudTrailTrailDetails
    -> Maybe Text -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Text
a -> AwsCloudTrailTrailDetails
s {$sel:kmsKeyId:AwsCloudTrailTrailDetails' :: Maybe Text
kmsKeyId = Maybe Text
a} :: AwsCloudTrailTrailDetails)

-- | The Region where the trail was created.
awsCloudTrailTrailDetails_homeRegion :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Text)
awsCloudTrailTrailDetails_homeRegion :: (Maybe Text -> f (Maybe Text))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_homeRegion = (AwsCloudTrailTrailDetails -> Maybe Text)
-> (AwsCloudTrailTrailDetails
    -> Maybe Text -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Text
homeRegion :: Maybe Text
$sel:homeRegion:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
homeRegion} -> Maybe Text
homeRegion) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Text
a -> AwsCloudTrailTrailDetails
s {$sel:homeRegion:AwsCloudTrailTrailDetails' :: Maybe Text
homeRegion = Maybe Text
a} :: AwsCloudTrailTrailDetails)

-- | The name of the trail.
awsCloudTrailTrailDetails_name :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Text)
awsCloudTrailTrailDetails_name :: (Maybe Text -> f (Maybe Text))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_name = (AwsCloudTrailTrailDetails -> Maybe Text)
-> (AwsCloudTrailTrailDetails
    -> Maybe Text -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Text
name :: Maybe Text
$sel:name:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
name} -> Maybe Text
name) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Text
a -> AwsCloudTrailTrailDetails
s {$sel:name:AwsCloudTrailTrailDetails' :: Maybe Text
name = Maybe Text
a} :: AwsCloudTrailTrailDetails)

-- | Indicates whether the trail publishes events from global services such
-- as IAM to the log files.
awsCloudTrailTrailDetails_includeGlobalServiceEvents :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Bool)
awsCloudTrailTrailDetails_includeGlobalServiceEvents :: (Maybe Bool -> f (Maybe Bool))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_includeGlobalServiceEvents = (AwsCloudTrailTrailDetails -> Maybe Bool)
-> (AwsCloudTrailTrailDetails
    -> Maybe Bool -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Bool
includeGlobalServiceEvents :: Maybe Bool
$sel:includeGlobalServiceEvents:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Bool
includeGlobalServiceEvents} -> Maybe Bool
includeGlobalServiceEvents) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Bool
a -> AwsCloudTrailTrailDetails
s {$sel:includeGlobalServiceEvents:AwsCloudTrailTrailDetails' :: Maybe Bool
includeGlobalServiceEvents = Maybe Bool
a} :: AwsCloudTrailTrailDetails)

-- | Indicates whether the trail has custom event selectors.
awsCloudTrailTrailDetails_hasCustomEventSelectors :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Bool)
awsCloudTrailTrailDetails_hasCustomEventSelectors :: (Maybe Bool -> f (Maybe Bool))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_hasCustomEventSelectors = (AwsCloudTrailTrailDetails -> Maybe Bool)
-> (AwsCloudTrailTrailDetails
    -> Maybe Bool -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Bool
hasCustomEventSelectors :: Maybe Bool
$sel:hasCustomEventSelectors:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Bool
hasCustomEventSelectors} -> Maybe Bool
hasCustomEventSelectors) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Bool
a -> AwsCloudTrailTrailDetails
s {$sel:hasCustomEventSelectors:AwsCloudTrailTrailDetails' :: Maybe Bool
hasCustomEventSelectors = Maybe Bool
a} :: AwsCloudTrailTrailDetails)

-- | Whether the trail is created for all accounts in an organization in
-- Organizations, or only for the current Amazon Web Services account.
awsCloudTrailTrailDetails_isOrganizationTrail :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Bool)
awsCloudTrailTrailDetails_isOrganizationTrail :: (Maybe Bool -> f (Maybe Bool))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_isOrganizationTrail = (AwsCloudTrailTrailDetails -> Maybe Bool)
-> (AwsCloudTrailTrailDetails
    -> Maybe Bool -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Bool
isOrganizationTrail :: Maybe Bool
$sel:isOrganizationTrail:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Bool
isOrganizationTrail} -> Maybe Bool
isOrganizationTrail) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Bool
a -> AwsCloudTrailTrailDetails
s {$sel:isOrganizationTrail:AwsCloudTrailTrailDetails' :: Maybe Bool
isOrganizationTrail = Maybe Bool
a} :: AwsCloudTrailTrailDetails)

-- | The ARN of the role that the CloudWatch Events endpoint assumes when it
-- writes to the log group.
awsCloudTrailTrailDetails_cloudWatchLogsRoleArn :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Text)
awsCloudTrailTrailDetails_cloudWatchLogsRoleArn :: (Maybe Text -> f (Maybe Text))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_cloudWatchLogsRoleArn = (AwsCloudTrailTrailDetails -> Maybe Text)
-> (AwsCloudTrailTrailDetails
    -> Maybe Text -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Text
cloudWatchLogsRoleArn :: Maybe Text
$sel:cloudWatchLogsRoleArn:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
cloudWatchLogsRoleArn} -> Maybe Text
cloudWatchLogsRoleArn) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Text
a -> AwsCloudTrailTrailDetails
s {$sel:cloudWatchLogsRoleArn:AwsCloudTrailTrailDetails' :: Maybe Text
cloudWatchLogsRoleArn = Maybe Text
a} :: AwsCloudTrailTrailDetails)

-- | The name of the S3 bucket where the log files are published.
awsCloudTrailTrailDetails_s3BucketName :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Text)
awsCloudTrailTrailDetails_s3BucketName :: (Maybe Text -> f (Maybe Text))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_s3BucketName = (AwsCloudTrailTrailDetails -> Maybe Text)
-> (AwsCloudTrailTrailDetails
    -> Maybe Text -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Text
s3BucketName :: Maybe Text
$sel:s3BucketName:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
s3BucketName} -> Maybe Text
s3BucketName) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Text
a -> AwsCloudTrailTrailDetails
s {$sel:s3BucketName:AwsCloudTrailTrailDetails' :: Maybe Text
s3BucketName = Maybe Text
a} :: AwsCloudTrailTrailDetails)

-- | Indicates whether the trail applies only to the current Region or to all
-- Regions.
awsCloudTrailTrailDetails_isMultiRegionTrail :: Lens.Lens' AwsCloudTrailTrailDetails (Prelude.Maybe Prelude.Bool)
awsCloudTrailTrailDetails_isMultiRegionTrail :: (Maybe Bool -> f (Maybe Bool))
-> AwsCloudTrailTrailDetails -> f AwsCloudTrailTrailDetails
awsCloudTrailTrailDetails_isMultiRegionTrail = (AwsCloudTrailTrailDetails -> Maybe Bool)
-> (AwsCloudTrailTrailDetails
    -> Maybe Bool -> AwsCloudTrailTrailDetails)
-> Lens
     AwsCloudTrailTrailDetails
     AwsCloudTrailTrailDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudTrailTrailDetails' {Maybe Bool
isMultiRegionTrail :: Maybe Bool
$sel:isMultiRegionTrail:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Bool
isMultiRegionTrail} -> Maybe Bool
isMultiRegionTrail) (\s :: AwsCloudTrailTrailDetails
s@AwsCloudTrailTrailDetails' {} Maybe Bool
a -> AwsCloudTrailTrailDetails
s {$sel:isMultiRegionTrail:AwsCloudTrailTrailDetails' :: Maybe Bool
isMultiRegionTrail = Maybe Bool
a} :: AwsCloudTrailTrailDetails)

instance Core.FromJSON AwsCloudTrailTrailDetails where
  parseJSON :: Value -> Parser AwsCloudTrailTrailDetails
parseJSON =
    String
-> (Object -> Parser AwsCloudTrailTrailDetails)
-> Value
-> Parser AwsCloudTrailTrailDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsCloudTrailTrailDetails"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> AwsCloudTrailTrailDetails
AwsCloudTrailTrailDetails'
            (Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LogFileValidationEnabled")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TrailArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"S3KeyPrefix")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SnsTopicArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SnsTopicName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CloudWatchLogsLogGroupArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KmsKeyId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HomeRegion")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IncludeGlobalServiceEvents")
            Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HasCustomEventSelectors")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Bool -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsOrganizationTrail")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Bool -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Bool -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CloudWatchLogsRoleArn")
            Parser (Maybe Text -> Maybe Bool -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> AwsCloudTrailTrailDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"S3BucketName")
            Parser (Maybe Bool -> AwsCloudTrailTrailDetails)
-> Parser (Maybe Bool) -> Parser AwsCloudTrailTrailDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsMultiRegionTrail")
      )

instance Prelude.Hashable AwsCloudTrailTrailDetails

instance Prelude.NFData AwsCloudTrailTrailDetails

instance Core.ToJSON AwsCloudTrailTrailDetails where
  toJSON :: AwsCloudTrailTrailDetails -> Value
toJSON AwsCloudTrailTrailDetails' {Maybe Bool
Maybe Text
isMultiRegionTrail :: Maybe Bool
s3BucketName :: Maybe Text
cloudWatchLogsRoleArn :: Maybe Text
isOrganizationTrail :: Maybe Bool
hasCustomEventSelectors :: Maybe Bool
includeGlobalServiceEvents :: Maybe Bool
name :: Maybe Text
homeRegion :: Maybe Text
kmsKeyId :: Maybe Text
cloudWatchLogsLogGroupArn :: Maybe Text
snsTopicName :: Maybe Text
snsTopicArn :: Maybe Text
s3KeyPrefix :: Maybe Text
trailArn :: Maybe Text
logFileValidationEnabled :: Maybe Bool
$sel:isMultiRegionTrail:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Bool
$sel:s3BucketName:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
$sel:cloudWatchLogsRoleArn:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
$sel:isOrganizationTrail:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Bool
$sel:hasCustomEventSelectors:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Bool
$sel:includeGlobalServiceEvents:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Bool
$sel:name:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
$sel:homeRegion:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
$sel:kmsKeyId:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
$sel:cloudWatchLogsLogGroupArn:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
$sel:snsTopicName:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
$sel:snsTopicArn:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
$sel:s3KeyPrefix:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
$sel:trailArn:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Text
$sel:logFileValidationEnabled:AwsCloudTrailTrailDetails' :: AwsCloudTrailTrailDetails -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"LogFileValidationEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
logFileValidationEnabled,
            (Text
"TrailArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
trailArn,
            (Text
"S3KeyPrefix" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3KeyPrefix,
            (Text
"SnsTopicArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
snsTopicArn,
            (Text
"SnsTopicName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
snsTopicName,
            (Text
"CloudWatchLogsLogGroupArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
cloudWatchLogsLogGroupArn,
            (Text
"KmsKeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
            (Text
"HomeRegion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
homeRegion,
            (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"IncludeGlobalServiceEvents" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeGlobalServiceEvents,
            (Text
"HasCustomEventSelectors" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
hasCustomEventSelectors,
            (Text
"IsOrganizationTrail" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
isOrganizationTrail,
            (Text
"CloudWatchLogsRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
cloudWatchLogsRoleArn,
            (Text
"S3BucketName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3BucketName,
            (Text
"IsMultiRegionTrail" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
isMultiRegionTrail
          ]
      )