{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.OpsWorks.Types.Recipes where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Recipes = Recipes'
{
Recipes -> Maybe [Text]
setup :: Prelude.Maybe [Prelude.Text],
Recipes -> Maybe [Text]
shutdown :: Prelude.Maybe [Prelude.Text],
Recipes -> Maybe [Text]
undeploy :: Prelude.Maybe [Prelude.Text],
Recipes -> Maybe [Text]
configure :: Prelude.Maybe [Prelude.Text],
Recipes -> Maybe [Text]
deploy :: Prelude.Maybe [Prelude.Text]
}
deriving (Recipes -> Recipes -> Bool
(Recipes -> Recipes -> Bool)
-> (Recipes -> Recipes -> Bool) -> Eq Recipes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Recipes -> Recipes -> Bool
$c/= :: Recipes -> Recipes -> Bool
== :: Recipes -> Recipes -> Bool
$c== :: Recipes -> Recipes -> Bool
Prelude.Eq, ReadPrec [Recipes]
ReadPrec Recipes
Int -> ReadS Recipes
ReadS [Recipes]
(Int -> ReadS Recipes)
-> ReadS [Recipes]
-> ReadPrec Recipes
-> ReadPrec [Recipes]
-> Read Recipes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Recipes]
$creadListPrec :: ReadPrec [Recipes]
readPrec :: ReadPrec Recipes
$creadPrec :: ReadPrec Recipes
readList :: ReadS [Recipes]
$creadList :: ReadS [Recipes]
readsPrec :: Int -> ReadS Recipes
$creadsPrec :: Int -> ReadS Recipes
Prelude.Read, Int -> Recipes -> ShowS
[Recipes] -> ShowS
Recipes -> String
(Int -> Recipes -> ShowS)
-> (Recipes -> String) -> ([Recipes] -> ShowS) -> Show Recipes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Recipes] -> ShowS
$cshowList :: [Recipes] -> ShowS
show :: Recipes -> String
$cshow :: Recipes -> String
showsPrec :: Int -> Recipes -> ShowS
$cshowsPrec :: Int -> Recipes -> ShowS
Prelude.Show, (forall x. Recipes -> Rep Recipes x)
-> (forall x. Rep Recipes x -> Recipes) -> Generic Recipes
forall x. Rep Recipes x -> Recipes
forall x. Recipes -> Rep Recipes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Recipes x -> Recipes
$cfrom :: forall x. Recipes -> Rep Recipes x
Prelude.Generic)
newRecipes ::
Recipes
newRecipes :: Recipes
newRecipes =
Recipes' :: Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Recipes
Recipes'
{ $sel:setup:Recipes' :: Maybe [Text]
setup = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:shutdown:Recipes' :: Maybe [Text]
shutdown = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:undeploy:Recipes' :: Maybe [Text]
undeploy = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:configure:Recipes' :: Maybe [Text]
configure = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:deploy:Recipes' :: Maybe [Text]
deploy = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
}
recipes_setup :: Lens.Lens' Recipes (Prelude.Maybe [Prelude.Text])
recipes_setup :: (Maybe [Text] -> f (Maybe [Text])) -> Recipes -> f Recipes
recipes_setup = (Recipes -> Maybe [Text])
-> (Recipes -> Maybe [Text] -> Recipes)
-> Lens Recipes Recipes (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipes' {Maybe [Text]
setup :: Maybe [Text]
$sel:setup:Recipes' :: Recipes -> Maybe [Text]
setup} -> Maybe [Text]
setup) (\s :: Recipes
s@Recipes' {} Maybe [Text]
a -> Recipes
s {$sel:setup:Recipes' :: Maybe [Text]
setup = Maybe [Text]
a} :: Recipes) ((Maybe [Text] -> f (Maybe [Text])) -> Recipes -> f Recipes)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Recipes
-> f Recipes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
recipes_shutdown :: Lens.Lens' Recipes (Prelude.Maybe [Prelude.Text])
recipes_shutdown :: (Maybe [Text] -> f (Maybe [Text])) -> Recipes -> f Recipes
recipes_shutdown = (Recipes -> Maybe [Text])
-> (Recipes -> Maybe [Text] -> Recipes)
-> Lens Recipes Recipes (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipes' {Maybe [Text]
shutdown :: Maybe [Text]
$sel:shutdown:Recipes' :: Recipes -> Maybe [Text]
shutdown} -> Maybe [Text]
shutdown) (\s :: Recipes
s@Recipes' {} Maybe [Text]
a -> Recipes
s {$sel:shutdown:Recipes' :: Maybe [Text]
shutdown = Maybe [Text]
a} :: Recipes) ((Maybe [Text] -> f (Maybe [Text])) -> Recipes -> f Recipes)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Recipes
-> f Recipes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
recipes_undeploy :: Lens.Lens' Recipes (Prelude.Maybe [Prelude.Text])
recipes_undeploy :: (Maybe [Text] -> f (Maybe [Text])) -> Recipes -> f Recipes
recipes_undeploy = (Recipes -> Maybe [Text])
-> (Recipes -> Maybe [Text] -> Recipes)
-> Lens Recipes Recipes (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipes' {Maybe [Text]
undeploy :: Maybe [Text]
$sel:undeploy:Recipes' :: Recipes -> Maybe [Text]
undeploy} -> Maybe [Text]
undeploy) (\s :: Recipes
s@Recipes' {} Maybe [Text]
a -> Recipes
s {$sel:undeploy:Recipes' :: Maybe [Text]
undeploy = Maybe [Text]
a} :: Recipes) ((Maybe [Text] -> f (Maybe [Text])) -> Recipes -> f Recipes)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Recipes
-> f Recipes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
recipes_configure :: Lens.Lens' Recipes (Prelude.Maybe [Prelude.Text])
recipes_configure :: (Maybe [Text] -> f (Maybe [Text])) -> Recipes -> f Recipes
recipes_configure = (Recipes -> Maybe [Text])
-> (Recipes -> Maybe [Text] -> Recipes)
-> Lens Recipes Recipes (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipes' {Maybe [Text]
configure :: Maybe [Text]
$sel:configure:Recipes' :: Recipes -> Maybe [Text]
configure} -> Maybe [Text]
configure) (\s :: Recipes
s@Recipes' {} Maybe [Text]
a -> Recipes
s {$sel:configure:Recipes' :: Maybe [Text]
configure = Maybe [Text]
a} :: Recipes) ((Maybe [Text] -> f (Maybe [Text])) -> Recipes -> f Recipes)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Recipes
-> f Recipes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
recipes_deploy :: Lens.Lens' Recipes (Prelude.Maybe [Prelude.Text])
recipes_deploy :: (Maybe [Text] -> f (Maybe [Text])) -> Recipes -> f Recipes
recipes_deploy = (Recipes -> Maybe [Text])
-> (Recipes -> Maybe [Text] -> Recipes)
-> Lens Recipes Recipes (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Recipes' {Maybe [Text]
deploy :: Maybe [Text]
$sel:deploy:Recipes' :: Recipes -> Maybe [Text]
deploy} -> Maybe [Text]
deploy) (\s :: Recipes
s@Recipes' {} Maybe [Text]
a -> Recipes
s {$sel:deploy:Recipes' :: Maybe [Text]
deploy = Maybe [Text]
a} :: Recipes) ((Maybe [Text] -> f (Maybe [Text])) -> Recipes -> f Recipes)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Recipes
-> f Recipes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON Recipes where
parseJSON :: Value -> Parser Recipes
parseJSON =
String -> (Object -> Parser Recipes) -> Value -> Parser Recipes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Recipes"
( \Object
x ->
Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Recipes
Recipes'
(Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Recipes)
-> Parser (Maybe [Text])
-> Parser
(Maybe [Text]
-> Maybe [Text] -> Maybe [Text] -> Maybe [Text] -> Recipes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Setup" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe [Text]
-> Maybe [Text] -> Maybe [Text] -> Maybe [Text] -> Recipes)
-> Parser (Maybe [Text])
-> Parser (Maybe [Text] -> Maybe [Text] -> Maybe [Text] -> Recipes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Shutdown" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe [Text] -> Maybe [Text] -> Maybe [Text] -> Recipes)
-> Parser (Maybe [Text])
-> Parser (Maybe [Text] -> Maybe [Text] -> Recipes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Undeploy" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe [Text] -> Maybe [Text] -> Recipes)
-> Parser (Maybe [Text]) -> Parser (Maybe [Text] -> Recipes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Configure" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe [Text] -> Recipes)
-> Parser (Maybe [Text]) -> Parser Recipes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Deploy" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Recipes
instance Prelude.NFData Recipes
instance Core.ToJSON Recipes where
toJSON :: Recipes -> Value
toJSON Recipes' {Maybe [Text]
deploy :: Maybe [Text]
configure :: Maybe [Text]
undeploy :: Maybe [Text]
shutdown :: Maybe [Text]
setup :: Maybe [Text]
$sel:deploy:Recipes' :: Recipes -> Maybe [Text]
$sel:configure:Recipes' :: Recipes -> Maybe [Text]
$sel:undeploy:Recipes' :: Recipes -> Maybe [Text]
$sel:shutdown:Recipes' :: Recipes -> Maybe [Text]
$sel:setup:Recipes' :: Recipes -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Setup" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
setup,
(Text
"Shutdown" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
shutdown,
(Text
"Undeploy" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
undeploy,
(Text
"Configure" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
configure,
(Text
"Deploy" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
deploy
]
)