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