{-# 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.Route53AutoNaming.GetInstancesHealthStatus
-- 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)
--
-- Gets the current health status (@Healthy@, @Unhealthy@, or @Unknown@) of
-- one or more instances that are associated with a specified service.
--
-- There\'s a brief delay between when you register an instance and when
-- the health status for the instance is available.
module Amazonka.Route53AutoNaming.GetInstancesHealthStatus
  ( -- * Creating a Request
    GetInstancesHealthStatus (..),
    newGetInstancesHealthStatus,

    -- * Request Lenses
    getInstancesHealthStatus_nextToken,
    getInstancesHealthStatus_instances,
    getInstancesHealthStatus_maxResults,
    getInstancesHealthStatus_serviceId,

    -- * Destructuring the Response
    GetInstancesHealthStatusResponse (..),
    newGetInstancesHealthStatusResponse,

    -- * Response Lenses
    getInstancesHealthStatusResponse_status,
    getInstancesHealthStatusResponse_nextToken,
    getInstancesHealthStatusResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetInstancesHealthStatus' smart constructor.
data GetInstancesHealthStatus = GetInstancesHealthStatus'
  { -- | For the first @GetInstancesHealthStatus@ request, omit this value.
    --
    -- If more than @MaxResults@ instances match the specified criteria, you
    -- can submit another @GetInstancesHealthStatus@ request to get the next
    -- group of results. Specify the value of @NextToken@ from the previous
    -- response in the next request.
    GetInstancesHealthStatus -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array that contains the IDs of all the instances that you want to get
    -- the health status for.
    --
    -- If you omit @Instances@, Cloud Map returns the health status for all the
    -- instances that are associated with the specified service.
    --
    -- To get the IDs for the instances that you\'ve registered by using a
    -- specified service, submit a
    -- <https://docs.aws.amazon.com/cloud-map/latest/api/API_ListInstances.html ListInstances>
    -- request.
    GetInstancesHealthStatus -> Maybe (NonEmpty Text)
instances :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The maximum number of instances that you want Cloud Map to return in the
    -- response to a @GetInstancesHealthStatus@ request. If you don\'t specify
    -- a value for @MaxResults@, Cloud Map returns up to 100 instances.
    GetInstancesHealthStatus -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the service that the instance is associated with.
    GetInstancesHealthStatus -> Text
serviceId :: Prelude.Text
  }
  deriving (GetInstancesHealthStatus -> GetInstancesHealthStatus -> Bool
(GetInstancesHealthStatus -> GetInstancesHealthStatus -> Bool)
-> (GetInstancesHealthStatus -> GetInstancesHealthStatus -> Bool)
-> Eq GetInstancesHealthStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetInstancesHealthStatus -> GetInstancesHealthStatus -> Bool
$c/= :: GetInstancesHealthStatus -> GetInstancesHealthStatus -> Bool
== :: GetInstancesHealthStatus -> GetInstancesHealthStatus -> Bool
$c== :: GetInstancesHealthStatus -> GetInstancesHealthStatus -> Bool
Prelude.Eq, ReadPrec [GetInstancesHealthStatus]
ReadPrec GetInstancesHealthStatus
Int -> ReadS GetInstancesHealthStatus
ReadS [GetInstancesHealthStatus]
(Int -> ReadS GetInstancesHealthStatus)
-> ReadS [GetInstancesHealthStatus]
-> ReadPrec GetInstancesHealthStatus
-> ReadPrec [GetInstancesHealthStatus]
-> Read GetInstancesHealthStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetInstancesHealthStatus]
$creadListPrec :: ReadPrec [GetInstancesHealthStatus]
readPrec :: ReadPrec GetInstancesHealthStatus
$creadPrec :: ReadPrec GetInstancesHealthStatus
readList :: ReadS [GetInstancesHealthStatus]
$creadList :: ReadS [GetInstancesHealthStatus]
readsPrec :: Int -> ReadS GetInstancesHealthStatus
$creadsPrec :: Int -> ReadS GetInstancesHealthStatus
Prelude.Read, Int -> GetInstancesHealthStatus -> ShowS
[GetInstancesHealthStatus] -> ShowS
GetInstancesHealthStatus -> String
(Int -> GetInstancesHealthStatus -> ShowS)
-> (GetInstancesHealthStatus -> String)
-> ([GetInstancesHealthStatus] -> ShowS)
-> Show GetInstancesHealthStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetInstancesHealthStatus] -> ShowS
$cshowList :: [GetInstancesHealthStatus] -> ShowS
show :: GetInstancesHealthStatus -> String
$cshow :: GetInstancesHealthStatus -> String
showsPrec :: Int -> GetInstancesHealthStatus -> ShowS
$cshowsPrec :: Int -> GetInstancesHealthStatus -> ShowS
Prelude.Show, (forall x.
 GetInstancesHealthStatus -> Rep GetInstancesHealthStatus x)
