{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ElasticBeanstalk.Types.SingleInstanceHealth
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ElasticBeanstalk.Types.SingleInstanceHealth where

import qualified Amazonka.Core as Core
import Amazonka.ElasticBeanstalk.Types.ApplicationMetrics
import Amazonka.ElasticBeanstalk.Types.Deployment
import Amazonka.ElasticBeanstalk.Types.SystemStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Detailed health information about an Amazon EC2 instance in your Elastic
-- Beanstalk environment.
--
-- /See:/ 'newSingleInstanceHealth' smart constructor.
data SingleInstanceHealth = SingleInstanceHealth'
  { -- | The ID of the Amazon EC2 instance.
    SingleInstanceHealth -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
    -- | Represents the causes, which provide more information about the current
    -- health status.
    SingleInstanceHealth -> Maybe [Text]
causes :: Prelude.Maybe [Prelude.Text],
    -- | Operating system metrics from the instance.
    SingleInstanceHealth -> Maybe SystemStatus
system :: Prelude.Maybe SystemStatus,
    -- | Request metrics from your application.
    SingleInstanceHealth -> Maybe ApplicationMetrics
applicationMetrics :: Prelude.Maybe ApplicationMetrics,
    -- | Represents the color indicator that gives you information about the
    -- health of the EC2 instance. For more information, see
    -- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html Health Colors and Statuses>.
    SingleInstanceHealth -> Maybe Text
color :: Prelude.Maybe Prelude.Text,
    -- | The instance\'s type.
    SingleInstanceHealth -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
    -- | The availability zone in which the instance runs.
    SingleInstanceHealth -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
    -- | Returns the health status of the specified instance. For more
    -- information, see
    -- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html Health Colors and Statuses>.
    SingleInstanceHealth -> Maybe Text
healthStatus :: Prelude.Maybe Prelude.Text,
    -- | Information about the most recent deployment to an instance.
    SingleInstanceHealth -> Maybe Deployment
deployment :: Prelude.Maybe Deployment,
    -- | The time at which the EC2 instance was launched.
    SingleInstanceHealth -> Maybe ISO8601
launchedAt :: Prelude.Maybe Core.ISO8601
  }
  deriving (SingleInstanceHealth -> SingleInstanceHealth -> Bool
(SingleInstanceHealth -> SingleInstanceHealth -> Bool)
-> (SingleInstanceHealth -> SingleInstanceHealth -> Bool)
-> Eq SingleInstanceHealth
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SingleInstanceHealth -> SingleInstanceHealth -> Bool
$c/= :: SingleInstanceHealth -> SingleInstanceHealth -> Bool
== :: SingleInstanceHealth -> SingleInstanceHealth -> Bool
$c== :: SingleInstanceHealth -> SingleInstanceHealth -> Bool
Prelude.Eq, ReadPrec [SingleInstanceHealth]
ReadPrec SingleInstanceHealth
Int -> ReadS SingleInstanceHealth
ReadS [SingleInstanceHealth]
(Int -> ReadS SingleInstanceHealth)
-> ReadS [SingleInstanceHealth]
-> ReadPrec SingleInstanceHealth
-> ReadPrec [SingleInstanceHealth]
-> Read SingleInstanceHealth
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SingleInstanceHealth]
$creadListPrec :: ReadPrec [SingleInstanceHealth]
readPrec :: ReadPrec SingleInstanceHealth
$creadPrec :: ReadPrec SingleInstanceHealth
readList :: ReadS [SingleInstanceHealth]
$creadList :: ReadS [SingleInstanceHealth]
readsPrec :: Int -> ReadS SingleInstanceHealth
$creadsPrec :: Int -> ReadS SingleInstanceHealth
Prelude.Read, Int -> SingleInstanceHealth -> ShowS
[SingleInstanceHealth] -> ShowS
SingleInstanceHealth -> String
(Int -> SingleInstanceHealth -> ShowS)
-> (SingleInstanceHealth -> String)
-> ([SingleInstanceHealth] -> ShowS)
-> Show SingleInstanceHealth
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SingleInstanceHealth] -> ShowS
$cshowList :: [SingleInstanceHealth] -> ShowS
show :: SingleInstanceHealth -> String
$cshow :: SingleInstanceHealth -> String
showsPrec :: Int -> SingleInstanceHealth -> ShowS
$cshowsPrec :: Int -> SingleInstanceHealth -> ShowS
Prelude.Show, (forall x. SingleInstanceHealth -> Rep SingleInstanceHealth x)
-> (forall x. Rep SingleInstanceHealth x -> SingleInstanceHealth)
-> Generic SingleInstanceHealth
forall x. Rep SingleInstanceHealth x -> SingleInstanceHealth
forall x. SingleInstanceHealth -> Rep SingleInstanceHealth x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SingleInstanceHealth x -> SingleInstanceHealth
$cfrom :: forall x. SingleInstanceHealth -> Rep SingleInstanceHealth x
Prelude.Generic)

-- |
-- Create a value of 'SingleInstanceHealth' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'instanceId', 'singleInstanceHealth_instanceId' - The ID of the Amazon EC2 instance.
--
-- 'causes', 'singleInstanceHealth_causes' - Represents the causes, which provide more information about the current
-- health status.
--
-- 'system', 'singleInstanceHealth_system' - Operating system metrics from the instance.
--
-- 'applicationMetrics', 'singleInstanceHealth_applicationMetrics' - Request metrics from your application.
--
-- 'color', 'singleInstanceHealth_color' - Represents the color indicator that gives you information about the
-- health of the EC2 instance. For more information, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html Health Colors and Statuses>.
--
-- 'instanceType', 'singleInstanceHealth_instanceType' - The instance\'s type.
--
-- 'availabilityZone', 'singleInstanceHealth_availabilityZone' - The availability zone in which the instance runs.
--
-- 'healthStatus', 'singleInstanceHealth_healthStatus' - Returns the health status of the specified instance. For more
-- information, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html Health Colors and Statuses>.
--
-- 'deployment', 'singleInstanceHealth_deployment' - Information about the most recent deployment to an instance.
--
-- 'launchedAt', 'singleInstanceHealth_launchedAt' - The time at which the EC2 instance was launched.
newSingleInstanceHealth ::
  SingleInstanceHealth
newSingleInstanceHealth :: SingleInstanceHealth
newSingleInstanceHealth =
  SingleInstanceHealth' :: Maybe Text
-> Maybe [Text]
-> Maybe SystemStatus
-> Maybe ApplicationMetrics
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Deployment
-> Maybe ISO8601
-> SingleInstanceHealth
SingleInstanceHealth'
    { $sel:instanceId:SingleInstanceHealth' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:causes:SingleInstanceHealth' :: Maybe [Text]
causes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:system:SingleInstanceHealth' :: Maybe SystemStatus
system = Maybe SystemStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationMetrics:SingleInstanceHealth' :: Maybe ApplicationMetrics
applicationMetrics = Maybe ApplicationMetrics
forall a. Maybe a
Prelude.Nothing,
      $sel:color:SingleInstanceHealth' :: Maybe Text
color = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:SingleInstanceHealth' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZone:SingleInstanceHealth' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:healthStatus:SingleInstanceHealth' :: Maybe Text
healthStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deployment:SingleInstanceHealth' :: Maybe Deployment
deployment = Maybe Deployment
forall a. Maybe a
Prelude.Nothing,
      $sel:launchedAt:SingleInstanceHealth' :: Maybe ISO8601
launchedAt = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the Amazon EC2 instance.
singleInstanceHealth_instanceId :: Lens.Lens' SingleInstanceHealth (Prelude.Maybe Prelude.Text)
singleInstanceHealth_instanceId :: (Maybe Text -> f (Maybe Text))
-> SingleInstanceHealth -> f SingleInstanceHealth
singleInstanceHealth_instanceId = (SingleInstanceHealth -> Maybe Text)
-> (SingleInstanceHealth -> Maybe Text -> SingleInstanceHealth)
-> Lens
     SingleInstanceHealth SingleInstanceHealth (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleInstanceHealth' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:SingleInstanceHealth' :: SingleInstanceHealth -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: SingleInstanceHealth
s@SingleInstanceHealth' {} Maybe Text
a -> SingleInstanceHealth
s {$sel:instanceId:SingleInstanceHealth' :: Maybe Text
instanceId = Maybe Text
a} :: SingleInstanceHealth)

-- | Represents the causes, which provide more information about the current
-- health status.
singleInstanceHealth_causes :: Lens.Lens' SingleInstanceHealth (Prelude.Maybe [Prelude.Text])
singleInstanceHealth_causes :: (Maybe [Text] -> f (Maybe [Text]))
-> SingleInstanceHealth -> f SingleInstanceHealth
singleInstanceHealth_causes = (SingleInstanceHealth -> Maybe [Text])
-> (SingleInstanceHealth -> Maybe [Text] -> SingleInstanceHealth)
-> Lens
     SingleInstanceHealth
     SingleInstanceHealth
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleInstanceHealth' {Maybe [Text]
causes :: Maybe [Text]
$sel:causes:SingleInstanceHealth' :: SingleInstanceHealth -> Maybe [Text]
causes} -> Maybe [Text]
causes) (\s :: SingleInstanceHealth
s@SingleInstanceHealth' {} Maybe [Text]
a -> SingleInstanceHealth
s {$sel:causes:SingleInstanceHealth' :: Maybe [Text]
causes = Maybe [Text]
a} :: SingleInstanceHealth) ((Maybe [Text] -> f (Maybe [Text]))
 -> SingleInstanceHealth -> f SingleInstanceHealth)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SingleInstanceHealth
