module Stratosphere.Route53Profiles.Profile (
        Profile(..), mkProfile
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Profile
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53profiles-profile.html>
    Profile {Profile -> ()
haddock_workaround_ :: (),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53profiles-profile.html#cfn-route53profiles-profile-name>
             Profile -> Value Text
name :: (Value Prelude.Text),
             -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53profiles-profile.html#cfn-route53profiles-profile-tags>
             Profile -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (Profile -> Profile -> Bool
(Profile -> Profile -> Bool)
-> (Profile -> Profile -> Bool) -> Eq Profile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Profile -> Profile -> Bool
== :: Profile -> Profile -> Bool
$c/= :: Profile -> Profile -> Bool
/= :: Profile -> Profile -> Bool
Prelude.Eq, Int -> Profile -> ShowS
[Profile] -> ShowS
Profile -> String
(Int -> Profile -> ShowS)
-> (Profile -> String) -> ([Profile] -> ShowS) -> Show Profile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Profile -> ShowS
showsPrec :: Int -> Profile -> ShowS
$cshow :: Profile -> String
show :: Profile -> String
$cshowList :: [Profile] -> ShowS
showList :: [Profile] -> ShowS
Prelude.Show)
mkProfile :: Value Prelude.Text -> Profile
mkProfile :: Value Text -> Profile
mkProfile Value Text
name
  = Profile
      {haddock_workaround_ :: ()
haddock_workaround_ = (), name :: Value Text
name = Value Text
name, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Profile where
  toResourceProperties :: Profile -> ResourceProperties
toResourceProperties Profile {Maybe [Tag]
()
Value Text
haddock_workaround_ :: Profile -> ()
name :: Profile -> Value Text
tags :: Profile -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::Route53Profiles::Profile",
         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]
                           ([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 Profile where
  toJSON :: Profile -> Value
toJSON Profile {Maybe [Tag]
()
Value Text
haddock_workaround_ :: Profile -> ()
name :: Profile -> Value Text
tags :: Profile -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
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]
              ([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 "Name" Profile where
  type PropertyType "Name" Profile = Value Prelude.Text
  set :: PropertyType "Name" Profile -> Profile -> Profile
set PropertyType "Name" Profile
newValue Profile {Maybe [Tag]
()
Value Text
haddock_workaround_ :: Profile -> ()
name :: Profile -> Value Text
tags :: Profile -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
tags :: Maybe [Tag]
..} = Profile {name :: Value Text
name = PropertyType "Name" Profile
Value Text
newValue, Maybe [Tag]
()
haddock_workaround_ :: ()
tags :: Maybe [Tag]
haddock_workaround_ :: ()
tags :: Maybe [Tag]
..}
instance Property "Tags" Profile where
  type PropertyType "Tags" Profile = [Tag]
  set :: PropertyType "Tags" Profile -> Profile -> Profile
set PropertyType "Tags" Profile
newValue Profile {Maybe [Tag]
()
Value Text
haddock_workaround_ :: Profile -> ()
name :: Profile -> Value Text
tags :: Profile -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
tags :: Maybe [Tag]
..}
    = Profile {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" Profile
newValue, ()
Value Text
haddock_workaround_ :: ()
name :: Value Text
haddock_workaround_ :: ()
name :: Value Text
..}