module Stratosphere.Personalize.Schema (
Schema(..), mkSchema
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data Schema
=
Schema {Schema -> ()
haddock_workaround_ :: (),
Schema -> Maybe (Value Text)
domain :: (Prelude.Maybe (Value Prelude.Text)),
Schema -> Value Text
name :: (Value Prelude.Text),
Schema -> Value Text
schema :: (Value Prelude.Text)}
deriving stock (Schema -> Schema -> Bool
(Schema -> Schema -> Bool)
-> (Schema -> Schema -> Bool) -> Eq Schema
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Schema -> Schema -> Bool
== :: Schema -> Schema -> Bool
$c/= :: Schema -> Schema -> Bool
/= :: Schema -> Schema -> Bool
Prelude.Eq, Int -> Schema -> ShowS
[Schema] -> ShowS
Schema -> String
(Int -> Schema -> ShowS)
-> (Schema -> String) -> ([Schema] -> ShowS) -> Show Schema
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Schema -> ShowS
showsPrec :: Int -> Schema -> ShowS
$cshow :: Schema -> String
show :: Schema -> String
$cshowList :: [Schema] -> ShowS
showList :: [Schema] -> ShowS
Prelude.Show)
mkSchema :: Value Prelude.Text -> Value Prelude.Text -> Schema
mkSchema :: Value Text -> Value Text -> Schema
mkSchema Value Text
name Value Text
schema
= Schema
{haddock_workaround_ :: ()
haddock_workaround_ = (), name :: Value Text
name = Value Text
name, schema :: Value Text
schema = Value Text
schema,
domain :: Maybe (Value Text)
domain = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Schema where
toResourceProperties :: Schema -> ResourceProperties
toResourceProperties Schema {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Schema -> ()
domain :: Schema -> Maybe (Value Text)
name :: Schema -> Value Text
schema :: Schema -> Value Text
haddock_workaround_ :: ()
domain :: Maybe (Value Text)
name :: Value Text
schema :: Value Text
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::Personalize::Schema",
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
"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, Key
"Schema" 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
schema]
([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
"Domain" (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)
domain]))}
instance JSON.ToJSON Schema where
toJSON :: Schema -> Value
toJSON Schema {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Schema -> ()
domain :: Schema -> Maybe (Value Text)
name :: Schema -> Value Text
schema :: Schema -> Value Text
haddock_workaround_ :: ()
domain :: Maybe (Value Text)
name :: Value Text
schema :: Value Text
..}
= [(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, Key
"Schema" 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
schema]
([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
"Domain" (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)
domain])))
instance Property "Domain" Schema where
type PropertyType "Domain" Schema = Value Prelude.Text
set :: PropertyType "Domain" Schema -> Schema -> Schema
set PropertyType "Domain" Schema
newValue Schema {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Schema -> ()
domain :: Schema -> Maybe (Value Text)
name :: Schema -> Value Text
schema :: Schema -> Value Text
haddock_workaround_ :: ()
domain :: Maybe (Value Text)
name :: Value Text
schema :: Value Text
..}
= Schema {domain :: Maybe (Value Text)
domain = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Domain" Schema
Value Text
newValue, ()
Value Text
haddock_workaround_ :: ()
name :: Value Text
schema :: Value Text
haddock_workaround_ :: ()
name :: Value Text
schema :: Value Text
..}
instance Property "Name" Schema where
type PropertyType "Name" Schema = Value Prelude.Text
set :: PropertyType "Name" Schema -> Schema -> Schema
set PropertyType "Name" Schema
newValue Schema {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Schema -> ()
domain :: Schema -> Maybe (Value Text)
name :: Schema -> Value Text
schema :: Schema -> Value Text
haddock_workaround_ :: ()
domain :: Maybe (Value Text)
name :: Value Text
schema :: Value Text
..} = Schema {name :: Value Text
name = PropertyType "Name" Schema
Value Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
domain :: Maybe (Value Text)
schema :: Value Text
haddock_workaround_ :: ()
domain :: Maybe (Value Text)
schema :: Value Text
..}
instance Property "Schema" Schema where
type PropertyType "Schema" Schema = Value Prelude.Text
set :: PropertyType "Schema" Schema -> Schema -> Schema
set PropertyType "Schema" Schema
newValue Schema {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Schema -> ()
domain :: Schema -> Maybe (Value Text)
name :: Schema -> Value Text
schema :: Schema -> Value Text
haddock_workaround_ :: ()
domain :: Maybe (Value Text)
name :: Value Text
schema :: Value Text
..} = Schema {schema :: Value Text
schema = PropertyType "Schema" Schema
Value Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
domain :: Maybe (Value Text)
name :: Value Text
haddock_workaround_ :: ()
domain :: Maybe (Value Text)
name :: Value Text
..}