module Stratosphere.DataBrew.Schedule (
        Schedule(..), mkSchedule
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Schedule
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-schedule.html>
    Schedule {Schedule -> ()
haddock_workaround_ :: (),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-schedule.html#cfn-databrew-schedule-cronexpression>
              Schedule -> Value Text
cronExpression :: (Value Prelude.Text),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-schedule.html#cfn-databrew-schedule-jobnames>
              Schedule -> Maybe (ValueList Text)
jobNames :: (Prelude.Maybe (ValueList Prelude.Text)),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-schedule.html#cfn-databrew-schedule-name>
              Schedule -> Value Text
name :: (Value Prelude.Text),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-schedule.html#cfn-databrew-schedule-tags>
              Schedule -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (Schedule -> Schedule -> Bool
(Schedule -> Schedule -> Bool)
-> (Schedule -> Schedule -> Bool) -> Eq Schedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Schedule -> Schedule -> Bool
== :: Schedule -> Schedule -> Bool
$c/= :: Schedule -> Schedule -> Bool
/= :: Schedule -> Schedule -> Bool
Prelude.Eq, Int -> Schedule -> ShowS
[Schedule] -> ShowS
Schedule -> String
(Int -> Schedule -> ShowS)
-> (Schedule -> String) -> ([Schedule] -> ShowS) -> Show Schedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Schedule -> ShowS
showsPrec :: Int -> Schedule -> ShowS
$cshow :: Schedule -> String
show :: Schedule -> String
$cshowList :: [Schedule] -> ShowS
showList :: [Schedule] -> ShowS
Prelude.Show)
mkSchedule :: Value Prelude.Text -> Value Prelude.Text -> Schedule
mkSchedule :: Value Text -> Value Text -> Schedule
mkSchedule Value Text
cronExpression Value Text
name
  = Schedule
      {haddock_workaround_ :: ()
haddock_workaround_ = (), cronExpression :: Value Text
cronExpression = Value Text
cronExpression,
       name :: Value Text
name = Value Text
name, jobNames :: Maybe (ValueList Text)
jobNames = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Schedule where
  toResourceProperties :: Schedule -> ResourceProperties
toResourceProperties Schedule {Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: Schedule -> ()
cronExpression :: Schedule -> Value Text
jobNames :: Schedule -> Maybe (ValueList Text)
name :: Schedule -> Value Text
tags :: Schedule -> Maybe [Tag]
haddock_workaround_ :: ()
cronExpression :: Value Text
jobNames :: Maybe (ValueList Text)
name :: Value Text
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::DataBrew::Schedule", supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         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
"CronExpression" 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
cronExpression, 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]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> ValueList 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
"JobNames" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
jobNames,
                               Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON Schedule where
  toJSON :: Schedule -> Value
toJSON Schedule {Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: Schedule -> ()
cronExpression :: Schedule -> Value Text
jobNames :: Schedule -> Maybe (ValueList Text)
name :: Schedule -> Value Text
tags :: Schedule -> Maybe [Tag]
haddock_workaround_ :: ()
cronExpression :: Value Text
jobNames :: Maybe (ValueList Text)
name :: Value Text
tags :: Maybe [Tag]
..}
    = [(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
"CronExpression" 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
cronExpression, 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]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> ValueList 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
"JobNames" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
jobNames,
                  Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "CronExpression" Schedule where
  type PropertyType "CronExpression" Schedule = Value Prelude.Text
  set :: PropertyType "CronExpression" Schedule -> Schedule -> Schedule
set PropertyType "CronExpression" Schedule
newValue Schedule {Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: Schedule -> ()
cronExpression :: Schedule -> Value Text
jobNames :: Schedule -> Maybe (ValueList Text)
name :: Schedule -> Value Text
tags :: Schedule -> Maybe [Tag]
haddock_workaround_ :: ()
cronExpression :: Value Text
jobNames :: Maybe (ValueList Text)
name :: Value Text
tags :: Maybe [Tag]
..}
    = Schedule {cronExpression :: Value Text
cronExpression = PropertyType "CronExpression" Schedule
Value Text
newValue, Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: ()
jobNames :: Maybe (ValueList Text)
name :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
jobNames :: Maybe (ValueList Text)
name :: Value Text
tags :: Maybe [Tag]
..}
instance Property "JobNames" Schedule where
  type PropertyType "JobNames" Schedule = ValueList Prelude.Text
  set :: PropertyType "JobNames" Schedule -> Schedule -> Schedule
set PropertyType "JobNames" Schedule
newValue Schedule {Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: Schedule -> ()
cronExpression :: Schedule -> Value Text
jobNames :: Schedule -> Maybe (ValueList Text)
name :: Schedule -> Value Text
tags :: Schedule -> Maybe [Tag]
haddock_workaround_ :: ()
cronExpression :: Value Text
jobNames :: Maybe (ValueList Text)
name :: Value Text
tags :: Maybe [Tag]
..}
    = Schedule {jobNames :: Maybe (ValueList Text)
jobNames = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "JobNames" Schedule
ValueList Text
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
cronExpression :: Value Text
name :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
cronExpression :: Value Text
name :: Value Text
tags :: Maybe [Tag]
..}
instance Property "Name" Schedule where
  type PropertyType "Name" Schedule = Value Prelude.Text
  set :: PropertyType "Name" Schedule -> Schedule -> Schedule
set PropertyType "Name" Schedule
newValue Schedule {Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: Schedule -> ()
cronExpression :: Schedule -> Value Text
jobNames :: Schedule -> Maybe (ValueList Text)
name :: Schedule -> Value Text
tags :: Schedule -> Maybe [Tag]
haddock_workaround_ :: ()
cronExpression :: Value Text
jobNames :: Maybe (ValueList Text)
name :: Value Text
tags :: Maybe [Tag]
..} = Schedule {name :: Value Text
name = PropertyType "Name" Schedule
Value Text
newValue, Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: ()
cronExpression :: Value Text
jobNames :: Maybe (ValueList Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
cronExpression :: Value Text
jobNames :: Maybe (ValueList Text)
tags :: Maybe [Tag]
..}
instance Property "Tags" Schedule where
  type PropertyType "Tags" Schedule = [Tag]
  set :: PropertyType "Tags" Schedule -> Schedule -> Schedule
set PropertyType "Tags" Schedule
newValue Schedule {Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: Schedule -> ()
cronExpression :: Schedule -> Value Text
jobNames :: Schedule -> Maybe (ValueList Text)
name :: Schedule -> Value Text
tags :: Schedule -> Maybe [Tag]
haddock_workaround_ :: ()
cronExpression :: Value Text
jobNames :: Maybe (ValueList Text)
name :: Value Text
tags :: Maybe [Tag]
..}
    = Schedule {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" Schedule
newValue, Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: ()
cronExpression :: Value Text
jobNames :: Maybe (ValueList Text)
name :: Value Text
haddock_workaround_ :: ()
cronExpression :: Value Text
jobNames :: Maybe (ValueList Text)
name :: Value Text
..}