{-# 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.Backup.ListRecoveryPointsByLegalHold
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- This action returns recovery point ARNs (Amazon Resource Names) of the
-- specified legal hold.
--
-- This operation returns paginated results.
module Amazonka.Backup.ListRecoveryPointsByLegalHold
  ( -- * Creating a Request
    ListRecoveryPointsByLegalHold (..),
    newListRecoveryPointsByLegalHold,

    -- * Request Lenses
    listRecoveryPointsByLegalHold_maxResults,
    listRecoveryPointsByLegalHold_nextToken,
    listRecoveryPointsByLegalHold_legalHoldId,

    -- * Destructuring the Response
    ListRecoveryPointsByLegalHoldResponse (..),
    newListRecoveryPointsByLegalHoldResponse,

    -- * Response Lenses
    listRecoveryPointsByLegalHoldResponse_nextToken,
    listRecoveryPointsByLegalHoldResponse_recoveryPoints,
    listRecoveryPointsByLegalHoldResponse_httpStatus,
  )
where

import Amazonka.Backup.Types
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

-- | /See:/ 'newListRecoveryPointsByLegalHold' smart constructor.
data ListRecoveryPointsByLegalHold = ListRecoveryPointsByLegalHold'
  { -- | This is the maximum number of resource list items to be returned.
    ListRecoveryPointsByLegalHold -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | This is the next item following a partial list of returned resources.
    -- For example, if a request is made to return @maxResults@ number of
    -- resources, @NextToken@ allows you to return more items in your list
    -- starting at the location pointed to by the next token.
    ListRecoveryPointsByLegalHold -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | This is the ID of the legal hold.
    ListRecoveryPointsByLegalHold -> Text
legalHoldId :: Prelude.Text
  }
  deriving (ListRecoveryPointsByLegalHold
-> ListRecoveryPointsByLegalHold -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecoveryPointsByLegalHold
-> ListRecoveryPointsByLegalHold -> Bool
$c/= :: ListRecoveryPointsByLegalHold
-> ListRecoveryPointsByLegalHold -> Bool
== :: ListRecoveryPointsByLegalHold
-> ListRecoveryPointsByLegalHold -> Bool
$c== :: ListRecoveryPointsByLegalHold
-> ListRecoveryPointsByLegalHold -> Bool
Prelude.Eq, ReadPrec [ListRecoveryPointsByLegalHold]
ReadPrec ListRecoveryPointsByLegalHold
Int -> ReadS ListRecoveryPointsByLegalHold
ReadS [ListRecoveryPointsByLegalHold]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecoveryPointsByLegalHold]
$creadListPrec :: ReadPrec [ListRecoveryPointsByLegalHold]
readPrec :: ReadPrec ListRecoveryPointsByLegalHold
$creadPrec :: ReadPrec ListRecoveryPointsByLegalHold
readList :: ReadS [ListRecoveryPointsByLegalHold]
$creadList :: ReadS [ListRecoveryPointsByLegalHold]
readsPrec :: Int -> ReadS ListRecoveryPointsByLegalHold
$creadsPrec :: Int -> ReadS ListRecoveryPointsByLegalHold
Prelude.Read, Int -> ListRecoveryPointsByLegalHold -> ShowS
[ListRecoveryPointsByLegalHold] -> ShowS
ListRecoveryPointsByLegalHold -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecoveryPointsByLegalHold] -> ShowS
$cshowList :: [ListRecoveryPointsByLegalHold] -> ShowS
show :: ListRecoveryPointsByLegalHold -> String
$cshow :: ListRecoveryPointsByLegalHold -> String
showsPrec :: Int -> ListRecoveryPointsByLegalHold -> ShowS
$cshowsPrec :: Int -> ListRecoveryPointsByLegalHold -> ShowS
Prelude.Show, forall x.
Rep ListRecoveryPointsByLegalHold x
-> ListRecoveryPointsByLegalHold
forall x.
ListRecoveryPointsByLegalHold
-> Rep ListRecoveryPointsByLegalHold x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRecoveryPointsByLegalHold x
-> ListRecoveryPointsByLegalHold
$cfrom :: forall x.
ListRecoveryPointsByLegalHold
-> Rep ListRecoveryPointsByLegalHold x
Prelude.Generic)

