{-# 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.Route53RecoveryReadiness.GetRecoveryGroupReadinessSummary
-- 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)
--
-- Returns information about a Recovery Group.
--
-- This operation returns paginated results.
module Amazonka.Route53RecoveryReadiness.GetRecoveryGroupReadinessSummary
  ( -- * Creating a Request
    GetRecoveryGroupReadinessSummary (..),
    newGetRecoveryGroupReadinessSummary,

    -- * Request Lenses
    getRecoveryGroupReadinessSummary_nextToken,
    getRecoveryGroupReadinessSummary_maxResults,
    getRecoveryGroupReadinessSummary_recoveryGroupName,

    -- * Destructuring the Response
    GetRecoveryGroupReadinessSummaryResponse (..),
    newGetRecoveryGroupReadinessSummaryResponse,

    -- * Response Lenses
    getRecoveryGroupReadinessSummaryResponse_readinessChecks,
    getRecoveryGroupReadinessSummaryResponse_readiness,
    getRecoveryGroupReadinessSummaryResponse_nextToken,
    getRecoveryGroupReadinessSummaryResponse_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.Route53RecoveryReadiness.Types

-- | /See:/ 'newGetRecoveryGroupReadinessSummary' smart constructor.
data GetRecoveryGroupReadinessSummary = GetRecoveryGroupReadinessSummary'
  { -- | A token used to resume pagination from the end of a previous request.
    GetRecoveryGroupReadinessSummary -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Upper bound on number of records to return.
    GetRecoveryGroupReadinessSummary -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the RecoveryGroup
    GetRecoveryGroupReadinessSummary -> Text
recoveryGroupName :: Prelude.Text
  }
  deriving (GetRecoveryGroupReadinessSummary
-> GetRecoveryGroupReadinessSummary -> Bool
(GetRecoveryGroupReadinessSummary
 -> GetRecoveryGroupReadinessSummary -> Bool)
-> (GetRecoveryGroupReadinessSummary
    -> GetRecoveryGroupReadinessSummary -> Bool)
-> Eq GetRecoveryGroupReadinessSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRecoveryGroupReadinessSummary
-> GetRecoveryGroupReadinessSummary -> Bool
$c/= :: GetRecoveryGroupReadinessSummary
-> GetRecoveryGroupReadinessSummary -> Bool
== :: GetRecoveryGroupReadinessSummary
-> GetRecoveryGroupReadinessSummary -> Bool
$c== :: GetRecoveryGroupReadinessSummary
-> GetRecoveryGroupReadinessSummary -> Bool
Prelude.Eq, ReadPrec [GetRecoveryGroupReadinessSummary]
ReadPrec GetRecoveryGroupReadinessSummary
Int -> ReadS GetRecoveryGroupReadinessSummary
ReadS [GetRecoveryGroupReadinessSummary]
(Int -> ReadS GetRecoveryGroupReadinessSummary)
-> ReadS [GetRecoveryGroupReadinessSummary]
-> ReadPrec GetRecoveryGroupReadinessSummary
-> ReadPrec [GetRecoveryGroupReadinessSummary]
-> Read GetRecoveryGroupReadinessSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRecoveryGroupReadinessSummary]
$creadListPrec :: ReadPrec [GetRecoveryGroupReadinessSummary]
readPrec :: ReadPrec GetRecoveryGroupReadinessSummary
$creadPrec :: ReadPrec GetRecoveryGroupReadinessSummary
readList :: ReadS [GetRecoveryGroupReadinessSummary]
$creadList :: ReadS [GetRecoveryGroupReadinessSummary]
readsPrec :: Int -> ReadS GetRecoveryGroupReadinessSummary
$creadsPrec :: Int -> ReadS GetRecoveryGroupReadinessSummary
Prelude.Read, Int -> GetRecoveryGroupReadinessSummary -> ShowS
[GetRecoveryGroupReadinessSummary] -> ShowS
GetRecoveryGroupReadinessSummary -> String
(Int -> GetRecoveryGroupReadinessSummary -> ShowS)
-> (GetRecoveryGroupReadinessSummary -> String)
-> ([GetRecoveryGroupReadinessSummary] -> ShowS)
-> Show GetRecoveryGroupReadinessSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRecoveryGroupReadinessSummary] -> ShowS
$cshowList :: [GetRecoveryGroupReadinessSummary] -> ShowS
show :: GetRecoveryGroupReadinessSummary -> String
$cshow :: GetRecoveryGroupReadinessSummary -> String
showsPrec :: Int -> GetRecoveryGroupReadinessSummary -> ShowS
$cshowsPrec :: Int -> GetRecoveryGroupReadinessSummary -> ShowS
Prelude.Show, (forall x.
 GetRecoveryGroupReadinessSummary
 -> Rep GetRecoveryGroupReadinessSummary x)