-> (forall x.
    Rep GetInstancesHealthStatus x -> GetInstancesHealthStatus)
-> Generic GetInstancesHealthStatus
forall x.
Rep GetInstancesHealthStatus x -> GetInstancesHealthStatus
forall x.
GetInstancesHealthStatus -> Rep GetInstancesHealthStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetInstancesHealthStatus x -> GetInstancesHealthStatus
$cfrom :: forall x.
GetInstancesHealthStatus -> Rep GetInstancesHealthStatus x
Prelude.Generic)

-- |
-- Create a value of 'GetInstancesHealthStatus' 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', 'getInstancesHealthStatus_nextToken' - For the first @GetInstancesHealthStatus@ request, omit this value.
--
-- If more than @MaxResults@ instances match the specified criteria, you
-- can submit another @GetInstancesHealthStatus@ request to get the next
-- group of results. Specify the value of @NextToken@ from the previous
-- response in the next request.
--
-- 'instances', 'getInstancesHealthStatus_instances' - An array that contains the IDs of all the instances that you want to get
-- the health status for.
--
-- If you omit @Instances@, Cloud Map returns the health status for all the
-- instances that are associated with the specified service.
--
-- To get the IDs for the instances that you\'ve registered by using a
-- specified service, submit a
-- <https://docs.aws.amazon.com/cloud-map/latest/api/API_ListInstances.html ListInstances>
-- request.
--
-- 'maxResults', 'getInstancesHealthStatus_maxResults' - The maximum number of instances that you want Cloud Map to return in the
-- response to a @GetInstancesHealthStatus@ request. If you don\'t specify
-- a value for @MaxResults@, Cloud Map returns up to 100 instances.
--
-- 'serviceId', 'getInstancesHealthStatus_serviceId' - The ID of the service that the instance is associated with.
newGetInstancesHealthStatus ::
  -- | 'serviceId'
  Prelude.Text ->
  GetInstancesHealthStatus
newGetInstancesHealthStatus :: Text -> GetInstancesHealthStatus
newGetInstancesHealthStatus Text
pServiceId_ =
  GetInstancesHealthStatus' :: Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Natural
-> Text
-> GetInstancesHealthStatus
GetInstancesHealthStatus'
    { $sel:nextToken:GetInstancesHealthStatus' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instances:GetInstancesHealthStatus' :: Maybe (NonEmpty Text)
instances = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetInstancesHealthStatus' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceId:GetInstancesHealthStatus' :: Text
serviceId = Text
pServiceId_
    }

-- | For the first @GetInstancesHealthStatus@ request, omit this value.
--
-- If more than @MaxResults@ instances match the specified criteria, you
-- can submit another @GetInstancesHealthStatus@ request to get the next
-- group of results. Specify the value of @NextToken@ from the previous
-- response in the next request.
getInstancesHealthStatus_nextToken :: Lens.Lens' GetInstancesHealthStatus (Prelude.Maybe Prelude.Text)
getInstancesHealthStatus_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetInstancesHealthStatus -> f GetInstancesHealthStatus
getInstancesHealthStatus_nextToken = (GetInstancesHealthStatus -> Maybe Text)
-> (GetInstancesHealthStatus
    -> Maybe Text -> GetInstancesHealthStatus)
