{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.DescribeInstancesHealth
-- 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)
--
-- Retrieves detailed information about the health of instances in your AWS
-- Elastic Beanstalk. This operation requires
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced.html enhanced health reporting>.
module Amazonka.ElasticBeanstalk.DescribeInstancesHealth
  ( -- * Creating a Request
    DescribeInstancesHealth (..),
    newDescribeInstancesHealth,

    -- * Request Lenses
    describeInstancesHealth_nextToken,
    describeInstancesHealth_environmentName,
    describeInstancesHealth_attributeNames,
    describeInstancesHealth_environmentId,

    -- * Destructuring the Response
    DescribeInstancesHealthResponse (..),
    newDescribeInstancesHealthResponse,

    -- * Response Lenses
    describeInstancesHealthResponse_instanceHealthList,
    describeInstancesHealthResponse_nextToken,
    describeInstancesHealthResponse_refreshedAt,
    describeInstancesHealthResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ElasticBeanstalk.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Parameters for a call to @DescribeInstancesHealth@.
--
-- /See:/ 'newDescribeInstancesHealth' smart constructor.
data DescribeInstancesHealth = DescribeInstancesHealth'
  { -- | Specify the pagination token returned by a previous call.
    DescribeInstancesHealth -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specify the AWS Elastic Beanstalk environment by name.
    DescribeInstancesHealth -> Maybe Text
environmentName :: Prelude.Maybe Prelude.Text,
    -- | Specifies the response elements you wish to receive. To retrieve all
    -- attributes, set to @All@. If no attribute names are specified, returns a
    -- list of instances.
    DescribeInstancesHealth -> Maybe [InstancesHealthAttribute]
attributeNames :: Prelude.Maybe [InstancesHealthAttribute],
    -- | Specify the AWS Elastic Beanstalk environment by ID.
    DescribeInstancesHealth -> Maybe Text
environmentId :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeInstancesHealth -> DescribeInstancesHealth -> Bool
(DescribeInstancesHealth -> DescribeInstancesHealth -> Bool)
-> (DescribeInstancesHealth -> DescribeInstancesHealth -> Bool)
-> Eq DescribeInstancesHealth
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstancesHealth -> DescribeInstancesHealth -> Bool
$c/= :: DescribeInstancesHealth -> DescribeInstancesHealth -> Bool
== :: DescribeInstancesHealth -> DescribeInstancesHealth -> Bool
$c== :: DescribeInstancesHealth -> DescribeInstancesHealth -> Bool
Prelude.Eq, ReadPrec [DescribeInstancesHealth]
ReadPrec DescribeInstancesHealth
Int -> ReadS DescribeInstancesHealth
ReadS [DescribeInstancesHealth]
(Int -> ReadS DescribeInstancesHealth)
-> ReadS [DescribeInstancesHealth]
-> ReadPrec DescribeInstancesHealth
-> ReadPrec [DescribeInstancesHealth]
-> Read DescribeInstancesHealth
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstancesHealth]
$creadListPrec :: ReadPrec [DescribeInstancesHealth]
readPrec :: ReadPrec DescribeInstancesHealth
$creadPrec :: ReadPrec DescribeInstancesHealth
readList :: ReadS [DescribeInstancesHealth]
$creadList :: ReadS [DescribeInstancesHealth]
readsPrec :: Int -> ReadS DescribeInstancesHealth
$creadsPrec :: Int -> ReadS DescribeInstancesHealth
Prelude.Read, Int -> DescribeInstancesHealth -> ShowS
[DescribeInstancesHealth] -> ShowS
DescribeInstancesHealth -> String
(Int -> DescribeInstancesHealth -> ShowS)
-> (DescribeInstancesHealth -> String)
-> ([DescribeInstancesHealth] -> ShowS)
-> Show DescribeInstancesHealth
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstancesHealth] -> ShowS
$cshowList :: [DescribeInstancesHealth] -> ShowS
show :: DescribeInstancesHealth -> String
$cshow :: DescribeInstancesHealth -> String
showsPrec :: Int -> DescribeInstancesHealth -> ShowS
$cshowsPrec :: Int -> DescribeInstancesHealth -> ShowS
Prelude.Show, (forall x.
 DescribeInstancesHealth -> Rep DescribeInstancesHealth x)
