module Stratosphere.MPA.IdentitySource (
        module Exports, IdentitySource(..), mkIdentitySource
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.MPA.IdentitySource.IdentitySourceParametersProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
data IdentitySource
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mpa-identitysource.html>
    IdentitySource {IdentitySource -> ()
haddock_workaround_ :: (),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mpa-identitysource.html#cfn-mpa-identitysource-identitysourceparameters>
                    IdentitySource -> IdentitySourceParametersProperty
identitySourceParameters :: IdentitySourceParametersProperty,
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mpa-identitysource.html#cfn-mpa-identitysource-tags>
                    IdentitySource -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (IdentitySource -> IdentitySource -> Bool
(IdentitySource -> IdentitySource -> Bool)
-> (IdentitySource -> IdentitySource -> Bool) -> Eq IdentitySource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IdentitySource -> IdentitySource -> Bool
== :: IdentitySource -> IdentitySource -> Bool
$c/= :: IdentitySource -> IdentitySource -> Bool
/= :: IdentitySource -> IdentitySource -> Bool
Prelude.Eq, Int -> IdentitySource -> ShowS
[IdentitySource] -> ShowS
IdentitySource -> String
(Int -> IdentitySource -> ShowS)
-> (IdentitySource -> String)
-> ([IdentitySource] -> ShowS)
-> Show IdentitySource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IdentitySource -> ShowS
showsPrec :: Int -> IdentitySource -> ShowS
$cshow :: IdentitySource -> String
show :: IdentitySource -> String
$cshowList :: [IdentitySource] -> ShowS
showList :: [IdentitySource] -> ShowS
Prelude.Show)
mkIdentitySource ::
  IdentitySourceParametersProperty -> IdentitySource
mkIdentitySource :: IdentitySourceParametersProperty -> IdentitySource
mkIdentitySource IdentitySourceParametersProperty
identitySourceParameters
  = IdentitySource
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       identitySourceParameters :: IdentitySourceParametersProperty
identitySourceParameters = IdentitySourceParametersProperty
identitySourceParameters,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties IdentitySource where
  toResourceProperties :: IdentitySource -> ResourceProperties
toResourceProperties IdentitySource {Maybe [Tag]
()
IdentitySourceParametersProperty
haddock_workaround_ :: IdentitySource -> ()
identitySourceParameters :: IdentitySource -> IdentitySourceParametersProperty
tags :: IdentitySource -> Maybe [Tag]
haddock_workaround_ :: ()
identitySourceParameters :: IdentitySourceParametersProperty
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::MPA::IdentitySource", 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
"IdentitySourceParameters" Key -> IdentitySourceParametersProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= IdentitySourceParametersProperty
identitySourceParameters]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [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 IdentitySource where
  toJSON :: IdentitySource -> Value
toJSON IdentitySource {Maybe [Tag]
()
IdentitySourceParametersProperty
haddock_workaround_ :: IdentitySource -> ()
identitySourceParameters :: IdentitySource -> IdentitySourceParametersProperty
tags :: IdentitySource -> Maybe [Tag]
haddock_workaround_ :: ()
identitySourceParameters :: IdentitySourceParametersProperty
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
"IdentitySourceParameters" Key -> IdentitySourceParametersProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= IdentitySourceParametersProperty
identitySourceParameters]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [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 "IdentitySourceParameters" IdentitySource where
  type PropertyType "IdentitySourceParameters" IdentitySource = IdentitySourceParametersProperty
  set :: PropertyType "IdentitySourceParameters" IdentitySource
-> IdentitySource -> IdentitySource
set PropertyType "IdentitySourceParameters" IdentitySource
newValue IdentitySource {Maybe [Tag]
()
IdentitySourceParametersProperty
haddock_workaround_ :: IdentitySource -> ()
identitySourceParameters :: IdentitySource -> IdentitySourceParametersProperty
tags :: IdentitySource -> Maybe [Tag]
haddock_workaround_ :: ()
identitySourceParameters :: IdentitySourceParametersProperty
tags :: Maybe [Tag]
..}
    = IdentitySource {identitySourceParameters :: IdentitySourceParametersProperty
identitySourceParameters = PropertyType "IdentitySourceParameters" IdentitySource
IdentitySourceParametersProperty
newValue, Maybe [Tag]
()
haddock_workaround_ :: ()
tags :: Maybe [Tag]
haddock_workaround_ :: ()
tags :: Maybe [Tag]
..}
instance Property "Tags" IdentitySource where
  type PropertyType "Tags" IdentitySource = [Tag]
  set :: PropertyType "Tags" IdentitySource
-> IdentitySource -> IdentitySource
set PropertyType "Tags" IdentitySource
newValue IdentitySource {Maybe [Tag]
()
IdentitySourceParametersProperty
haddock_workaround_ :: IdentitySource -> ()
identitySourceParameters :: IdentitySource -> IdentitySourceParametersProperty
tags :: IdentitySource -> Maybe [Tag]
haddock_workaround_ :: ()
identitySourceParameters :: IdentitySourceParametersProperty
tags :: Maybe [Tag]
..}
    = IdentitySource {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" IdentitySource
newValue, ()
IdentitySourceParametersProperty
haddock_workaround_ :: ()
identitySourceParameters :: IdentitySourceParametersProperty
haddock_workaround_ :: ()
identitySourceParameters :: IdentitySourceParametersProperty
..}