{-# 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.ListRecoveryPointsByResource
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns detailed information about all the recovery points of the type
-- specified by a resource Amazon Resource Name (ARN).
--
-- For Amazon EFS and Amazon EC2, this action only lists recovery points
-- created by Backup.
--
-- This operation returns paginated results.
module Amazonka.Backup.ListRecoveryPointsByResource
  ( -- * Creating a Request
    ListRecoveryPointsByResource (..),
    newListRecoveryPointsByResource,

    -- * Request Lenses
    listRecoveryPointsByResource_maxResults,
    listRecoveryPointsByResource_nextToken,
    listRecoveryPointsByResource_resourceArn,

    -- * Destructuring the Response
    ListRecoveryPointsByResourceResponse (..),
    newListRecoveryPointsByResourceResponse,

    -- * Response Lenses
    listRecoveryPointsByResourceResponse_nextToken,
    listRecoveryPointsByResourceResponse_recoveryPoints,
    listRecoveryPointsByResourceResponse_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:/ 'newListRecoveryPointsByResource' smart constructor.
data ListRecoveryPointsByResource = ListRecoveryPointsByResource'
  { -- | The maximum number of items to be returned.
    --
    -- Amazon RDS requires a value of at least 20.
    ListRecoveryPointsByResource -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The next item following a partial list of returned items. For example,
    -- if a request is made to return @maxResults@ number of items, @NextToken@
    -- allows you to return more items in your list starting at the location
    -- pointed to by the next token.
    ListRecoveryPointsByResource -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An ARN that uniquely identifies a resource. The format of the ARN
    -- depends on the resource type.
    ListRecoveryPointsByResource -> Text
resourceArn :: Prelude.Text
  }
  deriving (ListRecoveryPointsByResource
-> ListRecoveryPointsByResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecoveryPointsByResource
-> ListRecoveryPointsByResource -> Bool
$c/= :: ListRecoveryPointsByResource
-> ListRecoveryPointsByResource -> Bool
== :: ListRecoveryPointsByResource
-> ListRecoveryPointsByResource -> Bool
$c== :: ListRecoveryPointsByResource
-> ListRecoveryPointsByResource -> Bool
Prelude.Eq, ReadPrec [ListRecoveryPointsByResource]
ReadPrec ListRecoveryPointsByResource
Int -> ReadS ListRecoveryPointsByResource
ReadS [ListRecoveryPointsByResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecoveryPointsByResource]
$creadListPrec :: ReadPrec [ListRecoveryPointsByResource]
readPrec :: ReadPrec ListRecoveryPointsByResource
$creadPrec :: ReadPrec ListRecoveryPointsByResource
readList :: ReadS [ListRecoveryPointsByResource]
$creadList :: ReadS [ListRecoveryPointsByResource]
readsPrec :: Int -> ReadS ListRecoveryPointsByResource
$creadsPrec :: Int -> ReadS ListRecoveryPointsByResource
Prelude.Read, Int -> ListRecoveryPointsByResource -> ShowS
[ListRecoveryPointsByResource] -> ShowS
ListRecoveryPointsByResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecoveryPointsByResource] -> ShowS
$cshowList :: [ListRecoveryPointsByResource] -> ShowS
show :: ListRecoveryPointsByResource -> String
$cshow :: ListRecoveryPointsByResource -> String
showsPrec :: Int -> ListRecoveryPointsByResource -> ShowS
$cshowsPrec :: Int -> ListRecoveryPointsByResource -> ShowS
Prelude.Show, forall x.
Rep ListRecoveryPointsByResource x -> ListRecoveryPointsByResource
forall x.
ListRecoveryPointsByResource -> Rep ListRecoveryPointsByResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRecoveryPointsByResource x -> ListRecoveryPointsByResource
$cfrom :: forall x.
ListRecoveryPointsByResource -> Rep ListRecoveryPointsByResource x
Prelude.Generic)

-- |
-- Create a value of 'ListRecoveryPointsByResource' 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', 'listRecoveryPointsByResource_maxResults' - The maximum number of items to be returned.
--
-- Amazon RDS requires a value of at least 20.
--
-- 'nextToken', 'listRecoveryPointsByResource_nextToken' - The next item following a partial list of returned items. For example,
-- if a request is made to return @maxResults@ number of items, @NextToken@
-- allows you to return more items in your list starting at the location
-- pointed to by the next token.
--
-- 'resourceArn', 'listRecoveryPointsByResource_resourceArn' - An ARN that uniquely identifies a resource. The format of the ARN
-- depends on the resource type.
newListRecoveryPointsByResource ::
  -- | 'resourceArn'
  Prelude.Text ->
  ListRecoveryPointsByResource
newListRecoveryPointsByResource :: Text -> ListRecoveryPointsByResource
newListRecoveryPointsByResource Text
pResourceArn_ =
  ListRecoveryPointsByResource'
    { $sel:maxResults:ListRecoveryPointsByResource' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRecoveryPointsByResource' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:ListRecoveryPointsByResource' :: Text
resourceArn = Text
pResourceArn_
    }

-- | The maximum number of items to be returned.
--
-- Amazon RDS requires a value of at least 20.
listRecoveryPointsByResource_maxResults :: Lens.Lens' ListRecoveryPointsByResource (Prelude.Maybe Prelude.Natural)
listRecoveryPointsByResource_maxResults :: Lens' ListRecoveryPointsByResource (Maybe Natural)
listRecoveryPointsByResource_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsByResource' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListRecoveryPointsByResource' :: ListRecoveryPointsByResource -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListRecoveryPointsByResource
s@ListRecoveryPointsByResource' {} Maybe Natural
a -> ListRecoveryPointsByResource
s {$sel:maxResults:ListRecoveryPointsByResource' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListRecoveryPointsByResource)

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

-- | An ARN that uniquely identifies a resource. The format of the ARN
-- depends on the resource type.
listRecoveryPointsByResource_resourceArn :: Lens.Lens' ListRecoveryPointsByResource Prelude.Text
listRecoveryPointsByResource_resourceArn :: Lens' ListRecoveryPointsByResource Text
listRecoveryPointsByResource_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsByResource' {Text
resourceArn :: Text
$sel:resourceArn:ListRecoveryPointsByResource' :: ListRecoveryPointsByResource -> Text
resourceArn} -> Text
resourceArn) (\s :: ListRecoveryPointsByResource
s@ListRecoveryPointsByResource' {} Text
a -> ListRecoveryPointsByResource
s {$sel:resourceArn:ListRecoveryPointsByResource' :: Text
resourceArn = Text
a} :: ListRecoveryPointsByResource)

