{-# 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.CloudTrail.Types.Trail
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudTrail.Types.Trail where

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

-- | The settings for a trail.
--
-- /See:/ 'newTrail' smart constructor.
data Trail = Trail'
  { -- | Specifies an Amazon Resource Name (ARN), a unique identifier that
    -- represents the log group to which CloudTrail logs will be delivered.
    Trail -> Maybe Text
cloudWatchLogsLogGroupArn :: Prelude.Maybe Prelude.Text,
    -- | Specifies the role for the CloudWatch Logs endpoint to assume to write
    -- to a user\'s log group.
    Trail -> Maybe Text
cloudWatchLogsRoleArn :: Prelude.Maybe Prelude.Text,
    -- | Specifies if the trail has custom event selectors.
    Trail -> Maybe Bool
hasCustomEventSelectors :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether a trail has insight types specified in an
    -- @InsightSelector@ list.
    Trail -> Maybe Bool
hasInsightSelectors :: Prelude.Maybe Prelude.Bool,
    -- | The region in which the trail was created.
    Trail -> Maybe Text
homeRegion :: Prelude.Maybe Prelude.Text,
    -- | Set to __True__ to include Amazon Web Services API calls from Amazon Web
    -- Services global services such as IAM. Otherwise, __False__.
    Trail -> Maybe Bool
includeGlobalServiceEvents :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether the trail exists only in one region or exists in all
    -- regions.
    Trail -> Maybe Bool
isMultiRegionTrail :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether the trail is an organization trail.
    Trail -> Maybe Bool
isOrganizationTrail :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the KMS key ID that encrypts the logs 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@
    Trail -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether log file validation is enabled.
    Trail -> Maybe Bool
logFileValidationEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Name of the trail set by calling CreateTrail. The maximum length is 128
    -- characters.
    Trail -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Name of the Amazon S3 bucket into which CloudTrail delivers your trail
    -- files. See
    -- <https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html Amazon S3 Bucket Naming Requirements>.
    Trail -> Maybe Text
s3BucketName :: Prelude.Maybe Prelude.Text,
    -- | Specifies the Amazon S3 key prefix that comes after the name of the
    -- bucket you have designated for log file delivery. For more information,
    -- see
    -- <https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html Finding Your CloudTrail Log Files>.
    -- The maximum length is 200 characters.
    Trail -> Maybe Text
s3KeyPrefix :: Prelude.Maybe Prelude.Text,
    -- | Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send
    -- notifications when log files are delivered. The following is the format
    -- of a topic ARN.
    --
    -- @arn:aws:sns:us-east-2:123456789012:MyTopic@
    Trail -> Maybe Text
snsTopicARN :: Prelude.Maybe Prelude.Text,
    -- | This field is no longer in use. Use SnsTopicARN.
    Trail -> Maybe Text
snsTopicName :: Prelude.Maybe Prelude.Text,
    -- | Specifies the ARN of the trail. The following is the format of a trail
    -- ARN.
    --
    -- @arn:aws:cloudtrail:us-east-2:123456789012:trail\/MyTrail@
    Trail -> Maybe Text
trailARN :: Prelude.Maybe Prelude.Text
  }
  deriving (Trail -> Trail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Trail -> Trail -> Bool
$c/= :: Trail -> Trail -> Bool
== :: Trail -> Trail -> Bool
$c== :: Trail -> Trail -> Bool
Prelude.Eq, ReadPrec [Trail]
ReadPrec Trail
Int -> ReadS Trail
ReadS [Trail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Trail]
$creadListPrec :: ReadPrec [Trail]
readPrec :: ReadPrec Trail
$creadPrec :: ReadPrec Trail
readList :: ReadS [Trail]
$creadList :: ReadS [Trail]
readsPrec :: Int -> ReadS Trail
$creadsPrec :: Int -> ReadS Trail
Prelude.Read, Int -> Trail -> ShowS
[Trail] -> ShowS
Trail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Trail] -> ShowS
$cshowList :: [Trail] -> ShowS
show :: Trail -> String
$cshow :: Trail -> String
showsPrec :: Int -> Trail -> ShowS
$cshowsPrec :: Int -> Trail -> ShowS
Prelude.Show, forall x. Rep Trail x -> Trail
forall x. Trail -> Rep Trail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Trail x -> Trail
$cfrom :: forall x. Trail -> Rep Trail x
Prelude.Generic)