-> Lens
     GetInstancesHealthStatus
     GetInstancesHealthStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstancesHealthStatus' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetInstancesHealthStatus
s@GetInstancesHealthStatus' {} Maybe Text
a -> GetInstancesHealthStatus
s {$sel:nextToken:GetInstancesHealthStatus' :: Maybe Text
nextToken = Maybe Text
a} :: GetInstancesHealthStatus)

-- | An array that contains the IDs of all the instances that you want to get
-- the health status for.
--
-- If you omit @Instances@, Cloud Map returns the health status for all the
-- instances that are associated with the specified service.
--
-- To get the IDs for the instances that you\'ve registered by using a
-- specified service, submit a
-- <https://docs.aws.amazon.com/cloud-map/latest/api/API_ListInstances.html ListInstances>
-- request.
getInstancesHealthStatus_instances :: Lens.Lens' GetInstancesHealthStatus (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
getInstancesHealthStatus_instances :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetInstancesHealthStatus -> f GetInstancesHealthStatus
getInstancesHealthStatus_instances = (GetInstancesHealthStatus -> Maybe (NonEmpty Text))
-> (GetInstancesHealthStatus
    -> Maybe (NonEmpty Text) -> GetInstancesHealthStatus)
-> Lens
     GetInstancesHealthStatus
     GetInstancesHealthStatus
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstancesHealthStatus' {Maybe (NonEmpty Text)
instances :: Maybe (NonEmpty Text)
$sel:instances:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Maybe (NonEmpty Text)
instances} -> Maybe (NonEmpty Text)
instances) (\s :: GetInstancesHealthStatus
s@GetInstancesHealthStatus' {} Maybe (NonEmpty Text)
a -> GetInstancesHealthStatus
s {$sel:instances:GetInstancesHealthStatus' :: Maybe (NonEmpty Text)
instances = Maybe (NonEmpty Text)
a} :: GetInstancesHealthStatus) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> GetInstancesHealthStatus -> f GetInstancesHealthStatus)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetInstancesHealthStatus
-> f GetInstancesHealthStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of instances that you want Cloud Map to return in the
-- response to a @GetInstancesHealthStatus@ request. If you don\'t specify
-- a value for @MaxResults@, Cloud Map returns up to 100 instances.
getInstancesHealthStatus_maxResults :: Lens.Lens' GetInstancesHealthStatus (Prelude.Maybe Prelude.Natural)
getInstancesHealthStatus_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetInstancesHealthStatus -> f GetInstancesHealthStatus
getInstancesHealthStatus_maxResults = (GetInstancesHealthStatus -> Maybe Natural)
-> (GetInstancesHealthStatus
    -> Maybe Natural -> GetInstancesHealthStatus)
-> Lens
     GetInstancesHealthStatus
     GetInstancesHealthStatus
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstancesHealthStatus' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetInstancesHealthStatus
s@GetInstancesHealthStatus' {} Maybe Natural
a -> GetInstancesHealthStatus
s {$sel:maxResults:GetInstancesHealthStatus' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetInstancesHealthStatus)

-- | The ID of the service that the instance is associated with.
getInstancesHealthStatus_serviceId :: Lens.Lens' GetInstancesHealthStatus Prelude.Text
getInstancesHealthStatus_serviceId :: (Text -> f Text)
-> GetInstancesHealthStatus -> f GetInstancesHealthStatus
getInstancesHealthStatus_serviceId = (GetInstancesHealthStatus -> Text)
-> (GetInstancesHealthStatus -> Text -> GetInstancesHealthStatus)
-> Lens GetInstancesHealthStatus GetInstancesHealthStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstancesHealthStatus' {Text
serviceId :: Text
$sel:serviceId:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Text
serviceId} -> Text
serviceId) (\s :: GetInstancesHealthStatus
s@GetInstancesHealthStatus' {} Text
a -> GetInstancesHealthStatus
s {$sel:serviceId:GetInstancesHealthStatus' :: Text
serviceId = Text
a} :: GetInstancesHealthStatus)

