module Stratosphere.AppSync.Resolver.CachingConfigProperty (
        CachingConfigProperty(..), mkCachingConfigProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data CachingConfigProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-resolver-cachingconfig.html>
    CachingConfigProperty {CachingConfigProperty -> ()
haddock_workaround_ :: (),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-resolver-cachingconfig.html#cfn-appsync-resolver-cachingconfig-cachingkeys>
                           CachingConfigProperty -> Maybe (ValueList Text)
cachingKeys :: (Prelude.Maybe (ValueList Prelude.Text)),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-resolver-cachingconfig.html#cfn-appsync-resolver-cachingconfig-ttl>
                           CachingConfigProperty -> Value Double
ttl :: (Value Prelude.Double)}
  deriving stock (CachingConfigProperty -> CachingConfigProperty -> Bool
(CachingConfigProperty -> CachingConfigProperty -> Bool)
-> (CachingConfigProperty -> CachingConfigProperty -> Bool)
-> Eq CachingConfigProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CachingConfigProperty -> CachingConfigProperty -> Bool
== :: CachingConfigProperty -> CachingConfigProperty -> Bool
$c/= :: CachingConfigProperty -> CachingConfigProperty -> Bool
/= :: CachingConfigProperty -> CachingConfigProperty -> Bool
Prelude.Eq, Int -> CachingConfigProperty -> ShowS
[CachingConfigProperty] -> ShowS
CachingConfigProperty -> String
(Int -> CachingConfigProperty -> ShowS)
-> (CachingConfigProperty -> String)
-> ([CachingConfigProperty] -> ShowS)
-> Show CachingConfigProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CachingConfigProperty -> ShowS
showsPrec :: Int -> CachingConfigProperty -> ShowS
$cshow :: CachingConfigProperty -> String
show :: CachingConfigProperty -> String
$cshowList :: [CachingConfigProperty] -> ShowS
showList :: [CachingConfigProperty] -> ShowS
Prelude.Show)
mkCachingConfigProperty ::
  Value Prelude.Double -> CachingConfigProperty
mkCachingConfigProperty :: Value Double -> CachingConfigProperty
mkCachingConfigProperty Value Double
ttl
  = CachingConfigProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), ttl :: Value Double
ttl = Value Double
ttl,
       cachingKeys :: Maybe (ValueList Text)
cachingKeys = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties CachingConfigProperty where
  toResourceProperties :: CachingConfigProperty -> ResourceProperties
toResourceProperties CachingConfigProperty {Maybe (ValueList Text)
()
Value Double
haddock_workaround_ :: CachingConfigProperty -> ()
cachingKeys :: CachingConfigProperty -> Maybe (ValueList Text)
ttl :: CachingConfigProperty -> Value Double
haddock_workaround_ :: ()
cachingKeys :: Maybe (ValueList Text)
ttl :: Value Double
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::AppSync::Resolver.CachingConfig",
         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
"Ttl" 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..= Value Double
ttl]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> ValueList 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
"CachingKeys" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
cachingKeys]))}
instance JSON.ToJSON CachingConfigProperty where
  toJSON :: CachingConfigProperty -> Value
toJSON CachingConfigProperty {Maybe (ValueList Text)
()
Value Double
haddock_workaround_ :: CachingConfigProperty -> ()
cachingKeys :: CachingConfigProperty -> Maybe (ValueList Text)
ttl :: CachingConfigProperty -> Value Double
haddock_workaround_ :: ()
cachingKeys :: Maybe (ValueList Text)
ttl :: Value Double
..}
    = [(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
"Ttl" 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..= Value Double
ttl]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> ValueList 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
"CachingKeys" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
cachingKeys])))
instance Property "CachingKeys" CachingConfigProperty where
  type PropertyType "CachingKeys" CachingConfigProperty = ValueList Prelude.Text
  set :: PropertyType "CachingKeys" CachingConfigProperty
-> CachingConfigProperty -> CachingConfigProperty
set PropertyType "CachingKeys" CachingConfigProperty
newValue CachingConfigProperty {Maybe (ValueList Text)
()
Value Double
haddock_workaround_ :: CachingConfigProperty -> ()
cachingKeys :: CachingConfigProperty -> Maybe (ValueList Text)
ttl :: CachingConfigProperty -> Value Double
haddock_workaround_ :: ()
cachingKeys :: Maybe (ValueList Text)
ttl :: Value Double
..}
    = CachingConfigProperty {cachingKeys :: Maybe (ValueList Text)
cachingKeys = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "CachingKeys" CachingConfigProperty
ValueList Text
newValue, ()
Value Double
haddock_workaround_ :: ()
ttl :: Value Double
haddock_workaround_ :: ()
ttl :: Value Double
..}
instance Property "Ttl" CachingConfigProperty where
  type PropertyType "Ttl" CachingConfigProperty = Value Prelude.Double
  set :: PropertyType "Ttl" CachingConfigProperty
-> CachingConfigProperty -> CachingConfigProperty
set PropertyType "Ttl" CachingConfigProperty
newValue CachingConfigProperty {Maybe (ValueList Text)
()
Value Double
haddock_workaround_ :: CachingConfigProperty -> ()
cachingKeys :: CachingConfigProperty -> Maybe (ValueList Text)
ttl :: CachingConfigProperty -> Value Double
haddock_workaround_ :: ()
cachingKeys :: Maybe (ValueList Text)
ttl :: Value Double
..}
    = CachingConfigProperty {ttl :: Value Double
ttl = PropertyType "Ttl" CachingConfigProperty
Value Double
newValue, Maybe (ValueList Text)
()
haddock_workaround_ :: ()
cachingKeys :: Maybe (ValueList Text)
haddock_workaround_ :: ()
cachingKeys :: Maybe (ValueList Text)
..}