-- |
-- Create a value of 'Trail' 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:
--
-- 'cloudWatchLogsLogGroupArn', 'trail_cloudWatchLogsLogGroupArn' - Specifies an Amazon Resource Name (ARN), a unique identifier that
-- represents the log group to which CloudTrail logs will be delivered.
--
-- 'cloudWatchLogsRoleArn', 'trail_cloudWatchLogsRoleArn' - Specifies the role for the CloudWatch Logs endpoint to assume to write
-- to a user\'s log group.
--
-- 'hasCustomEventSelectors', 'trail_hasCustomEventSelectors' - Specifies if the trail has custom event selectors.
--
-- 'hasInsightSelectors', 'trail_hasInsightSelectors' - Specifies whether a trail has insight types specified in an
-- @InsightSelector@ list.
--
-- 'homeRegion', 'trail_homeRegion' - The region in which the trail was created.
--
-- 'includeGlobalServiceEvents', 'trail_includeGlobalServiceEvents' - Set to __True__ to include Amazon Web Services API calls from Amazon Web
-- Services global services such as IAM. Otherwise, __False__.
--
-- 'isMultiRegionTrail', 'trail_isMultiRegionTrail' - Specifies whether the trail exists only in one region or exists in all
-- regions.
--
-- 'isOrganizationTrail', 'trail_isOrganizationTrail' - Specifies whether the trail is an organization trail.
--
-- 'kmsKeyId', 'trail_kmsKeyId' - Specifies the KMS key ID that encrypts the logs 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@
--
-- 'logFileValidationEnabled', 'trail_logFileValidationEnabled' - Specifies whether log file validation is enabled.
--
-- 'name', 'trail_name' - Name of the trail set by calling CreateTrail. The maximum length is 128
-- characters.
--
-- 's3BucketName', 'trail_s3BucketName' - Name of the Amazon S3 bucket into which CloudTrail delivers your trail
-- files. See
-- <https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html Amazon S3 Bucket Naming Requirements>.
--
-- 's3KeyPrefix', 'trail_s3KeyPrefix' - Specifies the Amazon S3 key prefix that comes after the name of the
-- bucket you have designated for log file delivery. For more information,
-- see
-- <https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html Finding Your CloudTrail Log Files>.
-- The maximum length is 200 characters.
--
-- 'snsTopicARN', 'trail_snsTopicARN' - Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send
-- notifications when log files are delivered. The following is the format
-- of a topic ARN.
--
-- @arn:aws:sns:us-east-2:123456789012:MyTopic@
--
-- 'snsTopicName', 'trail_snsTopicName' - This field is no longer in use. Use SnsTopicARN.
--
-- 'trailARN', 'trail_trailARN' - Specifies the ARN of the trail. The following is the format of a trail
-- ARN.
--
-- @arn:aws:cloudtrail:us-east-2:123456789012:trail\/MyTrail@
newTrail ::
  Trail
