module Stratosphere.AppSync.Api (
module Exports, Api(..), mkApi
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.AppSync.Api.EventConfigProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Api
=
Api {Api -> ()
haddock_workaround_ :: (),
Api -> Maybe EventConfigProperty
eventConfig :: (Prelude.Maybe EventConfigProperty),
Api -> Value Text
name :: (Value Prelude.Text),
Api -> Maybe (Value Text)
ownerContact :: (Prelude.Maybe (Value Prelude.Text)),
Api -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
deriving stock (Api -> Api -> Bool
(Api -> Api -> Bool) -> (Api -> Api -> Bool) -> Eq Api
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Api -> Api -> Bool
== :: Api -> Api -> Bool
$c/= :: Api -> Api -> Bool
/= :: Api -> Api -> Bool
Prelude.Eq, Int -> Api -> ShowS
[Api] -> ShowS
Api -> String
(Int -> Api -> ShowS)
-> (Api -> String) -> ([Api] -> ShowS) -> Show Api
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Api -> ShowS
showsPrec :: Int -> Api -> ShowS
$cshow :: Api -> String
show :: Api -> String
$cshowList :: [Api] -> ShowS
showList :: [Api] -> ShowS
Prelude.Show)
mkApi :: Value Prelude.Text -> Api
mkApi :: Value Text -> Api
mkApi Value Text
name
= Api
{haddock_workaround_ :: ()
haddock_workaround_ = (), name :: Value Text
name = Value Text
name,
eventConfig :: Maybe EventConfigProperty
eventConfig = Maybe EventConfigProperty
forall a. Maybe a
Prelude.Nothing, ownerContact :: Maybe (Value Text)
ownerContact = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Api where
toResourceProperties :: Api -> ResourceProperties
toResourceProperties Api {Maybe [Tag]
Maybe (Value Text)
Maybe EventConfigProperty
()
Value Text
haddock_workaround_ :: Api -> ()
eventConfig :: Api -> Maybe EventConfigProperty
name :: Api -> Value Text
ownerContact :: Api -> Maybe (Value Text)
tags :: Api -> Maybe [Tag]
haddock_workaround_ :: ()
eventConfig :: Maybe EventConfigProperty
name :: Value Text
ownerContact :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::AppSync::Api", 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 -> EventConfigProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"EventConfig" (EventConfigProperty -> (Key, Value))
-> Maybe EventConfigProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EventConfigProperty
eventConfig,
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..=) Key
"OwnerContact" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
ownerContact,
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 Api where
toJSON :: Api -> Value
toJSON Api {Maybe [Tag]
Maybe (Value Text)
Maybe EventConfigProperty
()
Value Text
haddock_workaround_ :: Api -> ()
eventConfig :: Api -> Maybe EventConfigProperty
name :: Api -> Value Text
ownerContact :: Api -> Maybe (Value Text)
tags :: Api -> Maybe [Tag]
haddock_workaround_ :: ()
eventConfig :: Maybe EventConfigProperty
name :: Value Text
ownerContact :: Maybe (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 -> EventConfigProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"EventConfig" (EventConfigProperty -> (Key, Value))
-> Maybe EventConfigProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EventConfigProperty
eventConfig,
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..=) Key
"OwnerContact" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
ownerContact,
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 "EventConfig" Api where
type PropertyType "EventConfig" Api = EventConfigProperty
set :: PropertyType "EventConfig" Api -> Api -> Api
set PropertyType "EventConfig" Api
newValue Api {Maybe [Tag]
Maybe (Value Text)
Maybe EventConfigProperty
()
Value Text
haddock_workaround_ :: Api -> ()
eventConfig :: Api -> Maybe EventConfigProperty
name :: Api -> Value Text
ownerContact :: Api -> Maybe (Value Text)
tags :: Api -> Maybe [Tag]
haddock_workaround_ :: ()
eventConfig :: Maybe EventConfigProperty
name :: Value Text
ownerContact :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= Api {eventConfig :: Maybe EventConfigProperty
eventConfig = EventConfigProperty -> Maybe EventConfigProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "EventConfig" Api
EventConfigProperty
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
name :: Value Text
ownerContact :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
ownerContact :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "Name" Api where
type PropertyType "Name" Api = Value Prelude.Text
set :: PropertyType "Name" Api -> Api -> Api
set PropertyType "Name" Api
newValue Api {Maybe [Tag]
Maybe (Value Text)
Maybe EventConfigProperty
()
Value Text
haddock_workaround_ :: Api -> ()
eventConfig :: Api -> Maybe EventConfigProperty
name :: Api -> Value Text
ownerContact :: Api -> Maybe (Value Text)
tags :: Api -> Maybe [Tag]
haddock_workaround_ :: ()
eventConfig :: Maybe EventConfigProperty
name :: Value Text
ownerContact :: Maybe (Value Text)
tags :: Maybe [Tag]
..} = Api {name :: Value Text
name = PropertyType "Name" Api
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
Maybe EventConfigProperty
()
haddock_workaround_ :: ()
eventConfig :: Maybe EventConfigProperty
ownerContact :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
eventConfig :: Maybe EventConfigProperty
ownerContact :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "OwnerContact" Api where
type PropertyType "OwnerContact" Api = Value Prelude.Text
set :: PropertyType "OwnerContact" Api -> Api -> Api
set PropertyType "OwnerContact" Api
newValue Api {Maybe [Tag]
Maybe (Value Text)
Maybe EventConfigProperty
()
Value Text
haddock_workaround_ :: Api -> ()
eventConfig :: Api -> Maybe EventConfigProperty
name :: Api -> Value Text
ownerContact :: Api -> Maybe (Value Text)
tags :: Api -> Maybe [Tag]
haddock_workaround_ :: ()
eventConfig :: Maybe EventConfigProperty
name :: Value Text
ownerContact :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= Api {ownerContact :: Maybe (Value Text)
ownerContact = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "OwnerContact" Api
Value Text
newValue, Maybe [Tag]
Maybe EventConfigProperty
()
Value Text
haddock_workaround_ :: ()
eventConfig :: Maybe EventConfigProperty
name :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
eventConfig :: Maybe EventConfigProperty
name :: Value Text
tags :: Maybe [Tag]
..}
instance Property "Tags" Api where
type PropertyType "Tags" Api = [Tag]
set :: PropertyType "Tags" Api -> Api -> Api
set PropertyType "Tags" Api
newValue Api {Maybe [Tag]
Maybe (Value Text)
Maybe EventConfigProperty
()
Value Text
haddock_workaround_ :: Api -> ()
eventConfig :: Api -> Maybe EventConfigProperty
name :: Api -> Value Text
ownerContact :: Api -> Maybe (Value Text)
tags :: Api -> Maybe [Tag]
haddock_workaround_ :: ()
eventConfig :: Maybe EventConfigProperty
name :: Value Text
ownerContact :: Maybe (Value Text)
tags :: Maybe [Tag]
..} = Api {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" Api
newValue, Maybe (Value Text)
Maybe EventConfigProperty
()
Value Text
haddock_workaround_ :: ()
eventConfig :: Maybe EventConfigProperty
name :: Value Text
ownerContact :: Maybe (Value Text)
haddock_workaround_ :: ()
eventConfig :: Maybe EventConfigProperty
name :: Value Text
ownerContact :: Maybe (Value Text)
..}