-> (forall x.
    Rep GetRecoveryGroupReadinessSummary x
    -> GetRecoveryGroupReadinessSummary)
-> Generic GetRecoveryGroupReadinessSummary
forall x.
Rep GetRecoveryGroupReadinessSummary x
-> GetRecoveryGroupReadinessSummary
forall x.
GetRecoveryGroupReadinessSummary
-> Rep GetRecoveryGroupReadinessSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRecoveryGroupReadinessSummary x
-> GetRecoveryGroupReadinessSummary
$cfrom :: forall x.
GetRecoveryGroupReadinessSummary
-> Rep GetRecoveryGroupReadinessSummary x
Prelude.Generic)

-- |
-- Create a value of 'GetRecoveryGroupReadinessSummary' 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', 'getRecoveryGroupReadinessSummary_nextToken' - A token used to resume pagination from the end of a previous request.
--
-- 'maxResults', 'getRecoveryGroupReadinessSummary_maxResults' - Upper bound on number of records to return.
--
-- 'recoveryGroupName', 'getRecoveryGroupReadinessSummary_recoveryGroupName' - The name of the RecoveryGroup
newGetRecoveryGroupReadinessSummary ::
  -- | 'recoveryGroupName'
  Prelude.Text ->
  GetRecoveryGroupReadinessSummary
newGetRecoveryGroupReadinessSummary :: Text -> GetRecoveryGroupReadinessSummary
newGetRecoveryGroupReadinessSummary
  Text
pRecoveryGroupName_ =
    GetRecoveryGroupReadinessSummary' :: Maybe Text
-> Maybe Natural -> Text -> GetRecoveryGroupReadinessSummary
GetRecoveryGroupReadinessSummary'
      { $sel:nextToken:GetRecoveryGroupReadinessSummary' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:GetRecoveryGroupReadinessSummary' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:recoveryGroupName:GetRecoveryGroupReadinessSummary' :: Text
recoveryGroupName = Text
pRecoveryGroupName_
      }

-- | A token used to resume pagination from the end of a previous request.
getRecoveryGroupReadinessSummary_nextToken :: Lens.Lens' GetRecoveryGroupReadinessSummary (Prelude.Maybe Prelude.Text)
getRecoveryGroupReadinessSummary_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetRecoveryGroupReadinessSummary
-> f GetRecoveryGroupReadinessSummary
getRecoveryGroupReadinessSummary_nextToken = (GetRecoveryGroupReadinessSummary -> Maybe Text)
-> (GetRecoveryGroupReadinessSummary
    -> Maybe Text -> GetRecoveryGroupReadinessSummary)
-> Lens
     GetRecoveryGroupReadinessSummary
     GetRecoveryGroupReadinessSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecoveryGroupReadinessSummary' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetRecoveryGroupReadinessSummary' :: GetRecoveryGroupReadinessSummary -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetRecoveryGroupReadinessSummary
s@GetRecoveryGroupReadinessSummary' {} Maybe Text
a -> GetRecoveryGroupReadinessSummary
s {$sel:nextToken:GetRecoveryGroupReadinessSummary' :: Maybe Text
nextToken = Maybe Text
a} :: GetRecoveryGroupReadinessSummary)

-- | Upper bound on number of records to return.
getRecoveryGroupReadinessSummary_maxResults :: Lens.Lens' GetRecoveryGroupReadinessSummary (Prelude.Maybe Prelude.Natural)
getRecoveryGroupReadinessSummary_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetRecoveryGroupReadinessSummary
-> f GetRecoveryGroupReadinessSummary
getRecoveryGroupReadinessSummary_maxResults = (GetRecoveryGroupReadinessSummary -> Maybe Natural)
-> (GetRecoveryGroupReadinessSummary
    -> Maybe Natural -> GetRecoveryGroupReadinessSummary)
-> Lens
     GetRecoveryGroupReadinessSummary
     GetRecoveryGroupReadinessSummary
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecoveryGroupReadinessSummary' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetRecoveryGroupReadinessSummary' :: GetRecoveryGroupReadinessSummary -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetRecoveryGroupReadinessSummary
s@GetRecoveryGroupReadinessSummary' {} Maybe Natural
a -> GetRecoveryGroupReadinessSummary
s {$sel:maxResults:GetRecoveryGroupReadinessSummary' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetRecoveryGroupReadinessSummary)

-- | The name of the RecoveryGroup
getRecoveryGroupReadinessSummary_recoveryGroupName :: Lens.Lens' GetRecoveryGroupReadinessSummary Prelude.Text
getRecoveryGroupReadinessSummary_recoveryGroupName :: (Text -> f Text)
-> GetRecoveryGroupReadinessSummary
-> f GetRecoveryGroupReadinessSummary
getRecoveryGroupReadinessSummary_recoveryGroupName = (GetRecoveryGroupReadinessSummary -> Text)
-> (GetRecoveryGroupReadinessSummary
    -> Text -> GetRecoveryGroupReadinessSummary)
-> Lens
     GetRecoveryGroupReadinessSummary
     GetRecoveryGroupReadinessSummary
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecoveryGroupReadinessSummary' {Text
recoveryGroupName :: Text
$sel:recoveryGroupName:GetRecoveryGroupReadinessSummary' :: GetRecoveryGroupReadinessSummary -> Text
recoveryGroupName} -> Text
recoveryGroupName) (\s :: GetRecoveryGroupReadinessSummary
s@GetRecoveryGroupReadinessSummary' {} Text
a -> GetRecoveryGroupReadinessSummary
s {$sel:recoveryGroupName:GetRecoveryGroupReadinessSummary' :: Text
recoveryGroupName = Text
a} :: GetRecoveryGroupReadinessSummary)

instance
  Core.AWSPager
    GetRecoveryGroupReadinessSummary
  where
  page :: GetRecoveryGroupReadinessSummary
-> AWSResponse GetRecoveryGroupReadinessSummary
-> Maybe GetRecoveryGroupReadinessSummary
page GetRecoveryGroupReadinessSummary
rq AWSResponse GetRecoveryGroupReadinessSummary
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetRecoveryGroupReadinessSummary
GetRecoveryGroupReadinessSummaryResponse
rs
            GetRecoveryGroupReadinessSummaryResponse
-> Getting
     (First Text) GetRecoveryGroupReadinessSummaryResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetRecoveryGroupReadinessSummaryResponse
-> Const (First Text) GetRecoveryGroupReadinessSummaryResponse
Lens' GetRecoveryGroupReadinessSummaryResponse (Maybe Text)
getRecoveryGroupReadinessSummaryResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetRecoveryGroupReadinessSummaryResponse
 -> Const (First Text) GetRecoveryGroupReadinessSummaryResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) GetRecoveryGroupReadinessSummaryResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetRecoveryGroupReadinessSummary
forall a. Maybe a
Prelude.Nothing
    | Maybe [ReadinessCheckSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetRecoveryGroupReadinessSummary
GetRecoveryGroupReadinessSummaryResponse
rs
            GetRecoveryGroupReadinessSummaryResponse
-> Getting
     (First [ReadinessCheckSummary])
     GetRecoveryGroupReadinessSummaryResponse
     [ReadinessCheckSummary]
-> Maybe [ReadinessCheckSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ReadinessCheckSummary]
 -> Const
      (First [ReadinessCheckSummary]) (Maybe [ReadinessCheckSummary]))