instance Core.AWSRequest GetInstancesHealthStatus where
  type
    AWSResponse GetInstancesHealthStatus =
      GetInstancesHealthStatusResponse
  request :: GetInstancesHealthStatus -> Request GetInstancesHealthStatus
request = Service
-> GetInstancesHealthStatus -> Request GetInstancesHealthStatus
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetInstancesHealthStatus
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetInstancesHealthStatus)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetInstancesHealthStatus))
-> Logger
-> Service
-> Proxy GetInstancesHealthStatus
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetInstancesHealthStatus)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (HashMap Text HealthStatus)
-> Maybe Text -> Int -> GetInstancesHealthStatusResponse
GetInstancesHealthStatusResponse'
            (Maybe (HashMap Text HealthStatus)
 -> Maybe Text -> Int -> GetInstancesHealthStatusResponse)
-> Either String (Maybe (HashMap Text HealthStatus))
-> Either
     String (Maybe Text -> Int -> GetInstancesHealthStatusResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either String (Maybe (Maybe (HashMap Text HealthStatus)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status" Either String (Maybe (Maybe (HashMap Text HealthStatus)))
-> Maybe (HashMap Text HealthStatus)
-> Either String (Maybe (HashMap Text HealthStatus))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text HealthStatus)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe Text -> Int -> GetInstancesHealthStatusResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetInstancesHealthStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Int -> GetInstancesHealthStatusResponse)
-> Either String Int
-> Either String GetInstancesHealthStatusResponse
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 GetInstancesHealthStatus

instance Prelude.NFData GetInstancesHealthStatus

instance Core.ToHeaders GetInstancesHealthStatus where
  toHeaders :: GetInstancesHealthStatus -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetInstancesHealthStatus -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Route53AutoNaming_v20170314.GetInstancesHealthStatus" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetInstancesHealthStatus where
  toJSON :: GetInstancesHealthStatus -> Value
toJSON GetInstancesHealthStatus' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Text
serviceId :: Text
maxResults :: Maybe Natural
instances :: Maybe (NonEmpty Text)
nextToken :: Maybe Text
$sel:serviceId:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Text
$sel:maxResults:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Maybe Natural
$sel:instances:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Maybe (NonEmpty Text)
$sel:nextToken:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"Instances" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
instances,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServiceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceId)
          ]
      )

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

instance Core.ToQuery GetInstancesHealthStatus where
  toQuery :: GetInstancesHealthStatus -> QueryString