newTrail :: Trail
newTrail =
  Trail'
    { $sel:cloudWatchLogsLogGroupArn:Trail' :: Maybe Text
cloudWatchLogsLogGroupArn = forall a. Maybe a
Prelude.Nothing,
      $sel:cloudWatchLogsRoleArn:Trail' :: Maybe Text
cloudWatchLogsRoleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:hasCustomEventSelectors:Trail' :: Maybe Bool
hasCustomEventSelectors = forall a. Maybe a
Prelude.Nothing,
      $sel:hasInsightSelectors:Trail' :: Maybe Bool
hasInsightSelectors = forall a. Maybe a
Prelude.Nothing,
      $sel:homeRegion:Trail' :: Maybe Text
homeRegion = forall a. Maybe a
Prelude.Nothing,
      $sel:includeGlobalServiceEvents:Trail' :: Maybe Bool
includeGlobalServiceEvents = forall a. Maybe a
Prelude.Nothing,
      $sel:isMultiRegionTrail:Trail' :: Maybe Bool
isMultiRegionTrail = forall a. Maybe a
Prelude.Nothing,
      $sel:isOrganizationTrail:Trail' :: Maybe Bool
isOrganizationTrail = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:Trail' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
      $sel:logFileValidationEnabled:Trail' :: Maybe Bool
logFileValidationEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:name:Trail' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:s3BucketName:Trail' :: Maybe Text
s3BucketName = forall a. Maybe a
Prelude.Nothing,
      $sel:s3KeyPrefix:Trail' :: Maybe Text
s3KeyPrefix = forall a. Maybe a
Prelude.Nothing,
      $sel:snsTopicARN:Trail' :: Maybe Text
snsTopicARN = forall a. Maybe a
Prelude.Nothing,
      $sel:snsTopicName:Trail' :: Maybe Text
snsTopicName = forall a. Maybe a
Prelude.Nothing,
      $sel:trailARN:Trail' :: Maybe Text
trailARN = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies an Amazon Resource Name (ARN), a unique identifier that
-- represents the log group to which CloudTrail logs will be delivered.
trail_cloudWatchLogsLogGroupArn :: Lens.Lens' Trail (Prelude.Maybe Prelude.Text)
trail_cloudWatchLogsLogGroupArn :: Lens' Trail (Maybe Text)
trail_cloudWatchLogsLogGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Text
cloudWatchLogsLogGroupArn :: Maybe Text
$sel:cloudWatchLogsLogGroupArn:Trail' :: Trail -> Maybe Text
cloudWatchLogsLogGroupArn} -> Maybe Text
cloudWatchLogsLogGroupArn) (\s :: Trail
s@Trail' {} Maybe Text
a -> Trail
s {$sel:cloudWatchLogsLogGroupArn:Trail' :: Maybe Text
cloudWatchLogsLogGroupArn = Maybe Text
a} :: Trail)

-- | Specifies the role for the CloudWatch Logs endpoint to assume to write
-- to a user\'s log group.
trail_cloudWatchLogsRoleArn :: Lens.Lens' Trail (Prelude.Maybe Prelude.Text)
trail_cloudWatchLogsRoleArn :: Lens' Trail (Maybe Text)
trail_cloudWatchLogsRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Text
cloudWatchLogsRoleArn :: Maybe Text
$sel:cloudWatchLogsRoleArn:Trail' :: Trail -> Maybe Text
cloudWatchLogsRoleArn} -> Maybe Text
cloudWatchLogsRoleArn) (\s :: Trail
s@Trail' {} Maybe Text
a -> Trail
s {$sel:cloudWatchLogsRoleArn:Trail' :: Maybe Text
cloudWatchLogsRoleArn = Maybe Text
a} :: Trail)

-- | Specifies if the trail has custom event selectors.
trail_hasCustomEventSelectors :: Lens.Lens' Trail (Prelude.Maybe Prelude.Bool)
trail_hasCustomEventSelectors :: Lens' Trail (Maybe Bool)
trail_hasCustomEventSelectors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Bool
hasCustomEventSelectors :: Maybe Bool
$sel:hasCustomEventSelectors:Trail' :: Trail -> Maybe Bool
hasCustomEventSelectors} -> Maybe Bool
hasCustomEventSelectors) (\s :: Trail
s@Trail' {} Maybe Bool
a -> Trail
s {$sel:hasCustomEventSelectors:Trail' :: Maybe Bool
hasCustomEventSelectors = Maybe Bool
a} :: Trail)

-- | Specifies whether a trail has insight types specified in an
-- @InsightSelector@ list.
trail_hasInsightSelectors :: Lens.Lens' Trail (Prelude.Maybe Prelude.Bool)
trail_hasInsightSelectors :: Lens' Trail (Maybe Bool)
trail_hasInsightSelectors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Bool
hasInsightSelectors :: Maybe Bool
$sel:hasInsightSelectors:Trail' :: Trail -> Maybe Bool
hasInsightSelectors} -> Maybe Bool
hasInsightSelectors) (\s :: Trail
s@Trail' {} Maybe Bool
a -> Trail
s {$sel:hasInsightSelectors:Trail' :: Maybe Bool
hasInsightSelectors = Maybe Bool
a} :: Trail)

-- | The region in which the trail was created.
trail_homeRegion :: Lens.Lens' Trail (Prelude.Maybe Prelude.Text)
trail_homeRegion :: Lens' Trail (Maybe Text)
trail_homeRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Text
homeRegion :: Maybe Text
$sel:homeRegion:Trail' :: Trail -> Maybe Text
homeRegion} -> Maybe Text
homeRegion) (\s :: Trail
s@Trail' {} Maybe Text
a -> Trail
s {$sel:homeRegion:Trail' :: Maybe Text
homeRegion = Maybe Text
a} :: Trail)

