{-# 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.ElasticBeanstalk.Types.EnvironmentLink where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EnvironmentLink = EnvironmentLink'
{
EnvironmentLink -> Maybe Text
linkName :: Prelude.Maybe Prelude.Text,
EnvironmentLink -> Maybe Text
environmentName :: Prelude.Maybe Prelude.Text
}
deriving (EnvironmentLink -> EnvironmentLink -> Bool
(EnvironmentLink -> EnvironmentLink -> Bool)
-> (EnvironmentLink -> EnvironmentLink -> Bool)
-> Eq EnvironmentLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnvironmentLink -> EnvironmentLink -> Bool
$c/= :: EnvironmentLink -> EnvironmentLink -> Bool
== :: EnvironmentLink -> EnvironmentLink -> Bool
$c== :: EnvironmentLink -> EnvironmentLink -> Bool
Prelude.Eq, ReadPrec [EnvironmentLink]
ReadPrec EnvironmentLink
Int -> ReadS EnvironmentLink
ReadS [EnvironmentLink]
(Int -> ReadS EnvironmentLink)
-> ReadS [EnvironmentLink]
-> ReadPrec EnvironmentLink
-> ReadPrec [EnvironmentLink]
-> Read EnvironmentLink
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnvironmentLink]
$creadListPrec :: ReadPrec [EnvironmentLink]
readPrec :: ReadPrec EnvironmentLink
$creadPrec :: ReadPrec EnvironmentLink
readList :: ReadS [EnvironmentLink]
$creadList :: ReadS [EnvironmentLink]
readsPrec :: Int -> ReadS EnvironmentLink
$creadsPrec :: Int -> ReadS EnvironmentLink
Prelude.Read, Int -> EnvironmentLink -> ShowS
[EnvironmentLink] -> ShowS
EnvironmentLink -> String
(Int -> EnvironmentLink -> ShowS)
-> (EnvironmentLink -> String)
-> ([EnvironmentLink] -> ShowS)
-> Show EnvironmentLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnvironmentLink] -> ShowS
$cshowList :: [EnvironmentLink] -> ShowS
show :: EnvironmentLink -> String
$cshow :: EnvironmentLink -> String
showsPrec :: Int -> EnvironmentLink -> ShowS
$cshowsPrec :: Int -> EnvironmentLink -> ShowS
Prelude.Show, (forall x. EnvironmentLink -> Rep EnvironmentLink x)
-> (forall x. Rep EnvironmentLink x -> EnvironmentLink)
-> Generic EnvironmentLink
forall x. Rep EnvironmentLink x -> EnvironmentLink
forall x. EnvironmentLink -> Rep EnvironmentLink x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnvironmentLink x -> EnvironmentLink
$cfrom :: forall x. EnvironmentLink -> Rep EnvironmentLink x
Prelude.Generic)
newEnvironmentLink ::
EnvironmentLink
newEnvironmentLink :: EnvironmentLink
newEnvironmentLink =
EnvironmentLink' :: Maybe Text -> Maybe Text -> EnvironmentLink
EnvironmentLink'
{ $sel:linkName:EnvironmentLink' :: Maybe Text
linkName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:environmentName:EnvironmentLink' :: Maybe Text
environmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
environmentLink_linkName :: Lens.Lens' EnvironmentLink (Prelude.Maybe Prelude.Text)
environmentLink_linkName :: (Maybe Text -> f (Maybe Text))
-> EnvironmentLink -> f EnvironmentLink
environmentLink_linkName = (EnvironmentLink -> Maybe Text)
-> (EnvironmentLink -> Maybe Text -> EnvironmentLink)
-> Lens EnvironmentLink EnvironmentLink (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentLink' {Maybe Text
linkName :: Maybe Text
$sel:linkName:EnvironmentLink' :: EnvironmentLink -> Maybe Text
linkName} -> Maybe Text
linkName) (\s :: EnvironmentLink
s@EnvironmentLink' {} Maybe Text
a -> EnvironmentLink
s {$sel:linkName:EnvironmentLink' :: Maybe Text
linkName = Maybe Text
a} :: EnvironmentLink)
environmentLink_environmentName :: Lens.Lens' EnvironmentLink (Prelude.Maybe Prelude.Text)
environmentLink_environmentName :: (Maybe Text -> f (Maybe Text))
-> EnvironmentLink -> f EnvironmentLink
environmentLink_environmentName = (EnvironmentLink -> Maybe Text)
-> (EnvironmentLink -> Maybe Text -> EnvironmentLink)
-> Lens EnvironmentLink EnvironmentLink (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentLink' {Maybe Text
environmentName :: Maybe Text
$sel:environmentName:EnvironmentLink' :: EnvironmentLink -> Maybe Text
environmentName} -> Maybe Text
environmentName) (\s :: EnvironmentLink
s@EnvironmentLink' {} Maybe Text
a -> EnvironmentLink
s {$sel:environmentName:EnvironmentLink' :: Maybe Text
environmentName = Maybe Text
a} :: EnvironmentLink)
instance Core.FromXML EnvironmentLink where
parseXML :: [Node] -> Either String EnvironmentLink
parseXML [Node]
x =
Maybe Text -> Maybe Text -> EnvironmentLink
EnvironmentLink'
(Maybe Text -> Maybe Text -> EnvironmentLink)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> EnvironmentLink)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LinkName")
Either String (Maybe Text -> EnvironmentLink)
-> Either String (Maybe Text) -> Either String EnvironmentLink
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EnvironmentName")
instance Prelude.Hashable EnvironmentLink
instance Prelude.NFData EnvironmentLink