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

-- | Describes logging options for an Amazon Web Services Verified Access
-- instance.
--
-- /See:/ 'newVerifiedAccessInstanceLoggingConfiguration' smart constructor.
data VerifiedAccessInstanceLoggingConfiguration = VerifiedAccessInstanceLoggingConfiguration'
  { -- | Details about the logging options.
    VerifiedAccessInstanceLoggingConfiguration
-> Maybe VerifiedAccessLogs
accessLogs :: Prelude.Maybe VerifiedAccessLogs,
    -- | The ID of the Amazon Web Services Verified Access instance.
    VerifiedAccessInstanceLoggingConfiguration -> Maybe Text
verifiedAccessInstanceId :: Prelude.Maybe Prelude.Text
  }
  deriving (VerifiedAccessInstanceLoggingConfiguration
-> VerifiedAccessInstanceLoggingConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifiedAccessInstanceLoggingConfiguration
-> VerifiedAccessInstanceLoggingConfiguration -> Bool
$c/= :: VerifiedAccessInstanceLoggingConfiguration
-> VerifiedAccessInstanceLoggingConfiguration -> Bool
== :: VerifiedAccessInstanceLoggingConfiguration
-> VerifiedAccessInstanceLoggingConfiguration -> Bool
$c== :: VerifiedAccessInstanceLoggingConfiguration
-> VerifiedAccessInstanceLoggingConfiguration -> Bool
Prelude.Eq, ReadPrec [VerifiedAccessInstanceLoggingConfiguration]
ReadPrec VerifiedAccessInstanceLoggingConfiguration
Int -> ReadS VerifiedAccessInstanceLoggingConfiguration
ReadS [VerifiedAccessInstanceLoggingConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifiedAccessInstanceLoggingConfiguration]
$creadListPrec :: ReadPrec [VerifiedAccessInstanceLoggingConfiguration]
readPrec :: ReadPrec VerifiedAccessInstanceLoggingConfiguration
$creadPrec :: ReadPrec VerifiedAccessInstanceLoggingConfiguration
readList :: ReadS [VerifiedAccessInstanceLoggingConfiguration]
$creadList :: ReadS [VerifiedAccessInstanceLoggingConfiguration]
readsPrec :: Int -> ReadS VerifiedAccessInstanceLoggingConfiguration
$creadsPrec :: Int -> ReadS VerifiedAccessInstanceLoggingConfiguration
Prelude.Read, Int -> VerifiedAccessInstanceLoggingConfiguration -> ShowS
[VerifiedAccessInstanceLoggingConfiguration] -> ShowS
VerifiedAccessInstanceLoggingConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifiedAccessInstanceLoggingConfiguration] -> ShowS
$cshowList :: [VerifiedAccessInstanceLoggingConfiguration] -> ShowS
show :: VerifiedAccessInstanceLoggingConfiguration -> String
$cshow :: VerifiedAccessInstanceLoggingConfiguration -> String
showsPrec :: Int -> VerifiedAccessInstanceLoggingConfiguration -> ShowS
$cshowsPrec :: Int -> VerifiedAccessInstanceLoggingConfiguration -> ShowS
Prelude.Show, forall x.
Rep VerifiedAccessInstanceLoggingConfiguration x
-> VerifiedAccessInstanceLoggingConfiguration
forall x.
VerifiedAccessInstanceLoggingConfiguration
-> Rep VerifiedAccessInstanceLoggingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VerifiedAccessInstanceLoggingConfiguration x
-> VerifiedAccessInstanceLoggingConfiguration
$cfrom :: forall x.
VerifiedAccessInstanceLoggingConfiguration
-> Rep VerifiedAccessInstanceLoggingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'VerifiedAccessInstanceLoggingConfiguration' 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:
--
-- 'accessLogs', 'verifiedAccessInstanceLoggingConfiguration_accessLogs' - Details about the logging options.
--
-- 'verifiedAccessInstanceId', 'verifiedAccessInstanceLoggingConfiguration_verifiedAccessInstanceId' - The ID of the Amazon Web Services Verified Access instance.
newVerifiedAccessInstanceLoggingConfiguration ::
  VerifiedAccessInstanceLoggingConfiguration
