module Stratosphere.Bedrock.Prompt.PromptTemplateConfigurationProperty (
module Exports, PromptTemplateConfigurationProperty(..),
mkPromptTemplateConfigurationProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.Bedrock.Prompt.ChatPromptTemplateConfigurationProperty as Exports
import {-# SOURCE #-} Stratosphere.Bedrock.Prompt.TextPromptTemplateConfigurationProperty as Exports
import Stratosphere.ResourceProperties
data PromptTemplateConfigurationProperty
=
PromptTemplateConfigurationProperty {PromptTemplateConfigurationProperty -> ()
haddock_workaround_ :: (),
PromptTemplateConfigurationProperty
-> Maybe ChatPromptTemplateConfigurationProperty
chat :: (Prelude.Maybe ChatPromptTemplateConfigurationProperty),
PromptTemplateConfigurationProperty
-> Maybe TextPromptTemplateConfigurationProperty
text :: (Prelude.Maybe TextPromptTemplateConfigurationProperty)}
deriving stock (PromptTemplateConfigurationProperty
-> PromptTemplateConfigurationProperty -> Bool
(PromptTemplateConfigurationProperty
-> PromptTemplateConfigurationProperty -> Bool)
-> (PromptTemplateConfigurationProperty
-> PromptTemplateConfigurationProperty -> Bool)
-> Eq PromptTemplateConfigurationProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PromptTemplateConfigurationProperty
-> PromptTemplateConfigurationProperty -> Bool
== :: PromptTemplateConfigurationProperty
-> PromptTemplateConfigurationProperty -> Bool
$c/= :: PromptTemplateConfigurationProperty
-> PromptTemplateConfigurationProperty -> Bool
/= :: PromptTemplateConfigurationProperty
-> PromptTemplateConfigurationProperty -> Bool
Prelude.Eq, Int -> PromptTemplateConfigurationProperty -> ShowS
[PromptTemplateConfigurationProperty] -> ShowS
PromptTemplateConfigurationProperty -> String
(Int -> PromptTemplateConfigurationProperty -> ShowS)
-> (PromptTemplateConfigurationProperty -> String)
-> ([PromptTemplateConfigurationProperty] -> ShowS)
-> Show PromptTemplateConfigurationProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PromptTemplateConfigurationProperty -> ShowS
showsPrec :: Int -> PromptTemplateConfigurationProperty -> ShowS
$cshow :: PromptTemplateConfigurationProperty -> String
show :: PromptTemplateConfigurationProperty -> String
$cshowList :: [PromptTemplateConfigurationProperty] -> ShowS
showList :: [PromptTemplateConfigurationProperty] -> ShowS
Prelude.Show)
mkPromptTemplateConfigurationProperty ::
PromptTemplateConfigurationProperty
mkPromptTemplateConfigurationProperty :: PromptTemplateConfigurationProperty
mkPromptTemplateConfigurationProperty
= PromptTemplateConfigurationProperty
{haddock_workaround_ :: ()
haddock_workaround_ = (), chat :: Maybe ChatPromptTemplateConfigurationProperty
chat = Maybe ChatPromptTemplateConfigurationProperty
forall a. Maybe a
Prelude.Nothing,
text :: Maybe TextPromptTemplateConfigurationProperty
text = Maybe TextPromptTemplateConfigurationProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties PromptTemplateConfigurationProperty where
toResourceProperties :: PromptTemplateConfigurationProperty -> ResourceProperties
toResourceProperties PromptTemplateConfigurationProperty {Maybe TextPromptTemplateConfigurationProperty
Maybe ChatPromptTemplateConfigurationProperty
()
haddock_workaround_ :: PromptTemplateConfigurationProperty -> ()
chat :: PromptTemplateConfigurationProperty
-> Maybe ChatPromptTemplateConfigurationProperty
text :: PromptTemplateConfigurationProperty
-> Maybe TextPromptTemplateConfigurationProperty
haddock_workaround_ :: ()
chat :: Maybe ChatPromptTemplateConfigurationProperty
text :: Maybe TextPromptTemplateConfigurationProperty
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::Bedrock::Prompt.PromptTemplateConfiguration",
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 -> ChatPromptTemplateConfigurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Chat" (ChatPromptTemplateConfigurationProperty -> (Key, Value))
-> Maybe ChatPromptTemplateConfigurationProperty
-> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChatPromptTemplateConfigurationProperty
chat,
Key -> TextPromptTemplateConfigurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Text" (TextPromptTemplateConfigurationProperty -> (Key, Value))
-> Maybe TextPromptTemplateConfigurationProperty
-> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TextPromptTemplateConfigurationProperty
text])}
instance JSON.ToJSON PromptTemplateConfigurationProperty where
toJSON :: PromptTemplateConfigurationProperty -> Value
toJSON PromptTemplateConfigurationProperty {Maybe TextPromptTemplateConfigurationProperty
Maybe ChatPromptTemplateConfigurationProperty
()
haddock_workaround_ :: PromptTemplateConfigurationProperty -> ()
chat :: PromptTemplateConfigurationProperty
-> Maybe ChatPromptTemplateConfigurationProperty
text :: PromptTemplateConfigurationProperty
-> Maybe TextPromptTemplateConfigurationProperty
haddock_workaround_ :: ()
chat :: Maybe ChatPromptTemplateConfigurationProperty
text :: Maybe TextPromptTemplateConfigurationProperty
..}
= [(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 -> ChatPromptTemplateConfigurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Chat" (ChatPromptTemplateConfigurationProperty -> (Key, Value))
-> Maybe ChatPromptTemplateConfigurationProperty
-> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChatPromptTemplateConfigurationProperty
chat,
Key -> TextPromptTemplateConfigurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Text" (TextPromptTemplateConfigurationProperty -> (Key, Value))
-> Maybe TextPromptTemplateConfigurationProperty
-> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TextPromptTemplateConfigurationProperty
text]))
instance Property "Chat" PromptTemplateConfigurationProperty where
type PropertyType "Chat" PromptTemplateConfigurationProperty = ChatPromptTemplateConfigurationProperty
set :: PropertyType "Chat" PromptTemplateConfigurationProperty
-> PromptTemplateConfigurationProperty
-> PromptTemplateConfigurationProperty
set PropertyType "Chat" PromptTemplateConfigurationProperty
newValue PromptTemplateConfigurationProperty {Maybe TextPromptTemplateConfigurationProperty
Maybe ChatPromptTemplateConfigurationProperty
()
haddock_workaround_ :: PromptTemplateConfigurationProperty -> ()
chat :: PromptTemplateConfigurationProperty
-> Maybe ChatPromptTemplateConfigurationProperty
text :: PromptTemplateConfigurationProperty
-> Maybe TextPromptTemplateConfigurationProperty
haddock_workaround_ :: ()
chat :: Maybe ChatPromptTemplateConfigurationProperty
text :: Maybe TextPromptTemplateConfigurationProperty
..}
= PromptTemplateConfigurationProperty
{chat :: Maybe ChatPromptTemplateConfigurationProperty
chat = ChatPromptTemplateConfigurationProperty
-> Maybe ChatPromptTemplateConfigurationProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Chat" PromptTemplateConfigurationProperty
ChatPromptTemplateConfigurationProperty
newValue, Maybe TextPromptTemplateConfigurationProperty
()
haddock_workaround_ :: ()
text :: Maybe TextPromptTemplateConfigurationProperty
haddock_workaround_ :: ()
text :: Maybe TextPromptTemplateConfigurationProperty
..}
instance Property "Text" PromptTemplateConfigurationProperty where
type PropertyType "Text" PromptTemplateConfigurationProperty = TextPromptTemplateConfigurationProperty
set :: PropertyType "Text" PromptTemplateConfigurationProperty
-> PromptTemplateConfigurationProperty
-> PromptTemplateConfigurationProperty
set PropertyType "Text" PromptTemplateConfigurationProperty
newValue PromptTemplateConfigurationProperty {Maybe TextPromptTemplateConfigurationProperty
Maybe ChatPromptTemplateConfigurationProperty
()
haddock_workaround_ :: PromptTemplateConfigurationProperty -> ()
chat :: PromptTemplateConfigurationProperty
-> Maybe ChatPromptTemplateConfigurationProperty
text :: PromptTemplateConfigurationProperty
-> Maybe TextPromptTemplateConfigurationProperty
haddock_workaround_ :: ()
chat :: Maybe ChatPromptTemplateConfigurationProperty
text :: Maybe TextPromptTemplateConfigurationProperty
..}
= PromptTemplateConfigurationProperty
{text :: Maybe TextPromptTemplateConfigurationProperty
text = TextPromptTemplateConfigurationProperty
-> Maybe TextPromptTemplateConfigurationProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Text" PromptTemplateConfigurationProperty
TextPromptTemplateConfigurationProperty
newValue, Maybe ChatPromptTemplateConfigurationProperty
()
haddock_workaround_ :: ()
chat :: Maybe ChatPromptTemplateConfigurationProperty
haddock_workaround_ :: ()
chat :: Maybe ChatPromptTemplateConfigurationProperty
..}