toQuery = QueryString -> GetInstancesHealthStatus -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetInstancesHealthStatusResponse' smart constructor.
data GetInstancesHealthStatusResponse = GetInstancesHealthStatusResponse'
  { -- | A complex type that contains the IDs and the health status of the
    -- instances that you specified in the @GetInstancesHealthStatus@ request.
    GetInstancesHealthStatusResponse
-> Maybe (HashMap Text HealthStatus)
status :: Prelude.Maybe (Prelude.HashMap Prelude.Text HealthStatus),
    -- | If more than @MaxResults@ instances match the specified criteria, you
    -- can submit another @GetInstancesHealthStatus@ request to get the next
    -- group of results. Specify the value of @NextToken@ from the previous
    -- response in the next request.
    GetInstancesHealthStatusResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetInstancesHealthStatusResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetInstancesHealthStatusResponse
-> GetInstancesHealthStatusResponse -> Bool
(GetInstancesHealthStatusResponse
 -> GetInstancesHealthStatusResponse -> Bool)
-> (GetInstancesHealthStatusResponse
    -> GetInstancesHealthStatusResponse -> Bool)
-> Eq GetInstancesHealthStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetInstancesHealthStatusResponse
-> GetInstancesHealthStatusResponse -> Bool
$c/= :: GetInstancesHealthStatusResponse
-> GetInstancesHealthStatusResponse -> Bool
== :: GetInstancesHealthStatusResponse
-> GetInstancesHealthStatusResponse -> Bool
$c== :: GetInstancesHealthStatusResponse
-> GetInstancesHealthStatusResponse -> Bool
Prelude.Eq, ReadPrec [GetInstancesHealthStatusResponse]
ReadPrec GetInstancesHealthStatusResponse
Int -> ReadS GetInstancesHealthStatusResponse
ReadS [GetInstancesHealthStatusResponse]
(Int -> ReadS GetInstancesHealthStatusResponse)
-> ReadS [GetInstancesHealthStatusResponse]
-> ReadPrec GetInstancesHealthStatusResponse
-> ReadPrec [GetInstancesHealthStatusResponse]
-> Read GetInstancesHealthStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetInstancesHealthStatusResponse]
$creadListPrec :: ReadPrec [GetInstancesHealthStatusResponse]
readPrec :: ReadPrec GetInstancesHealthStatusResponse
$creadPrec :: ReadPrec GetInstancesHealthStatusResponse
readList :: ReadS [GetInstancesHealthStatusResponse]
$creadList :: ReadS [GetInstancesHealthStatusResponse]
readsPrec :: Int -> ReadS GetInstancesHealthStatusResponse
$creadsPrec :: Int -> ReadS GetInstancesHealthStatusResponse
Prelude.Read, Int -> GetInstancesHealthStatusResponse -> ShowS
[GetInstancesHealthStatusResponse] -> ShowS
GetInstancesHealthStatusResponse -> String
(Int -> GetInstancesHealthStatusResponse -> ShowS)
-> (GetInstancesHealthStatusResponse -> String)
-> ([GetInstancesHealthStatusResponse] -> ShowS)
-> Show GetInstancesHealthStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetInstancesHealthStatusResponse] -> ShowS
$cshowList :: [GetInstancesHealthStatusResponse] -> ShowS
show :: GetInstancesHealthStatusResponse -> String
$cshow :: GetInstancesHealthStatusResponse -> String
showsPrec :: Int -> GetInstancesHealthStatusResponse -> ShowS
$cshowsPrec :: Int -> GetInstancesHealthStatusResponse -> ShowS
Prelude.Show, (forall x.
 GetInstancesHealthStatusResponse
 -> Rep GetInstancesHealthStatusResponse x)
-> (forall x.
    Rep GetInstancesHealthStatusResponse x
    -> GetInstancesHealthStatusResponse)
-> Generic GetInstancesHealthStatusResponse
forall x.
Rep GetInstancesHealthStatusResponse x
-> GetInstancesHealthStatusResponse
forall x.
GetInstancesHealthStatusResponse
-> Rep GetInstancesHealthStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetInstancesHealthStatusResponse x
-> GetInstancesHealthStatusResponse
$cfrom :: forall x.
GetInstancesHealthStatusResponse
-> Rep GetInstancesHealthStatusResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetInstancesHealthStatusResponse' 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:
--
-- 'status', 'getInstancesHealthStatusResponse_status' - A complex type that contains the IDs and the health status of the
-- instances that you specified in the @GetInstancesHealthStatus@ request.
--
-- 'nextToken', 'getInstancesHealthStatusResponse_nextToken' - If more than @MaxResults@ instances match the specified criteria, you
-- can submit another @GetInstancesHealthStatus@ request to get the next
-- group of results. Specify the value of @NextToken@ from the previous
-- response in the next request.
--
-- 'httpStatus', 'getInstancesHealthStatusResponse_httpStatus' - The response's http status code.
newGetInstancesHealthStatusResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetInstancesHealthStatusResponse
newGetInstancesHealthStatusResponse :: Int -> GetInstancesHealthStatusResponse
newGetInstancesHealthStatusResponse Int
pHttpStatus_ =
  GetInstancesHealthStatusResponse' :: Maybe (HashMap Text HealthStatus)
