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