-> f SingleInstanceHealth
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Operating system metrics from the instance.
singleInstanceHealth_system :: Lens.Lens' SingleInstanceHealth (Prelude.Maybe SystemStatus)
singleInstanceHealth_system :: (Maybe SystemStatus -> f (Maybe SystemStatus))
-> SingleInstanceHealth -> f SingleInstanceHealth
singleInstanceHealth_system = (SingleInstanceHealth -> Maybe SystemStatus)
-> (SingleInstanceHealth
    -> Maybe SystemStatus -> SingleInstanceHealth)
-> Lens
     SingleInstanceHealth
     SingleInstanceHealth
     (Maybe SystemStatus)
     (Maybe SystemStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleInstanceHealth' {Maybe SystemStatus
system :: Maybe SystemStatus
$sel:system:SingleInstanceHealth' :: SingleInstanceHealth -> Maybe SystemStatus
system} -> Maybe SystemStatus
system) (\s :: SingleInstanceHealth
s@SingleInstanceHealth' {} Maybe SystemStatus
a -> SingleInstanceHealth
s {$sel:system:SingleInstanceHealth' :: Maybe SystemStatus
system = Maybe SystemStatus
a} :: SingleInstanceHealth)

-- | Request metrics from your application.
singleInstanceHealth_applicationMetrics :: Lens.Lens' SingleInstanceHealth (Prelude.Maybe ApplicationMetrics)
singleInstanceHealth_applicationMetrics :: (Maybe ApplicationMetrics -> f (Maybe ApplicationMetrics))
-> SingleInstanceHealth -> f SingleInstanceHealth
singleInstanceHealth_applicationMetrics = (SingleInstanceHealth -> Maybe ApplicationMetrics)
-> (SingleInstanceHealth
    -> Maybe ApplicationMetrics -> SingleInstanceHealth)
-> Lens
     SingleInstanceHealth
     SingleInstanceHealth
     (Maybe ApplicationMetrics)
     (Maybe ApplicationMetrics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleInstanceHealth' {Maybe ApplicationMetrics
applicationMetrics :: Maybe ApplicationMetrics
$sel:applicationMetrics:SingleInstanceHealth' :: SingleInstanceHealth -> Maybe ApplicationMetrics
applicationMetrics} -> Maybe ApplicationMetrics
applicationMetrics) (\s :: SingleInstanceHealth
s@SingleInstanceHealth' {} Maybe ApplicationMetrics
a -> SingleInstanceHealth
s {$sel:applicationMetrics:SingleInstanceHealth' :: Maybe ApplicationMetrics
applicationMetrics = Maybe ApplicationMetrics
a} :: SingleInstanceHealth)

-- | Represents the color indicator that gives you information about the
-- health of the EC2 instance. For more information, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html Health Colors and Statuses>.
singleInstanceHealth_color :: Lens.Lens' SingleInstanceHealth (Prelude.Maybe Prelude.Text)
singleInstanceHealth_color :: (Maybe Text -> f (Maybe Text))
-> SingleInstanceHealth -> f SingleInstanceHealth
singleInstanceHealth_color = (SingleInstanceHealth -> Maybe Text)
-> (SingleInstanceHealth -> Maybe Text -> SingleInstanceHealth)
-> Lens
     SingleInstanceHealth SingleInstanceHealth (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleInstanceHealth' {Maybe Text
color :: Maybe Text
$sel:color:SingleInstanceHealth' :: SingleInstanceHealth -> Maybe Text
color} -> Maybe Text
color) (\s :: SingleInstanceHealth
s@SingleInstanceHealth' {} Maybe Text
a -> SingleInstanceHealth
s {$sel:color:SingleInstanceHealth' :: Maybe Text
color = Maybe Text
a} :: SingleInstanceHealth)