-> GetRecoveryGroupReadinessSummaryResponse
-> Const
     (First [ReadinessCheckSummary])
     GetRecoveryGroupReadinessSummaryResponse
Lens'
  GetRecoveryGroupReadinessSummaryResponse
  (Maybe [ReadinessCheckSummary])
getRecoveryGroupReadinessSummaryResponse_readinessChecks
              ((Maybe [ReadinessCheckSummary]
  -> Const
       (First [ReadinessCheckSummary]) (Maybe [ReadinessCheckSummary]))
 -> GetRecoveryGroupReadinessSummaryResponse
 -> Const
      (First [ReadinessCheckSummary])
      GetRecoveryGroupReadinessSummaryResponse)
-> (([ReadinessCheckSummary]
     -> Const (First [ReadinessCheckSummary]) [ReadinessCheckSummary])
    -> Maybe [ReadinessCheckSummary]
    -> Const
         (First [ReadinessCheckSummary]) (Maybe [ReadinessCheckSummary]))
-> Getting
     (First [ReadinessCheckSummary])
     GetRecoveryGroupReadinessSummaryResponse
     [ReadinessCheckSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ReadinessCheckSummary]
 -> Const (First [ReadinessCheckSummary]) [ReadinessCheckSummary])
-> Maybe [ReadinessCheckSummary]
-> Const
     (First [ReadinessCheckSummary]) (Maybe [ReadinessCheckSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetRecoveryGroupReadinessSummary
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetRecoveryGroupReadinessSummary
-> Maybe GetRecoveryGroupReadinessSummary
forall a. a -> Maybe a
Prelude.Just (GetRecoveryGroupReadinessSummary
 -> Maybe GetRecoveryGroupReadinessSummary)
-> GetRecoveryGroupReadinessSummary
-> Maybe GetRecoveryGroupReadinessSummary
forall a b. (a -> b) -> a -> b
Prelude.$
        GetRecoveryGroupReadinessSummary
rq
          GetRecoveryGroupReadinessSummary
-> (GetRecoveryGroupReadinessSummary
    -> GetRecoveryGroupReadinessSummary)
-> GetRecoveryGroupReadinessSummary
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetRecoveryGroupReadinessSummary
-> Identity GetRecoveryGroupReadinessSummary
Lens
  GetRecoveryGroupReadinessSummary
  GetRecoveryGroupReadinessSummary
  (Maybe Text)
  (Maybe Text)
getRecoveryGroupReadinessSummary_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetRecoveryGroupReadinessSummary
 -> Identity GetRecoveryGroupReadinessSummary)
-> Maybe Text
-> GetRecoveryGroupReadinessSummary
-> GetRecoveryGroupReadinessSummary
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetRecoveryGroupReadinessSummary
GetRecoveryGroupReadinessSummaryResponse
rs
          GetRecoveryGroupReadinessSummaryResponse
-> Getting
     (First Text) GetRecoveryGroupReadinessSummaryResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetRecoveryGroupReadinessSummaryResponse
-> Const (First Text) GetRecoveryGroupReadinessSummaryResponse
Lens' GetRecoveryGroupReadinessSummaryResponse (Maybe Text)
getRecoveryGroupReadinessSummaryResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetRecoveryGroupReadinessSummaryResponse
 -> Const (First Text) GetRecoveryGroupReadinessSummaryResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) GetRecoveryGroupReadinessSummaryResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    GetRecoveryGroupReadinessSummary
  where
  type
    AWSResponse GetRecoveryGroupReadinessSummary =
      GetRecoveryGroupReadinessSummaryResponse
  request :: GetRecoveryGroupReadinessSummary
-> Request GetRecoveryGroupReadinessSummary
request = Service
-> GetRecoveryGroupReadinessSummary
-> Request GetRecoveryGroupReadinessSummary
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetRecoveryGroupReadinessSummary
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetRecoveryGroupReadinessSummary)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetRecoveryGroupReadinessSummary))
-> Logger
-> Service
-> Proxy GetRecoveryGroupReadinessSummary
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetRecoveryGroupReadinessSummary)))
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 [ReadinessCheckSummary]
-> Maybe Readiness
-> Maybe Text
-> Int
-> GetRecoveryGroupReadinessSummaryResponse
GetRecoveryGroupReadinessSummaryResponse'
            (Maybe [ReadinessCheckSummary]
 -> Maybe Readiness
 -> Maybe Text
 -> Int
 -> GetRecoveryGroupReadinessSummaryResponse)
