{-# 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.IAM.Types.OrganizationsDecisionDetail
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IAM.Types.OrganizationsDecisionDetail where

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

-- | Contains information about the effect that Organizations has on a policy
-- simulation.
--
-- /See:/ 'newOrganizationsDecisionDetail' smart constructor.
data OrganizationsDecisionDetail = OrganizationsDecisionDetail'
  { -- | Specifies whether the simulated operation is allowed by the
    -- Organizations service control policies that impact the simulated user\'s
    -- account.
    OrganizationsDecisionDetail -> Maybe Bool
allowedByOrganizations :: Prelude.Maybe Prelude.Bool
  }
  deriving (OrganizationsDecisionDetail -> OrganizationsDecisionDetail -> Bool
(OrganizationsDecisionDetail
 -> OrganizationsDecisionDetail -> Bool)
-> (OrganizationsDecisionDetail
    -> OrganizationsDecisionDetail -> Bool)
-> Eq OrganizationsDecisionDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OrganizationsDecisionDetail -> OrganizationsDecisionDetail -> Bool
$c/= :: OrganizationsDecisionDetail -> OrganizationsDecisionDetail -> Bool
== :: OrganizationsDecisionDetail -> OrganizationsDecisionDetail -> Bool
$c== :: OrganizationsDecisionDetail -> OrganizationsDecisionDetail -> Bool
Prelude.Eq, ReadPrec [OrganizationsDecisionDetail]
ReadPrec OrganizationsDecisionDetail
Int -> ReadS OrganizationsDecisionDetail
ReadS [OrganizationsDecisionDetail]
(Int -> ReadS OrganizationsDecisionDetail)
-> ReadS [OrganizationsDecisionDetail]
-> ReadPrec OrganizationsDecisionDetail
-> ReadPrec [OrganizationsDecisionDetail]
-> Read OrganizationsDecisionDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OrganizationsDecisionDetail]
$creadListPrec :: ReadPrec [OrganizationsDecisionDetail]
readPrec :: ReadPrec OrganizationsDecisionDetail
$creadPrec :: ReadPrec OrganizationsDecisionDetail
readList :: ReadS [OrganizationsDecisionDetail]
$creadList :: ReadS [OrganizationsDecisionDetail]
readsPrec :: Int -> ReadS OrganizationsDecisionDetail
$creadsPrec :: Int -> ReadS OrganizationsDecisionDetail
Prelude.Read, Int -> OrganizationsDecisionDetail -> ShowS
[OrganizationsDecisionDetail] -> ShowS
OrganizationsDecisionDetail -> String
(Int -> OrganizationsDecisionDetail -> ShowS)
-> (OrganizationsDecisionDetail -> String)
-> ([OrganizationsDecisionDetail] -> ShowS)
-> Show OrganizationsDecisionDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrganizationsDecisionDetail] -> ShowS
$cshowList :: [OrganizationsDecisionDetail] -> ShowS
show :: OrganizationsDecisionDetail -> String
$cshow :: OrganizationsDecisionDetail -> String
showsPrec :: Int -> OrganizationsDecisionDetail -> ShowS
$cshowsPrec :: Int -> OrganizationsDecisionDetail -> ShowS
Prelude.Show, (forall x.
 OrganizationsDecisionDetail -> Rep OrganizationsDecisionDetail x)
-> (forall x.
    Rep OrganizationsDecisionDetail x -> OrganizationsDecisionDetail)
-> Generic OrganizationsDecisionDetail
forall x.
Rep OrganizationsDecisionDetail x -> OrganizationsDecisionDetail
forall x.
OrganizationsDecisionDetail -> Rep OrganizationsDecisionDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OrganizationsDecisionDetail x -> OrganizationsDecisionDetail
$cfrom :: forall x.
OrganizationsDecisionDetail -> Rep OrganizationsDecisionDetail x
Prelude.Generic)

-- |
-- Create a value of 'OrganizationsDecisionDetail' 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:
--
-- 'allowedByOrganizations', 'organizationsDecisionDetail_allowedByOrganizations' - Specifies whether the simulated operation is allowed by the
-- Organizations service control policies that impact the simulated user\'s
-- account.
newOrganizationsDecisionDetail ::
  OrganizationsDecisionDetail
newOrganizationsDecisionDetail :: OrganizationsDecisionDetail
newOrganizationsDecisionDetail =
  OrganizationsDecisionDetail' :: Maybe Bool -> OrganizationsDecisionDetail
OrganizationsDecisionDetail'
    { $sel:allowedByOrganizations:OrganizationsDecisionDetail' :: Maybe Bool
allowedByOrganizations =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies whether the simulated operation is allowed by the
-- Organizations service control policies that impact the simulated user\'s
-- account.
organizationsDecisionDetail_allowedByOrganizations :: Lens.Lens' OrganizationsDecisionDetail (Prelude.Maybe Prelude.Bool)
organizationsDecisionDetail_allowedByOrganizations :: (Maybe Bool -> f (Maybe Bool))
-> OrganizationsDecisionDetail -> f OrganizationsDecisionDetail
organizationsDecisionDetail_allowedByOrganizations = (OrganizationsDecisionDetail -> Maybe Bool)
-> (OrganizationsDecisionDetail
    -> Maybe Bool -> OrganizationsDecisionDetail)
-> Lens
     OrganizationsDecisionDetail
     OrganizationsDecisionDetail
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationsDecisionDetail' {Maybe Bool
allowedByOrganizations :: Maybe Bool
$sel:allowedByOrganizations:OrganizationsDecisionDetail' :: OrganizationsDecisionDetail -> Maybe Bool
allowedByOrganizations} -> Maybe Bool
allowedByOrganizations) (\s :: OrganizationsDecisionDetail
s@OrganizationsDecisionDetail' {} Maybe Bool
a -> OrganizationsDecisionDetail
s {$sel:allowedByOrganizations:OrganizationsDecisionDetail' :: Maybe Bool
allowedByOrganizations = Maybe Bool
a} :: OrganizationsDecisionDetail)

instance Core.FromXML OrganizationsDecisionDetail where
  parseXML :: [Node] -> Either String OrganizationsDecisionDetail
parseXML [Node]
x =
    Maybe Bool -> OrganizationsDecisionDetail
OrganizationsDecisionDetail'
      (Maybe Bool -> OrganizationsDecisionDetail)
-> Either String (Maybe Bool)
-> Either String OrganizationsDecisionDetail
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AllowedByOrganizations")

instance Prelude.Hashable OrganizationsDecisionDetail

instance Prelude.NFData OrganizationsDecisionDetail