{-# 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.ELB.Types.InstanceState where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ELB.Internal
import qualified Amazonka.Prelude as Prelude
data InstanceState = InstanceState'
{
InstanceState -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
InstanceState -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
InstanceState -> Maybe Text
reasonCode :: Prelude.Maybe Prelude.Text,
InstanceState -> Maybe Text
state :: Prelude.Maybe Prelude.Text
}
deriving (InstanceState -> InstanceState -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceState -> InstanceState -> Bool
$c/= :: InstanceState -> InstanceState -> Bool
== :: InstanceState -> InstanceState -> Bool
$c== :: InstanceState -> InstanceState -> Bool
Prelude.Eq, ReadPrec [InstanceState]
ReadPrec InstanceState
Int -> ReadS InstanceState
ReadS [InstanceState]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceState]
$creadListPrec :: ReadPrec [InstanceState]
readPrec :: ReadPrec InstanceState
$creadPrec :: ReadPrec InstanceState
readList :: ReadS [InstanceState]
$creadList :: ReadS [InstanceState]
readsPrec :: Int -> ReadS InstanceState
$creadsPrec :: Int -> ReadS InstanceState
Prelude.Read, Int -> InstanceState -> ShowS
[InstanceState] -> ShowS
InstanceState -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceState] -> ShowS
$cshowList :: [InstanceState] -> ShowS
show :: InstanceState -> String
$cshow :: InstanceState -> String
showsPrec :: Int -> InstanceState -> ShowS
$cshowsPrec :: Int -> InstanceState -> ShowS
Prelude.Show, forall x. Rep InstanceState x -> InstanceState
forall x. InstanceState -> Rep InstanceState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceState x -> InstanceState
$cfrom :: forall x. InstanceState -> Rep InstanceState x
Prelude.Generic)
newInstanceState ::
InstanceState
newInstanceState :: InstanceState
newInstanceState =
InstanceState'
{ $sel:description:InstanceState' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:InstanceState' :: Maybe Text
instanceId = forall a. Maybe a
Prelude.Nothing,
$sel:reasonCode:InstanceState' :: Maybe Text
reasonCode = forall a. Maybe a
Prelude.Nothing,
$sel:state:InstanceState' :: Maybe Text
state = forall a. Maybe a
Prelude.Nothing
}
instanceState_description :: Lens.Lens' InstanceState (Prelude.Maybe Prelude.Text)
instanceState_description :: Lens' InstanceState (Maybe Text)
instanceState_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceState' {Maybe Text
description :: Maybe Text
$sel:description:InstanceState' :: InstanceState -> Maybe Text
description} -> Maybe Text
description) (\s :: InstanceState
s@InstanceState' {} Maybe Text
a -> InstanceState
s {$sel:description:InstanceState' :: Maybe Text
description = Maybe Text
a} :: InstanceState)
instanceState_instanceId :: Lens.Lens' InstanceState (Prelude.Maybe Prelude.Text)
instanceState_instanceId :: Lens' InstanceState (Maybe Text)
instanceState_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceState' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:InstanceState' :: InstanceState -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: InstanceState
s@InstanceState' {} Maybe Text
a -> InstanceState
s {$sel:instanceId:InstanceState' :: Maybe Text
instanceId = Maybe Text
a} :: InstanceState)
instanceState_reasonCode :: Lens.Lens' InstanceState (Prelude.Maybe Prelude.Text)
instanceState_reasonCode :: Lens' InstanceState (Maybe Text)
instanceState_reasonCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceState' {Maybe Text
reasonCode :: Maybe Text
$sel:reasonCode:InstanceState' :: InstanceState -> Maybe Text
reasonCode} -> Maybe Text
reasonCode) (\s :: InstanceState
s@InstanceState' {} Maybe Text
a -> InstanceState
s {$sel:reasonCode:InstanceState' :: Maybe Text
reasonCode = Maybe Text
a} :: InstanceState)
instanceState_state :: Lens.Lens' InstanceState (Prelude.Maybe Prelude.Text)
instanceState_state :: Lens' InstanceState (Maybe Text)
instanceState_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceState' {Maybe Text
state :: Maybe Text
$sel:state:InstanceState' :: InstanceState -> Maybe Text
state} -> Maybe Text
state) (\s :: InstanceState
s@InstanceState' {} Maybe Text
a -> InstanceState
s {$sel:state:InstanceState' :: Maybe Text
state = Maybe Text
a} :: InstanceState)
instance Data.FromXML InstanceState where
parseXML :: [Node] -> Either String InstanceState
parseXML [Node]
x =
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> InstanceState
InstanceState'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Description")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"InstanceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ReasonCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"State")
instance Prelude.Hashable InstanceState where
hashWithSalt :: Int -> InstanceState -> Int
hashWithSalt Int
_salt InstanceState' {Maybe Text
state :: Maybe Text
reasonCode :: Maybe Text
instanceId :: Maybe Text
description :: Maybe Text
$sel:state:InstanceState' :: InstanceState -> Maybe Text
$sel:reasonCode:InstanceState' :: InstanceState -> Maybe Text
$sel:instanceId:InstanceState' :: InstanceState -> Maybe Text
$sel:description:InstanceState' :: InstanceState -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reasonCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
state
instance Prelude.NFData InstanceState where
rnf :: InstanceState -> ()
rnf InstanceState' {Maybe Text
state :: Maybe Text
reasonCode :: Maybe Text
instanceId :: Maybe Text
description :: Maybe Text
$sel:state:InstanceState' :: InstanceState -> Maybe Text
$sel:reasonCode:InstanceState' :: InstanceState -> Maybe Text
$sel:instanceId:InstanceState' :: InstanceState -> Maybe Text
$sel:description:InstanceState' :: InstanceState -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reasonCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
state