{-# 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.ListRecoveryGroups
-- 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 a collection of Recovery Groups.
--
-- This operation returns paginated results.
module Amazonka.Route53RecoveryReadiness.ListRecoveryGroups
  ( -- * Creating a Request
    ListRecoveryGroups (..),
    newListRecoveryGroups,

    -- * Request Lenses
    listRecoveryGroups_nextToken,
    listRecoveryGroups_maxResults,

    -- * Destructuring the Response
    ListRecoveryGroupsResponse (..),
    newListRecoveryGroupsResponse,

    -- * Response Lenses
    listRecoveryGroupsResponse_recoveryGroups,
    listRecoveryGroupsResponse_nextToken,
    listRecoveryGroupsResponse_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:/ 'newListRecoveryGroups' smart constructor.
data ListRecoveryGroups = ListRecoveryGroups'
  { -- | A token used to resume pagination from the end of a previous request.
    ListRecoveryGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Upper bound on number of records to return.
    ListRecoveryGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListRecoveryGroups -> ListRecoveryGroups -> Bool
(ListRecoveryGroups -> ListRecoveryGroups -> Bool)
-> (ListRecoveryGroups -> ListRecoveryGroups -> Bool)
-> Eq ListRecoveryGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecoveryGroups -> ListRecoveryGroups -> Bool
$c/= :: ListRecoveryGroups -> ListRecoveryGroups -> Bool
== :: ListRecoveryGroups -> ListRecoveryGroups -> Bool
$c== :: ListRecoveryGroups -> ListRecoveryGroups -> Bool
Prelude.Eq, ReadPrec [ListRecoveryGroups]
ReadPrec ListRecoveryGroups
Int -> ReadS ListRecoveryGroups
ReadS [ListRecoveryGroups]
(Int -> ReadS ListRecoveryGroups)
-> ReadS [ListRecoveryGroups]
-> ReadPrec ListRecoveryGroups
-> ReadPrec [ListRecoveryGroups]
-> Read ListRecoveryGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecoveryGroups]
$creadListPrec :: ReadPrec [ListRecoveryGroups]
readPrec :: ReadPrec ListRecoveryGroups
$creadPrec :: ReadPrec ListRecoveryGroups
readList :: ReadS [ListRecoveryGroups]
$creadList :: ReadS [ListRecoveryGroups]
readsPrec :: Int -> ReadS ListRecoveryGroups
$creadsPrec :: Int -> ReadS ListRecoveryGroups
Prelude.Read, Int -> ListRecoveryGroups -> ShowS
[ListRecoveryGroups] -> ShowS
ListRecoveryGroups -> String
(Int -> ListRecoveryGroups -> ShowS)
-> (ListRecoveryGroups -> String)
-> ([ListRecoveryGroups] -> ShowS)
-> Show ListRecoveryGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecoveryGroups] -> ShowS
$cshowList :: [ListRecoveryGroups] -> ShowS
show :: ListRecoveryGroups -> String
$cshow :: ListRecoveryGroups -> String
showsPrec :: Int -> ListRecoveryGroups -> ShowS
$cshowsPrec :: Int -> ListRecoveryGroups -> ShowS
Prelude.Show, (forall x. ListRecoveryGroups -> Rep ListRecoveryGroups x)
-> (forall x. Rep ListRecoveryGroups x -> ListRecoveryGroups)
-> Generic ListRecoveryGroups
forall x. Rep ListRecoveryGroups x -> ListRecoveryGroups
forall x. ListRecoveryGroups -> Rep ListRecoveryGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRecoveryGroups x -> ListRecoveryGroups
$cfrom :: forall x. ListRecoveryGroups -> Rep ListRecoveryGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListRecoveryGroups' 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', 'listRecoveryGroups_nextToken' - A token used to resume pagination from the end of a previous request.
--
-- 'maxResults', 'listRecoveryGroups_maxResults' - Upper bound on number of records to return.
newListRecoveryGroups ::
  ListRecoveryGroups
newListRecoveryGroups :: ListRecoveryGroups
newListRecoveryGroups =
  ListRecoveryGroups' :: Maybe Text -> Maybe Natural -> ListRecoveryGroups
ListRecoveryGroups'
    { $sel:nextToken:ListRecoveryGroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListRecoveryGroups' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Core.AWSPager ListRecoveryGroups where
  page :: ListRecoveryGroups
-> AWSResponse ListRecoveryGroups -> Maybe ListRecoveryGroups
page ListRecoveryGroups
rq AWSResponse ListRecoveryGroups
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRecoveryGroups
ListRecoveryGroupsResponse
rs
            ListRecoveryGroupsResponse
-> Getting (First Text) ListRecoveryGroupsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListRecoveryGroupsResponse
-> Const (First Text) ListRecoveryGroupsResponse
Lens' ListRecoveryGroupsResponse (Maybe Text)
listRecoveryGroupsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListRecoveryGroupsResponse
 -> Const (First Text) ListRecoveryGroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListRecoveryGroupsResponse 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 ListRecoveryGroups
forall a. Maybe a
Prelude.Nothing
    | Maybe [RecoveryGroupOutput] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRecoveryGroups
ListRecoveryGroupsResponse
rs
            ListRecoveryGroupsResponse
-> Getting
     (First [RecoveryGroupOutput])
     ListRecoveryGroupsResponse
     [RecoveryGroupOutput]
-> Maybe [RecoveryGroupOutput]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [RecoveryGroupOutput]
 -> Const
      (First [RecoveryGroupOutput]) (Maybe [RecoveryGroupOutput]))
-> ListRecoveryGroupsResponse
-> Const (First [RecoveryGroupOutput]) ListRecoveryGroupsResponse
Lens' ListRecoveryGroupsResponse (Maybe [RecoveryGroupOutput])
listRecoveryGroupsResponse_recoveryGroups
              ((Maybe [RecoveryGroupOutput]
  -> Const
       (First [RecoveryGroupOutput]) (Maybe [RecoveryGroupOutput]))
 -> ListRecoveryGroupsResponse
 -> Const (First [RecoveryGroupOutput]) ListRecoveryGroupsResponse)
-> (([RecoveryGroupOutput]
     -> Const (First [RecoveryGroupOutput]) [RecoveryGroupOutput])
    -> Maybe [RecoveryGroupOutput]
    -> Const
         (First [RecoveryGroupOutput]) (Maybe [RecoveryGroupOutput]))
-> Getting
     (First [RecoveryGroupOutput])
     ListRecoveryGroupsResponse
     [RecoveryGroupOutput]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RecoveryGroupOutput]
 -> Const (First [RecoveryGroupOutput]) [RecoveryGroupOutput])