-- | The instance\'s type.
singleInstanceHealth_instanceType :: Lens.Lens' SingleInstanceHealth (Prelude.Maybe Prelude.Text)
singleInstanceHealth_instanceType :: (Maybe Text -> f (Maybe Text))
-> SingleInstanceHealth -> f SingleInstanceHealth
singleInstanceHealth_instanceType = (SingleInstanceHealth -> Maybe Text)
-> (SingleInstanceHealth -> Maybe Text -> SingleInstanceHealth)
-> Lens
     SingleInstanceHealth SingleInstanceHealth (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleInstanceHealth' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:SingleInstanceHealth' :: SingleInstanceHealth -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: SingleInstanceHealth
s@SingleInstanceHealth' {} Maybe Text
a -> SingleInstanceHealth
s {$sel:instanceType:SingleInstanceHealth' :: Maybe Text
instanceType = Maybe Text
a} :: SingleInstanceHealth)

-- | The availability zone in which the instance runs.
singleInstanceHealth_availabilityZone :: Lens.Lens' SingleInstanceHealth (Prelude.Maybe Prelude.Text)
singleInstanceHealth_availabilityZone :: (Maybe Text -> f (Maybe Text))
-> SingleInstanceHealth -> f SingleInstanceHealth
singleInstanceHealth_availabilityZone = (SingleInstanceHealth -> Maybe Text)
-> (SingleInstanceHealth -> Maybe Text -> SingleInstanceHealth)
-> Lens
     SingleInstanceHealth SingleInstanceHealth (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleInstanceHealth' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:SingleInstanceHealth' :: SingleInstanceHealth -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: SingleInstanceHealth
s@SingleInstanceHealth' {} Maybe Text
a -> SingleInstanceHealth
s {$sel:availabilityZone:SingleInstanceHealth' :: Maybe Text
availabilityZone = Maybe Text
a} :: SingleInstanceHealth)

-- | Returns the health status of the specified instance. For more
-- information, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-status.html Health Colors and Statuses>.
singleInstanceHealth_healthStatus :: Lens.Lens' SingleInstanceHealth (Prelude.Maybe Prelude.Text)
singleInstanceHealth_healthStatus :: (Maybe Text -> f (Maybe Text))
-> SingleInstanceHealth -> f SingleInstanceHealth
singleInstanceHealth_healthStatus = (SingleInstanceHealth -> Maybe Text)
-> (SingleInstanceHealth -> Maybe Text -> SingleInstanceHealth)
-> Lens
     SingleInstanceHealth SingleInstanceHealth (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleInstanceHealth' {Maybe Text
healthStatus :: Maybe Text
$sel:healthStatus:SingleInstanceHealth' :: SingleInstanceHealth -> Maybe Text
healthStatus} -> Maybe Text
healthStatus) (\s :: SingleInstanceHealth
s@SingleInstanceHealth' {} Maybe Text
a -> SingleInstanceHealth
s {$sel:healthStatus:SingleInstanceHealth' :: Maybe Text
healthStatus = Maybe Text
a} :: SingleInstanceHealth)

-- | Information about the most recent deployment to an instance.
singleInstanceHealth_deployment :: Lens.Lens' SingleInstanceHealth (Prelude.Maybe Deployment)
singleInstanceHealth_deployment :: (Maybe Deployment -> f (Maybe Deployment))
-> SingleInstanceHealth -> f SingleInstanceHealth
singleInstanceHealth_deployment = (SingleInstanceHealth -> Maybe Deployment)
-> (SingleInstanceHealth
    -> Maybe Deployment -> SingleInstanceHealth)
-> Lens
     SingleInstanceHealth
     SingleInstanceHealth
     (Maybe Deployment)
     (Maybe Deployment)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleInstanceHealth' {Maybe Deployment
deployment :: Maybe Deployment
$sel:deployment:SingleInstanceHealth' :: SingleInstanceHealth -> Maybe Deployment
deployment} -> Maybe Deployment
deployment) (\s :: SingleInstanceHealth
s@SingleInstanceHealth' {} Maybe Deployment
a -> SingleInstanceHealth
s {$sel:deployment:SingleInstanceHealth' :: Maybe Deployment
deployment = Maybe Deployment
a} :: SingleInstanceHealth)