-- | Set to __True__ to include Amazon Web Services API calls from Amazon Web
-- Services global services such as IAM. Otherwise, __False__.
trail_includeGlobalServiceEvents :: Lens.Lens' Trail (Prelude.Maybe Prelude.Bool)
trail_includeGlobalServiceEvents :: Lens' Trail (Maybe Bool)
trail_includeGlobalServiceEvents = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Bool
includeGlobalServiceEvents :: Maybe Bool
$sel:includeGlobalServiceEvents:Trail' :: Trail -> Maybe Bool
includeGlobalServiceEvents} -> Maybe Bool
includeGlobalServiceEvents) (\s :: Trail
s@Trail' {} Maybe Bool
a -> Trail
s {$sel:includeGlobalServiceEvents:Trail' :: Maybe Bool
includeGlobalServiceEvents = Maybe Bool
a} :: Trail)

-- | Specifies whether the trail exists only in one region or exists in all
-- regions.
trail_isMultiRegionTrail :: Lens.Lens' Trail (Prelude.Maybe Prelude.Bool)
trail_isMultiRegionTrail :: Lens' Trail (Maybe Bool)
trail_isMultiRegionTrail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Bool
isMultiRegionTrail :: Maybe Bool
$sel:isMultiRegionTrail:Trail' :: Trail -> Maybe Bool
isMultiRegionTrail} -> Maybe Bool
isMultiRegionTrail) (\s :: Trail
s@Trail' {} Maybe Bool
a -> Trail
s {$sel:isMultiRegionTrail:Trail' :: Maybe Bool
isMultiRegionTrail = Maybe Bool
a} :: Trail)

-- | Specifies whether the trail is an organization trail.
trail_isOrganizationTrail :: Lens.Lens' Trail (Prelude.Maybe Prelude.Bool)
trail_isOrganizationTrail :: Lens' Trail (Maybe Bool)
trail_isOrganizationTrail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Bool
isOrganizationTrail :: Maybe Bool
$sel:isOrganizationTrail:Trail' :: Trail -> Maybe Bool
isOrganizationTrail} -> Maybe Bool
isOrganizationTrail) (\s :: Trail
s@Trail' {} Maybe Bool
a -> Trail
s {$sel:isOrganizationTrail:Trail' :: Maybe Bool
isOrganizationTrail = Maybe Bool
a} :: Trail)

-- | Specifies the KMS key ID that encrypts the logs 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@
trail_kmsKeyId :: Lens.Lens' Trail (Prelude.Maybe Prelude.Text)
trail_kmsKeyId :: Lens' Trail (Maybe Text)
trail_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:Trail' :: Trail -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: Trail
s@Trail' {} Maybe Text
a -> Trail
s {$sel:kmsKeyId:Trail' :: Maybe Text
kmsKeyId = Maybe Text
a} :: Trail)

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

-- | Name of the trail set by calling CreateTrail. The maximum length is 128
-- characters.
trail_name :: Lens.Lens' Trail (Prelude.Maybe Prelude.Text)
trail_name :: Lens' Trail (Maybe Text)
trail_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Text
name :: Maybe Text
$sel:name:Trail' :: Trail -> Maybe Text
name} -> Maybe Text
name) (\s :: Trail
s@Trail' {} Maybe Text
a -> Trail
s {$sel:name:Trail' :: Maybe Text
name = Maybe Text
a} :: Trail)

-- | Name of the Amazon S3 bucket into which CloudTrail delivers your trail
-- files. See
-- <https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html Amazon S3 Bucket Naming Requirements>.
trail_s3BucketName :: Lens.Lens' Trail (Prelude.Maybe Prelude.Text)
trail_s3BucketName :: Lens' Trail (Maybe Text)
trail_s3BucketName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Text
s3BucketName :: Maybe Text
$sel:s3BucketName:Trail' :: Trail -> Maybe Text
s3BucketName} -> Maybe Text
s3BucketName) (\s :: Trail
s@Trail' {} Maybe Text
a -> Trail
s {$sel:s3BucketName:Trail' :: Maybe Text
s3BucketName = Maybe Text
a} :: Trail)