-> Maybe [RecoveryGroupOutput]
-> Const
     (First [RecoveryGroupOutput]) (Maybe [RecoveryGroupOutput])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListRecoveryGroups
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListRecoveryGroups -> Maybe ListRecoveryGroups
forall a. a -> Maybe a
Prelude.Just (ListRecoveryGroups -> Maybe ListRecoveryGroups)
-> ListRecoveryGroups -> Maybe ListRecoveryGroups
forall a b. (a -> b) -> a -> b
Prelude.$
        ListRecoveryGroups
rq
          ListRecoveryGroups
-> (ListRecoveryGroups -> ListRecoveryGroups) -> ListRecoveryGroups
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListRecoveryGroups -> Identity ListRecoveryGroups
Lens
  ListRecoveryGroups ListRecoveryGroups (Maybe Text) (Maybe Text)
listRecoveryGroups_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListRecoveryGroups -> Identity ListRecoveryGroups)
-> Maybe Text -> ListRecoveryGroups -> ListRecoveryGroups
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRecoveryGroups
ListRecoveryGroupsResponse
rs
          ListRecoveryGroupsResponse
-> Getting (First Text) ListRecoveryGroupsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListRecoveryGroupsResponse
-> Const (First Text) ListRecoveryGroupsResponse
Lens' ListRecoveryGroupsResponse (Maybe Text)
listRecoveryGroupsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListRecoveryGroupsResponse
 -> Const (First Text) ListRecoveryGroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListRecoveryGroupsResponse 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 ListRecoveryGroups where
  type
    AWSResponse ListRecoveryGroups =
      ListRecoveryGroupsResponse
  request :: ListRecoveryGroups -> Request ListRecoveryGroups
request = Service -> ListRecoveryGroups -> Request ListRecoveryGroups
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListRecoveryGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListRecoveryGroups)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListRecoveryGroups))
-> Logger
-> Service
-> Proxy ListRecoveryGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListRecoveryGroups)))
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 [RecoveryGroupOutput]
-> Maybe Text -> Int -> ListRecoveryGroupsResponse
ListRecoveryGroupsResponse'
            (Maybe [RecoveryGroupOutput]
 -> Maybe Text -> Int -> ListRecoveryGroupsResponse)