-- |
-- Create a value of 'ListRecoveryPointsByLegalHold' 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:
--
-- 'maxResults', 'listRecoveryPointsByLegalHold_maxResults' - This is the maximum number of resource list items to be returned.
--
-- 'nextToken', 'listRecoveryPointsByLegalHold_nextToken' - This is the next item following a partial list of returned resources.
-- For example, if a request is made to return @maxResults@ number of
-- resources, @NextToken@ allows you to return more items in your list
-- starting at the location pointed to by the next token.
--
-- 'legalHoldId', 'listRecoveryPointsByLegalHold_legalHoldId' - This is the ID of the legal hold.
newListRecoveryPointsByLegalHold ::
  -- | 'legalHoldId'
  Prelude.Text ->
  ListRecoveryPointsByLegalHold
newListRecoveryPointsByLegalHold :: Text -> ListRecoveryPointsByLegalHold
newListRecoveryPointsByLegalHold Text
pLegalHoldId_ =
  ListRecoveryPointsByLegalHold'
    { $sel:maxResults:ListRecoveryPointsByLegalHold' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRecoveryPointsByLegalHold' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:legalHoldId:ListRecoveryPointsByLegalHold' :: Text
legalHoldId = Text
pLegalHoldId_
    }

-- | This is the maximum number of resource list items to be returned.
listRecoveryPointsByLegalHold_maxResults :: Lens.Lens' ListRecoveryPointsByLegalHold (Prelude.Maybe Prelude.Natural)
listRecoveryPointsByLegalHold_maxResults :: Lens' ListRecoveryPointsByLegalHold (Maybe Natural)
listRecoveryPointsByLegalHold_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsByLegalHold' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListRecoveryPointsByLegalHold' :: ListRecoveryPointsByLegalHold -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListRecoveryPointsByLegalHold
s@ListRecoveryPointsByLegalHold' {} Maybe Natural
a -> ListRecoveryPointsByLegalHold
s {$sel:maxResults:ListRecoveryPointsByLegalHold' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListRecoveryPointsByLegalHold)

-- | This is the next item following a partial list of returned resources.
-- For example, if a request is made to return @maxResults@ number of
-- resources, @NextToken@ allows you to return more items in your list
-- starting at the location pointed to by the next token.
listRecoveryPointsByLegalHold_nextToken :: Lens.Lens' ListRecoveryPointsByLegalHold (Prelude.Maybe Prelude.Text)
listRecoveryPointsByLegalHold_nextToken :: Lens' ListRecoveryPointsByLegalHold (Maybe Text)
listRecoveryPointsByLegalHold_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsByLegalHold' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRecoveryPointsByLegalHold' :: ListRecoveryPointsByLegalHold -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRecoveryPointsByLegalHold
s@ListRecoveryPointsByLegalHold' {} Maybe Text
a -> ListRecoveryPointsByLegalHold
s {$sel:nextToken:ListRecoveryPointsByLegalHold' :: Maybe Text
nextToken = Maybe Text
a} :: ListRecoveryPointsByLegalHold)

-- | This is the ID of the legal hold.
listRecoveryPointsByLegalHold_legalHoldId :: Lens.Lens' ListRecoveryPointsByLegalHold Prelude.Text
listRecoveryPointsByLegalHold_legalHoldId :: Lens' ListRecoveryPointsByLegalHold Text
listRecoveryPointsByLegalHold_legalHoldId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsByLegalHold' {Text
legalHoldId :: Text
$sel:legalHoldId:ListRecoveryPointsByLegalHold' :: ListRecoveryPointsByLegalHold -> Text
legalHoldId} -> Text
legalHoldId) (\s :: ListRecoveryPointsByLegalHold
s@ListRecoveryPointsByLegalHold' {} Text
a -> ListRecoveryPointsByLegalHold
s {$sel:legalHoldId:ListRecoveryPointsByLegalHold' :: Text
legalHoldId = Text
a} :: ListRecoveryPointsByLegalHold)

instance Core.AWSPager ListRecoveryPointsByLegalHold where
  page :: ListRecoveryPointsByLegalHold
