module Stratosphere.ServiceDiscovery.PublicDnsNamespace.SOAProperty (
        SOAProperty(..), mkSOAProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data SOAProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-publicdnsnamespace-soa.html>
    SOAProperty {SOAProperty -> ()
haddock_workaround_ :: (),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-servicediscovery-publicdnsnamespace-soa.html#cfn-servicediscovery-publicdnsnamespace-soa-ttl>
                 SOAProperty -> Maybe (Value Double)
tTL :: (Prelude.Maybe (Value Prelude.Double))}
  deriving stock (SOAProperty -> SOAProperty -> Bool
(SOAProperty -> SOAProperty -> Bool)
-> (SOAProperty -> SOAProperty -> Bool) -> Eq SOAProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SOAProperty -> SOAProperty -> Bool
== :: SOAProperty -> SOAProperty -> Bool
$c/= :: SOAProperty -> SOAProperty -> Bool
/= :: SOAProperty -> SOAProperty -> Bool
Prelude.Eq, Int -> SOAProperty -> ShowS
[SOAProperty] -> ShowS
SOAProperty -> String
(Int -> SOAProperty -> ShowS)
-> (SOAProperty -> String)
-> ([SOAProperty] -> ShowS)
-> Show SOAProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SOAProperty -> ShowS
showsPrec :: Int -> SOAProperty -> ShowS
$cshow :: SOAProperty -> String
show :: SOAProperty -> String
$cshowList :: [SOAProperty] -> ShowS
showList :: [SOAProperty] -> ShowS
Prelude.Show)
mkSOAProperty :: SOAProperty
mkSOAProperty :: SOAProperty
mkSOAProperty
  = SOAProperty {haddock_workaround_ :: ()
haddock_workaround_ = (), tTL :: Maybe (Value Double)
tTL = Maybe (Value Double)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties SOAProperty where
  toResourceProperties :: SOAProperty -> ResourceProperties
toResourceProperties SOAProperty {Maybe (Value Double)
()
haddock_workaround_ :: SOAProperty -> ()
tTL :: SOAProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
tTL :: Maybe (Value Double)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::ServiceDiscovery::PublicDnsNamespace.SOA",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"TTL" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
tTL])}
instance JSON.ToJSON SOAProperty where
  toJSON :: SOAProperty -> Value
toJSON SOAProperty {Maybe (Value Double)
()
haddock_workaround_ :: SOAProperty -> ()
tTL :: SOAProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
tTL :: Maybe (Value Double)
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> Value Double -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"TTL" (Value Double -> (Key, Value))
-> Maybe (Value Double) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Double)
tTL]))
instance Property "TTL" SOAProperty where
  type PropertyType "TTL" SOAProperty = Value Prelude.Double
  set :: PropertyType "TTL" SOAProperty -> SOAProperty -> SOAProperty
set PropertyType "TTL" SOAProperty
newValue SOAProperty {Maybe (Value Double)
()
haddock_workaround_ :: SOAProperty -> ()
tTL :: SOAProperty -> Maybe (Value Double)
haddock_workaround_ :: ()
tTL :: Maybe (Value Double)
..}
    = SOAProperty {tTL :: Maybe (Value Double)
tTL = Value Double -> Maybe (Value Double)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "TTL" SOAProperty
Value Double
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}