-> Either String (Maybe [ReadinessCheckSummary])
-> Either
     String
     (Maybe Readiness
      -> Maybe Text -> Int -> GetRecoveryGroupReadinessSummaryResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ReadinessCheckSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"readinessChecks"
                            Either String (Maybe (Maybe [ReadinessCheckSummary]))
-> Maybe [ReadinessCheckSummary]
-> Either String (Maybe [ReadinessCheckSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ReadinessCheckSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Readiness
   -> Maybe Text -> Int -> GetRecoveryGroupReadinessSummaryResponse)
-> Either String (Maybe Readiness)
-> Either
     String
     (Maybe Text -> Int -> GetRecoveryGroupReadinessSummaryResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Readiness)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"readiness")
            Either
  String
  (Maybe Text -> Int -> GetRecoveryGroupReadinessSummaryResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetRecoveryGroupReadinessSummaryResponse)
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 -> GetRecoveryGroupReadinessSummaryResponse)
-> Either String Int
-> Either String GetRecoveryGroupReadinessSummaryResponse
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
    GetRecoveryGroupReadinessSummary

instance
  Prelude.NFData
    GetRecoveryGroupReadinessSummary

instance
  Core.ToHeaders
    GetRecoveryGroupReadinessSummary
  where
  toHeaders :: GetRecoveryGroupReadinessSummary -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> GetRecoveryGroupReadinessSummary -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath GetRecoveryGroupReadinessSummary where
  toPath :: GetRecoveryGroupReadinessSummary -> ByteString
toPath GetRecoveryGroupReadinessSummary' {Maybe Natural
Maybe Text
Text
recoveryGroupName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:recoveryGroupName:GetRecoveryGroupReadinessSummary' :: GetRecoveryGroupReadinessSummary -> Text
$sel:maxResults:GetRecoveryGroupReadinessSummary' :: GetRecoveryGroupReadinessSummary -> Maybe Natural
$sel:nextToken:GetRecoveryGroupReadinessSummary' :: GetRecoveryGroupReadinessSummary -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/recoverygroupreadiness/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
recoveryGroupName
      ]

instance
  Core.ToQuery
    GetRecoveryGroupReadinessSummary
  where
  toQuery :: GetRecoveryGroupReadinessSummary -> QueryString
toQuery GetRecoveryGroupReadinessSummary' {Maybe Natural
Maybe Text
Text
recoveryGroupName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:recoveryGroupName:GetRecoveryGroupReadinessSummary' :: GetRecoveryGroupReadinessSummary -> Text
$sel:maxResults:GetRecoveryGroupReadinessSummary' :: GetRecoveryGroupReadinessSummary -> Maybe Natural
$sel:nextToken:GetRecoveryGroupReadinessSummary' :: GetRecoveryGroupReadinessSummary -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newGetRecoveryGroupReadinessSummaryResponse' smart constructor.
data GetRecoveryGroupReadinessSummaryResponse = GetRecoveryGroupReadinessSummaryResponse'
  { -- | Summaries for the ReadinessChecks making up the RecoveryGroup
    GetRecoveryGroupReadinessSummaryResponse
-> Maybe [ReadinessCheckSummary]
readinessChecks :: Prelude.Maybe [ReadinessCheckSummary],
    -- | The readiness at RecoveryGroup level.
    GetRecoveryGroupReadinessSummaryResponse -> Maybe Readiness
readiness :: Prelude.Maybe Readiness,
    -- | A token that can be used to resume pagination from the end of the
    -- collection.
    GetRecoveryGroupReadinessSummaryResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetRecoveryGroupReadinessSummaryResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRecoveryGroupReadinessSummaryResponse
-> GetRecoveryGroupReadinessSummaryResponse -> Bool
(GetRecoveryGroupReadinessSummaryResponse
 -> GetRecoveryGroupReadinessSummaryResponse -> Bool)
-> (GetRecoveryGroupReadinessSummaryResponse
    -> GetRecoveryGroupReadinessSummaryResponse -> Bool)
-> Eq GetRecoveryGroupReadinessSummaryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRecoveryGroupReadinessSummaryResponse
-> GetRecoveryGroupReadinessSummaryResponse -> Bool
$c/= :: GetRecoveryGroupReadinessSummaryResponse
-> GetRecoveryGroupReadinessSummaryResponse -> Bool
== :: GetRecoveryGroupReadinessSummaryResponse
-> GetRecoveryGroupReadinessSummaryResponse -> Bool
$c== :: GetRecoveryGroupReadinessSummaryResponse
-> GetRecoveryGroupReadinessSummaryResponse -> Bool
Prelude.Eq, ReadPrec [GetRecoveryGroupReadinessSummaryResponse]
ReadPrec GetRecoveryGroupReadinessSummaryResponse
Int -> ReadS GetRecoveryGroupReadinessSummaryResponse
ReadS [GetRecoveryGroupReadinessSummaryResponse]
(Int -> ReadS GetRecoveryGroupReadinessSummaryResponse)
-> ReadS [GetRecoveryGroupReadinessSummaryResponse]
-> ReadPrec GetRecoveryGroupReadinessSummaryResponse
-> ReadPrec [GetRecoveryGroupReadinessSummaryResponse]
-> Read GetRecoveryGroupReadinessSummaryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRecoveryGroupReadinessSummaryResponse]
$creadListPrec :: ReadPrec [GetRecoveryGroupReadinessSummaryResponse]
readPrec :: ReadPrec GetRecoveryGroupReadinessSummaryResponse
$creadPrec :: ReadPrec GetRecoveryGroupReadinessSummaryResponse
readList :: ReadS [GetRecoveryGroupReadinessSummaryResponse]
$creadList :: ReadS [GetRecoveryGroupReadinessSummaryResponse]
readsPrec :: Int -> ReadS GetRecoveryGroupReadinessSummaryResponse
$creadsPrec :: Int -> ReadS GetRecoveryGroupReadinessSummaryResponse
Prelude.Read, Int -> GetRecoveryGroupReadinessSummaryResponse -> ShowS
[GetRecoveryGroupReadinessSummaryResponse] -> ShowS
GetRecoveryGroupReadinessSummaryResponse -> String
(Int -> GetRecoveryGroupReadinessSummaryResponse -> ShowS)
-> (GetRecoveryGroupReadinessSummaryResponse -> String)
-> ([GetRecoveryGroupReadinessSummaryResponse] -> ShowS)
-> Show GetRecoveryGroupReadinessSummaryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRecoveryGroupReadinessSummaryResponse] -> ShowS
$cshowList :: [GetRecoveryGroupReadinessSummaryResponse] -> ShowS
show :: GetRecoveryGroupReadinessSummaryResponse -> String
$cshow :: GetRecoveryGroupReadinessSummaryResponse -> String
showsPrec :: Int -> GetRecoveryGroupReadinessSummaryResponse -> ShowS
$cshowsPrec :: Int -> GetRecoveryGroupReadinessSummaryResponse -> ShowS
Prelude.Show, (forall x.
 GetRecoveryGroupReadinessSummaryResponse
 -> Rep GetRecoveryGroupReadinessSummaryResponse x)
-> (forall x.
    Rep GetRecoveryGroupReadinessSummaryResponse x
    -> GetRecoveryGroupReadinessSummaryResponse)
-> Generic GetRecoveryGroupReadinessSummaryResponse
forall x.
Rep GetRecoveryGroupReadinessSummaryResponse x
-> GetRecoveryGroupReadinessSummaryResponse
forall x.
GetRecoveryGroupReadinessSummaryResponse
-> Rep GetRecoveryGroupReadinessSummaryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRecoveryGroupReadinessSummaryResponse x
-> GetRecoveryGroupReadinessSummaryResponse
$cfrom :: forall x.
GetRecoveryGroupReadinessSummaryResponse
-> Rep GetRecoveryGroupReadinessSummaryResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRecoveryGroupReadinessSummaryResponse' 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:
--
-- 'readinessChecks', 'getRecoveryGroupReadinessSummaryResponse_readinessChecks' - Summaries for the ReadinessChecks making up the RecoveryGroup
--
-- 'readiness', 'getRecoveryGroupReadinessSummaryResponse_readiness' - The readiness at RecoveryGroup level.
--
-- 'nextToken', 'getRecoveryGroupReadinessSummaryResponse_nextToken' - A token that can be used to resume pagination from the end of the
-- collection.
--
-- 'httpStatus', 'getRecoveryGroupReadinessSummaryResponse_httpStatus' - The response's http status code.
newGetRecoveryGroupReadinessSummaryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRecoveryGroupReadinessSummaryResponse
newGetRecoveryGroupReadinessSummaryResponse :: Int -> GetRecoveryGroupReadinessSummaryResponse
newGetRecoveryGroupReadinessSummaryResponse
  Int
pHttpStatus_ =
    GetRecoveryGroupReadinessSummaryResponse' :: Maybe [ReadinessCheckSummary]
-> Maybe Readiness
-> Maybe Text
-> Int
-> GetRecoveryGroupReadinessSummaryResponse
GetRecoveryGroupReadinessSummaryResponse'
      { $sel:readinessChecks:GetRecoveryGroupReadinessSummaryResponse' :: Maybe [ReadinessCheckSummary]
readinessChecks =
          Maybe [ReadinessCheckSummary]
forall a. Maybe a
Prelude.Nothing,
        $sel:readiness:GetRecoveryGroupReadinessSummaryResponse' :: Maybe Readiness
readiness = Maybe Readiness
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetRecoveryGroupReadinessSummaryResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetRecoveryGroupReadinessSummaryResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Summaries for the ReadinessChecks making up the RecoveryGroup
getRecoveryGroupReadinessSummaryResponse_readinessChecks :: Lens.Lens' GetRecoveryGroupReadinessSummaryResponse (Prelude.Maybe [ReadinessCheckSummary])
getRecoveryGroupReadinessSummaryResponse_readinessChecks :: (Maybe [ReadinessCheckSummary]
 -> f (Maybe [ReadinessCheckSummary]))
-> GetRecoveryGroupReadinessSummaryResponse
-> f GetRecoveryGroupReadinessSummaryResponse
getRecoveryGroupReadinessSummaryResponse_readinessChecks = (GetRecoveryGroupReadinessSummaryResponse
 -> Maybe [ReadinessCheckSummary])
-> (GetRecoveryGroupReadinessSummaryResponse
    -> Maybe [ReadinessCheckSummary]
    -> GetRecoveryGroupReadinessSummaryResponse)
-> Lens'
     GetRecoveryGroupReadinessSummaryResponse
     (Maybe [ReadinessCheckSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecoveryGroupReadinessSummaryResponse' {Maybe [ReadinessCheckSummary]
readinessChecks :: Maybe [ReadinessCheckSummary]
$sel:readinessChecks:GetRecoveryGroupReadinessSummaryResponse' :: GetRecoveryGroupReadinessSummaryResponse
-> Maybe [ReadinessCheckSummary]
readinessChecks} -> Maybe [ReadinessCheckSummary]
readinessChecks) (\s :: GetRecoveryGroupReadinessSummaryResponse
s@GetRecoveryGroupReadinessSummaryResponse' {} Maybe [ReadinessCheckSummary]
a -> GetRecoveryGroupReadinessSummaryResponse
s {$sel:readinessChecks:GetRecoveryGroupReadinessSummaryResponse' :: Maybe [ReadinessCheckSummary]
readinessChecks = Maybe [ReadinessCheckSummary]
a} :: GetRecoveryGroupReadinessSummaryResponse) ((Maybe [ReadinessCheckSummary]
  -> f (Maybe [ReadinessCheckSummary]))
 -> GetRecoveryGroupReadinessSummaryResponse
 -> f GetRecoveryGroupReadinessSummaryResponse)
-> ((Maybe [ReadinessCheckSummary]
     -> f (Maybe [ReadinessCheckSummary]))
    -> Maybe [ReadinessCheckSummary]
    -> f (Maybe [ReadinessCheckSummary]))
-> (Maybe [ReadinessCheckSummary]
    -> f (Maybe [ReadinessCheckSummary]))
-> GetRecoveryGroupReadinessSummaryResponse
-> f GetRecoveryGroupReadinessSummaryResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ReadinessCheckSummary]
  [ReadinessCheckSummary]
  [ReadinessCheckSummary]
  [ReadinessCheckSummary]