-> AWSResponse ListRecoveryPointsByLegalHold
-> Maybe ListRecoveryPointsByLegalHold
page ListRecoveryPointsByLegalHold
rq AWSResponse ListRecoveryPointsByLegalHold
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRecoveryPointsByLegalHold
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRecoveryPointsByLegalHoldResponse (Maybe Text)
listRecoveryPointsByLegalHoldResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRecoveryPointsByLegalHold
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListRecoveryPointsByLegalHoldResponse (Maybe [RecoveryPointMember])
listRecoveryPointsByLegalHoldResponse_recoveryPoints
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListRecoveryPointsByLegalHold
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListRecoveryPointsByLegalHold (Maybe Text)
listRecoveryPointsByLegalHold_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRecoveryPointsByLegalHold
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRecoveryPointsByLegalHoldResponse (Maybe Text)
listRecoveryPointsByLegalHoldResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    ListRecoveryPointsByLegalHold
  where
  type
    AWSResponse ListRecoveryPointsByLegalHold =
      ListRecoveryPointsByLegalHoldResponse
  request :: (Service -> Service)
-> ListRecoveryPointsByLegalHold
-> Request ListRecoveryPointsByLegalHold
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListRecoveryPointsByLegalHold
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListRecoveryPointsByLegalHold)))
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 [RecoveryPointMember]
-> Int
-> ListRecoveryPointsByLegalHoldResponse
ListRecoveryPointsByLegalHoldResponse'
            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
"RecoveryPoints" 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
    ListRecoveryPointsByLegalHold
  where
  hashWithSalt :: Int -> ListRecoveryPointsByLegalHold -> Int
hashWithSalt Int
_salt ListRecoveryPointsByLegalHold' {Maybe Natural
Maybe Text
Text
legalHoldId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:legalHoldId:ListRecoveryPointsByLegalHold' :: ListRecoveryPointsByLegalHold -> Text
$sel:nextToken:ListRecoveryPointsByLegalHold' :: ListRecoveryPointsByLegalHold -> Maybe Text
$sel:maxResults:ListRecoveryPointsByLegalHold' :: ListRecoveryPointsByLegalHold -> Maybe Natural
..} =
    Int
_salt
      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
legalHoldId

instance Prelude.NFData ListRecoveryPointsByLegalHold where
  rnf :: ListRecoveryPointsByLegalHold -> ()
rnf ListRecoveryPointsByLegalHold' {Maybe Natural
Maybe Text
Text
legalHoldId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:legalHoldId:ListRecoveryPointsByLegalHold' :: ListRecoveryPointsByLegalHold -> Text
$sel:nextToken:ListRecoveryPointsByLegalHold' :: ListRecoveryPointsByLegalHold -> Maybe Text
$sel:maxResults:ListRecoveryPointsByLegalHold' :: ListRecoveryPointsByLegalHold -> Maybe Natural
..} =
    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
legalHoldId

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

instance Data.ToPath ListRecoveryPointsByLegalHold where
  toPath :: ListRecoveryPointsByLegalHold -> ByteString
toPath ListRecoveryPointsByLegalHold' {Maybe Natural
Maybe Text
Text
legalHoldId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:legalHoldId:ListRecoveryPointsByLegalHold' :: ListRecoveryPointsByLegalHold -> Text
$sel:nextToken:ListRecoveryPointsByLegalHold' :: ListRecoveryPointsByLegalHold -> Maybe Text
$sel:maxResults:ListRecoveryPointsByLegalHold' :: ListRecoveryPointsByLegalHold -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/legal-holds/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
legalHoldId,
        ByteString
"/recovery-points"
      ]

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