-- | Specifies the Amazon S3 key prefix that comes after the name of the
-- bucket you have designated for log file delivery. For more information,
-- see
-- <https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html Finding Your CloudTrail Log Files>.
-- The maximum length is 200 characters.
trail_s3KeyPrefix :: Lens.Lens' Trail (Prelude.Maybe Prelude.Text)
trail_s3KeyPrefix :: Lens' Trail (Maybe Text)
trail_s3KeyPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Text
s3KeyPrefix :: Maybe Text
$sel:s3KeyPrefix:Trail' :: Trail -> Maybe Text
s3KeyPrefix} -> Maybe Text
s3KeyPrefix) (\s :: Trail
s@Trail' {} Maybe Text
a -> Trail
s {$sel:s3KeyPrefix:Trail' :: Maybe Text
s3KeyPrefix = Maybe Text
a} :: Trail)

-- | Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send
-- notifications when log files are delivered. The following is the format
-- of a topic ARN.
--
-- @arn:aws:sns:us-east-2:123456789012:MyTopic@
trail_snsTopicARN :: Lens.Lens' Trail (Prelude.Maybe Prelude.Text)
trail_snsTopicARN :: Lens' Trail (Maybe Text)
trail_snsTopicARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Text
snsTopicARN :: Maybe Text
$sel:snsTopicARN:Trail' :: Trail -> Maybe Text
snsTopicARN} -> Maybe Text
snsTopicARN) (\s :: Trail
s@Trail' {} Maybe Text
a -> Trail
s {$sel:snsTopicARN:Trail' :: Maybe Text
snsTopicARN = Maybe Text
a} :: Trail)

-- | This field is no longer in use. Use SnsTopicARN.
trail_snsTopicName :: Lens.Lens' Trail (Prelude.Maybe Prelude.Text)
trail_snsTopicName :: Lens' Trail (Maybe Text)
trail_snsTopicName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Text
snsTopicName :: Maybe Text
$sel:snsTopicName:Trail' :: Trail -> Maybe Text
snsTopicName} -> Maybe Text
snsTopicName) (\s :: Trail
s@Trail' {} Maybe Text
a -> Trail
s {$sel:snsTopicName:Trail' :: Maybe Text
snsTopicName = Maybe Text
a} :: Trail)

-- | Specifies the ARN of the trail. The following is the format of a trail
-- ARN.
--
-- @arn:aws:cloudtrail:us-east-2:123456789012:trail\/MyTrail@
trail_trailARN :: Lens.Lens' Trail (Prelude.Maybe Prelude.Text)
trail_trailARN :: Lens' Trail (Maybe Text)
trail_trailARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Trail' {Maybe Text
trailARN :: Maybe Text
$sel:trailARN:Trail' :: Trail -> Maybe Text
trailARN} -> Maybe Text
trailARN) (\s :: Trail
s@Trail' {} Maybe Text
a -> Trail
s {$sel:trailARN:Trail' :: Maybe Text
trailARN = Maybe Text
a} :: Trail)

instance Data.FromJSON Trail where
  parseJSON :: Value -> Parser Trail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Trail"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Trail
Trail'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CloudWatchLogsLogGroupArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CloudWatchLogsRoleArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HasCustomEventSelectors")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HasInsightSelectors")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HomeRegion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IncludeGlobalServiceEvents")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IsMultiRegionTrail")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IsOrganizationTrail")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (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 -> Parser (Maybe a)
Data..:? Key
"LogFileValidationEnabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (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 -> Parser (Maybe a)
Data..:? Key
"S3BucketName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"S3KeyPrefix")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SnsTopicARN")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SnsTopicName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TrailARN")
      )

instance Prelude.Hashable Trail where
  hashWithSalt :: Int -> Trail -> Int
