{-# 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.SSMIncidents.Types.ResourcePolicy where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ResourcePolicy = ResourcePolicy'
{
ResourcePolicy -> Text
policyDocument :: Prelude.Text,
ResourcePolicy -> Text
policyId :: Prelude.Text,
ResourcePolicy -> Text
ramResourceShareRegion :: Prelude.Text
}
deriving (ResourcePolicy -> ResourcePolicy -> Bool
(ResourcePolicy -> ResourcePolicy -> Bool)
-> (ResourcePolicy -> ResourcePolicy -> Bool) -> Eq ResourcePolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourcePolicy -> ResourcePolicy -> Bool
$c/= :: ResourcePolicy -> ResourcePolicy -> Bool
== :: ResourcePolicy -> ResourcePolicy -> Bool
$c== :: ResourcePolicy -> ResourcePolicy -> Bool
Prelude.Eq, ReadPrec [ResourcePolicy]
ReadPrec ResourcePolicy
Int -> ReadS ResourcePolicy
ReadS [ResourcePolicy]
(Int -> ReadS ResourcePolicy)
-> ReadS [ResourcePolicy]
-> ReadPrec ResourcePolicy
-> ReadPrec [ResourcePolicy]
-> Read ResourcePolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourcePolicy]
$creadListPrec :: ReadPrec [ResourcePolicy]
readPrec :: ReadPrec ResourcePolicy
$creadPrec :: ReadPrec ResourcePolicy
readList :: ReadS [ResourcePolicy]
$creadList :: ReadS [ResourcePolicy]
readsPrec :: Int -> ReadS ResourcePolicy
$creadsPrec :: Int -> ReadS ResourcePolicy
Prelude.Read, Int -> ResourcePolicy -> ShowS
[ResourcePolicy] -> ShowS
ResourcePolicy -> String
(Int -> ResourcePolicy -> ShowS)
-> (ResourcePolicy -> String)
-> ([ResourcePolicy] -> ShowS)
-> Show ResourcePolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourcePolicy] -> ShowS
$cshowList :: [ResourcePolicy] -> ShowS
show :: ResourcePolicy -> String
$cshow :: ResourcePolicy -> String
showsPrec :: Int -> ResourcePolicy -> ShowS
$cshowsPrec :: Int -> ResourcePolicy -> ShowS
Prelude.Show, (forall x. ResourcePolicy -> Rep ResourcePolicy x)
-> (forall x. Rep ResourcePolicy x -> ResourcePolicy)
-> Generic ResourcePolicy
forall x. Rep ResourcePolicy x -> ResourcePolicy
forall x. ResourcePolicy -> Rep ResourcePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourcePolicy x -> ResourcePolicy
$cfrom :: forall x. ResourcePolicy -> Rep ResourcePolicy x
Prelude.Generic)
newResourcePolicy ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
ResourcePolicy
newResourcePolicy :: Text -> Text -> Text -> ResourcePolicy
newResourcePolicy
Text
pPolicyDocument_
Text
pPolicyId_
Text
pRamResourceShareRegion_ =
ResourcePolicy' :: Text -> Text -> Text -> ResourcePolicy
ResourcePolicy'
{ $sel:policyDocument:ResourcePolicy' :: Text
policyDocument = Text
pPolicyDocument_,
$sel:policyId:ResourcePolicy' :: Text
policyId = Text
pPolicyId_,
$sel:ramResourceShareRegion:ResourcePolicy' :: Text
ramResourceShareRegion = Text
pRamResourceShareRegion_
}
resourcePolicy_policyDocument :: Lens.Lens' ResourcePolicy Prelude.Text
resourcePolicy_policyDocument :: (Text -> f Text) -> ResourcePolicy -> f ResourcePolicy
resourcePolicy_policyDocument = (ResourcePolicy -> Text)
-> (ResourcePolicy -> Text -> ResourcePolicy)
-> Lens ResourcePolicy ResourcePolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourcePolicy' {Text
policyDocument :: Text
$sel:policyDocument:ResourcePolicy' :: ResourcePolicy -> Text
policyDocument} -> Text
policyDocument) (\s :: ResourcePolicy
s@ResourcePolicy' {} Text
a -> ResourcePolicy
s {$sel:policyDocument:ResourcePolicy' :: Text
policyDocument = Text
a} :: ResourcePolicy)
resourcePolicy_policyId :: Lens.Lens' ResourcePolicy Prelude.Text
resourcePolicy_policyId :: (Text -> f Text) -> ResourcePolicy -> f ResourcePolicy
resourcePolicy_policyId = (ResourcePolicy -> Text)
-> (ResourcePolicy -> Text -> ResourcePolicy)
-> Lens ResourcePolicy ResourcePolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourcePolicy' {Text
policyId :: Text
$sel:policyId:ResourcePolicy' :: ResourcePolicy -> Text
policyId} -> Text
policyId) (\s :: ResourcePolicy
s@ResourcePolicy' {} Text
a -> ResourcePolicy
s {$sel:policyId:ResourcePolicy' :: Text
policyId = Text
a} :: ResourcePolicy)
resourcePolicy_ramResourceShareRegion :: Lens.Lens' ResourcePolicy Prelude.Text
resourcePolicy_ramResourceShareRegion :: (Text -> f Text) -> ResourcePolicy -> f ResourcePolicy
resourcePolicy_ramResourceShareRegion = (ResourcePolicy -> Text)
-> (ResourcePolicy -> Text -> ResourcePolicy)
-> Lens ResourcePolicy ResourcePolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourcePolicy' {Text
ramResourceShareRegion :: Text
$sel:ramResourceShareRegion:ResourcePolicy' :: ResourcePolicy -> Text
ramResourceShareRegion} -> Text
ramResourceShareRegion) (\s :: ResourcePolicy
s@ResourcePolicy' {} Text
a -> ResourcePolicy
s {$sel:ramResourceShareRegion:ResourcePolicy' :: Text
ramResourceShareRegion = Text
a} :: ResourcePolicy)
instance Core.FromJSON ResourcePolicy where
parseJSON :: Value -> Parser ResourcePolicy
parseJSON =
String
-> (Object -> Parser ResourcePolicy)
-> Value
-> Parser ResourcePolicy
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResourcePolicy"
( \Object
x ->
Text -> Text -> Text -> ResourcePolicy
ResourcePolicy'
(Text -> Text -> Text -> ResourcePolicy)
-> Parser Text -> Parser (Text -> Text -> ResourcePolicy)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"policyDocument")
Parser (Text -> Text -> ResourcePolicy)
-> Parser Text -> Parser (Text -> ResourcePolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"policyId")
Parser (Text -> ResourcePolicy)
-> Parser Text -> Parser ResourcePolicy
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ramResourceShareRegion")
)
instance Prelude.Hashable ResourcePolicy
instance Prelude.NFData ResourcePolicy