{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_instances,
    getInstancesHealthStatus_maxResults,
    getInstancesHealthStatus_nextToken,
    getInstancesHealthStatus_serviceId,

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

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

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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53AutoNaming.Types

-- | /See:/ 'newGetInstancesHealthStatus' smart constructor.
data GetInstancesHealthStatus = 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 -> 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,
    -- | 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,
    -- | The ID of the service that the instance is associated with.
    GetInstancesHealthStatus -> Text
serviceId :: Prelude.Text
  }
  deriving (GetInstancesHealthStatus -> GetInstancesHealthStatus -> Bool
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]
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
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.
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:
--
-- '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.
--
-- '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.
--
-- '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'
    { $sel:instances:GetInstancesHealthStatus' :: Maybe (NonEmpty Text)
instances =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetInstancesHealthStatus' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetInstancesHealthStatus' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceId:GetInstancesHealthStatus' :: Text
serviceId = Text
pServiceId_
    }

-- | 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 :: Lens' GetInstancesHealthStatus (Maybe (NonEmpty Text))
getInstancesHealthStatus_instances = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' GetInstancesHealthStatus (Maybe Natural)
getInstancesHealthStatus_maxResults = 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)

-- | 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 :: Lens' GetInstancesHealthStatus (Maybe Text)
getInstancesHealthStatus_nextToken = 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)

-- | The ID of the service that the instance is associated with.
getInstancesHealthStatus_serviceId :: Lens.Lens' GetInstancesHealthStatus Prelude.Text
getInstancesHealthStatus_serviceId :: Lens' GetInstancesHealthStatus Text
getInstancesHealthStatus_serviceId = 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 :: (Service -> Service)
-> GetInstancesHealthStatus -> Request GetInstancesHealthStatus
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetInstancesHealthStatus
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetInstancesHealthStatus)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe (HashMap Text HealthStatus)
-> Int
-> GetInstancesHealthStatusResponse
GetInstancesHealthStatusResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Status" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetInstancesHealthStatus where
  hashWithSalt :: Int -> GetInstancesHealthStatus -> Int
hashWithSalt Int
_salt GetInstancesHealthStatus' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Text
serviceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
instances :: Maybe (NonEmpty Text)
$sel:serviceId:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Text
$sel:nextToken:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Maybe Text
$sel:maxResults:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Maybe Natural
$sel:instances:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Maybe (NonEmpty Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
instances
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceId

instance Prelude.NFData GetInstancesHealthStatus where
  rnf :: GetInstancesHealthStatus -> ()
rnf GetInstancesHealthStatus' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Text
serviceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
instances :: Maybe (NonEmpty Text)
$sel:serviceId:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Text
$sel:nextToken:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Maybe Text
$sel:maxResults:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Maybe Natural
$sel:instances:GetInstancesHealthStatus' :: GetInstancesHealthStatus -> Maybe (NonEmpty Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
instances
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serviceId

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

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

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

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

-- | /See:/ 'newGetInstancesHealthStatusResponse' smart constructor.
data GetInstancesHealthStatusResponse = GetInstancesHealthStatusResponse'
  { -- | 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,
    -- | 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),
    -- | The response's http status code.
    GetInstancesHealthStatusResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetInstancesHealthStatusResponse
-> GetInstancesHealthStatusResponse -> Bool
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]
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
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.
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:
--
-- '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.
--
-- 'status', 'getInstancesHealthStatusResponse_status' - A complex type that contains the IDs and the health status of the
-- instances that you specified in the @GetInstancesHealthStatus@ request.
--
-- 'httpStatus', 'getInstancesHealthStatusResponse_httpStatus' - The response's http status code.
newGetInstancesHealthStatusResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetInstancesHealthStatusResponse
newGetInstancesHealthStatusResponse :: Int -> GetInstancesHealthStatusResponse
newGetInstancesHealthStatusResponse Int
pHttpStatus_ =
  GetInstancesHealthStatusResponse'
    { $sel:nextToken:GetInstancesHealthStatusResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:status:GetInstancesHealthStatusResponse' :: Maybe (HashMap Text HealthStatus)
status = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetInstancesHealthStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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 :: Lens' GetInstancesHealthStatusResponse (Maybe Text)
getInstancesHealthStatusResponse_nextToken = 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)

-- | 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 :: Lens'
  GetInstancesHealthStatusResponse
  (Maybe (HashMap Text HealthStatus))
getInstancesHealthStatusResponse_status = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
getInstancesHealthStatusResponse_httpStatus :: Lens.Lens' GetInstancesHealthStatusResponse Prelude.Int
getInstancesHealthStatusResponse_httpStatus :: Lens' GetInstancesHealthStatusResponse Int
getInstancesHealthStatusResponse_httpStatus = 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
  where
  rnf :: GetInstancesHealthStatusResponse -> ()
rnf GetInstancesHealthStatusResponse' {Int
Maybe Text
Maybe (HashMap Text HealthStatus)
httpStatus :: Int
status :: Maybe (HashMap Text HealthStatus)
nextToken :: Maybe Text
$sel:httpStatus:GetInstancesHealthStatusResponse' :: GetInstancesHealthStatusResponse -> Int
$sel:status:GetInstancesHealthStatusResponse' :: GetInstancesHealthStatusResponse
-> Maybe (HashMap Text HealthStatus)
$sel:nextToken:GetInstancesHealthStatusResponse' :: GetInstancesHealthStatusResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text HealthStatus)
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus