{-# 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.VerifiedAccessLogCloudWatchLogsDestination
-- 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.VerifiedAccessLogCloudWatchLogsDestination 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.VerifiedAccessLogDeliveryStatus
import qualified Amazonka.Prelude as Prelude

-- | Options for CloudWatch Logs as a logging destination.
--
-- /See:/ 'newVerifiedAccessLogCloudWatchLogsDestination' smart constructor.
data VerifiedAccessLogCloudWatchLogsDestination = VerifiedAccessLogCloudWatchLogsDestination'
  { -- | The delivery status for access logs.
    VerifiedAccessLogCloudWatchLogsDestination
-> Maybe VerifiedAccessLogDeliveryStatus
deliveryStatus :: Prelude.Maybe VerifiedAccessLogDeliveryStatus,
    -- | Indicates whether logging is enabled.
    VerifiedAccessLogCloudWatchLogsDestination -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the CloudWatch Logs log group.
    VerifiedAccessLogCloudWatchLogsDestination -> Maybe Text
logGroup :: Prelude.Maybe Prelude.Text
  }
  deriving (VerifiedAccessLogCloudWatchLogsDestination
-> VerifiedAccessLogCloudWatchLogsDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifiedAccessLogCloudWatchLogsDestination
-> VerifiedAccessLogCloudWatchLogsDestination -> Bool
$c/= :: VerifiedAccessLogCloudWatchLogsDestination
-> VerifiedAccessLogCloudWatchLogsDestination -> Bool
== :: VerifiedAccessLogCloudWatchLogsDestination
-> VerifiedAccessLogCloudWatchLogsDestination -> Bool
$c== :: VerifiedAccessLogCloudWatchLogsDestination
-> VerifiedAccessLogCloudWatchLogsDestination -> Bool
Prelude.Eq, ReadPrec [VerifiedAccessLogCloudWatchLogsDestination]
ReadPrec VerifiedAccessLogCloudWatchLogsDestination
Int -> ReadS VerifiedAccessLogCloudWatchLogsDestination
ReadS [VerifiedAccessLogCloudWatchLogsDestination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifiedAccessLogCloudWatchLogsDestination]
$creadListPrec :: ReadPrec [VerifiedAccessLogCloudWatchLogsDestination]
readPrec :: ReadPrec VerifiedAccessLogCloudWatchLogsDestination
$creadPrec :: ReadPrec VerifiedAccessLogCloudWatchLogsDestination
readList :: ReadS [VerifiedAccessLogCloudWatchLogsDestination]
$creadList :: ReadS [VerifiedAccessLogCloudWatchLogsDestination]
readsPrec :: Int -> ReadS VerifiedAccessLogCloudWatchLogsDestination
$creadsPrec :: Int -> ReadS VerifiedAccessLogCloudWatchLogsDestination
Prelude.Read, Int -> VerifiedAccessLogCloudWatchLogsDestination -> ShowS
[VerifiedAccessLogCloudWatchLogsDestination] -> ShowS
VerifiedAccessLogCloudWatchLogsDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifiedAccessLogCloudWatchLogsDestination] -> ShowS
$cshowList :: [VerifiedAccessLogCloudWatchLogsDestination] -> ShowS
show :: VerifiedAccessLogCloudWatchLogsDestination -> String
$cshow :: VerifiedAccessLogCloudWatchLogsDestination -> String
showsPrec :: Int -> VerifiedAccessLogCloudWatchLogsDestination -> ShowS
$cshowsPrec :: Int -> VerifiedAccessLogCloudWatchLogsDestination -> ShowS
Prelude.Show, forall x.
Rep VerifiedAccessLogCloudWatchLogsDestination x
-> VerifiedAccessLogCloudWatchLogsDestination
forall x.
VerifiedAccessLogCloudWatchLogsDestination
-> Rep VerifiedAccessLogCloudWatchLogsDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VerifiedAccessLogCloudWatchLogsDestination x
-> VerifiedAccessLogCloudWatchLogsDestination
$cfrom :: forall x.
VerifiedAccessLogCloudWatchLogsDestination
-> Rep VerifiedAccessLogCloudWatchLogsDestination x
Prelude.Generic)

-- |
-- Create a value of 'VerifiedAccessLogCloudWatchLogsDestination' 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:
--
-- 'deliveryStatus', 'verifiedAccessLogCloudWatchLogsDestination_deliveryStatus' - The delivery status for access logs.
--
-- 'enabled', 'verifiedAccessLogCloudWatchLogsDestination_enabled' - Indicates whether logging is enabled.
--
-- 'logGroup', 'verifiedAccessLogCloudWatchLogsDestination_logGroup' - The ID of the CloudWatch Logs log group.
newVerifiedAccessLogCloudWatchLogsDestination ::
  VerifiedAccessLogCloudWatchLogsDestination
newVerifiedAccessLogCloudWatchLogsDestination :: VerifiedAccessLogCloudWatchLogsDestination
newVerifiedAccessLogCloudWatchLogsDestination =
  VerifiedAccessLogCloudWatchLogsDestination'
    { $sel:deliveryStatus:VerifiedAccessLogCloudWatchLogsDestination' :: Maybe VerifiedAccessLogDeliveryStatus
deliveryStatus =
        forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:VerifiedAccessLogCloudWatchLogsDestination' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
      $sel:logGroup:VerifiedAccessLogCloudWatchLogsDestination' :: Maybe Text
logGroup = forall a. Maybe a
Prelude.Nothing
    }

-- | The delivery status for access logs.
verifiedAccessLogCloudWatchLogsDestination_deliveryStatus :: Lens.Lens' VerifiedAccessLogCloudWatchLogsDestination (Prelude.Maybe VerifiedAccessLogDeliveryStatus)
verifiedAccessLogCloudWatchLogsDestination_deliveryStatus :: Lens'
  VerifiedAccessLogCloudWatchLogsDestination
  (Maybe VerifiedAccessLogDeliveryStatus)
verifiedAccessLogCloudWatchLogsDestination_deliveryStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessLogCloudWatchLogsDestination' {Maybe VerifiedAccessLogDeliveryStatus
deliveryStatus :: Maybe VerifiedAccessLogDeliveryStatus
$sel:deliveryStatus:VerifiedAccessLogCloudWatchLogsDestination' :: VerifiedAccessLogCloudWatchLogsDestination
-> Maybe VerifiedAccessLogDeliveryStatus
deliveryStatus} -> Maybe VerifiedAccessLogDeliveryStatus
deliveryStatus) (\s :: VerifiedAccessLogCloudWatchLogsDestination
s@VerifiedAccessLogCloudWatchLogsDestination' {} Maybe VerifiedAccessLogDeliveryStatus
a -> VerifiedAccessLogCloudWatchLogsDestination
s {$sel:deliveryStatus:VerifiedAccessLogCloudWatchLogsDestination' :: Maybe VerifiedAccessLogDeliveryStatus
deliveryStatus = Maybe VerifiedAccessLogDeliveryStatus
a} :: VerifiedAccessLogCloudWatchLogsDestination)

-- | Indicates whether logging is enabled.
verifiedAccessLogCloudWatchLogsDestination_enabled :: Lens.Lens' VerifiedAccessLogCloudWatchLogsDestination (Prelude.Maybe Prelude.Bool)
verifiedAccessLogCloudWatchLogsDestination_enabled :: Lens' VerifiedAccessLogCloudWatchLogsDestination (Maybe Bool)
verifiedAccessLogCloudWatchLogsDestination_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessLogCloudWatchLogsDestination' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:VerifiedAccessLogCloudWatchLogsDestination' :: VerifiedAccessLogCloudWatchLogsDestination -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: VerifiedAccessLogCloudWatchLogsDestination
s@VerifiedAccessLogCloudWatchLogsDestination' {} Maybe Bool
a -> VerifiedAccessLogCloudWatchLogsDestination
s {$sel:enabled:VerifiedAccessLogCloudWatchLogsDestination' :: Maybe Bool
enabled = Maybe Bool
a} :: VerifiedAccessLogCloudWatchLogsDestination)

-- | The ID of the CloudWatch Logs log group.
verifiedAccessLogCloudWatchLogsDestination_logGroup :: Lens.Lens' VerifiedAccessLogCloudWatchLogsDestination (Prelude.Maybe Prelude.Text)
verifiedAccessLogCloudWatchLogsDestination_logGroup :: Lens' VerifiedAccessLogCloudWatchLogsDestination (Maybe Text)
verifiedAccessLogCloudWatchLogsDestination_logGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessLogCloudWatchLogsDestination' {Maybe Text
logGroup :: Maybe Text
$sel:logGroup:VerifiedAccessLogCloudWatchLogsDestination' :: VerifiedAccessLogCloudWatchLogsDestination -> Maybe Text
logGroup} -> Maybe Text
logGroup) (\s :: VerifiedAccessLogCloudWatchLogsDestination
s@VerifiedAccessLogCloudWatchLogsDestination' {} Maybe Text
a -> VerifiedAccessLogCloudWatchLogsDestination
s {$sel:logGroup:VerifiedAccessLogCloudWatchLogsDestination' :: Maybe Text
logGroup = Maybe Text
a} :: VerifiedAccessLogCloudWatchLogsDestination)

instance
  Data.FromXML
    VerifiedAccessLogCloudWatchLogsDestination
  where
  parseXML :: [Node] -> Either String VerifiedAccessLogCloudWatchLogsDestination
parseXML [Node]
x =
    Maybe VerifiedAccessLogDeliveryStatus
-> Maybe Bool
-> Maybe Text
-> VerifiedAccessLogCloudWatchLogsDestination
VerifiedAccessLogCloudWatchLogsDestination'
      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
"deliveryStatus")
      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
"enabled")
      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
"logGroup")

instance
  Prelude.Hashable
    VerifiedAccessLogCloudWatchLogsDestination
  where
  hashWithSalt :: Int -> VerifiedAccessLogCloudWatchLogsDestination -> Int
hashWithSalt
    Int
_salt
    VerifiedAccessLogCloudWatchLogsDestination' {Maybe Bool
Maybe Text
Maybe VerifiedAccessLogDeliveryStatus
logGroup :: Maybe Text
enabled :: Maybe Bool
deliveryStatus :: Maybe VerifiedAccessLogDeliveryStatus
$sel:logGroup:VerifiedAccessLogCloudWatchLogsDestination' :: VerifiedAccessLogCloudWatchLogsDestination -> Maybe Text
$sel:enabled:VerifiedAccessLogCloudWatchLogsDestination' :: VerifiedAccessLogCloudWatchLogsDestination -> Maybe Bool
$sel:deliveryStatus:VerifiedAccessLogCloudWatchLogsDestination' :: VerifiedAccessLogCloudWatchLogsDestination
-> Maybe VerifiedAccessLogDeliveryStatus
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VerifiedAccessLogDeliveryStatus
deliveryStatus
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
logGroup

instance
  Prelude.NFData
    VerifiedAccessLogCloudWatchLogsDestination
  where
  rnf :: VerifiedAccessLogCloudWatchLogsDestination -> ()
rnf VerifiedAccessLogCloudWatchLogsDestination' {Maybe Bool
Maybe Text
Maybe VerifiedAccessLogDeliveryStatus
logGroup :: Maybe Text
enabled :: Maybe Bool
deliveryStatus :: Maybe VerifiedAccessLogDeliveryStatus
$sel:logGroup:VerifiedAccessLogCloudWatchLogsDestination' :: VerifiedAccessLogCloudWatchLogsDestination -> Maybe Text
$sel:enabled:VerifiedAccessLogCloudWatchLogsDestination' :: VerifiedAccessLogCloudWatchLogsDestination -> Maybe Bool
$sel:deliveryStatus:VerifiedAccessLogCloudWatchLogsDestination' :: VerifiedAccessLogCloudWatchLogsDestination
-> Maybe VerifiedAccessLogDeliveryStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe VerifiedAccessLogDeliveryStatus
deliveryStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
logGroup