module Stratosphere.RolesAnywhere.TrustAnchor (
        module Exports, TrustAnchor(..), mkTrustAnchor
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.RolesAnywhere.TrustAnchor.NotificationSettingProperty as Exports
import {-# SOURCE #-} Stratosphere.RolesAnywhere.TrustAnchor.SourceProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data TrustAnchor
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rolesanywhere-trustanchor.html>
    TrustAnchor {TrustAnchor -> ()
haddock_workaround_ :: (),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rolesanywhere-trustanchor.html#cfn-rolesanywhere-trustanchor-enabled>
                 TrustAnchor -> Maybe (Value Bool)
enabled :: (Prelude.Maybe (Value Prelude.Bool)),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rolesanywhere-trustanchor.html#cfn-rolesanywhere-trustanchor-name>
                 TrustAnchor -> Value Text
name :: (Value Prelude.Text),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rolesanywhere-trustanchor.html#cfn-rolesanywhere-trustanchor-notificationsettings>
                 TrustAnchor -> Maybe [NotificationSettingProperty]
notificationSettings :: (Prelude.Maybe [NotificationSettingProperty]),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rolesanywhere-trustanchor.html#cfn-rolesanywhere-trustanchor-source>
                 TrustAnchor -> SourceProperty
source :: SourceProperty,
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rolesanywhere-trustanchor.html#cfn-rolesanywhere-trustanchor-tags>
                 TrustAnchor -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (TrustAnchor -> TrustAnchor -> Bool
(TrustAnchor -> TrustAnchor -> Bool)
-> (TrustAnchor -> TrustAnchor -> Bool) -> Eq TrustAnchor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TrustAnchor -> TrustAnchor -> Bool
== :: TrustAnchor -> TrustAnchor -> Bool
$c/= :: TrustAnchor -> TrustAnchor -> Bool
/= :: TrustAnchor -> TrustAnchor -> Bool
Prelude.Eq, Int -> TrustAnchor -> ShowS
[TrustAnchor] -> ShowS
TrustAnchor -> String
(Int -> TrustAnchor -> ShowS)
-> (TrustAnchor -> String)
-> ([TrustAnchor] -> ShowS)
-> Show TrustAnchor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TrustAnchor -> ShowS
showsPrec :: Int -> TrustAnchor -> ShowS
$cshow :: TrustAnchor -> String
show :: TrustAnchor -> String
$cshowList :: [TrustAnchor] -> ShowS
showList :: [TrustAnchor] -> ShowS
Prelude.Show)
mkTrustAnchor ::
  Value Prelude.Text -> SourceProperty -> TrustAnchor
mkTrustAnchor :: Value Text -> SourceProperty -> TrustAnchor
mkTrustAnchor Value Text
name SourceProperty
source
  = TrustAnchor
      {haddock_workaround_ :: ()
haddock_workaround_ = (), name :: Value Text
name = Value Text
name, source :: SourceProperty
source = SourceProperty
source,
       enabled :: Maybe (Value Bool)
enabled = Maybe (Value Bool)
forall a. Maybe a
Prelude.Nothing, notificationSettings :: Maybe [NotificationSettingProperty]
notificationSettings = Maybe [NotificationSettingProperty]
forall a. Maybe a
Prelude.Nothing,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties TrustAnchor where
  toResourceProperties :: TrustAnchor -> ResourceProperties
toResourceProperties TrustAnchor {Maybe [Tag]
Maybe [NotificationSettingProperty]
Maybe (Value Bool)
()
Value Text
SourceProperty
haddock_workaround_ :: TrustAnchor -> ()
enabled :: TrustAnchor -> Maybe (Value Bool)
name :: TrustAnchor -> Value Text
notificationSettings :: TrustAnchor -> Maybe [NotificationSettingProperty]
source :: TrustAnchor -> SourceProperty
tags :: TrustAnchor -> Maybe [Tag]
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::RolesAnywhere::TrustAnchor",
         supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         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
"Name" 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
name, Key
"Source" Key -> SourceProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= SourceProperty
source]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> Value Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Enabled" (Value Bool -> (Key, Value))
-> Maybe (Value Bool) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Bool)
enabled,
                               Key -> [NotificationSettingProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"NotificationSettings" ([NotificationSettingProperty] -> (Key, Value))
-> Maybe [NotificationSettingProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [NotificationSettingProperty]
notificationSettings,
                               Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON TrustAnchor where
  toJSON :: TrustAnchor -> Value
toJSON TrustAnchor {Maybe [Tag]
Maybe [NotificationSettingProperty]
Maybe (Value Bool)
()
Value Text
SourceProperty
haddock_workaround_ :: TrustAnchor -> ()
enabled :: TrustAnchor -> Maybe (Value Bool)
name :: TrustAnchor -> Value Text
notificationSettings :: TrustAnchor -> Maybe [NotificationSettingProperty]
source :: TrustAnchor -> SourceProperty
tags :: TrustAnchor -> Maybe [Tag]
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
tags :: Maybe [Tag]
..}
    = [(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
"Name" 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
name, Key
"Source" Key -> SourceProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= SourceProperty
source]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> Value Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Enabled" (Value Bool -> (Key, Value))
-> Maybe (Value Bool) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Bool)
enabled,
                  Key -> [NotificationSettingProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"NotificationSettings" ([NotificationSettingProperty] -> (Key, Value))
-> Maybe [NotificationSettingProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [NotificationSettingProperty]
notificationSettings,
                  Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "Enabled" TrustAnchor where
  type PropertyType "Enabled" TrustAnchor = Value Prelude.Bool
  set :: PropertyType "Enabled" TrustAnchor -> TrustAnchor -> TrustAnchor
set PropertyType "Enabled" TrustAnchor
newValue TrustAnchor {Maybe [Tag]
Maybe [NotificationSettingProperty]
Maybe (Value Bool)
()
Value Text
SourceProperty
haddock_workaround_ :: TrustAnchor -> ()
enabled :: TrustAnchor -> Maybe (Value Bool)
name :: TrustAnchor -> Value Text
notificationSettings :: TrustAnchor -> Maybe [NotificationSettingProperty]
source :: TrustAnchor -> SourceProperty
tags :: TrustAnchor -> Maybe [Tag]
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
tags :: Maybe [Tag]
..}
    = TrustAnchor {enabled :: Maybe (Value Bool)
enabled = Value Bool -> Maybe (Value Bool)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Enabled" TrustAnchor
Value Bool
newValue, Maybe [Tag]
Maybe [NotificationSettingProperty]
()
Value Text
SourceProperty
haddock_workaround_ :: ()
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
tags :: Maybe [Tag]
..}
instance Property "Name" TrustAnchor where
  type PropertyType "Name" TrustAnchor = Value Prelude.Text
  set :: PropertyType "Name" TrustAnchor -> TrustAnchor -> TrustAnchor
set PropertyType "Name" TrustAnchor
newValue TrustAnchor {Maybe [Tag]
Maybe [NotificationSettingProperty]
Maybe (Value Bool)
()
Value Text
SourceProperty
haddock_workaround_ :: TrustAnchor -> ()
enabled :: TrustAnchor -> Maybe (Value Bool)
name :: TrustAnchor -> Value Text
notificationSettings :: TrustAnchor -> Maybe [NotificationSettingProperty]
source :: TrustAnchor -> SourceProperty
tags :: TrustAnchor -> Maybe [Tag]
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
tags :: Maybe [Tag]
..} = TrustAnchor {name :: Value Text
name = PropertyType "Name" TrustAnchor
Value Text
newValue, Maybe [Tag]
Maybe [NotificationSettingProperty]
Maybe (Value Bool)
()
SourceProperty
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
tags :: Maybe [Tag]
..}
instance Property "NotificationSettings" TrustAnchor where
  type PropertyType "NotificationSettings" TrustAnchor = [NotificationSettingProperty]
  set :: PropertyType "NotificationSettings" TrustAnchor
-> TrustAnchor -> TrustAnchor
set PropertyType "NotificationSettings" TrustAnchor
newValue TrustAnchor {Maybe [Tag]
Maybe [NotificationSettingProperty]
Maybe (Value Bool)
()
Value Text
SourceProperty
haddock_workaround_ :: TrustAnchor -> ()
enabled :: TrustAnchor -> Maybe (Value Bool)
name :: TrustAnchor -> Value Text
notificationSettings :: TrustAnchor -> Maybe [NotificationSettingProperty]
source :: TrustAnchor -> SourceProperty
tags :: TrustAnchor -> Maybe [Tag]
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
tags :: Maybe [Tag]
..}
    = TrustAnchor {notificationSettings :: Maybe [NotificationSettingProperty]
notificationSettings = [NotificationSettingProperty]
-> Maybe [NotificationSettingProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [NotificationSettingProperty]
PropertyType "NotificationSettings" TrustAnchor
newValue, Maybe [Tag]
Maybe (Value Bool)
()
Value Text
SourceProperty
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
source :: SourceProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
source :: SourceProperty
tags :: Maybe [Tag]
..}
instance Property "Source" TrustAnchor where
  type PropertyType "Source" TrustAnchor = SourceProperty
  set :: PropertyType "Source" TrustAnchor -> TrustAnchor -> TrustAnchor
set PropertyType "Source" TrustAnchor
newValue TrustAnchor {Maybe [Tag]
Maybe [NotificationSettingProperty]
Maybe (Value Bool)
()
Value Text
SourceProperty
haddock_workaround_ :: TrustAnchor -> ()
enabled :: TrustAnchor -> Maybe (Value Bool)
name :: TrustAnchor -> Value Text
notificationSettings :: TrustAnchor -> Maybe [NotificationSettingProperty]
source :: TrustAnchor -> SourceProperty
tags :: TrustAnchor -> Maybe [Tag]
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
tags :: Maybe [Tag]
..} = TrustAnchor {source :: SourceProperty
source = PropertyType "Source" TrustAnchor
SourceProperty
newValue, Maybe [Tag]
Maybe [NotificationSettingProperty]
Maybe (Value Bool)
()
Value Text
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
tags :: Maybe [Tag]
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
tags :: Maybe [Tag]
..}
instance Property "Tags" TrustAnchor where
  type PropertyType "Tags" TrustAnchor = [Tag]
  set :: PropertyType "Tags" TrustAnchor -> TrustAnchor -> TrustAnchor
set PropertyType "Tags" TrustAnchor
newValue TrustAnchor {Maybe [Tag]
Maybe [NotificationSettingProperty]
Maybe (Value Bool)
()
Value Text
SourceProperty
haddock_workaround_ :: TrustAnchor -> ()
enabled :: TrustAnchor -> Maybe (Value Bool)
name :: TrustAnchor -> Value Text
notificationSettings :: TrustAnchor -> Maybe [NotificationSettingProperty]
source :: TrustAnchor -> SourceProperty
tags :: TrustAnchor -> Maybe [Tag]
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
tags :: Maybe [Tag]
..}
    = TrustAnchor {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" TrustAnchor
newValue, Maybe [NotificationSettingProperty]
Maybe (Value Bool)
()
Value Text
SourceProperty
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
haddock_workaround_ :: ()
enabled :: Maybe (Value Bool)
name :: Value Text
notificationSettings :: Maybe [NotificationSettingProperty]
source :: SourceProperty
..}