hashWithSalt Int
_salt Trail' {Maybe Bool
Maybe Text
trailARN :: Maybe Text
snsTopicName :: Maybe Text
snsTopicARN :: Maybe Text
s3KeyPrefix :: Maybe Text
s3BucketName :: Maybe Text
name :: Maybe Text
logFileValidationEnabled :: Maybe Bool
kmsKeyId :: Maybe Text
isOrganizationTrail :: Maybe Bool
isMultiRegionTrail :: Maybe Bool
includeGlobalServiceEvents :: Maybe Bool
homeRegion :: Maybe Text
hasInsightSelectors :: Maybe Bool
hasCustomEventSelectors :: Maybe Bool
cloudWatchLogsRoleArn :: Maybe Text
cloudWatchLogsLogGroupArn :: Maybe Text
$sel:trailARN:Trail' :: Trail -> Maybe Text
$sel:snsTopicName:Trail' :: Trail -> Maybe Text
$sel:snsTopicARN:Trail' :: Trail -> Maybe Text
$sel:s3KeyPrefix:Trail' :: Trail -> Maybe Text
$sel:s3BucketName:Trail' :: Trail -> Maybe Text
$sel:name:Trail' :: Trail -> Maybe Text
$sel:logFileValidationEnabled:Trail' :: Trail -> Maybe Bool
$sel:kmsKeyId:Trail' :: Trail -> Maybe Text
$sel:isOrganizationTrail:Trail' :: Trail -> Maybe Bool
$sel:isMultiRegionTrail:Trail' :: Trail -> Maybe Bool
$sel:includeGlobalServiceEvents:Trail' :: Trail -> Maybe Bool
$sel:homeRegion:Trail' :: Trail -> Maybe Text
$sel:hasInsightSelectors:Trail' :: Trail -> Maybe Bool
$sel:hasCustomEventSelectors:Trail' :: Trail -> Maybe Bool
$sel:cloudWatchLogsRoleArn:Trail' :: Trail -> Maybe Text
$sel:cloudWatchLogsLogGroupArn:Trail' :: Trail -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cloudWatchLogsLogGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cloudWatchLogsRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
hasCustomEventSelectors
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
hasInsightSelectors
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
homeRegion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
includeGlobalServiceEvents
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isMultiRegionTrail
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isOrganizationTrail
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
logFileValidationEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3BucketName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3KeyPrefix
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snsTopicARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snsTopicName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
trailARN

instance Prelude.NFData Trail where
  rnf :: Trail -> ()
rnf Trail' {Maybe Bool
Maybe Text
trailARN :: Maybe Text
snsTopicName :: Maybe Text
snsTopicARN :: Maybe Text
s3KeyPrefix :: Maybe Text
s3BucketName :: Maybe Text
name :: Maybe Text
logFileValidationEnabled :: Maybe Bool
kmsKeyId :: Maybe Text
isOrganizationTrail :: Maybe Bool
isMultiRegionTrail :: Maybe Bool
includeGlobalServiceEvents :: Maybe Bool
homeRegion :: Maybe Text
hasInsightSelectors :: Maybe Bool
hasCustomEventSelectors :: Maybe Bool
cloudWatchLogsRoleArn :: Maybe Text
cloudWatchLogsLogGroupArn :: Maybe Text
$sel:trailARN:Trail' :: Trail -> Maybe Text
$sel:snsTopicName:Trail' :: Trail -> Maybe Text
$sel:snsTopicARN:Trail' :: Trail -> Maybe Text
$sel:s3KeyPrefix:Trail' :: Trail -> Maybe Text
$sel:s3BucketName:Trail' :: Trail -> Maybe Text
$sel:name:Trail' :: Trail -> Maybe Text
$sel:logFileValidationEnabled:Trail' :: Trail -> Maybe Bool
$sel:kmsKeyId:Trail' :: Trail -> Maybe Text
$sel:isOrganizationTrail:Trail' :: Trail -> Maybe Bool
$sel:isMultiRegionTrail:Trail' :: Trail -> Maybe Bool
$sel:includeGlobalServiceEvents:Trail' :: Trail -> Maybe Bool
$sel:homeRegion:Trail' :: Trail -> Maybe Text
$sel:hasInsightSelectors:Trail' :: Trail -> Maybe Bool
$sel:hasCustomEventSelectors:Trail' :: Trail -> Maybe Bool
$sel:cloudWatchLogsRoleArn:Trail' :: Trail -> Maybe Text
$sel:cloudWatchLogsLogGroupArn:Trail' :: Trail -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cloudWatchLogsLogGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cloudWatchLogsRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
hasCustomEventSelectors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
hasInsightSelectors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
homeRegion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
includeGlobalServiceEvents
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isMultiRegionTrail
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isOrganizationTrail
      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
logFileValidationEnabled
      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 Text
s3BucketName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3KeyPrefix
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snsTopicARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snsTopicName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
trailARN