-> Iso
     (Maybe [ReadinessCheckSummary])
     (Maybe [ReadinessCheckSummary])
     (Maybe [ReadinessCheckSummary])
     (Maybe [ReadinessCheckSummary])
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
  [ReadinessCheckSummary]
  [ReadinessCheckSummary]
  [ReadinessCheckSummary]
  [ReadinessCheckSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The readiness at RecoveryGroup level.
getRecoveryGroupReadinessSummaryResponse_readiness :: Lens.Lens' GetRecoveryGroupReadinessSummaryResponse (Prelude.Maybe Readiness)
getRecoveryGroupReadinessSummaryResponse_readiness :: (Maybe Readiness -> f (Maybe Readiness))
-> GetRecoveryGroupReadinessSummaryResponse
-> f GetRecoveryGroupReadinessSummaryResponse
getRecoveryGroupReadinessSummaryResponse_readiness = (GetRecoveryGroupReadinessSummaryResponse -> Maybe Readiness)
-> (GetRecoveryGroupReadinessSummaryResponse
    -> Maybe Readiness -> GetRecoveryGroupReadinessSummaryResponse)
-> Lens
     GetRecoveryGroupReadinessSummaryResponse
     GetRecoveryGroupReadinessSummaryResponse
     (Maybe Readiness)
     (Maybe Readiness)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecoveryGroupReadinessSummaryResponse' {Maybe Readiness
readiness :: Maybe Readiness
$sel:readiness:GetRecoveryGroupReadinessSummaryResponse' :: GetRecoveryGroupReadinessSummaryResponse -> Maybe Readiness
readiness} -> Maybe Readiness
readiness) (\s :: GetRecoveryGroupReadinessSummaryResponse
s@GetRecoveryGroupReadinessSummaryResponse' {} Maybe Readiness
a -> GetRecoveryGroupReadinessSummaryResponse
s {$sel:readiness:GetRecoveryGroupReadinessSummaryResponse' :: Maybe Readiness
readiness = Maybe Readiness
a} :: GetRecoveryGroupReadinessSummaryResponse)

-- | A token that can be used to resume pagination from the end of the
-- collection.
getRecoveryGroupReadinessSummaryResponse_nextToken :: Lens.Lens' GetRecoveryGroupReadinessSummaryResponse (Prelude.Maybe Prelude.Text)
getRecoveryGroupReadinessSummaryResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetRecoveryGroupReadinessSummaryResponse
-> f GetRecoveryGroupReadinessSummaryResponse
getRecoveryGroupReadinessSummaryResponse_nextToken = (GetRecoveryGroupReadinessSummaryResponse -> Maybe Text)
-> (GetRecoveryGroupReadinessSummaryResponse
    -> Maybe Text -> GetRecoveryGroupReadinessSummaryResponse)
-> Lens' GetRecoveryGroupReadinessSummaryResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecoveryGroupReadinessSummaryResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetRecoveryGroupReadinessSummaryResponse' :: GetRecoveryGroupReadinessSummaryResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetRecoveryGroupReadinessSummaryResponse
s@GetRecoveryGroupReadinessSummaryResponse' {} Maybe Text
a -> GetRecoveryGroupReadinessSummaryResponse
s {$sel:nextToken:GetRecoveryGroupReadinessSummaryResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetRecoveryGroupReadinessSummaryResponse)

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

instance
  Prelude.NFData
    GetRecoveryGroupReadinessSummaryResponse