-> (forall x.
    Rep DescribeInstancesHealth x -> DescribeInstancesHealth)
-> Generic DescribeInstancesHealth
forall x. Rep DescribeInstancesHealth x -> DescribeInstancesHealth
forall x. DescribeInstancesHealth -> Rep DescribeInstancesHealth x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeInstancesHealth x -> DescribeInstancesHealth
$cfrom :: forall x. DescribeInstancesHealth -> Rep DescribeInstancesHealth x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstancesHealth' 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:
--
-- 'nextToken', 'describeInstancesHealth_nextToken' - Specify the pagination token returned by a previous call.
--
-- 'environmentName', 'describeInstancesHealth_environmentName' - Specify the AWS Elastic Beanstalk environment by name.
--
-- 'attributeNames', 'describeInstancesHealth_attributeNames' - Specifies the response elements you wish to receive. To retrieve all
-- attributes, set to @All@. If no attribute names are specified, returns a
-- list of instances.
--
-- 'environmentId', 'describeInstancesHealth_environmentId' - Specify the AWS Elastic Beanstalk environment by ID.
newDescribeInstancesHealth ::
  DescribeInstancesHealth
newDescribeInstancesHealth :: DescribeInstancesHealth
newDescribeInstancesHealth =
  DescribeInstancesHealth' :: Maybe Text
-> Maybe Text
-> Maybe [InstancesHealthAttribute]
-> Maybe Text
-> DescribeInstancesHealth
DescribeInstancesHealth'
    { $sel:nextToken:DescribeInstancesHealth' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:environmentName:DescribeInstancesHealth' :: Maybe Text
environmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attributeNames:DescribeInstancesHealth' :: Maybe [InstancesHealthAttribute]
attributeNames = Maybe [InstancesHealthAttribute]
forall a. Maybe a
Prelude.Nothing,
      $sel:environmentId:DescribeInstancesHealth' :: Maybe Text
environmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Specify the pagination token returned by a previous call.
describeInstancesHealth_nextToken :: Lens.Lens' DescribeInstancesHealth (Prelude.Maybe Prelude.Text)
describeInstancesHealth_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeInstancesHealth -> f DescribeInstancesHealth
describeInstancesHealth_nextToken = (DescribeInstancesHealth -> Maybe Text)
-> (DescribeInstancesHealth
    -> Maybe Text -> DescribeInstancesHealth)
-> Lens
     DescribeInstancesHealth
     DescribeInstancesHealth
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancesHealth' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeInstancesHealth' :: DescribeInstancesHealth -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeInstancesHealth
s@DescribeInstancesHealth' {} Maybe Text
a -> DescribeInstancesHealth
s {$sel:nextToken:DescribeInstancesHealth' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeInstancesHealth)

-- | Specify the AWS Elastic Beanstalk environment by name.
describeInstancesHealth_environmentName :: Lens.Lens' DescribeInstancesHealth (Prelude.Maybe Prelude.Text)
describeInstancesHealth_environmentName :: (Maybe Text -> f (Maybe Text))
-> DescribeInstancesHealth -> f DescribeInstancesHealth
describeInstancesHealth_environmentName = (DescribeInstancesHealth -> Maybe Text)
-> (DescribeInstancesHealth
    -> Maybe Text -> DescribeInstancesHealth)
-> Lens
     DescribeInstancesHealth
     DescribeInstancesHealth
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancesHealth' {Maybe Text
environmentName :: Maybe Text
$sel:environmentName:DescribeInstancesHealth' :: DescribeInstancesHealth -> Maybe Text
environmentName} -> Maybe Text
environmentName) (\s :: DescribeInstancesHealth
s@DescribeInstancesHealth' {} Maybe Text
a -> DescribeInstancesHealth
s {$sel:environmentName:DescribeInstancesHealth' :: Maybe Text
environmentName = Maybe Text
a} :: DescribeInstancesHealth)