-> Either String (Maybe [RecoveryGroupOutput])
-> Either String (Maybe Text -> Int -> ListRecoveryGroupsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [RecoveryGroupOutput]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"recoveryGroups" Either String (Maybe (Maybe [RecoveryGroupOutput]))
-> Maybe [RecoveryGroupOutput]
-> Either String (Maybe [RecoveryGroupOutput])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [RecoveryGroupOutput]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListRecoveryGroupsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListRecoveryGroupsResponse)
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 -> ListRecoveryGroupsResponse)
-> Either String Int -> Either String ListRecoveryGroupsResponse
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 ListRecoveryGroups

instance Prelude.NFData ListRecoveryGroups

instance Core.ToHeaders ListRecoveryGroups where
  toHeaders :: ListRecoveryGroups -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListRecoveryGroups -> 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 ListRecoveryGroups where
  toPath :: ListRecoveryGroups -> ByteString
toPath = ByteString -> ListRecoveryGroups -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/recoverygroups"

instance Core.ToQuery ListRecoveryGroups where
  toQuery :: ListRecoveryGroups -> QueryString
toQuery ListRecoveryGroups' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListRecoveryGroups' :: ListRecoveryGroups -> Maybe Natural
$sel:nextToken:ListRecoveryGroups' :: ListRecoveryGroups -> 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:/ 'newListRecoveryGroupsResponse' smart constructor.
data ListRecoveryGroupsResponse = ListRecoveryGroupsResponse'
  { -- | A list of RecoveryGroups
    ListRecoveryGroupsResponse -> Maybe [RecoveryGroupOutput]
recoveryGroups :: Prelude.Maybe [RecoveryGroupOutput],
    -- | A token that can be used to resume pagination from the end of the
    -- collection.
    ListRecoveryGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListRecoveryGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListRecoveryGroupsResponse -> ListRecoveryGroupsResponse -> Bool
(ListRecoveryGroupsResponse -> ListRecoveryGroupsResponse -> Bool)
-> (ListRecoveryGroupsResponse
    -> ListRecoveryGroupsResponse -> Bool)
-> Eq ListRecoveryGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecoveryGroupsResponse -> ListRecoveryGroupsResponse -> Bool
$c/= :: ListRecoveryGroupsResponse -> ListRecoveryGroupsResponse -> Bool
== :: ListRecoveryGroupsResponse -> ListRecoveryGroupsResponse -> Bool
$c== :: ListRecoveryGroupsResponse -> ListRecoveryGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListRecoveryGroupsResponse]
ReadPrec ListRecoveryGroupsResponse
Int -> ReadS ListRecoveryGroupsResponse
ReadS [ListRecoveryGroupsResponse]
(Int -> ReadS ListRecoveryGroupsResponse)
-> ReadS [ListRecoveryGroupsResponse]
-> ReadPrec ListRecoveryGroupsResponse
-> ReadPrec [ListRecoveryGroupsResponse]
-> Read ListRecoveryGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecoveryGroupsResponse]
$creadListPrec :: ReadPrec [ListRecoveryGroupsResponse]
readPrec :: ReadPrec ListRecoveryGroupsResponse
$creadPrec :: ReadPrec ListRecoveryGroupsResponse
readList :: ReadS [ListRecoveryGroupsResponse]
$creadList :: ReadS [ListRecoveryGroupsResponse]
readsPrec :: Int -> ReadS ListRecoveryGroupsResponse
$creadsPrec :: Int -> ReadS ListRecoveryGroupsResponse
Prelude.Read, Int -> ListRecoveryGroupsResponse -> ShowS
[ListRecoveryGroupsResponse] -> ShowS
ListRecoveryGroupsResponse -> String
(Int -> ListRecoveryGroupsResponse -> ShowS)
-> (ListRecoveryGroupsResponse -> String)
-> ([ListRecoveryGroupsResponse] -> ShowS)
-> Show ListRecoveryGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecoveryGroupsResponse] -> ShowS
$cshowList :: [ListRecoveryGroupsResponse] -> ShowS
show :: ListRecoveryGroupsResponse -> String
$cshow :: ListRecoveryGroupsResponse -> String
showsPrec :: Int -> ListRecoveryGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListRecoveryGroupsResponse -> ShowS
Prelude.Show, (forall x.
 ListRecoveryGroupsResponse -> Rep ListRecoveryGroupsResponse x)
