{-# 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.AutoScaling.Types.Instance where
import Amazonka.AutoScaling.Types.LaunchTemplateSpecification
import Amazonka.AutoScaling.Types.LifecycleState
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 Instance = Instance'
{
Instance -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
Instance -> Maybe Text
launchConfigurationName :: Prelude.Maybe Prelude.Text,
Instance -> Maybe LaunchTemplateSpecification
launchTemplate :: Prelude.Maybe LaunchTemplateSpecification,
Instance -> Maybe Text
weightedCapacity :: Prelude.Maybe Prelude.Text,
Instance -> Text
instanceId :: Prelude.Text,
Instance -> Text
availabilityZone :: Prelude.Text,
Instance -> LifecycleState
lifecycleState :: LifecycleState,
Instance -> Text
healthStatus :: Prelude.Text,
Instance -> Bool
protectedFromScaleIn :: Prelude.Bool
}
deriving (Instance -> Instance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Instance -> Instance -> Bool
$c/= :: Instance -> Instance -> Bool
== :: Instance -> Instance -> Bool
$c== :: Instance -> Instance -> Bool
Prelude.Eq, ReadPrec [Instance]
ReadPrec Instance
Int -> ReadS Instance
ReadS [Instance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Instance]
$creadListPrec :: ReadPrec [Instance]
readPrec :: ReadPrec Instance
$creadPrec :: ReadPrec Instance
readList :: ReadS [Instance]
$creadList :: ReadS [Instance]
readsPrec :: Int -> ReadS Instance
$creadsPrec :: Int -> ReadS Instance
Prelude.Read, Int -> Instance -> ShowS
[Instance] -> ShowS
Instance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Instance] -> ShowS
$cshowList :: [Instance] -> ShowS
show :: Instance -> String
$cshow :: Instance -> String
showsPrec :: Int -> Instance -> ShowS
$cshowsPrec :: Int -> Instance -> ShowS
Prelude.Show, forall x. Rep Instance x -> Instance
forall x. Instance -> Rep Instance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Instance x -> Instance
$cfrom :: forall x. Instance -> Rep Instance x
Prelude.Generic)
newInstance ::
Prelude.Text ->
Prelude.Text ->
LifecycleState ->
Prelude.Text ->
Prelude.Bool ->
Instance
newInstance :: Text -> Text -> LifecycleState -> Text -> Bool -> Instance
newInstance
Text
pInstanceId_
Text
pAvailabilityZone_
LifecycleState
pLifecycleState_
Text
pHealthStatus_
Bool
pProtectedFromScaleIn_ =
Instance'
{ $sel:instanceType:Instance' :: Maybe Text
instanceType = forall a. Maybe a
Prelude.Nothing,
$sel:launchConfigurationName:Instance' :: Maybe Text
launchConfigurationName = forall a. Maybe a
Prelude.Nothing,
$sel:launchTemplate:Instance' :: Maybe LaunchTemplateSpecification
launchTemplate = forall a. Maybe a
Prelude.Nothing,
$sel:weightedCapacity:Instance' :: Maybe Text
weightedCapacity = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:Instance' :: Text
instanceId = Text
pInstanceId_,
$sel:availabilityZone:Instance' :: Text
availabilityZone = Text
pAvailabilityZone_,
$sel:lifecycleState:Instance' :: LifecycleState
lifecycleState = LifecycleState
pLifecycleState_,
$sel:healthStatus:Instance' :: Text
healthStatus = Text
pHealthStatus_,
$sel:protectedFromScaleIn:Instance' :: Bool
protectedFromScaleIn = Bool
pProtectedFromScaleIn_
}
instance_instanceType :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_instanceType :: Lens' Instance (Maybe Text)
instance_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:Instance' :: Instance -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:instanceType:Instance' :: Maybe Text
instanceType = Maybe Text
a} :: Instance)
instance_launchConfigurationName :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_launchConfigurationName :: Lens' Instance (Maybe Text)
instance_launchConfigurationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
launchConfigurationName :: Maybe Text
$sel:launchConfigurationName:Instance' :: Instance -> Maybe Text
launchConfigurationName} -> Maybe Text
launchConfigurationName) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:launchConfigurationName:Instance' :: Maybe Text
launchConfigurationName = Maybe Text
a} :: Instance)
instance_launchTemplate :: Lens.Lens' Instance (Prelude.Maybe LaunchTemplateSpecification)
instance_launchTemplate :: Lens' Instance (Maybe LaunchTemplateSpecification)
instance_launchTemplate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe LaunchTemplateSpecification
launchTemplate :: Maybe LaunchTemplateSpecification
$sel:launchTemplate:Instance' :: Instance -> Maybe LaunchTemplateSpecification
launchTemplate} -> Maybe LaunchTemplateSpecification
launchTemplate) (\s :: Instance
s@Instance' {} Maybe LaunchTemplateSpecification
a -> Instance
s {$sel:launchTemplate:Instance' :: Maybe LaunchTemplateSpecification
launchTemplate = Maybe LaunchTemplateSpecification
a} :: Instance)
instance_weightedCapacity :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_weightedCapacity :: Lens' Instance (Maybe Text)
instance_weightedCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
weightedCapacity :: Maybe Text
$sel:weightedCapacity:Instance' :: Instance -> Maybe Text
weightedCapacity} -> Maybe Text
weightedCapacity) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:weightedCapacity:Instance' :: Maybe Text
weightedCapacity = Maybe Text
a} :: Instance)
instance_instanceId :: Lens.Lens' Instance Prelude.Text
instance_instanceId :: Lens' Instance Text
instance_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Text
instanceId :: Text
$sel:instanceId:Instance' :: Instance -> Text
instanceId} -> Text
instanceId) (\s :: Instance
s@Instance' {} Text
a -> Instance
s {$sel:instanceId:Instance' :: Text
instanceId = Text
a} :: Instance)
instance_availabilityZone :: Lens.Lens' Instance Prelude.Text
instance_availabilityZone :: Lens' Instance Text
instance_availabilityZone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Text
availabilityZone :: Text
$sel:availabilityZone:Instance' :: Instance -> Text
availabilityZone} -> Text
availabilityZone) (\s :: Instance
s@Instance' {} Text
a -> Instance
s {$sel:availabilityZone:Instance' :: Text
availabilityZone = Text
a} :: Instance)
instance_lifecycleState :: Lens.Lens' Instance LifecycleState
instance_lifecycleState :: Lens' Instance LifecycleState
instance_lifecycleState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {LifecycleState
lifecycleState :: LifecycleState
$sel:lifecycleState:Instance' :: Instance -> LifecycleState
lifecycleState} -> LifecycleState
lifecycleState) (\s :: Instance
s@Instance' {} LifecycleState
a -> Instance
s {$sel:lifecycleState:Instance' :: LifecycleState
lifecycleState = LifecycleState
a} :: Instance)
instance_healthStatus :: Lens.Lens' Instance Prelude.Text
instance_healthStatus :: Lens' Instance Text
instance_healthStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Text
healthStatus :: Text
$sel:healthStatus:Instance' :: Instance -> Text
healthStatus} -> Text
healthStatus) (\s :: Instance
s@Instance' {} Text
a -> Instance
s {$sel:healthStatus:Instance' :: Text
healthStatus = Text
a} :: Instance)
instance_protectedFromScaleIn :: Lens.Lens' Instance Prelude.Bool
instance_protectedFromScaleIn :: Lens' Instance Bool
instance_protectedFromScaleIn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Bool
protectedFromScaleIn :: Bool
$sel:protectedFromScaleIn:Instance' :: Instance -> Bool
protectedFromScaleIn} -> Bool
protectedFromScaleIn) (\s :: Instance
s@Instance' {} Bool
a -> Instance
s {$sel:protectedFromScaleIn:Instance' :: Bool
protectedFromScaleIn = Bool
a} :: Instance)
instance Data.FromXML Instance where
parseXML :: [Node] -> Either String Instance
parseXML [Node]
x =
Maybe Text
-> Maybe Text
-> Maybe LaunchTemplateSpecification
-> Maybe Text
-> Text
-> Text
-> LifecycleState
-> Text
-> Bool
-> Instance
Instance'
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
"InstanceType")
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
"LaunchConfigurationName")
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
"LaunchTemplate")
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
"WeightedCapacity")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String 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 a
Data..@ Text
"AvailabilityZone")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"LifecycleState")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"HealthStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"ProtectedFromScaleIn")
instance Prelude.Hashable Instance where
hashWithSalt :: Int -> Instance -> Int
hashWithSalt Int
_salt Instance' {Bool
Maybe Text
Maybe LaunchTemplateSpecification
Text
LifecycleState
protectedFromScaleIn :: Bool
healthStatus :: Text
lifecycleState :: LifecycleState
availabilityZone :: Text
instanceId :: Text
weightedCapacity :: Maybe Text
launchTemplate :: Maybe LaunchTemplateSpecification
launchConfigurationName :: Maybe Text
instanceType :: Maybe Text
$sel:protectedFromScaleIn:Instance' :: Instance -> Bool
$sel:healthStatus:Instance' :: Instance -> Text
$sel:lifecycleState:Instance' :: Instance -> LifecycleState
$sel:availabilityZone:Instance' :: Instance -> Text
$sel:instanceId:Instance' :: Instance -> Text
$sel:weightedCapacity:Instance' :: Instance -> Maybe Text
$sel:launchTemplate:Instance' :: Instance -> Maybe LaunchTemplateSpecification
$sel:launchConfigurationName:Instance' :: Instance -> Maybe Text
$sel:instanceType:Instance' :: Instance -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
launchConfigurationName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LaunchTemplateSpecification
launchTemplate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
weightedCapacity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
availabilityZone
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LifecycleState
lifecycleState
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
healthStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
protectedFromScaleIn
instance Prelude.NFData Instance where
rnf :: Instance -> ()
rnf Instance' {Bool
Maybe Text
Maybe LaunchTemplateSpecification
Text
LifecycleState
protectedFromScaleIn :: Bool
healthStatus :: Text
lifecycleState :: LifecycleState
availabilityZone :: Text
instanceId :: Text
weightedCapacity :: Maybe Text
launchTemplate :: Maybe LaunchTemplateSpecification
launchConfigurationName :: Maybe Text
instanceType :: Maybe Text
$sel:protectedFromScaleIn:Instance' :: Instance -> Bool
$sel:healthStatus:Instance' :: Instance -> Text
$sel:lifecycleState:Instance' :: Instance -> LifecycleState
$sel:availabilityZone:Instance' :: Instance -> Text
$sel:instanceId:Instance' :: Instance -> Text
$sel:weightedCapacity:Instance' :: Instance -> Maybe Text
$sel:launchTemplate:Instance' :: Instance -> Maybe LaunchTemplateSpecification
$sel:launchConfigurationName:Instance' :: Instance -> Maybe Text
$sel:instanceType:Instance' :: Instance -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
launchConfigurationName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LaunchTemplateSpecification
launchTemplate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
weightedCapacity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
availabilityZone
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LifecycleState
lifecycleState
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
healthStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
protectedFromScaleIn