{-# 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.StackConfigurationManager where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data StackConfigurationManager = StackConfigurationManager'
{
StackConfigurationManager -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
StackConfigurationManager -> Maybe Text
version :: Prelude.Maybe Prelude.Text
}
deriving (StackConfigurationManager -> StackConfigurationManager -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackConfigurationManager -> StackConfigurationManager -> Bool
$c/= :: StackConfigurationManager -> StackConfigurationManager -> Bool
== :: StackConfigurationManager -> StackConfigurationManager -> Bool
$c== :: StackConfigurationManager -> StackConfigurationManager -> Bool
Prelude.Eq, ReadPrec [StackConfigurationManager]
ReadPrec StackConfigurationManager
Int -> ReadS StackConfigurationManager
ReadS [StackConfigurationManager]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackConfigurationManager]
$creadListPrec :: ReadPrec [StackConfigurationManager]
readPrec :: ReadPrec StackConfigurationManager
$creadPrec :: ReadPrec StackConfigurationManager
readList :: ReadS [StackConfigurationManager]
$creadList :: ReadS [StackConfigurationManager]
readsPrec :: Int -> ReadS StackConfigurationManager
$creadsPrec :: Int -> ReadS StackConfigurationManager
Prelude.Read, Int -> StackConfigurationManager -> ShowS
[StackConfigurationManager] -> ShowS
StackConfigurationManager -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackConfigurationManager] -> ShowS
$cshowList :: [StackConfigurationManager] -> ShowS
show :: StackConfigurationManager -> String
$cshow :: StackConfigurationManager -> String
showsPrec :: Int -> StackConfigurationManager -> ShowS
$cshowsPrec :: Int -> StackConfigurationManager -> ShowS
Prelude.Show, forall x.
Rep StackConfigurationManager x -> StackConfigurationManager
forall x.
StackConfigurationManager -> Rep StackConfigurationManager x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StackConfigurationManager x -> StackConfigurationManager
$cfrom :: forall x.
StackConfigurationManager -> Rep StackConfigurationManager x
Prelude.Generic)
newStackConfigurationManager ::
StackConfigurationManager
newStackConfigurationManager :: StackConfigurationManager
newStackConfigurationManager =
StackConfigurationManager'
{ $sel:name:StackConfigurationManager' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:version:StackConfigurationManager' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing
}
stackConfigurationManager_name :: Lens.Lens' StackConfigurationManager (Prelude.Maybe Prelude.Text)
stackConfigurationManager_name :: Lens' StackConfigurationManager (Maybe Text)
stackConfigurationManager_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackConfigurationManager' {Maybe Text
name :: Maybe Text
$sel:name:StackConfigurationManager' :: StackConfigurationManager -> Maybe Text
name} -> Maybe Text
name) (\s :: StackConfigurationManager
s@StackConfigurationManager' {} Maybe Text
a -> StackConfigurationManager
s {$sel:name:StackConfigurationManager' :: Maybe Text
name = Maybe Text
a} :: StackConfigurationManager)
stackConfigurationManager_version :: Lens.Lens' StackConfigurationManager (Prelude.Maybe Prelude.Text)
stackConfigurationManager_version :: Lens' StackConfigurationManager (Maybe Text)
stackConfigurationManager_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackConfigurationManager' {Maybe Text
version :: Maybe Text
$sel:version:StackConfigurationManager' :: StackConfigurationManager -> Maybe Text
version} -> Maybe Text
version) (\s :: StackConfigurationManager
s@StackConfigurationManager' {} Maybe Text
a -> StackConfigurationManager
s {$sel:version:StackConfigurationManager' :: Maybe Text
version = Maybe Text
a} :: StackConfigurationManager)
instance Data.FromJSON StackConfigurationManager where
parseJSON :: Value -> Parser StackConfigurationManager
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StackConfigurationManager"
( \Object
x ->
Maybe Text -> Maybe Text -> StackConfigurationManager
StackConfigurationManager'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Version")
)
instance Prelude.Hashable StackConfigurationManager where
hashWithSalt :: Int -> StackConfigurationManager -> Int
hashWithSalt Int
_salt StackConfigurationManager' {Maybe Text
version :: Maybe Text
name :: Maybe Text
$sel:version:StackConfigurationManager' :: StackConfigurationManager -> Maybe Text
$sel:name:StackConfigurationManager' :: StackConfigurationManager -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version
instance Prelude.NFData StackConfigurationManager where
rnf :: StackConfigurationManager -> ()
rnf StackConfigurationManager' {Maybe Text
version :: Maybe Text
name :: Maybe Text
$sel:version:StackConfigurationManager' :: StackConfigurationManager -> Maybe Text
$sel:name:StackConfigurationManager' :: StackConfigurationManager -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version
instance Data.ToJSON StackConfigurationManager where
toJSON :: StackConfigurationManager -> Value
toJSON StackConfigurationManager' {Maybe Text
version :: Maybe Text
name :: Maybe Text
$sel:version:StackConfigurationManager' :: StackConfigurationManager -> Maybe Text
$sel:name:StackConfigurationManager' :: StackConfigurationManager -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Key
"Version" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
version
]
)