module Stratosphere.Chatbot.CustomAction (
module Exports, CustomAction(..), mkCustomAction
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Chatbot.CustomAction.CustomActionAttachmentProperty as Exports
import {-# SOURCE #-} Stratosphere.Chatbot.CustomAction.CustomActionDefinitionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data CustomAction
=
CustomAction {CustomAction -> ()
haddock_workaround_ :: (),
CustomAction -> Value Text
actionName :: (Value Prelude.Text),
CustomAction -> Maybe (Value Text)
aliasName :: (Prelude.Maybe (Value Prelude.Text)),
CustomAction -> Maybe [CustomActionAttachmentProperty]
attachments :: (Prelude.Maybe [CustomActionAttachmentProperty]),
CustomAction -> CustomActionDefinitionProperty
definition :: CustomActionDefinitionProperty,
CustomAction -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
deriving stock (CustomAction -> CustomAction -> Bool
(CustomAction -> CustomAction -> Bool)
-> (CustomAction -> CustomAction -> Bool) -> Eq CustomAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CustomAction -> CustomAction -> Bool
== :: CustomAction -> CustomAction -> Bool
$c/= :: CustomAction -> CustomAction -> Bool
/= :: CustomAction -> CustomAction -> Bool
Prelude.Eq, Int -> CustomAction -> ShowS
[CustomAction] -> ShowS
CustomAction -> String
(Int -> CustomAction -> ShowS)
-> (CustomAction -> String)
-> ([CustomAction] -> ShowS)
-> Show CustomAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CustomAction -> ShowS
showsPrec :: Int -> CustomAction -> ShowS
$cshow :: CustomAction -> String
show :: CustomAction -> String
$cshowList :: [CustomAction] -> ShowS
showList :: [CustomAction] -> ShowS
Prelude.Show)
mkCustomAction ::
Value Prelude.Text
-> CustomActionDefinitionProperty -> CustomAction
mkCustomAction :: Value Text -> CustomActionDefinitionProperty -> CustomAction
mkCustomAction Value Text
actionName CustomActionDefinitionProperty
definition
= CustomAction
{haddock_workaround_ :: ()
haddock_workaround_ = (), actionName :: Value Text
actionName = Value Text
actionName,
definition :: CustomActionDefinitionProperty
definition = CustomActionDefinitionProperty
definition, aliasName :: Maybe (Value Text)
aliasName = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
attachments :: Maybe [CustomActionAttachmentProperty]
attachments = Maybe [CustomActionAttachmentProperty]
forall a. Maybe a
Prelude.Nothing, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties CustomAction where
toResourceProperties :: CustomAction -> ResourceProperties
toResourceProperties CustomAction {Maybe [Tag]
Maybe [CustomActionAttachmentProperty]
Maybe (Value Text)
()
Value Text
CustomActionDefinitionProperty
haddock_workaround_ :: CustomAction -> ()
actionName :: CustomAction -> Value Text
aliasName :: CustomAction -> Maybe (Value Text)
attachments :: CustomAction -> Maybe [CustomActionAttachmentProperty]
definition :: CustomAction -> CustomActionDefinitionProperty
tags :: CustomAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
tags :: Maybe [Tag]
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::Chatbot::CustomAction",
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
"ActionName" 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
actionName, Key
"Definition" Key -> CustomActionDefinitionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= CustomActionDefinitionProperty
definition]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[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
"AliasName" (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)
aliasName,
Key -> [CustomActionAttachmentProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Attachments" ([CustomActionAttachmentProperty] -> (Key, Value))
-> Maybe [CustomActionAttachmentProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CustomActionAttachmentProperty]
attachments,
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 CustomAction where
toJSON :: CustomAction -> Value
toJSON CustomAction {Maybe [Tag]
Maybe [CustomActionAttachmentProperty]
Maybe (Value Text)
()
Value Text
CustomActionDefinitionProperty
haddock_workaround_ :: CustomAction -> ()
actionName :: CustomAction -> Value Text
aliasName :: CustomAction -> Maybe (Value Text)
attachments :: CustomAction -> Maybe [CustomActionAttachmentProperty]
definition :: CustomAction -> CustomActionDefinitionProperty
tags :: CustomAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
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
"ActionName" 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
actionName, Key
"Definition" Key -> CustomActionDefinitionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= CustomActionDefinitionProperty
definition]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[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
"AliasName" (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)
aliasName,
Key -> [CustomActionAttachmentProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Attachments" ([CustomActionAttachmentProperty] -> (Key, Value))
-> Maybe [CustomActionAttachmentProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CustomActionAttachmentProperty]
attachments,
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 "ActionName" CustomAction where
type PropertyType "ActionName" CustomAction = Value Prelude.Text
set :: PropertyType "ActionName" CustomAction
-> CustomAction -> CustomAction
set PropertyType "ActionName" CustomAction
newValue CustomAction {Maybe [Tag]
Maybe [CustomActionAttachmentProperty]
Maybe (Value Text)
()
Value Text
CustomActionDefinitionProperty
haddock_workaround_ :: CustomAction -> ()
actionName :: CustomAction -> Value Text
aliasName :: CustomAction -> Maybe (Value Text)
attachments :: CustomAction -> Maybe [CustomActionAttachmentProperty]
definition :: CustomAction -> CustomActionDefinitionProperty
tags :: CustomAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
tags :: Maybe [Tag]
..}
= CustomAction {actionName :: Value Text
actionName = PropertyType "ActionName" CustomAction
Value Text
newValue, Maybe [Tag]
Maybe [CustomActionAttachmentProperty]
Maybe (Value Text)
()
CustomActionDefinitionProperty
haddock_workaround_ :: ()
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
tags :: Maybe [Tag]
..}
instance Property "AliasName" CustomAction where
type PropertyType "AliasName" CustomAction = Value Prelude.Text
set :: PropertyType "AliasName" CustomAction
-> CustomAction -> CustomAction
set PropertyType "AliasName" CustomAction
newValue CustomAction {Maybe [Tag]
Maybe [CustomActionAttachmentProperty]
Maybe (Value Text)
()
Value Text
CustomActionDefinitionProperty
haddock_workaround_ :: CustomAction -> ()
actionName :: CustomAction -> Value Text
aliasName :: CustomAction -> Maybe (Value Text)
attachments :: CustomAction -> Maybe [CustomActionAttachmentProperty]
definition :: CustomAction -> CustomActionDefinitionProperty
tags :: CustomAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
tags :: Maybe [Tag]
..}
= CustomAction {aliasName :: Maybe (Value Text)
aliasName = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AliasName" CustomAction
Value Text
newValue, Maybe [Tag]
Maybe [CustomActionAttachmentProperty]
()
Value Text
CustomActionDefinitionProperty
haddock_workaround_ :: ()
actionName :: Value Text
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Value Text
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
tags :: Maybe [Tag]
..}
instance Property "Attachments" CustomAction where
type PropertyType "Attachments" CustomAction = [CustomActionAttachmentProperty]
set :: PropertyType "Attachments" CustomAction
-> CustomAction -> CustomAction
set PropertyType "Attachments" CustomAction
newValue CustomAction {Maybe [Tag]
Maybe [CustomActionAttachmentProperty]
Maybe (Value Text)
()
Value Text
CustomActionDefinitionProperty
haddock_workaround_ :: CustomAction -> ()
actionName :: CustomAction -> Value Text
aliasName :: CustomAction -> Maybe (Value Text)
attachments :: CustomAction -> Maybe [CustomActionAttachmentProperty]
definition :: CustomAction -> CustomActionDefinitionProperty
tags :: CustomAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
tags :: Maybe [Tag]
..}
= CustomAction {attachments :: Maybe [CustomActionAttachmentProperty]
attachments = [CustomActionAttachmentProperty]
-> Maybe [CustomActionAttachmentProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [CustomActionAttachmentProperty]
PropertyType "Attachments" CustomAction
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Text
CustomActionDefinitionProperty
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
definition :: CustomActionDefinitionProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
definition :: CustomActionDefinitionProperty
tags :: Maybe [Tag]
..}
instance Property "Definition" CustomAction where
type PropertyType "Definition" CustomAction = CustomActionDefinitionProperty
set :: PropertyType "Definition" CustomAction
-> CustomAction -> CustomAction
set PropertyType "Definition" CustomAction
newValue CustomAction {Maybe [Tag]
Maybe [CustomActionAttachmentProperty]
Maybe (Value Text)
()
Value Text
CustomActionDefinitionProperty
haddock_workaround_ :: CustomAction -> ()
actionName :: CustomAction -> Value Text
aliasName :: CustomAction -> Maybe (Value Text)
attachments :: CustomAction -> Maybe [CustomActionAttachmentProperty]
definition :: CustomAction -> CustomActionDefinitionProperty
tags :: CustomAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
tags :: Maybe [Tag]
..}
= CustomAction {definition :: CustomActionDefinitionProperty
definition = PropertyType "Definition" CustomAction
CustomActionDefinitionProperty
newValue, Maybe [Tag]
Maybe [CustomActionAttachmentProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
tags :: Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
tags :: Maybe [Tag]
..}
instance Property "Tags" CustomAction where
type PropertyType "Tags" CustomAction = [Tag]
set :: PropertyType "Tags" CustomAction -> CustomAction -> CustomAction
set PropertyType "Tags" CustomAction
newValue CustomAction {Maybe [Tag]
Maybe [CustomActionAttachmentProperty]
Maybe (Value Text)
()
Value Text
CustomActionDefinitionProperty
haddock_workaround_ :: CustomAction -> ()
actionName :: CustomAction -> Value Text
aliasName :: CustomAction -> Maybe (Value Text)
attachments :: CustomAction -> Maybe [CustomActionAttachmentProperty]
definition :: CustomAction -> CustomActionDefinitionProperty
tags :: CustomAction -> Maybe [Tag]
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
tags :: Maybe [Tag]
..}
= CustomAction {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" CustomAction
newValue, Maybe [CustomActionAttachmentProperty]
Maybe (Value Text)
()
Value Text
CustomActionDefinitionProperty
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
haddock_workaround_ :: ()
actionName :: Value Text
aliasName :: Maybe (Value Text)
attachments :: Maybe [CustomActionAttachmentProperty]
definition :: CustomActionDefinitionProperty
..}