-- | The time at which the EC2 instance was launched.
singleInstanceHealth_launchedAt :: Lens.Lens' SingleInstanceHealth (Prelude.Maybe Prelude.UTCTime)
singleInstanceHealth_launchedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SingleInstanceHealth -> f SingleInstanceHealth
singleInstanceHealth_launchedAt = (SingleInstanceHealth -> Maybe ISO8601)
-> (SingleInstanceHealth -> Maybe ISO8601 -> SingleInstanceHealth)
-> Lens
     SingleInstanceHealth
     SingleInstanceHealth
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleInstanceHealth' {Maybe ISO8601
launchedAt :: Maybe ISO8601
$sel:launchedAt:SingleInstanceHealth' :: SingleInstanceHealth -> Maybe ISO8601
launchedAt} -> Maybe ISO8601
launchedAt) (\s :: SingleInstanceHealth
s@SingleInstanceHealth' {} Maybe ISO8601
a -> SingleInstanceHealth
s {$sel:launchedAt:SingleInstanceHealth' :: Maybe ISO8601
launchedAt = Maybe ISO8601
a} :: SingleInstanceHealth) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> SingleInstanceHealth -> f SingleInstanceHealth)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SingleInstanceHealth
-> f SingleInstanceHealth
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.FromXML SingleInstanceHealth where
  parseXML :: [Node] -> Either String SingleInstanceHealth
parseXML [Node]
x =
    Maybe Text
-> Maybe [Text]
-> Maybe SystemStatus
-> Maybe ApplicationMetrics
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Deployment
-> Maybe ISO8601
-> SingleInstanceHealth
SingleInstanceHealth'
      (Maybe Text
 -> Maybe [Text]
 -> Maybe SystemStatus
 -> Maybe ApplicationMetrics
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Deployment
 -> Maybe ISO8601
 -> SingleInstanceHealth)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe SystemStatus
      -> Maybe ApplicationMetrics
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Deployment
      -> Maybe ISO8601
      -> SingleInstanceHealth)
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
"InstanceId")
      Either
  String
  (Maybe [Text]
   -> Maybe SystemStatus
   -> Maybe ApplicationMetrics
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Deployment
   -> Maybe ISO8601
   -> SingleInstanceHealth)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe SystemStatus
      -> Maybe ApplicationMetrics
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Deployment
      -> Maybe ISO8601
      -> SingleInstanceHealth)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Causes" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String
  (Maybe SystemStatus
   -> Maybe ApplicationMetrics
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Deployment
   -> Maybe ISO8601
   -> SingleInstanceHealth)
-> Either String (Maybe SystemStatus)
-> Either
     String
     (Maybe ApplicationMetrics
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Deployment
      -> Maybe ISO8601
      -> SingleInstanceHealth)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe SystemStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"System")
      Either
  String
  (Maybe ApplicationMetrics
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Deployment
   -> Maybe ISO8601
   -> SingleInstanceHealth)
-> Either String (Maybe ApplicationMetrics)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Deployment
      -> Maybe ISO8601
      -> SingleInstanceHealth)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ApplicationMetrics)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ApplicationMetrics")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Deployment
   -> Maybe ISO8601
   -> SingleInstanceHealth)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Deployment
      -> Maybe ISO8601
      -> SingleInstanceHealth)
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
"Color")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Deployment
   -> Maybe ISO8601
   -> SingleInstanceHealth)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Deployment
      -> Maybe ISO8601
      -> SingleInstanceHealth)
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
"InstanceType")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Deployment
   -> Maybe ISO8601
   -> SingleInstanceHealth)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Deployment -> Maybe ISO8601 -> SingleInstanceHealth)
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
"AvailabilityZone")
      Either
  String
  (Maybe Text
   -> Maybe Deployment -> Maybe ISO8601 -> SingleInstanceHealth)
-> Either String (Maybe Text)
-> Either
     String (Maybe Deployment -> Maybe ISO8601 -> SingleInstanceHealth)
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
"HealthStatus")
      Either
  String (Maybe Deployment -> Maybe ISO8601 -> SingleInstanceHealth)
-> Either String (Maybe Deployment)
-> Either String (Maybe ISO8601 -> SingleInstanceHealth)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Deployment)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Deployment")
      Either String (Maybe ISO8601 -> SingleInstanceHealth)
-> Either String (Maybe ISO8601)
-> Either String SingleInstanceHealth
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LaunchedAt")

instance Prelude.Hashable SingleInstanceHealth

instance Prelude.NFData SingleInstanceHealth