module Stratosphere.EventSchemas.Schema ( module Exports, Schema(..), mkSchema ) where import qualified Data.Aeson as JSON import qualified Stratosphere.Prelude as Prelude import Stratosphere.Property import {-# SOURCE #-} Stratosphere.EventSchemas.Schema.TagsEntryProperty as Exports import Stratosphere.ResourceProperties import Stratosphere.Value data Schema = -- | See: Schema {haddock_workaround_ :: (), -- | See: content :: (Value Prelude.Text), -- | See: description :: (Prelude.Maybe (Value Prelude.Text)), -- | See: registryName :: (Value Prelude.Text), -- | See: schemaName :: (Prelude.Maybe (Value Prelude.Text)), -- | See: tags :: (Prelude.Maybe [TagsEntryProperty]), -- | See: type' :: (Value Prelude.Text)} deriving stock (Prelude.Eq, Prelude.Show) mkSchema :: Value Prelude.Text -> Value Prelude.Text -> Value Prelude.Text -> Schema mkSchema content registryName type' = Schema {haddock_workaround_ = (), content = content, registryName = registryName, type' = type', description = Prelude.Nothing, schemaName = Prelude.Nothing, tags = Prelude.Nothing} instance ToResourceProperties Schema where toResourceProperties Schema {..} = ResourceProperties {awsType = "AWS::EventSchemas::Schema", supportsTags = Prelude.True, properties = Prelude.fromList ((Prelude.<>) ["Content" JSON..= content, "RegistryName" JSON..= registryName, "Type" JSON..= type'] (Prelude.catMaybes [(JSON..=) "Description" Prelude.<$> description, (JSON..=) "SchemaName" Prelude.<$> schemaName, (JSON..=) "Tags" Prelude.<$> tags]))} instance JSON.ToJSON Schema where toJSON Schema {..} = JSON.object (Prelude.fromList ((Prelude.<>) ["Content" JSON..= content, "RegistryName" JSON..= registryName, "Type" JSON..= type'] (Prelude.catMaybes [(JSON..=) "Description" Prelude.<$> description, (JSON..=) "SchemaName" Prelude.<$> schemaName, (JSON..=) "Tags" Prelude.<$> tags]))) instance Property "Content" Schema where type PropertyType "Content" Schema = Value Prelude.Text set newValue Schema {..} = Schema {content = newValue, ..} instance Property "Description" Schema where type PropertyType "Description" Schema = Value Prelude.Text set newValue Schema {..} = Schema {description = Prelude.pure newValue, ..} instance Property "RegistryName" Schema where type PropertyType "RegistryName" Schema = Value Prelude.Text set newValue Schema {..} = Schema {registryName = newValue, ..} instance Property "SchemaName" Schema where type PropertyType "SchemaName" Schema = Value Prelude.Text set newValue Schema {..} = Schema {schemaName = Prelude.pure newValue, ..} instance Property "Tags" Schema where type PropertyType "Tags" Schema = [TagsEntryProperty] set newValue Schema {..} = Schema {tags = Prelude.pure newValue, ..} instance Property "Type" Schema where type PropertyType "Type" Schema = Value Prelude.Text set newValue Schema {..} = Schema {type' = newValue, ..}