instance Core.AWSPager ListRecoveryPointsByResource where
  page :: ListRecoveryPointsByResource
-> AWSResponse ListRecoveryPointsByResource
-> Maybe ListRecoveryPointsByResource
page ListRecoveryPointsByResource
rq AWSResponse ListRecoveryPointsByResource
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRecoveryPointsByResource
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRecoveryPointsByResourceResponse (Maybe Text)
listRecoveryPointsByResourceResponse_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 ListRecoveryPointsByResource
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListRecoveryPointsByResourceResponse
  (Maybe [RecoveryPointByResource])
listRecoveryPointsByResourceResponse_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.$ ListRecoveryPointsByResource
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListRecoveryPointsByResource (Maybe Text)
listRecoveryPointsByResource_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRecoveryPointsByResource
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRecoveryPointsByResourceResponse (Maybe Text)
listRecoveryPointsByResourceResponse_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 ListRecoveryPointsByResource where
  type
    AWSResponse ListRecoveryPointsByResource =
      ListRecoveryPointsByResourceResponse
  request :: (Service -> Service)
-> ListRecoveryPointsByResource
-> Request ListRecoveryPointsByResource
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 ListRecoveryPointsByResource
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListRecoveryPointsByResource)))
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 [RecoveryPointByResource]
-> Int
-> ListRecoveryPointsByResourceResponse
ListRecoveryPointsByResourceResponse'
            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
    ListRecoveryPointsByResource
  where
  hashWithSalt :: Int -> ListRecoveryPointsByResource -> Int