-> Maybe Text -> Int -> GetInstancesHealthStatusResponse
GetInstancesHealthStatusResponse'
    { $sel:status:GetInstancesHealthStatusResponse' :: Maybe (HashMap Text HealthStatus)
status =
        Maybe (HashMap Text HealthStatus)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetInstancesHealthStatusResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetInstancesHealthStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A complex type that contains the IDs and the health status of the
-- instances that you specified in the @GetInstancesHealthStatus@ request.
getInstancesHealthStatusResponse_status :: Lens.Lens' GetInstancesHealthStatusResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text HealthStatus))
getInstancesHealthStatusResponse_status :: (Maybe (HashMap Text HealthStatus)
 -> f (Maybe (HashMap Text HealthStatus)))
-> GetInstancesHealthStatusResponse
-> f GetInstancesHealthStatusResponse
getInstancesHealthStatusResponse_status = (GetInstancesHealthStatusResponse
 -> Maybe (HashMap Text HealthStatus))
-> (GetInstancesHealthStatusResponse
    -> Maybe (HashMap Text HealthStatus)
    -> GetInstancesHealthStatusResponse)
-> Lens
     GetInstancesHealthStatusResponse
     GetInstancesHealthStatusResponse
     (Maybe (HashMap Text HealthStatus))
     (Maybe (HashMap Text HealthStatus))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstancesHealthStatusResponse' {Maybe (HashMap Text HealthStatus)
status :: Maybe (HashMap Text HealthStatus)
$sel:status:GetInstancesHealthStatusResponse' :: GetInstancesHealthStatusResponse
-> Maybe (HashMap Text HealthStatus)
status} -> Maybe (HashMap Text HealthStatus)
status) (\s :: GetInstancesHealthStatusResponse
s@GetInstancesHealthStatusResponse' {} Maybe (HashMap Text HealthStatus)
a -> GetInstancesHealthStatusResponse
s {$sel:status:GetInstancesHealthStatusResponse' :: Maybe (HashMap Text HealthStatus)
status = Maybe (HashMap Text HealthStatus)
a} :: GetInstancesHealthStatusResponse) ((Maybe (HashMap Text HealthStatus)
  -> f (Maybe (HashMap Text HealthStatus)))
 -> GetInstancesHealthStatusResponse
 -> f GetInstancesHealthStatusResponse)
-> ((Maybe (HashMap Text HealthStatus)
     -> f (Maybe (HashMap Text HealthStatus)))
    -> Maybe (HashMap Text HealthStatus)
    -> f (Maybe (HashMap Text HealthStatus)))
-> (Maybe (HashMap Text HealthStatus)
    -> f (Maybe (HashMap Text HealthStatus)))
-> GetInstancesHealthStatusResponse
-> f GetInstancesHealthStatusResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text HealthStatus)
  (HashMap Text HealthStatus)
  (HashMap Text HealthStatus)
  (HashMap Text HealthStatus)
-> Iso
     (Maybe (HashMap Text HealthStatus))
     (Maybe (HashMap Text HealthStatus))
     (Maybe (HashMap Text HealthStatus))
     (Maybe (HashMap Text HealthStatus))
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
  (HashMap Text HealthStatus)
  (HashMap Text HealthStatus)
  (HashMap Text HealthStatus)
  (HashMap Text HealthStatus)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If more than @MaxResults@ instances match the specified criteria, you
-- can submit another @GetInstancesHealthStatus@ request to get the next
-- group of results. Specify the value of @NextToken@ from the previous
-- response in the next request.
getInstancesHealthStatusResponse_nextToken :: Lens.Lens' GetInstancesHealthStatusResponse (Prelude.Maybe Prelude.Text)
getInstancesHealthStatusResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetInstancesHealthStatusResponse
-> f GetInstancesHealthStatusResponse
getInstancesHealthStatusResponse_nextToken = (GetInstancesHealthStatusResponse -> Maybe Text)
-> (GetInstancesHealthStatusResponse
    -> Maybe Text -> GetInstancesHealthStatusResponse)
-> Lens
     GetInstancesHealthStatusResponse
     GetInstancesHealthStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstancesHealthStatusResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetInstancesHealthStatusResponse' :: GetInstancesHealthStatusResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetInstancesHealthStatusResponse
s@GetInstancesHealthStatusResponse' {} Maybe Text
a -> GetInstancesHealthStatusResponse
s {$sel:nextToken:GetInstancesHealthStatusResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetInstancesHealthStatusResponse)

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

instance
  Prelude.NFData
    GetInstancesHealthStatusResponse