{-# 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.GuardDuty.Types.AccountLevelPermissions
-- 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.GuardDuty.Types.AccountLevelPermissions where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GuardDuty.Types.BlockPublicAccess
import qualified Amazonka.Prelude as Prelude

-- | Contains information about the account level permissions on the S3
-- bucket.
--
-- /See:/ 'newAccountLevelPermissions' smart constructor.
data AccountLevelPermissions = AccountLevelPermissions'
  { -- | Describes the S3 Block Public Access settings of the bucket\'s parent
    -- account.
    AccountLevelPermissions -> Maybe BlockPublicAccess
blockPublicAccess :: Prelude.Maybe BlockPublicAccess
  }
  deriving (AccountLevelPermissions -> AccountLevelPermissions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountLevelPermissions -> AccountLevelPermissions -> Bool
$c/= :: AccountLevelPermissions -> AccountLevelPermissions -> Bool
== :: AccountLevelPermissions -> AccountLevelPermissions -> Bool
$c== :: AccountLevelPermissions -> AccountLevelPermissions -> Bool
Prelude.Eq, ReadPrec [AccountLevelPermissions]
ReadPrec AccountLevelPermissions
Int -> ReadS AccountLevelPermissions
ReadS [AccountLevelPermissions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountLevelPermissions]
$creadListPrec :: ReadPrec [AccountLevelPermissions]
readPrec :: ReadPrec AccountLevelPermissions
$creadPrec :: ReadPrec AccountLevelPermissions
readList :: ReadS [AccountLevelPermissions]
$creadList :: ReadS [AccountLevelPermissions]
readsPrec :: Int -> ReadS AccountLevelPermissions
$creadsPrec :: Int -> ReadS AccountLevelPermissions
Prelude.Read, Int -> AccountLevelPermissions -> ShowS
[AccountLevelPermissions] -> ShowS
AccountLevelPermissions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountLevelPermissions] -> ShowS
$cshowList :: [AccountLevelPermissions] -> ShowS
show :: AccountLevelPermissions -> String
$cshow :: AccountLevelPermissions -> String
showsPrec :: Int -> AccountLevelPermissions -> ShowS
$cshowsPrec :: Int -> AccountLevelPermissions -> ShowS
Prelude.Show, forall x. Rep AccountLevelPermissions x -> AccountLevelPermissions
forall x. AccountLevelPermissions -> Rep AccountLevelPermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountLevelPermissions x -> AccountLevelPermissions
$cfrom :: forall x. AccountLevelPermissions -> Rep AccountLevelPermissions x
Prelude.Generic)

-- |
-- Create a value of 'AccountLevelPermissions' 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:
--
-- 'blockPublicAccess', 'accountLevelPermissions_blockPublicAccess' - Describes the S3 Block Public Access settings of the bucket\'s parent
-- account.
newAccountLevelPermissions ::
  AccountLevelPermissions
newAccountLevelPermissions :: AccountLevelPermissions
newAccountLevelPermissions =
  AccountLevelPermissions'
    { $sel:blockPublicAccess:AccountLevelPermissions' :: Maybe BlockPublicAccess
blockPublicAccess =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Describes the S3 Block Public Access settings of the bucket\'s parent
-- account.
accountLevelPermissions_blockPublicAccess :: Lens.Lens' AccountLevelPermissions (Prelude.Maybe BlockPublicAccess)
accountLevelPermissions_blockPublicAccess :: Lens' AccountLevelPermissions (Maybe BlockPublicAccess)
accountLevelPermissions_blockPublicAccess = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountLevelPermissions' {Maybe BlockPublicAccess
blockPublicAccess :: Maybe BlockPublicAccess
$sel:blockPublicAccess:AccountLevelPermissions' :: AccountLevelPermissions -> Maybe BlockPublicAccess
blockPublicAccess} -> Maybe BlockPublicAccess
blockPublicAccess) (\s :: AccountLevelPermissions
s@AccountLevelPermissions' {} Maybe BlockPublicAccess
a -> AccountLevelPermissions
s {$sel:blockPublicAccess:AccountLevelPermissions' :: Maybe BlockPublicAccess
blockPublicAccess = Maybe BlockPublicAccess
a} :: AccountLevelPermissions)

instance Data.FromJSON AccountLevelPermissions where
  parseJSON :: Value -> Parser AccountLevelPermissions
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AccountLevelPermissions"
      ( \Object
x ->
          Maybe BlockPublicAccess -> AccountLevelPermissions
AccountLevelPermissions'
            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
"blockPublicAccess")
      )

instance Prelude.Hashable AccountLevelPermissions where
  hashWithSalt :: Int -> AccountLevelPermissions -> Int
hashWithSalt Int
_salt AccountLevelPermissions' {Maybe BlockPublicAccess
blockPublicAccess :: Maybe BlockPublicAccess
$sel:blockPublicAccess:AccountLevelPermissions' :: AccountLevelPermissions -> Maybe BlockPublicAccess
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BlockPublicAccess
blockPublicAccess

instance Prelude.NFData AccountLevelPermissions where
  rnf :: AccountLevelPermissions -> ()
rnf AccountLevelPermissions' {Maybe BlockPublicAccess
blockPublicAccess :: Maybe BlockPublicAccess
$sel:blockPublicAccess:AccountLevelPermissions' :: AccountLevelPermissions -> Maybe BlockPublicAccess
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe BlockPublicAccess
blockPublicAccess