-> (forall x.
    Rep ListRecoveryGroupsResponse x -> ListRecoveryGroupsResponse)
-> Generic ListRecoveryGroupsResponse
forall x.
Rep ListRecoveryGroupsResponse x -> ListRecoveryGroupsResponse
forall x.
ListRecoveryGroupsResponse -> Rep ListRecoveryGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRecoveryGroupsResponse x -> ListRecoveryGroupsResponse
$cfrom :: forall x.
ListRecoveryGroupsResponse -> Rep ListRecoveryGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRecoveryGroupsResponse' 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:
--
-- 'recoveryGroups', 'listRecoveryGroupsResponse_recoveryGroups' - A list of RecoveryGroups
--
-- 'nextToken', 'listRecoveryGroupsResponse_nextToken' - A token that can be used to resume pagination from the end of the
-- collection.
--
-- 'httpStatus', 'listRecoveryGroupsResponse_httpStatus' - The response's http status code.
newListRecoveryGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRecoveryGroupsResponse
newListRecoveryGroupsResponse :: Int -> ListRecoveryGroupsResponse
newListRecoveryGroupsResponse Int
pHttpStatus_ =
  ListRecoveryGroupsResponse' :: Maybe [RecoveryGroupOutput]
-> Maybe Text -> Int -> ListRecoveryGroupsResponse
ListRecoveryGroupsResponse'
    { $sel:recoveryGroups:ListRecoveryGroupsResponse' :: Maybe [RecoveryGroupOutput]
recoveryGroups =
        Maybe [RecoveryGroupOutput]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRecoveryGroupsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRecoveryGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of RecoveryGroups
listRecoveryGroupsResponse_recoveryGroups :: Lens.Lens' ListRecoveryGroupsResponse (Prelude.Maybe [RecoveryGroupOutput])
listRecoveryGroupsResponse_recoveryGroups :: (Maybe [RecoveryGroupOutput] -> f (Maybe [RecoveryGroupOutput]))
-> ListRecoveryGroupsResponse -> f ListRecoveryGroupsResponse
listRecoveryGroupsResponse_recoveryGroups = (ListRecoveryGroupsResponse -> Maybe [RecoveryGroupOutput])
-> (ListRecoveryGroupsResponse
    -> Maybe [RecoveryGroupOutput] -> ListRecoveryGroupsResponse)
-> Lens' ListRecoveryGroupsResponse (Maybe [RecoveryGroupOutput])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryGroupsResponse' {Maybe [RecoveryGroupOutput]
recoveryGroups :: Maybe [RecoveryGroupOutput]
$sel:recoveryGroups:ListRecoveryGroupsResponse' :: ListRecoveryGroupsResponse -> Maybe [RecoveryGroupOutput]
recoveryGroups} -> Maybe [RecoveryGroupOutput]
recoveryGroups) (\s :: ListRecoveryGroupsResponse
s@ListRecoveryGroupsResponse' {} Maybe [RecoveryGroupOutput]
a -> ListRecoveryGroupsResponse
s {$sel:recoveryGroups:ListRecoveryGroupsResponse' :: Maybe [RecoveryGroupOutput]
recoveryGroups = Maybe [RecoveryGroupOutput]
a} :: ListRecoveryGroupsResponse) ((Maybe [RecoveryGroupOutput] -> f (Maybe [RecoveryGroupOutput]))
 -> ListRecoveryGroupsResponse -> f ListRecoveryGroupsResponse)
-> ((Maybe [RecoveryGroupOutput]
     -> f (Maybe [RecoveryGroupOutput]))
    -> Maybe [RecoveryGroupOutput] -> f (Maybe [RecoveryGroupOutput]))
-> (Maybe [RecoveryGroupOutput] -> f (Maybe [RecoveryGroupOutput]))
-> ListRecoveryGroupsResponse
-> f ListRecoveryGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RecoveryGroupOutput]
  [RecoveryGroupOutput]
  [RecoveryGroupOutput]
  [RecoveryGroupOutput]
-> Iso
     (Maybe [RecoveryGroupOutput])
     (Maybe [RecoveryGroupOutput])
     (Maybe [RecoveryGroupOutput])
     (Maybe [RecoveryGroupOutput])
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
  [RecoveryGroupOutput]
  [RecoveryGroupOutput]
  [RecoveryGroupOutput]
  [RecoveryGroupOutput]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance Prelude.NFData ListRecoveryGroupsResponse