{-# 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.CodeDeploy.Types.TargetGroupInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TargetGroupInfo = TargetGroupInfo'
{
TargetGroupInfo -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (TargetGroupInfo -> TargetGroupInfo -> Bool
(TargetGroupInfo -> TargetGroupInfo -> Bool)
-> (TargetGroupInfo -> TargetGroupInfo -> Bool)
-> Eq TargetGroupInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TargetGroupInfo -> TargetGroupInfo -> Bool
$c/= :: TargetGroupInfo -> TargetGroupInfo -> Bool
== :: TargetGroupInfo -> TargetGroupInfo -> Bool
$c== :: TargetGroupInfo -> TargetGroupInfo -> Bool
Prelude.Eq, ReadPrec [TargetGroupInfo]
ReadPrec TargetGroupInfo
Int -> ReadS TargetGroupInfo
ReadS [TargetGroupInfo]
(Int -> ReadS TargetGroupInfo)
-> ReadS [TargetGroupInfo]
-> ReadPrec TargetGroupInfo
-> ReadPrec [TargetGroupInfo]
-> Read TargetGroupInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TargetGroupInfo]
$creadListPrec :: ReadPrec [TargetGroupInfo]
readPrec :: ReadPrec TargetGroupInfo
$creadPrec :: ReadPrec TargetGroupInfo
readList :: ReadS [TargetGroupInfo]
$creadList :: ReadS [TargetGroupInfo]
readsPrec :: Int -> ReadS TargetGroupInfo
$creadsPrec :: Int -> ReadS TargetGroupInfo
Prelude.Read, Int -> TargetGroupInfo -> ShowS
[TargetGroupInfo] -> ShowS
TargetGroupInfo -> String
(Int -> TargetGroupInfo -> ShowS)
-> (TargetGroupInfo -> String)
-> ([TargetGroupInfo] -> ShowS)
-> Show TargetGroupInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TargetGroupInfo] -> ShowS
$cshowList :: [TargetGroupInfo] -> ShowS
show :: TargetGroupInfo -> String
$cshow :: TargetGroupInfo -> String
showsPrec :: Int -> TargetGroupInfo -> ShowS
$cshowsPrec :: Int -> TargetGroupInfo -> ShowS
Prelude.Show, (forall x. TargetGroupInfo -> Rep TargetGroupInfo x)
-> (forall x. Rep TargetGroupInfo x -> TargetGroupInfo)
-> Generic TargetGroupInfo
forall x. Rep TargetGroupInfo x -> TargetGroupInfo
forall x. TargetGroupInfo -> Rep TargetGroupInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TargetGroupInfo x -> TargetGroupInfo
$cfrom :: forall x. TargetGroupInfo -> Rep TargetGroupInfo x
Prelude.Generic)
newTargetGroupInfo ::
TargetGroupInfo
newTargetGroupInfo :: TargetGroupInfo
newTargetGroupInfo =
TargetGroupInfo' :: Maybe Text -> TargetGroupInfo
TargetGroupInfo' {$sel:name:TargetGroupInfo' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing}
targetGroupInfo_name :: Lens.Lens' TargetGroupInfo (Prelude.Maybe Prelude.Text)
targetGroupInfo_name :: (Maybe Text -> f (Maybe Text))
-> TargetGroupInfo -> f TargetGroupInfo
targetGroupInfo_name = (TargetGroupInfo -> Maybe Text)
-> (TargetGroupInfo -> Maybe Text -> TargetGroupInfo)
-> Lens TargetGroupInfo TargetGroupInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TargetGroupInfo' {Maybe Text
name :: Maybe Text
$sel:name:TargetGroupInfo' :: TargetGroupInfo -> Maybe Text
name} -> Maybe Text
name) (\s :: TargetGroupInfo
s@TargetGroupInfo' {} Maybe Text
a -> TargetGroupInfo
s {$sel:name:TargetGroupInfo' :: Maybe Text
name = Maybe Text
a} :: TargetGroupInfo)
instance Core.FromJSON TargetGroupInfo where
parseJSON :: Value -> Parser TargetGroupInfo
parseJSON =
String
-> (Object -> Parser TargetGroupInfo)
-> Value
-> Parser TargetGroupInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TargetGroupInfo"
( \Object
x ->
Maybe Text -> TargetGroupInfo
TargetGroupInfo' (Maybe Text -> TargetGroupInfo)
-> Parser (Maybe Text) -> Parser TargetGroupInfo
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
)
instance Prelude.Hashable TargetGroupInfo
instance Prelude.NFData TargetGroupInfo
instance Core.ToJSON TargetGroupInfo where
toJSON :: TargetGroupInfo -> Value
toJSON TargetGroupInfo' {Maybe Text
name :: Maybe Text
$sel:name:TargetGroupInfo' :: TargetGroupInfo -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"name" 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
name]
)