hashWithSalt Int
_salt ListRecoveryPointsByResource' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:resourceArn:ListRecoveryPointsByResource' :: ListRecoveryPointsByResource -> Text
$sel:nextToken:ListRecoveryPointsByResource' :: ListRecoveryPointsByResource -> Maybe Text
$sel:maxResults:ListRecoveryPointsByResource' :: ListRecoveryPointsByResource -> 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
resourceArn

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

instance Data.ToHeaders ListRecoveryPointsByResource where
  toHeaders :: ListRecoveryPointsByResource -> 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 ListRecoveryPointsByResource where
  toPath :: ListRecoveryPointsByResource -> ByteString
toPath ListRecoveryPointsByResource' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:resourceArn:ListRecoveryPointsByResource' :: ListRecoveryPointsByResource -> Text
$sel:nextToken:ListRecoveryPointsByResource' :: ListRecoveryPointsByResource -> Maybe Text
$sel:maxResults:ListRecoveryPointsByResource' :: ListRecoveryPointsByResource -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/resources/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
resourceArn,
        ByteString
"/recovery-points/"
      ]

instance Data.ToQuery ListRecoveryPointsByResource where
  toQuery :: ListRecoveryPointsByResource -> QueryString
toQuery ListRecoveryPointsByResource' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:resourceArn:ListRecoveryPointsByResource' :: ListRecoveryPointsByResource -> Text
$sel:nextToken:ListRecoveryPointsByResource' :: ListRecoveryPointsByResource -> Maybe Text
$sel:maxResults:ListRecoveryPointsByResource' :: ListRecoveryPointsByResource -> 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:/ 'newListRecoveryPointsByResourceResponse' smart constructor.
data ListRecoveryPointsByResourceResponse = ListRecoveryPointsByResourceResponse'
  { -- | The next item following a partial list of returned items. For example,
    -- if a request is made to return @maxResults@ number of items, @NextToken@
    -- allows you to return more items in your list starting at the location
    -- pointed to by the next token.
    ListRecoveryPointsByResourceResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that contain detailed information about recovery
    -- points of the specified resource type.
    --
    -- Only Amazon EFS and Amazon EC2 recovery points return BackupVaultName.
    ListRecoveryPointsByResourceResponse
-> Maybe [RecoveryPointByResource]
recoveryPoints :: Prelude.Maybe [RecoveryPointByResource],
    -- | The response's http status code.
    ListRecoveryPointsByResourceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListRecoveryPointsByResourceResponse
-> ListRecoveryPointsByResourceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecoveryPointsByResourceResponse
-> ListRecoveryPointsByResourceResponse -> Bool
$c/= :: ListRecoveryPointsByResourceResponse
-> ListRecoveryPointsByResourceResponse -> Bool
== :: ListRecoveryPointsByResourceResponse
-> ListRecoveryPointsByResourceResponse -> Bool
$c== :: ListRecoveryPointsByResourceResponse
-> ListRecoveryPointsByResourceResponse -> Bool
Prelude.Eq, ReadPrec [ListRecoveryPointsByResourceResponse]
ReadPrec ListRecoveryPointsByResourceResponse
Int -> ReadS ListRecoveryPointsByResourceResponse
ReadS [ListRecoveryPointsByResourceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecoveryPointsByResourceResponse]
$creadListPrec :: ReadPrec [ListRecoveryPointsByResourceResponse]
readPrec :: ReadPrec ListRecoveryPointsByResourceResponse
$creadPrec :: ReadPrec ListRecoveryPointsByResourceResponse
readList :: ReadS [ListRecoveryPointsByResourceResponse]
$creadList :: ReadS [ListRecoveryPointsByResourceResponse]
readsPrec :: Int -> ReadS ListRecoveryPointsByResourceResponse
$creadsPrec :: Int -> ReadS ListRecoveryPointsByResourceResponse
Prelude.Read, Int -> ListRecoveryPointsByResourceResponse -> ShowS
[ListRecoveryPointsByResourceResponse] -> ShowS
ListRecoveryPointsByResourceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecoveryPointsByResourceResponse] -> ShowS
$cshowList :: [ListRecoveryPointsByResourceResponse] -> ShowS
show :: ListRecoveryPointsByResourceResponse -> String
$cshow :: ListRecoveryPointsByResourceResponse -> String
showsPrec :: Int -> ListRecoveryPointsByResourceResponse -> ShowS
$cshowsPrec :: Int -> ListRecoveryPointsByResourceResponse -> ShowS
Prelude.Show, forall x.
Rep ListRecoveryPointsByResourceResponse x
-> ListRecoveryPointsByResourceResponse
forall x.
ListRecoveryPointsByResourceResponse
-> Rep ListRecoveryPointsByResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRecoveryPointsByResourceResponse x
-> ListRecoveryPointsByResourceResponse
$cfrom :: forall x.
ListRecoveryPointsByResourceResponse
-> Rep ListRecoveryPointsByResourceResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRecoveryPointsByResourceResponse' 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', 'listRecoveryPointsByResourceResponse_nextToken' - The next item following a partial list of returned items. For example,
-- if a request is made to return @maxResults@ number of items, @NextToken@
-- allows you to return more items in your list starting at the location
-- pointed to by the next token.
--
-- 'recoveryPoints', 'listRecoveryPointsByResourceResponse_recoveryPoints' - An array of objects that contain detailed information about recovery
-- points of the specified resource type.
--
-- Only Amazon EFS and Amazon EC2 recovery points return BackupVaultName.
--
-- 'httpStatus', 'listRecoveryPointsByResourceResponse_httpStatus' - The response's http status code.
newListRecoveryPointsByResourceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRecoveryPointsByResourceResponse
newListRecoveryPointsByResourceResponse :: Int -> ListRecoveryPointsByResourceResponse
newListRecoveryPointsByResourceResponse Int
pHttpStatus_ =
  ListRecoveryPointsByResourceResponse'
    { $sel:nextToken:ListRecoveryPointsByResourceResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:recoveryPoints:ListRecoveryPointsByResourceResponse' :: Maybe [RecoveryPointByResource]
recoveryPoints = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRecoveryPointsByResourceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | An array of objects that contain detailed information about recovery
-- points of the specified resource type.
--
-- Only Amazon EFS and Amazon EC2 recovery points return BackupVaultName.
listRecoveryPointsByResourceResponse_recoveryPoints :: Lens.Lens' ListRecoveryPointsByResourceResponse (Prelude.Maybe [RecoveryPointByResource])
listRecoveryPointsByResourceResponse_recoveryPoints :: Lens'
  ListRecoveryPointsByResourceResponse
  (Maybe [RecoveryPointByResource])
listRecoveryPointsByResourceResponse_recoveryPoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsByResourceResponse' {Maybe [RecoveryPointByResource]
recoveryPoints :: Maybe [RecoveryPointByResource]
$sel:recoveryPoints:ListRecoveryPointsByResourceResponse' :: ListRecoveryPointsByResourceResponse
-> Maybe [RecoveryPointByResource]
recoveryPoints} -> Maybe [RecoveryPointByResource]
recoveryPoints) (\s :: ListRecoveryPointsByResourceResponse
s@ListRecoveryPointsByResourceResponse' {} Maybe [RecoveryPointByResource]
a -> ListRecoveryPointsByResourceResponse
s {$sel:recoveryPoints:ListRecoveryPointsByResourceResponse' :: Maybe [RecoveryPointByResource]
recoveryPoints = Maybe [RecoveryPointByResource]
a} :: ListRecoveryPointsByResourceResponse) 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.
listRecoveryPointsByResourceResponse_httpStatus :: Lens.Lens' ListRecoveryPointsByResourceResponse Prelude.Int
listRecoveryPointsByResourceResponse_httpStatus :: Lens' ListRecoveryPointsByResourceResponse Int
listRecoveryPointsByResourceResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsByResourceResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListRecoveryPointsByResourceResponse' :: ListRecoveryPointsByResourceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListRecoveryPointsByResourceResponse
s@ListRecoveryPointsByResourceResponse' {} Int
a -> ListRecoveryPointsByResourceResponse
s {$sel:httpStatus:ListRecoveryPointsByResourceResponse' :: Int
httpStatus = Int
a} :: ListRecoveryPointsByResourceResponse)

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