module Stratosphere.EventSchemas.RegistryPolicy (
RegistryPolicy(..), mkRegistryPolicy
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data RegistryPolicy
=
RegistryPolicy {RegistryPolicy -> ()
haddock_workaround_ :: (),
RegistryPolicy -> Object
policy :: JSON.Object,
RegistryPolicy -> Value Text
registryName :: (Value Prelude.Text),
RegistryPolicy -> Maybe (Value Text)
revisionId :: (Prelude.Maybe (Value Prelude.Text))}
deriving stock (RegistryPolicy -> RegistryPolicy -> Bool
(RegistryPolicy -> RegistryPolicy -> Bool)
-> (RegistryPolicy -> RegistryPolicy -> Bool) -> Eq RegistryPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RegistryPolicy -> RegistryPolicy -> Bool
== :: RegistryPolicy -> RegistryPolicy -> Bool
$c/= :: RegistryPolicy -> RegistryPolicy -> Bool
/= :: RegistryPolicy -> RegistryPolicy -> Bool
Prelude.Eq, Int -> RegistryPolicy -> ShowS
[RegistryPolicy] -> ShowS
RegistryPolicy -> String
(Int -> RegistryPolicy -> ShowS)
-> (RegistryPolicy -> String)
-> ([RegistryPolicy] -> ShowS)
-> Show RegistryPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RegistryPolicy -> ShowS
showsPrec :: Int -> RegistryPolicy -> ShowS
$cshow :: RegistryPolicy -> String
show :: RegistryPolicy -> String
$cshowList :: [RegistryPolicy] -> ShowS
showList :: [RegistryPolicy] -> ShowS
Prelude.Show)
mkRegistryPolicy ::
JSON.Object -> Value Prelude.Text -> RegistryPolicy
mkRegistryPolicy :: Object -> Value Text -> RegistryPolicy
mkRegistryPolicy Object
policy Value Text
registryName
= RegistryPolicy
{haddock_workaround_ :: ()
haddock_workaround_ = (), policy :: Object
policy = Object
policy,
registryName :: Value Text
registryName = Value Text
registryName, revisionId :: Maybe (Value Text)
revisionId = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties RegistryPolicy where
toResourceProperties :: RegistryPolicy -> ResourceProperties
toResourceProperties RegistryPolicy {Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: RegistryPolicy -> ()
policy :: RegistryPolicy -> Object
registryName :: RegistryPolicy -> Value Text
revisionId :: RegistryPolicy -> Maybe (Value Text)
haddock_workaround_ :: ()
policy :: Object
registryName :: Value Text
revisionId :: Maybe (Value Text)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::EventSchemas::RegistryPolicy",
supportsTags :: Bool
supportsTags = Bool
Prelude.False,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"Policy" Key -> Object -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Object
policy, Key
"RegistryName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
registryName]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RevisionId" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
revisionId]))}
instance JSON.ToJSON RegistryPolicy where
toJSON :: RegistryPolicy -> Value
toJSON RegistryPolicy {Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: RegistryPolicy -> ()
policy :: RegistryPolicy -> Object
registryName :: RegistryPolicy -> Value Text
revisionId :: RegistryPolicy -> Maybe (Value Text)
haddock_workaround_ :: ()
policy :: Object
registryName :: Value Text
revisionId :: Maybe (Value Text)
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"Policy" Key -> Object -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Object
policy, Key
"RegistryName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
registryName]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RevisionId" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
revisionId])))
instance Property "Policy" RegistryPolicy where
type PropertyType "Policy" RegistryPolicy = JSON.Object
set :: PropertyType "Policy" RegistryPolicy
-> RegistryPolicy -> RegistryPolicy
set PropertyType "Policy" RegistryPolicy
newValue RegistryPolicy {Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: RegistryPolicy -> ()
policy :: RegistryPolicy -> Object
registryName :: RegistryPolicy -> Value Text
revisionId :: RegistryPolicy -> Maybe (Value Text)
haddock_workaround_ :: ()
policy :: Object
registryName :: Value Text
revisionId :: Maybe (Value Text)
..}
= RegistryPolicy {policy :: Object
policy = Object
PropertyType "Policy" RegistryPolicy
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
registryName :: Value Text
revisionId :: Maybe (Value Text)
haddock_workaround_ :: ()
registryName :: Value Text
revisionId :: Maybe (Value Text)
..}
instance Property "RegistryName" RegistryPolicy where
type PropertyType "RegistryName" RegistryPolicy = Value Prelude.Text
set :: PropertyType "RegistryName" RegistryPolicy
-> RegistryPolicy -> RegistryPolicy
set PropertyType "RegistryName" RegistryPolicy
newValue RegistryPolicy {Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: RegistryPolicy -> ()
policy :: RegistryPolicy -> Object
registryName :: RegistryPolicy -> Value Text
revisionId :: RegistryPolicy -> Maybe (Value Text)
haddock_workaround_ :: ()
policy :: Object
registryName :: Value Text
revisionId :: Maybe (Value Text)
..}
= RegistryPolicy {registryName :: Value Text
registryName = PropertyType "RegistryName" RegistryPolicy
Value Text
newValue, Maybe (Value Text)
()
Object
haddock_workaround_ :: ()
policy :: Object
revisionId :: Maybe (Value Text)
haddock_workaround_ :: ()
policy :: Object
revisionId :: Maybe (Value Text)
..}
instance Property "RevisionId" RegistryPolicy where
type PropertyType "RevisionId" RegistryPolicy = Value Prelude.Text
set :: PropertyType "RevisionId" RegistryPolicy
-> RegistryPolicy -> RegistryPolicy
set PropertyType "RevisionId" RegistryPolicy
newValue RegistryPolicy {Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: RegistryPolicy -> ()
policy :: RegistryPolicy -> Object
registryName :: RegistryPolicy -> Value Text
revisionId :: RegistryPolicy -> Maybe (Value Text)
haddock_workaround_ :: ()
policy :: Object
registryName :: Value Text
revisionId :: Maybe (Value Text)
..}
= RegistryPolicy {revisionId :: Maybe (Value Text)
revisionId = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "RevisionId" RegistryPolicy
Value Text
newValue, ()
Object
Value Text
haddock_workaround_ :: ()
policy :: Object
registryName :: Value Text
haddock_workaround_ :: ()
policy :: Object
registryName :: Value Text
..}