module Stratosphere.DataBrew.Recipe ( module Exports, Recipe(..), mkRecipe ) where import qualified Data.Aeson as JSON import qualified Stratosphere.Prelude as Prelude import Stratosphere.Property import {-# SOURCE #-} Stratosphere.DataBrew.Recipe.RecipeStepProperty as Exports import Stratosphere.ResourceProperties import Stratosphere.Tag import Stratosphere.Value data Recipe = -- | See: Recipe {haddock_workaround_ :: (), -- | See: description :: (Prelude.Maybe (Value Prelude.Text)), -- | See: name :: (Value Prelude.Text), -- | See: steps :: [RecipeStepProperty], -- | See: tags :: (Prelude.Maybe [Tag])} deriving stock (Prelude.Eq, Prelude.Show) mkRecipe :: Value Prelude.Text -> [RecipeStepProperty] -> Recipe mkRecipe name steps = Recipe {haddock_workaround_ = (), name = name, steps = steps, description = Prelude.Nothing, tags = Prelude.Nothing} instance ToResourceProperties Recipe where toResourceProperties Recipe {..} = ResourceProperties {awsType = "AWS::DataBrew::Recipe", supportsTags = Prelude.True, properties = Prelude.fromList ((Prelude.<>) ["Name" JSON..= name, "Steps" JSON..= steps] (Prelude.catMaybes [(JSON..=) "Description" Prelude.<$> description, (JSON..=) "Tags" Prelude.<$> tags]))} instance JSON.ToJSON Recipe where toJSON Recipe {..} = JSON.object (Prelude.fromList ((Prelude.<>) ["Name" JSON..= name, "Steps" JSON..= steps] (Prelude.catMaybes [(JSON..=) "Description" Prelude.<$> description, (JSON..=) "Tags" Prelude.<$> tags]))) instance Property "Description" Recipe where type PropertyType "Description" Recipe = Value Prelude.Text set newValue Recipe {..} = Recipe {description = Prelude.pure newValue, ..} instance Property "Name" Recipe where type PropertyType "Name" Recipe = Value Prelude.Text set newValue Recipe {..} = Recipe {name = newValue, ..} instance Property "Steps" Recipe where type PropertyType "Steps" Recipe = [RecipeStepProperty] set newValue Recipe {..} = Recipe {steps = newValue, ..} instance Property "Tags" Recipe where type PropertyType "Tags" Recipe = [Tag] set newValue Recipe {..} = Recipe {tags = Prelude.pure newValue, ..}