-- | /See:/ 'newListRecoveryPointsByLegalHoldResponse' smart constructor.
data ListRecoveryPointsByLegalHoldResponse = ListRecoveryPointsByLegalHoldResponse'
  { -- | This return is the next item following a partial list of returned
    -- resources.
    ListRecoveryPointsByLegalHoldResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | This is a list of the recovery points returned by
    -- @ListRecoveryPointsByLegalHold@.
    ListRecoveryPointsByLegalHoldResponse
-> Maybe [RecoveryPointMember]
recoveryPoints :: Prelude.Maybe [RecoveryPointMember],
    -- | The response's http status code.
    ListRecoveryPointsByLegalHoldResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListRecoveryPointsByLegalHoldResponse
-> ListRecoveryPointsByLegalHoldResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecoveryPointsByLegalHoldResponse
-> ListRecoveryPointsByLegalHoldResponse -> Bool
$c/= :: ListRecoveryPointsByLegalHoldResponse
-> ListRecoveryPointsByLegalHoldResponse -> Bool
== :: ListRecoveryPointsByLegalHoldResponse
-> ListRecoveryPointsByLegalHoldResponse -> Bool
$c== :: ListRecoveryPointsByLegalHoldResponse
-> ListRecoveryPointsByLegalHoldResponse -> Bool
Prelude.Eq, ReadPrec [ListRecoveryPointsByLegalHoldResponse]
ReadPrec ListRecoveryPointsByLegalHoldResponse
Int -> ReadS ListRecoveryPointsByLegalHoldResponse
ReadS [ListRecoveryPointsByLegalHoldResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecoveryPointsByLegalHoldResponse]
$creadListPrec :: ReadPrec [ListRecoveryPointsByLegalHoldResponse]
readPrec :: ReadPrec ListRecoveryPointsByLegalHoldResponse
$creadPrec :: ReadPrec ListRecoveryPointsByLegalHoldResponse
readList :: ReadS [ListRecoveryPointsByLegalHoldResponse]
$creadList :: ReadS [ListRecoveryPointsByLegalHoldResponse]
readsPrec :: Int -> ReadS ListRecoveryPointsByLegalHoldResponse
$creadsPrec :: Int -> ReadS ListRecoveryPointsByLegalHoldResponse
Prelude.Read, Int -> ListRecoveryPointsByLegalHoldResponse -> ShowS
[ListRecoveryPointsByLegalHoldResponse] -> ShowS
ListRecoveryPointsByLegalHoldResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecoveryPointsByLegalHoldResponse] -> ShowS
$cshowList :: [ListRecoveryPointsByLegalHoldResponse] -> ShowS
show :: ListRecoveryPointsByLegalHoldResponse -> String
$cshow :: ListRecoveryPointsByLegalHoldResponse -> String
showsPrec :: Int -> ListRecoveryPointsByLegalHoldResponse -> ShowS
$cshowsPrec :: Int -> ListRecoveryPointsByLegalHoldResponse -> ShowS
Prelude.Show, forall x.
Rep ListRecoveryPointsByLegalHoldResponse x
-> ListRecoveryPointsByLegalHoldResponse
forall x.
ListRecoveryPointsByLegalHoldResponse
-> Rep ListRecoveryPointsByLegalHoldResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRecoveryPointsByLegalHoldResponse x
-> ListRecoveryPointsByLegalHoldResponse
$cfrom :: forall x.
ListRecoveryPointsByLegalHoldResponse
-> Rep ListRecoveryPointsByLegalHoldResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRecoveryPointsByLegalHoldResponse' 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', 'listRecoveryPointsByLegalHoldResponse_nextToken' - This return is the next item following a partial list of returned
-- resources.
--
-- 'recoveryPoints', 'listRecoveryPointsByLegalHoldResponse_recoveryPoints' - This is a list of the recovery points returned by
-- @ListRecoveryPointsByLegalHold@.
--
-- 'httpStatus', 'listRecoveryPointsByLegalHoldResponse_httpStatus' - The response's http status code.
newListRecoveryPointsByLegalHoldResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRecoveryPointsByLegalHoldResponse
newListRecoveryPointsByLegalHoldResponse :: Int -> ListRecoveryPointsByLegalHoldResponse
newListRecoveryPointsByLegalHoldResponse Int
pHttpStatus_ =
  ListRecoveryPointsByLegalHoldResponse'
    { $sel:nextToken:ListRecoveryPointsByLegalHoldResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:recoveryPoints:ListRecoveryPointsByLegalHoldResponse' :: Maybe [RecoveryPointMember]
recoveryPoints = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRecoveryPointsByLegalHoldResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | This return is the next item following a partial list of returned
-- resources.
listRecoveryPointsByLegalHoldResponse_nextToken :: Lens.Lens' ListRecoveryPointsByLegalHoldResponse (Prelude.Maybe Prelude.Text)
listRecoveryPointsByLegalHoldResponse_nextToken :: Lens' ListRecoveryPointsByLegalHoldResponse (Maybe Text)
listRecoveryPointsByLegalHoldResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsByLegalHoldResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRecoveryPointsByLegalHoldResponse' :: ListRecoveryPointsByLegalHoldResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRecoveryPointsByLegalHoldResponse
s@ListRecoveryPointsByLegalHoldResponse' {} Maybe Text
a -> ListRecoveryPointsByLegalHoldResponse
s {$sel:nextToken:ListRecoveryPointsByLegalHoldResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRecoveryPointsByLegalHoldResponse)

-- | This is a list of the recovery points returned by
-- @ListRecoveryPointsByLegalHold@.
listRecoveryPointsByLegalHoldResponse_recoveryPoints :: Lens.Lens' ListRecoveryPointsByLegalHoldResponse (Prelude.Maybe [RecoveryPointMember])
listRecoveryPointsByLegalHoldResponse_recoveryPoints :: Lens'
  ListRecoveryPointsByLegalHoldResponse (Maybe [RecoveryPointMember])
listRecoveryPointsByLegalHoldResponse_recoveryPoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsByLegalHoldResponse' {Maybe [RecoveryPointMember]
recoveryPoints :: Maybe [RecoveryPointMember]
$sel:recoveryPoints:ListRecoveryPointsByLegalHoldResponse' :: ListRecoveryPointsByLegalHoldResponse
-> Maybe [RecoveryPointMember]
recoveryPoints} -> Maybe [RecoveryPointMember]
recoveryPoints) (\s :: ListRecoveryPointsByLegalHoldResponse
s@ListRecoveryPointsByLegalHoldResponse' {} Maybe [RecoveryPointMember]
a -> ListRecoveryPointsByLegalHoldResponse
s {$sel:recoveryPoints:ListRecoveryPointsByLegalHoldResponse' :: Maybe [RecoveryPointMember]
recoveryPoints = Maybe [RecoveryPointMember]
a} :: ListRecoveryPointsByLegalHoldResponse) 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.
listRecoveryPointsByLegalHoldResponse_httpStatus :: Lens.Lens' ListRecoveryPointsByLegalHoldResponse Prelude.Int
listRecoveryPointsByLegalHoldResponse_httpStatus :: Lens' ListRecoveryPointsByLegalHoldResponse Int
listRecoveryPointsByLegalHoldResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsByLegalHoldResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListRecoveryPointsByLegalHoldResponse' :: ListRecoveryPointsByLegalHoldResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListRecoveryPointsByLegalHoldResponse
s@ListRecoveryPointsByLegalHoldResponse' {} Int
a -> ListRecoveryPointsByLegalHoldResponse
s {$sel:httpStatus:ListRecoveryPointsByLegalHoldResponse' :: Int
httpStatus = Int
a} :: ListRecoveryPointsByLegalHoldResponse)

instance
  Prelude.NFData
    ListRecoveryPointsByLegalHoldResponse
  where
  rnf :: ListRecoveryPointsByLegalHoldResponse -> ()
rnf ListRecoveryPointsByLegalHoldResponse' {Int
Maybe [RecoveryPointMember]
Maybe Text
httpStatus :: Int
recoveryPoints :: Maybe [RecoveryPointMember]
nextToken :: Maybe Text
$sel:httpStatus:ListRecoveryPointsByLegalHoldResponse' :: ListRecoveryPointsByLegalHoldResponse -> Int
$sel:recoveryPoints:ListRecoveryPointsByLegalHoldResponse' :: ListRecoveryPointsByLegalHoldResponse
-> Maybe [RecoveryPointMember]
$sel:nextToken:ListRecoveryPointsByLegalHoldResponse' :: ListRecoveryPointsByLegalHoldResponse -> 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 [RecoveryPointMember]
recoveryPoints
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus