{-# 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.EC2.Types.VerifiedAccessLogs
-- 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.EC2.Types.VerifiedAccessLogs where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.VerifiedAccessLogCloudWatchLogsDestination
import Amazonka.EC2.Types.VerifiedAccessLogKinesisDataFirehoseDestination
import Amazonka.EC2.Types.VerifiedAccessLogS3Destination
import qualified Amazonka.Prelude as Prelude

-- | Describes the destinations for Verified Access logs.
--
-- /See:/ 'newVerifiedAccessLogs' smart constructor.
data VerifiedAccessLogs = VerifiedAccessLogs'
  { -- | CloudWatch Logs logging destination.
    VerifiedAccessLogs
-> Maybe VerifiedAccessLogCloudWatchLogsDestination
cloudWatchLogs :: Prelude.Maybe VerifiedAccessLogCloudWatchLogsDestination,
    -- | Kinesis logging destination.
    VerifiedAccessLogs
-> Maybe VerifiedAccessLogKinesisDataFirehoseDestination
kinesisDataFirehose :: Prelude.Maybe VerifiedAccessLogKinesisDataFirehoseDestination,
    -- | Amazon S3 logging options.
    VerifiedAccessLogs -> Maybe VerifiedAccessLogS3Destination
s3 :: Prelude.Maybe VerifiedAccessLogS3Destination
  }
  deriving (VerifiedAccessLogs -> VerifiedAccessLogs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifiedAccessLogs -> VerifiedAccessLogs -> Bool
$c/= :: VerifiedAccessLogs -> VerifiedAccessLogs -> Bool
== :: VerifiedAccessLogs -> VerifiedAccessLogs -> Bool
$c== :: VerifiedAccessLogs -> VerifiedAccessLogs -> Bool
Prelude.Eq, ReadPrec [VerifiedAccessLogs]
ReadPrec VerifiedAccessLogs
Int -> ReadS VerifiedAccessLogs
ReadS [VerifiedAccessLogs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifiedAccessLogs]
$creadListPrec :: ReadPrec [VerifiedAccessLogs]
readPrec :: ReadPrec VerifiedAccessLogs
$creadPrec :: ReadPrec VerifiedAccessLogs
readList :: ReadS [VerifiedAccessLogs]
$creadList :: ReadS [VerifiedAccessLogs]
readsPrec :: Int -> ReadS VerifiedAccessLogs
$creadsPrec :: Int -> ReadS VerifiedAccessLogs
Prelude.Read, Int -> VerifiedAccessLogs -> ShowS
[VerifiedAccessLogs] -> ShowS
VerifiedAccessLogs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifiedAccessLogs] -> ShowS
$cshowList :: [VerifiedAccessLogs] -> ShowS
show :: VerifiedAccessLogs -> String
$cshow :: VerifiedAccessLogs -> String
showsPrec :: Int -> VerifiedAccessLogs -> ShowS
$cshowsPrec :: Int -> VerifiedAccessLogs -> ShowS
Prelude.Show, forall x. Rep VerifiedAccessLogs x -> VerifiedAccessLogs
forall x. VerifiedAccessLogs -> Rep VerifiedAccessLogs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VerifiedAccessLogs x -> VerifiedAccessLogs
$cfrom :: forall x. VerifiedAccessLogs -> Rep VerifiedAccessLogs x
Prelude.Generic)

-- |
-- Create a value of 'VerifiedAccessLogs' 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:
--
-- 'cloudWatchLogs', 'verifiedAccessLogs_cloudWatchLogs' - CloudWatch Logs logging destination.
--
-- 'kinesisDataFirehose', 'verifiedAccessLogs_kinesisDataFirehose' - Kinesis logging destination.
--
-- 's3', 'verifiedAccessLogs_s3' - Amazon S3 logging options.
newVerifiedAccessLogs ::
  VerifiedAccessLogs
newVerifiedAccessLogs :: VerifiedAccessLogs
newVerifiedAccessLogs =
  VerifiedAccessLogs'
    { $sel:cloudWatchLogs:VerifiedAccessLogs' :: Maybe VerifiedAccessLogCloudWatchLogsDestination
cloudWatchLogs =
        forall a. Maybe a
Prelude.Nothing,
      $sel:kinesisDataFirehose:VerifiedAccessLogs' :: Maybe VerifiedAccessLogKinesisDataFirehoseDestination
kinesisDataFirehose = forall a. Maybe a
Prelude.Nothing,
      $sel:s3:VerifiedAccessLogs' :: Maybe VerifiedAccessLogS3Destination
s3 = forall a. Maybe a
Prelude.Nothing
    }

-- | CloudWatch Logs logging destination.
verifiedAccessLogs_cloudWatchLogs :: Lens.Lens' VerifiedAccessLogs (Prelude.Maybe VerifiedAccessLogCloudWatchLogsDestination)
verifiedAccessLogs_cloudWatchLogs :: Lens'
  VerifiedAccessLogs
  (Maybe VerifiedAccessLogCloudWatchLogsDestination)
verifiedAccessLogs_cloudWatchLogs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessLogs' {Maybe VerifiedAccessLogCloudWatchLogsDestination
cloudWatchLogs :: Maybe VerifiedAccessLogCloudWatchLogsDestination
$sel:cloudWatchLogs:VerifiedAccessLogs' :: VerifiedAccessLogs
-> Maybe VerifiedAccessLogCloudWatchLogsDestination
cloudWatchLogs} -> Maybe VerifiedAccessLogCloudWatchLogsDestination
cloudWatchLogs) (\s :: VerifiedAccessLogs
s@VerifiedAccessLogs' {} Maybe VerifiedAccessLogCloudWatchLogsDestination
a -> VerifiedAccessLogs
s {$sel:cloudWatchLogs:VerifiedAccessLogs' :: Maybe VerifiedAccessLogCloudWatchLogsDestination
cloudWatchLogs = Maybe VerifiedAccessLogCloudWatchLogsDestination
a} :: VerifiedAccessLogs)

-- | Kinesis logging destination.
verifiedAccessLogs_kinesisDataFirehose :: Lens.Lens' VerifiedAccessLogs (Prelude.Maybe VerifiedAccessLogKinesisDataFirehoseDestination)
verifiedAccessLogs_kinesisDataFirehose :: Lens'
  VerifiedAccessLogs
  (Maybe VerifiedAccessLogKinesisDataFirehoseDestination)
verifiedAccessLogs_kinesisDataFirehose = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessLogs' {Maybe VerifiedAccessLogKinesisDataFirehoseDestination
kinesisDataFirehose :: Maybe VerifiedAccessLogKinesisDataFirehoseDestination
$sel:kinesisDataFirehose:VerifiedAccessLogs' :: VerifiedAccessLogs
-> Maybe VerifiedAccessLogKinesisDataFirehoseDestination
kinesisDataFirehose} -> Maybe VerifiedAccessLogKinesisDataFirehoseDestination
kinesisDataFirehose) (\s :: VerifiedAccessLogs
s@VerifiedAccessLogs' {} Maybe VerifiedAccessLogKinesisDataFirehoseDestination
a -> VerifiedAccessLogs
s {$sel:kinesisDataFirehose:VerifiedAccessLogs' :: Maybe VerifiedAccessLogKinesisDataFirehoseDestination
kinesisDataFirehose = Maybe VerifiedAccessLogKinesisDataFirehoseDestination
a} :: VerifiedAccessLogs)

-- | Amazon S3 logging options.
verifiedAccessLogs_s3 :: Lens.Lens' VerifiedAccessLogs (Prelude.Maybe VerifiedAccessLogS3Destination)
verifiedAccessLogs_s3 :: Lens' VerifiedAccessLogs (Maybe VerifiedAccessLogS3Destination)
verifiedAccessLogs_s3 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessLogs' {Maybe VerifiedAccessLogS3Destination
s3 :: Maybe VerifiedAccessLogS3Destination
$sel:s3:VerifiedAccessLogs' :: VerifiedAccessLogs -> Maybe VerifiedAccessLogS3Destination
s3} -> Maybe VerifiedAccessLogS3Destination
s3) (\s :: VerifiedAccessLogs
s@VerifiedAccessLogs' {} Maybe VerifiedAccessLogS3Destination
a -> VerifiedAccessLogs
s {$sel:s3:VerifiedAccessLogs' :: Maybe VerifiedAccessLogS3Destination
s3 = Maybe VerifiedAccessLogS3Destination
a} :: VerifiedAccessLogs)

instance Data.FromXML VerifiedAccessLogs where
  parseXML :: [Node] -> Either String VerifiedAccessLogs
parseXML [Node]
x =
    Maybe VerifiedAccessLogCloudWatchLogsDestination
-> Maybe VerifiedAccessLogKinesisDataFirehoseDestination
-> Maybe VerifiedAccessLogS3Destination
-> VerifiedAccessLogs
VerifiedAccessLogs'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"cloudWatchLogs")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"kinesisDataFirehose")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"s3")

instance Prelude.Hashable VerifiedAccessLogs where
  hashWithSalt :: Int -> VerifiedAccessLogs -> Int
hashWithSalt Int
_salt VerifiedAccessLogs' {Maybe VerifiedAccessLogCloudWatchLogsDestination
Maybe VerifiedAccessLogKinesisDataFirehoseDestination
Maybe VerifiedAccessLogS3Destination
s3 :: Maybe VerifiedAccessLogS3Destination
kinesisDataFirehose :: Maybe VerifiedAccessLogKinesisDataFirehoseDestination
cloudWatchLogs :: Maybe VerifiedAccessLogCloudWatchLogsDestination
$sel:s3:VerifiedAccessLogs' :: VerifiedAccessLogs -> Maybe VerifiedAccessLogS3Destination
$sel:kinesisDataFirehose:VerifiedAccessLogs' :: VerifiedAccessLogs
-> Maybe VerifiedAccessLogKinesisDataFirehoseDestination
$sel:cloudWatchLogs:VerifiedAccessLogs' :: VerifiedAccessLogs
-> Maybe VerifiedAccessLogCloudWatchLogsDestination
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VerifiedAccessLogCloudWatchLogsDestination
cloudWatchLogs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VerifiedAccessLogKinesisDataFirehoseDestination
kinesisDataFirehose
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VerifiedAccessLogS3Destination
s3

instance Prelude.NFData VerifiedAccessLogs where
  rnf :: VerifiedAccessLogs -> ()
rnf VerifiedAccessLogs' {Maybe VerifiedAccessLogCloudWatchLogsDestination
Maybe VerifiedAccessLogKinesisDataFirehoseDestination
Maybe VerifiedAccessLogS3Destination
s3 :: Maybe VerifiedAccessLogS3Destination
kinesisDataFirehose :: Maybe VerifiedAccessLogKinesisDataFirehoseDestination
cloudWatchLogs :: Maybe VerifiedAccessLogCloudWatchLogsDestination
$sel:s3:VerifiedAccessLogs' :: VerifiedAccessLogs -> Maybe VerifiedAccessLogS3Destination
$sel:kinesisDataFirehose:VerifiedAccessLogs' :: VerifiedAccessLogs
-> Maybe VerifiedAccessLogKinesisDataFirehoseDestination
$sel:cloudWatchLogs:VerifiedAccessLogs' :: VerifiedAccessLogs
-> Maybe VerifiedAccessLogCloudWatchLogsDestination
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe VerifiedAccessLogCloudWatchLogsDestination
cloudWatchLogs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VerifiedAccessLogKinesisDataFirehoseDestination
kinesisDataFirehose
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VerifiedAccessLogS3Destination
s3