newVerifiedAccessInstanceLoggingConfiguration :: VerifiedAccessInstanceLoggingConfiguration
newVerifiedAccessInstanceLoggingConfiguration =
  VerifiedAccessInstanceLoggingConfiguration'
    { $sel:accessLogs:VerifiedAccessInstanceLoggingConfiguration' :: Maybe VerifiedAccessLogs
accessLogs =
        forall a. Maybe a
Prelude.Nothing,
      $sel:verifiedAccessInstanceId:VerifiedAccessInstanceLoggingConfiguration' :: Maybe Text
verifiedAccessInstanceId =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Details about the logging options.
verifiedAccessInstanceLoggingConfiguration_accessLogs :: Lens.Lens' VerifiedAccessInstanceLoggingConfiguration (Prelude.Maybe VerifiedAccessLogs)
verifiedAccessInstanceLoggingConfiguration_accessLogs :: Lens'
  VerifiedAccessInstanceLoggingConfiguration
  (Maybe VerifiedAccessLogs)
verifiedAccessInstanceLoggingConfiguration_accessLogs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessInstanceLoggingConfiguration' {Maybe VerifiedAccessLogs
accessLogs :: Maybe VerifiedAccessLogs
$sel:accessLogs:VerifiedAccessInstanceLoggingConfiguration' :: VerifiedAccessInstanceLoggingConfiguration
-> Maybe VerifiedAccessLogs
accessLogs} -> Maybe VerifiedAccessLogs
accessLogs) (\s :: VerifiedAccessInstanceLoggingConfiguration
s@VerifiedAccessInstanceLoggingConfiguration' {} Maybe VerifiedAccessLogs
a -> VerifiedAccessInstanceLoggingConfiguration
s {$sel:accessLogs:VerifiedAccessInstanceLoggingConfiguration' :: Maybe VerifiedAccessLogs
accessLogs = Maybe VerifiedAccessLogs
a} :: VerifiedAccessInstanceLoggingConfiguration)

-- | The ID of the Amazon Web Services Verified Access instance.
verifiedAccessInstanceLoggingConfiguration_verifiedAccessInstanceId :: Lens.Lens' VerifiedAccessInstanceLoggingConfiguration (Prelude.Maybe Prelude.Text)
verifiedAccessInstanceLoggingConfiguration_verifiedAccessInstanceId :: Lens' VerifiedAccessInstanceLoggingConfiguration (Maybe Text)
verifiedAccessInstanceLoggingConfiguration_verifiedAccessInstanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessInstanceLoggingConfiguration' {Maybe Text
verifiedAccessInstanceId :: Maybe Text
$sel:verifiedAccessInstanceId:VerifiedAccessInstanceLoggingConfiguration' :: VerifiedAccessInstanceLoggingConfiguration -> Maybe Text
verifiedAccessInstanceId} -> Maybe Text
verifiedAccessInstanceId) (\s :: VerifiedAccessInstanceLoggingConfiguration
s@VerifiedAccessInstanceLoggingConfiguration' {} Maybe Text
a -> VerifiedAccessInstanceLoggingConfiguration
s {$sel:verifiedAccessInstanceId:VerifiedAccessInstanceLoggingConfiguration' :: Maybe Text
verifiedAccessInstanceId = Maybe Text
a} :: VerifiedAccessInstanceLoggingConfiguration)

instance
  Data.FromXML
    VerifiedAccessInstanceLoggingConfiguration
  where
  parseXML :: [Node] -> Either String VerifiedAccessInstanceLoggingConfiguration
parseXML [Node]
x =
    Maybe VerifiedAccessLogs
-> Maybe Text -> VerifiedAccessInstanceLoggingConfiguration
VerifiedAccessInstanceLoggingConfiguration'
      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
"accessLogs")
      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
"verifiedAccessInstanceId")

instance
  Prelude.Hashable
    VerifiedAccessInstanceLoggingConfiguration
  where
  hashWithSalt :: Int -> VerifiedAccessInstanceLoggingConfiguration -> Int
hashWithSalt
    Int
_salt
    VerifiedAccessInstanceLoggingConfiguration' {Maybe Text
Maybe VerifiedAccessLogs
verifiedAccessInstanceId :: Maybe Text
accessLogs :: Maybe VerifiedAccessLogs
$sel:verifiedAccessInstanceId:VerifiedAccessInstanceLoggingConfiguration' :: VerifiedAccessInstanceLoggingConfiguration -> Maybe Text
$sel:accessLogs:VerifiedAccessInstanceLoggingConfiguration' :: VerifiedAccessInstanceLoggingConfiguration
-> Maybe VerifiedAccessLogs
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VerifiedAccessLogs
accessLogs
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
verifiedAccessInstanceId

instance
  Prelude.NFData
    VerifiedAccessInstanceLoggingConfiguration
  where
  rnf :: VerifiedAccessInstanceLoggingConfiguration -> ()
rnf VerifiedAccessInstanceLoggingConfiguration' {Maybe Text
Maybe VerifiedAccessLogs
verifiedAccessInstanceId :: Maybe Text
accessLogs :: Maybe VerifiedAccessLogs
$sel:verifiedAccessInstanceId:VerifiedAccessInstanceLoggingConfiguration' :: VerifiedAccessInstanceLoggingConfiguration -> Maybe Text
$sel:accessLogs:VerifiedAccessInstanceLoggingConfiguration' :: VerifiedAccessInstanceLoggingConfiguration
-> Maybe VerifiedAccessLogs
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe VerifiedAccessLogs
accessLogs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
verifiedAccessInstanceId