{-# 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.CodeArtifact.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 -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
ResourcePolicy -> Maybe Text
document :: Prelude.Maybe Prelude.Text,
ResourcePolicy -> Maybe Text
revision :: Prelude.Maybe 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 ::
ResourcePolicy
newResourcePolicy :: ResourcePolicy
newResourcePolicy =
ResourcePolicy' :: Maybe Text -> Maybe Text -> Maybe Text -> ResourcePolicy
ResourcePolicy'
{ $sel:resourceArn:ResourcePolicy' :: Maybe Text
resourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:document:ResourcePolicy' :: Maybe Text
document = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:revision:ResourcePolicy' :: Maybe Text
revision = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
resourcePolicy_resourceArn :: Lens.Lens' ResourcePolicy (Prelude.Maybe Prelude.Text)
resourcePolicy_resourceArn :: (Maybe Text -> f (Maybe Text))
-> ResourcePolicy -> f ResourcePolicy
resourcePolicy_resourceArn = (ResourcePolicy -> Maybe Text)
-> (ResourcePolicy -> Maybe Text -> ResourcePolicy)
-> Lens ResourcePolicy ResourcePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourcePolicy' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:ResourcePolicy' :: ResourcePolicy -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: ResourcePolicy
s@ResourcePolicy' {} Maybe Text
a -> ResourcePolicy
s {$sel:resourceArn:ResourcePolicy' :: Maybe Text
resourceArn = Maybe Text
a} :: ResourcePolicy)
resourcePolicy_document :: Lens.Lens' ResourcePolicy (Prelude.Maybe Prelude.Text)
resourcePolicy_document :: (Maybe Text -> f (Maybe Text))
-> ResourcePolicy -> f ResourcePolicy
resourcePolicy_document = (ResourcePolicy -> Maybe Text)
-> (ResourcePolicy -> Maybe Text -> ResourcePolicy)
-> Lens ResourcePolicy ResourcePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourcePolicy' {Maybe Text
document :: Maybe Text
$sel:document:ResourcePolicy' :: ResourcePolicy -> Maybe Text
document} -> Maybe Text
document) (\s :: ResourcePolicy
s@ResourcePolicy' {} Maybe Text
a -> ResourcePolicy
s {$sel:document:ResourcePolicy' :: Maybe Text
document = Maybe Text
a} :: ResourcePolicy)
resourcePolicy_revision :: Lens.Lens' ResourcePolicy (Prelude.Maybe Prelude.Text)
resourcePolicy_revision :: (Maybe Text -> f (Maybe Text))
-> ResourcePolicy -> f ResourcePolicy
resourcePolicy_revision = (ResourcePolicy -> Maybe Text)
-> (ResourcePolicy -> Maybe Text -> ResourcePolicy)
-> Lens ResourcePolicy ResourcePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourcePolicy' {Maybe Text
revision :: Maybe Text
$sel:revision:ResourcePolicy' :: ResourcePolicy -> Maybe Text
revision} -> Maybe Text
revision) (\s :: ResourcePolicy
s@ResourcePolicy' {} Maybe Text
a -> ResourcePolicy
s {$sel:revision:ResourcePolicy' :: Maybe Text
revision = Maybe 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 ->
Maybe Text -> Maybe Text -> Maybe Text -> ResourcePolicy
ResourcePolicy'
(Maybe Text -> Maybe Text -> Maybe Text -> ResourcePolicy)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ResourcePolicy)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceArn")
Parser (Maybe Text -> Maybe Text -> ResourcePolicy)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ResourcePolicy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"document")
Parser (Maybe Text -> ResourcePolicy)
-> Parser (Maybe Text) -> Parser ResourcePolicy
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"revision")
)
instance Prelude.Hashable ResourcePolicy
instance Prelude.NFData ResourcePolicy