{-# 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 #-}
module Amazonka.S3.Types.PolicyStatus where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
data PolicyStatus = PolicyStatus'
{
PolicyStatus -> Maybe Bool
isPublic :: Prelude.Maybe Prelude.Bool
}
deriving (PolicyStatus -> PolicyStatus -> Bool
(PolicyStatus -> PolicyStatus -> Bool)
-> (PolicyStatus -> PolicyStatus -> Bool) -> Eq PolicyStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolicyStatus -> PolicyStatus -> Bool
$c/= :: PolicyStatus -> PolicyStatus -> Bool
== :: PolicyStatus -> PolicyStatus -> Bool
$c== :: PolicyStatus -> PolicyStatus -> Bool
Prelude.Eq, ReadPrec [PolicyStatus]
ReadPrec PolicyStatus
Int -> ReadS PolicyStatus
ReadS [PolicyStatus]
(Int -> ReadS PolicyStatus)
-> ReadS [PolicyStatus]
-> ReadPrec PolicyStatus
-> ReadPrec [PolicyStatus]
-> Read PolicyStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PolicyStatus]
$creadListPrec :: ReadPrec [PolicyStatus]
readPrec :: ReadPrec PolicyStatus
$creadPrec :: ReadPrec PolicyStatus
readList :: ReadS [PolicyStatus]
$creadList :: ReadS [PolicyStatus]
readsPrec :: Int -> ReadS PolicyStatus
$creadsPrec :: Int -> ReadS PolicyStatus
Prelude.Read, Int -> PolicyStatus -> ShowS
[PolicyStatus] -> ShowS
PolicyStatus -> String
(Int -> PolicyStatus -> ShowS)
-> (PolicyStatus -> String)
-> ([PolicyStatus] -> ShowS)
-> Show PolicyStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PolicyStatus] -> ShowS
$cshowList :: [PolicyStatus] -> ShowS
show :: PolicyStatus -> String
$cshow :: PolicyStatus -> String
showsPrec :: Int -> PolicyStatus -> ShowS
$cshowsPrec :: Int -> PolicyStatus -> ShowS
Prelude.Show, (forall x. PolicyStatus -> Rep PolicyStatus x)
-> (forall x. Rep PolicyStatus x -> PolicyStatus)
-> Generic PolicyStatus
forall x. Rep PolicyStatus x -> PolicyStatus
forall x. PolicyStatus -> Rep PolicyStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PolicyStatus x -> PolicyStatus
$cfrom :: forall x. PolicyStatus -> Rep PolicyStatus x
Prelude.Generic)
newPolicyStatus ::
PolicyStatus
newPolicyStatus :: PolicyStatus
newPolicyStatus =
PolicyStatus' :: Maybe Bool -> PolicyStatus
PolicyStatus' {$sel:isPublic:PolicyStatus' :: Maybe Bool
isPublic = Maybe Bool
forall a. Maybe a
Prelude.Nothing}
policyStatus_isPublic :: Lens.Lens' PolicyStatus (Prelude.Maybe Prelude.Bool)
policyStatus_isPublic :: (Maybe Bool -> f (Maybe Bool)) -> PolicyStatus -> f PolicyStatus
policyStatus_isPublic = (PolicyStatus -> Maybe Bool)
-> (PolicyStatus -> Maybe Bool -> PolicyStatus)
-> Lens PolicyStatus PolicyStatus (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyStatus' {Maybe Bool
isPublic :: Maybe Bool
$sel:isPublic:PolicyStatus' :: PolicyStatus -> Maybe Bool
isPublic} -> Maybe Bool
isPublic) (\s :: PolicyStatus
s@PolicyStatus' {} Maybe Bool
a -> PolicyStatus
s {$sel:isPublic:PolicyStatus' :: Maybe Bool
isPublic = Maybe Bool
a} :: PolicyStatus)
instance Core.FromXML PolicyStatus where
parseXML :: [Node] -> Either String PolicyStatus
parseXML [Node]
x =
Maybe Bool -> PolicyStatus
PolicyStatus' (Maybe Bool -> PolicyStatus)
-> Either String (Maybe Bool) -> Either String PolicyStatus
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
"IsPublic")
instance Prelude.Hashable PolicyStatus
instance Prelude.NFData PolicyStatus