-- | Specifies the response elements you wish to receive. To retrieve all
-- attributes, set to @All@. If no attribute names are specified, returns a
-- list of instances.
describeInstancesHealth_attributeNames :: Lens.Lens' DescribeInstancesHealth (Prelude.Maybe [InstancesHealthAttribute])
describeInstancesHealth_attributeNames :: (Maybe [InstancesHealthAttribute]
 -> f (Maybe [InstancesHealthAttribute]))
-> DescribeInstancesHealth -> f DescribeInstancesHealth
describeInstancesHealth_attributeNames = (DescribeInstancesHealth -> Maybe [InstancesHealthAttribute])
-> (DescribeInstancesHealth
    -> Maybe [InstancesHealthAttribute] -> DescribeInstancesHealth)
-> Lens
     DescribeInstancesHealth
     DescribeInstancesHealth
     (Maybe [InstancesHealthAttribute])
     (Maybe [InstancesHealthAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancesHealth' {Maybe [InstancesHealthAttribute]
attributeNames :: Maybe [InstancesHealthAttribute]
$sel:attributeNames:DescribeInstancesHealth' :: DescribeInstancesHealth -> Maybe [InstancesHealthAttribute]
attributeNames} -> Maybe [InstancesHealthAttribute]
attributeNames) (\s :: DescribeInstancesHealth
s@DescribeInstancesHealth' {} Maybe [InstancesHealthAttribute]
a -> DescribeInstancesHealth
s {$sel:attributeNames:DescribeInstancesHealth' :: Maybe [InstancesHealthAttribute]
attributeNames = Maybe [InstancesHealthAttribute]
a} :: DescribeInstancesHealth) ((Maybe [InstancesHealthAttribute]
  -> f (Maybe [InstancesHealthAttribute]))
 -> DescribeInstancesHealth -> f DescribeInstancesHealth)
-> ((Maybe [InstancesHealthAttribute]
     -> f (Maybe [InstancesHealthAttribute]))
    -> Maybe [InstancesHealthAttribute]
    -> f (Maybe [InstancesHealthAttribute]))
-> (Maybe [InstancesHealthAttribute]
    -> f (Maybe [InstancesHealthAttribute]))
-> DescribeInstancesHealth
-> f DescribeInstancesHealth
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InstancesHealthAttribute]
  [InstancesHealthAttribute]
  [InstancesHealthAttribute]
  [InstancesHealthAttribute]
-> Iso
     (Maybe [InstancesHealthAttribute])
     (Maybe [InstancesHealthAttribute])
     (Maybe [InstancesHealthAttribute])
     (Maybe [InstancesHealthAttribute])
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
  [InstancesHealthAttribute]
  [InstancesHealthAttribute]
  [InstancesHealthAttribute]
  [InstancesHealthAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specify the AWS Elastic Beanstalk environment by ID.
describeInstancesHealth_environmentId :: Lens.Lens' DescribeInstancesHealth (Prelude.Maybe Prelude.Text)
describeInstancesHealth_environmentId :: (Maybe Text -> f (Maybe Text))
-> DescribeInstancesHealth -> f DescribeInstancesHealth
describeInstancesHealth_environmentId = (DescribeInstancesHealth -> Maybe Text)
-> (DescribeInstancesHealth
    -> Maybe Text -> DescribeInstancesHealth)
-> Lens
     DescribeInstancesHealth
     DescribeInstancesHealth
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancesHealth' {Maybe Text
environmentId :: Maybe Text
$sel:environmentId:DescribeInstancesHealth' :: DescribeInstancesHealth -> Maybe Text
environmentId} -> Maybe Text
environmentId) (\s :: DescribeInstancesHealth
s@DescribeInstancesHealth' {} Maybe Text
a -> DescribeInstancesHealth
s {$sel:environmentId:DescribeInstancesHealth' :: Maybe Text
environmentId = Maybe Text
a} :: DescribeInstancesHealth)

instance Core.AWSRequest DescribeInstancesHealth where
  type
    AWSResponse DescribeInstancesHealth =
      DescribeInstancesHealthResponse
  request :: DescribeInstancesHealth -> Request DescribeInstancesHealth
request = Service
-> DescribeInstancesHealth -> Request DescribeInstancesHealth
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeInstancesHealth
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeInstancesHealth)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeInstancesHealth))
-> Logger
-> Service
-> Proxy DescribeInstancesHealth
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeInstancesHealth)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeInstancesHealthResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [SingleInstanceHealth]
-> Maybe Text
-> Maybe ISO8601
-> Int
-> DescribeInstancesHealthResponse
DescribeInstancesHealthResponse'
            (Maybe [SingleInstanceHealth]
 -> Maybe Text
 -> Maybe ISO8601
 -> Int
 -> DescribeInstancesHealthResponse)
-> Either String (Maybe [SingleInstanceHealth])
-> Either
     String
     (Maybe Text
      -> Maybe ISO8601 -> Int -> DescribeInstancesHealthResponse)
forall (f :: * -> *) a b. Functor 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
"InstanceHealthList"
                            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 [SingleInstanceHealth]))
-> Either String (Maybe [SingleInstanceHealth])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [SingleInstanceHealth])
-> [Node] -> Either String (Maybe [SingleInstanceHealth])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [SingleInstanceHealth]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either
  String
  (Maybe Text
   -> Maybe ISO8601 -> Int -> DescribeInstancesHealthResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe ISO8601 -> Int -> DescribeInstancesHealthResponse)
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
"NextToken")
            Either
  String (Maybe ISO8601 -> Int -> DescribeInstancesHealthResponse)
-> Either String (Maybe ISO8601)
-> Either String (Int -> DescribeInstancesHealthResponse)
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
"RefreshedAt")
            Either String (Int -> DescribeInstancesHealthResponse)
-> Either String Int
-> Either String DescribeInstancesHealthResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeInstancesHealth

instance Prelude.NFData DescribeInstancesHealth

instance Core.ToHeaders DescribeInstancesHealth where
  toHeaders :: DescribeInstancesHealth -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeInstancesHealth -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DescribeInstancesHealth where
  toPath :: DescribeInstancesHealth -> ByteString
toPath = ByteString -> DescribeInstancesHealth -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DescribeInstancesHealth where
  toQuery :: DescribeInstancesHealth -> QueryString
toQuery DescribeInstancesHealth' {Maybe [InstancesHealthAttribute]
Maybe Text
environmentId :: Maybe Text
attributeNames :: Maybe [InstancesHealthAttribute]
environmentName :: Maybe Text
nextToken :: Maybe Text
$sel:environmentId:DescribeInstancesHealth' :: DescribeInstancesHealth -> Maybe Text
$sel:attributeNames:DescribeInstancesHealth' :: DescribeInstancesHealth -> Maybe [InstancesHealthAttribute]
$sel:environmentName:DescribeInstancesHealth' :: DescribeInstancesHealth -> Maybe Text
$sel:nextToken:DescribeInstancesHealth' :: DescribeInstancesHealth -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeInstancesHealth" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"EnvironmentName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
environmentName,
        ByteString
"AttributeNames"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [InstancesHealthAttribute] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([InstancesHealthAttribute] -> QueryString)
-> Maybe [InstancesHealthAttribute] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InstancesHealthAttribute]
attributeNames
            ),
        ByteString
"EnvironmentId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
environmentId
      ]

-- | Detailed health information about the Amazon EC2 instances in an AWS
-- Elastic Beanstalk environment.
--
-- /See:/ 'newDescribeInstancesHealthResponse' smart constructor.
data DescribeInstancesHealthResponse = DescribeInstancesHealthResponse'
  { -- | Detailed health information about each instance.
    --
    -- The output differs slightly between Linux and Windows environments.
    -- There is a difference in the members that are supported under the
    -- @\<CPUUtilization>@ type.
    DescribeInstancesHealthResponse -> Maybe [SingleInstanceHealth]
instanceHealthList :: Prelude.Maybe [SingleInstanceHealth],
    -- | Pagination token for the next page of results, if available.
    DescribeInstancesHealthResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the health information was retrieved.
    DescribeInstancesHealthResponse -> Maybe ISO8601
refreshedAt :: Prelude.Maybe Core.ISO8601,
    -- | The response's http status code.
    DescribeInstancesHealthResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeInstancesHealthResponse
-> DescribeInstancesHealthResponse -> Bool
(DescribeInstancesHealthResponse
 -> DescribeInstancesHealthResponse -> Bool)
-> (DescribeInstancesHealthResponse
    -> DescribeInstancesHealthResponse -> Bool)
-> Eq DescribeInstancesHealthResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstancesHealthResponse
-> DescribeInstancesHealthResponse -> Bool
$c/= :: DescribeInstancesHealthResponse
-> DescribeInstancesHealthResponse -> Bool
== :: DescribeInstancesHealthResponse
-> DescribeInstancesHealthResponse -> Bool
$c== :: DescribeInstancesHealthResponse
-> DescribeInstancesHealthResponse -> Bool
Prelude.Eq, ReadPrec [DescribeInstancesHealthResponse]
ReadPrec DescribeInstancesHealthResponse
Int -> ReadS DescribeInstancesHealthResponse
ReadS [DescribeInstancesHealthResponse]
(Int -> ReadS DescribeInstancesHealthResponse)
-> ReadS [DescribeInstancesHealthResponse]
-> ReadPrec DescribeInstancesHealthResponse
-> ReadPrec [DescribeInstancesHealthResponse]
-> Read DescribeInstancesHealthResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstancesHealthResponse]
$creadListPrec :: ReadPrec [DescribeInstancesHealthResponse]
readPrec :: ReadPrec DescribeInstancesHealthResponse
$creadPrec :: ReadPrec DescribeInstancesHealthResponse
readList :: ReadS [DescribeInstancesHealthResponse]
$creadList :: ReadS [DescribeInstancesHealthResponse]
readsPrec :: Int -> ReadS DescribeInstancesHealthResponse
$creadsPrec :: Int -> ReadS DescribeInstancesHealthResponse
Prelude.Read, Int -> DescribeInstancesHealthResponse -> ShowS
[DescribeInstancesHealthResponse] -> ShowS
DescribeInstancesHealthResponse -> String
(Int -> DescribeInstancesHealthResponse -> ShowS)
-> (DescribeInstancesHealthResponse -> String)
-> ([DescribeInstancesHealthResponse] -> ShowS)
-> Show DescribeInstancesHealthResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstancesHealthResponse] -> ShowS
$cshowList :: [DescribeInstancesHealthResponse] -> ShowS
show :: DescribeInstancesHealthResponse -> String
$cshow :: DescribeInstancesHealthResponse -> String
showsPrec :: Int -> DescribeInstancesHealthResponse -> ShowS
$cshowsPrec :: Int -> DescribeInstancesHealthResponse -> ShowS
Prelude.Show, (forall x.
 DescribeInstancesHealthResponse
 -> Rep DescribeInstancesHealthResponse x)
-> (forall x.
    Rep DescribeInstancesHealthResponse x
    -> DescribeInstancesHealthResponse)
-> Generic DescribeInstancesHealthResponse
forall x.
Rep DescribeInstancesHealthResponse x
-> DescribeInstancesHealthResponse
forall x.
DescribeInstancesHealthResponse
-> Rep DescribeInstancesHealthResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInstancesHealthResponse x
-> DescribeInstancesHealthResponse
$cfrom :: forall x.
DescribeInstancesHealthResponse
-> Rep DescribeInstancesHealthResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstancesHealthResponse' 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:
--
-- 'instanceHealthList', 'describeInstancesHealthResponse_instanceHealthList' - Detailed health information about each instance.
--
-- The output differs slightly between Linux and Windows environments.
-- There is a difference in the members that are supported under the
-- @\<CPUUtilization>@ type.
--
-- 'nextToken', 'describeInstancesHealthResponse_nextToken' - Pagination token for the next page of results, if available.
--
-- 'refreshedAt', 'describeInstancesHealthResponse_refreshedAt' - The date and time that the health information was retrieved.
--
-- 'httpStatus', 'describeInstancesHealthResponse_httpStatus' - The response's http status code.
newDescribeInstancesHealthResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeInstancesHealthResponse
newDescribeInstancesHealthResponse :: Int -> DescribeInstancesHealthResponse
newDescribeInstancesHealthResponse Int
pHttpStatus_ =
  DescribeInstancesHealthResponse' :: Maybe [SingleInstanceHealth]
-> Maybe Text
-> Maybe ISO8601
-> Int
-> DescribeInstancesHealthResponse
DescribeInstancesHealthResponse'
    { $sel:instanceHealthList:DescribeInstancesHealthResponse' :: Maybe [SingleInstanceHealth]
instanceHealthList =
        Maybe [SingleInstanceHealth]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeInstancesHealthResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:refreshedAt:DescribeInstancesHealthResponse' :: Maybe ISO8601
refreshedAt = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeInstancesHealthResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Detailed health information about each instance.
--
-- The output differs slightly between Linux and Windows environments.
-- There is a difference in the members that are supported under the
-- @\<CPUUtilization>@ type.
describeInstancesHealthResponse_instanceHealthList :: Lens.Lens' DescribeInstancesHealthResponse (Prelude.Maybe [SingleInstanceHealth])
describeInstancesHealthResponse_instanceHealthList :: (Maybe [SingleInstanceHealth] -> f (Maybe [SingleInstanceHealth]))
-> DescribeInstancesHealthResponse
-> f DescribeInstancesHealthResponse
describeInstancesHealthResponse_instanceHealthList = (DescribeInstancesHealthResponse -> Maybe [SingleInstanceHealth])
-> (DescribeInstancesHealthResponse
    -> Maybe [SingleInstanceHealth] -> DescribeInstancesHealthResponse)
-> Lens
     DescribeInstancesHealthResponse
     DescribeInstancesHealthResponse
     (Maybe [SingleInstanceHealth])
     (Maybe [SingleInstanceHealth])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancesHealthResponse' {Maybe [SingleInstanceHealth]
instanceHealthList :: Maybe [SingleInstanceHealth]
$sel:instanceHealthList:DescribeInstancesHealthResponse' :: DescribeInstancesHealthResponse -> Maybe [SingleInstanceHealth]
instanceHealthList} -> Maybe [SingleInstanceHealth]
instanceHealthList) (\s :: DescribeInstancesHealthResponse
s@DescribeInstancesHealthResponse' {} Maybe [SingleInstanceHealth]
a -> DescribeInstancesHealthResponse
s {$sel:instanceHealthList:DescribeInstancesHealthResponse' :: Maybe [SingleInstanceHealth]
instanceHealthList = Maybe [SingleInstanceHealth]
a} :: DescribeInstancesHealthResponse) ((Maybe [SingleInstanceHealth] -> f (Maybe [SingleInstanceHealth]))
 -> DescribeInstancesHealthResponse
 -> f DescribeInstancesHealthResponse)
-> ((Maybe [SingleInstanceHealth]
     -> f (Maybe [SingleInstanceHealth]))
    -> Maybe [SingleInstanceHealth]
    -> f (Maybe [SingleInstanceHealth]))
-> (Maybe [SingleInstanceHealth]
    -> f (Maybe [SingleInstanceHealth]))
-> DescribeInstancesHealthResponse
-> f DescribeInstancesHealthResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SingleInstanceHealth]
  [SingleInstanceHealth]
  [SingleInstanceHealth]
  [SingleInstanceHealth]
-> Iso
     (Maybe [SingleInstanceHealth])
     (Maybe [SingleInstanceHealth])
     (Maybe [SingleInstanceHealth])
     (Maybe [SingleInstanceHealth])
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
  [SingleInstanceHealth]
  [SingleInstanceHealth]
  [SingleInstanceHealth]
  [SingleInstanceHealth]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Pagination token for the next page of results, if available.
describeInstancesHealthResponse_nextToken :: Lens.Lens' DescribeInstancesHealthResponse (Prelude.Maybe Prelude.Text)
describeInstancesHealthResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeInstancesHealthResponse
-> f DescribeInstancesHealthResponse
describeInstancesHealthResponse_nextToken = (DescribeInstancesHealthResponse -> Maybe Text)
-> (DescribeInstancesHealthResponse
    -> Maybe Text -> DescribeInstancesHealthResponse)
-> Lens
     DescribeInstancesHealthResponse
     DescribeInstancesHealthResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancesHealthResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeInstancesHealthResponse' :: DescribeInstancesHealthResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeInstancesHealthResponse
s@DescribeInstancesHealthResponse' {} Maybe Text
a -> DescribeInstancesHealthResponse
s {$sel:nextToken:DescribeInstancesHealthResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeInstancesHealthResponse)

-- | The date and time that the health information was retrieved.
describeInstancesHealthResponse_refreshedAt :: Lens.Lens' DescribeInstancesHealthResponse (Prelude.Maybe Prelude.UTCTime)
describeInstancesHealthResponse_refreshedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeInstancesHealthResponse
-> f DescribeInstancesHealthResponse
describeInstancesHealthResponse_refreshedAt = (DescribeInstancesHealthResponse -> Maybe ISO8601)
-> (DescribeInstancesHealthResponse
    -> Maybe ISO8601 -> DescribeInstancesHealthResponse)
-> Lens
     DescribeInstancesHealthResponse
     DescribeInstancesHealthResponse
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancesHealthResponse' {Maybe ISO8601
refreshedAt :: Maybe ISO8601
$sel:refreshedAt:DescribeInstancesHealthResponse' :: DescribeInstancesHealthResponse -> Maybe ISO8601
refreshedAt} -> Maybe ISO8601
refreshedAt) (\s :: DescribeInstancesHealthResponse
s@DescribeInstancesHealthResponse' {} Maybe ISO8601
a -> DescribeInstancesHealthResponse
s {$sel:refreshedAt:DescribeInstancesHealthResponse' :: Maybe ISO8601
refreshedAt = Maybe ISO8601
a} :: DescribeInstancesHealthResponse) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> DescribeInstancesHealthResponse
 -> f DescribeInstancesHealthResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeInstancesHealthResponse
-> f DescribeInstancesHealthResponse
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

-- | The response's http status code.
describeInstancesHealthResponse_httpStatus :: Lens.Lens' DescribeInstancesHealthResponse Prelude.Int
describeInstancesHealthResponse_httpStatus :: (Int -> f Int)
-> DescribeInstancesHealthResponse
-> f DescribeInstancesHealthResponse
describeInstancesHealthResponse_httpStatus = (DescribeInstancesHealthResponse -> Int)
-> (DescribeInstancesHealthResponse
    -> Int -> DescribeInstancesHealthResponse)
-> Lens
     DescribeInstancesHealthResponse
     DescribeInstancesHealthResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstancesHealthResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeInstancesHealthResponse' :: DescribeInstancesHealthResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeInstancesHealthResponse
s@DescribeInstancesHealthResponse' {} Int
a -> DescribeInstancesHealthResponse
s {$sel:httpStatus:DescribeInstancesHealthResponse' :: Int
httpStatus = Int
a} :: DescribeInstancesHealthResponse)

instance
  Prelude.NFData
    DescribeInstancesHealthResponse