{-# 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.RedshiftServerLess.ListRecoveryPoints
-- 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 an array of recovery points.
--
-- This operation returns paginated results.
module Amazonka.RedshiftServerLess.ListRecoveryPoints
  ( -- * Creating a Request
    ListRecoveryPoints (..),
    newListRecoveryPoints,

    -- * Request Lenses
    listRecoveryPoints_endTime,
    listRecoveryPoints_maxResults,
    listRecoveryPoints_namespaceArn,
    listRecoveryPoints_namespaceName,
    listRecoveryPoints_nextToken,
    listRecoveryPoints_startTime,

    -- * Destructuring the Response
    ListRecoveryPointsResponse (..),
    newListRecoveryPointsResponse,

    -- * Response Lenses
    listRecoveryPointsResponse_nextToken,
    listRecoveryPointsResponse_recoveryPoints,
    listRecoveryPointsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.RedshiftServerLess.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListRecoveryPoints' smart constructor.
data ListRecoveryPoints = ListRecoveryPoints'
  { -- | The time when creation of the recovery point finished.
    ListRecoveryPoints -> Maybe POSIX
endTime :: Prelude.Maybe Data.POSIX,
    -- | An optional parameter that specifies the maximum number of results to
    -- return. You can use @nextToken@ to display the next page of results.
    ListRecoveryPoints -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the namespace from which to list
    -- recovery points.
    ListRecoveryPoints -> Maybe Text
namespaceArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the namespace to list recovery points for.
    ListRecoveryPoints -> Maybe Text
namespaceName :: Prelude.Maybe Prelude.Text,
    -- | If your initial @ListRecoveryPoints@ operation returns a @nextToken@,
    -- you can include the returned @nextToken@ in following
    -- @ListRecoveryPoints@ operations, which returns results in the next page.
    ListRecoveryPoints -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The time when the recovery point\'s creation was initiated.
    ListRecoveryPoints -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX
  }
  deriving (ListRecoveryPoints -> ListRecoveryPoints -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecoveryPoints -> ListRecoveryPoints -> Bool
$c/= :: ListRecoveryPoints -> ListRecoveryPoints -> Bool
== :: ListRecoveryPoints -> ListRecoveryPoints -> Bool
$c== :: ListRecoveryPoints -> ListRecoveryPoints -> Bool
Prelude.Eq, ReadPrec [ListRecoveryPoints]
ReadPrec ListRecoveryPoints
Int -> ReadS ListRecoveryPoints
ReadS [ListRecoveryPoints]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecoveryPoints]
$creadListPrec :: ReadPrec [ListRecoveryPoints]
readPrec :: ReadPrec ListRecoveryPoints
$creadPrec :: ReadPrec ListRecoveryPoints
readList :: ReadS [ListRecoveryPoints]
$creadList :: ReadS [ListRecoveryPoints]
readsPrec :: Int -> ReadS ListRecoveryPoints
$creadsPrec :: Int -> ReadS ListRecoveryPoints
Prelude.Read, Int -> ListRecoveryPoints -> ShowS
[ListRecoveryPoints] -> ShowS
ListRecoveryPoints -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecoveryPoints] -> ShowS
$cshowList :: [ListRecoveryPoints] -> ShowS
show :: ListRecoveryPoints -> String
$cshow :: ListRecoveryPoints -> String
showsPrec :: Int -> ListRecoveryPoints -> ShowS
$cshowsPrec :: Int -> ListRecoveryPoints -> ShowS
Prelude.Show, forall x. Rep ListRecoveryPoints x -> ListRecoveryPoints
forall x. ListRecoveryPoints -> Rep ListRecoveryPoints x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRecoveryPoints x -> ListRecoveryPoints
$cfrom :: forall x. ListRecoveryPoints -> Rep ListRecoveryPoints x
Prelude.Generic)

-- |
-- Create a value of 'ListRecoveryPoints' 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:
--
-- 'endTime', 'listRecoveryPoints_endTime' - The time when creation of the recovery point finished.
--
-- 'maxResults', 'listRecoveryPoints_maxResults' - An optional parameter that specifies the maximum number of results to
-- return. You can use @nextToken@ to display the next page of results.
--
-- 'namespaceArn', 'listRecoveryPoints_namespaceArn' - The Amazon Resource Name (ARN) of the namespace from which to list
-- recovery points.
--
-- 'namespaceName', 'listRecoveryPoints_namespaceName' - The name of the namespace to list recovery points for.
--
-- 'nextToken', 'listRecoveryPoints_nextToken' - If your initial @ListRecoveryPoints@ operation returns a @nextToken@,
-- you can include the returned @nextToken@ in following
-- @ListRecoveryPoints@ operations, which returns results in the next page.
--
-- 'startTime', 'listRecoveryPoints_startTime' - The time when the recovery point\'s creation was initiated.
newListRecoveryPoints ::
  ListRecoveryPoints
newListRecoveryPoints :: ListRecoveryPoints
newListRecoveryPoints =
  ListRecoveryPoints'
    { $sel:endTime:ListRecoveryPoints' :: Maybe POSIX
endTime = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListRecoveryPoints' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:namespaceArn:ListRecoveryPoints' :: Maybe Text
namespaceArn = forall a. Maybe a
Prelude.Nothing,
      $sel:namespaceName:ListRecoveryPoints' :: Maybe Text
namespaceName = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRecoveryPoints' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:ListRecoveryPoints' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing
    }

-- | The time when creation of the recovery point finished.
listRecoveryPoints_endTime :: Lens.Lens' ListRecoveryPoints (Prelude.Maybe Prelude.UTCTime)
listRecoveryPoints_endTime :: Lens' ListRecoveryPoints (Maybe UTCTime)
listRecoveryPoints_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPoints' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: ListRecoveryPoints
s@ListRecoveryPoints' {} Maybe POSIX
a -> ListRecoveryPoints
s {$sel:endTime:ListRecoveryPoints' :: Maybe POSIX
endTime = Maybe POSIX
a} :: ListRecoveryPoints) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | An optional parameter that specifies the maximum number of results to
-- return. You can use @nextToken@ to display the next page of results.
listRecoveryPoints_maxResults :: Lens.Lens' ListRecoveryPoints (Prelude.Maybe Prelude.Natural)
listRecoveryPoints_maxResults :: Lens' ListRecoveryPoints (Maybe Natural)
listRecoveryPoints_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPoints' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListRecoveryPoints
s@ListRecoveryPoints' {} Maybe Natural
a -> ListRecoveryPoints
s {$sel:maxResults:ListRecoveryPoints' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListRecoveryPoints)

-- | The Amazon Resource Name (ARN) of the namespace from which to list
-- recovery points.
listRecoveryPoints_namespaceArn :: Lens.Lens' ListRecoveryPoints (Prelude.Maybe Prelude.Text)
listRecoveryPoints_namespaceArn :: Lens' ListRecoveryPoints (Maybe Text)
listRecoveryPoints_namespaceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPoints' {Maybe Text
namespaceArn :: Maybe Text
$sel:namespaceArn:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Text
namespaceArn} -> Maybe Text
namespaceArn) (\s :: ListRecoveryPoints
s@ListRecoveryPoints' {} Maybe Text
a -> ListRecoveryPoints
s {$sel:namespaceArn:ListRecoveryPoints' :: Maybe Text
namespaceArn = Maybe Text
a} :: ListRecoveryPoints)

-- | The name of the namespace to list recovery points for.
listRecoveryPoints_namespaceName :: Lens.Lens' ListRecoveryPoints (Prelude.Maybe Prelude.Text)
listRecoveryPoints_namespaceName :: Lens' ListRecoveryPoints (Maybe Text)
listRecoveryPoints_namespaceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPoints' {Maybe Text
namespaceName :: Maybe Text
$sel:namespaceName:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Text
namespaceName} -> Maybe Text
namespaceName) (\s :: ListRecoveryPoints
s@ListRecoveryPoints' {} Maybe Text
a -> ListRecoveryPoints
s {$sel:namespaceName:ListRecoveryPoints' :: Maybe Text
namespaceName = Maybe Text
a} :: ListRecoveryPoints)

-- | If your initial @ListRecoveryPoints@ operation returns a @nextToken@,
-- you can include the returned @nextToken@ in following
-- @ListRecoveryPoints@ operations, which returns results in the next page.
listRecoveryPoints_nextToken :: Lens.Lens' ListRecoveryPoints (Prelude.Maybe Prelude.Text)
listRecoveryPoints_nextToken :: Lens' ListRecoveryPoints (Maybe Text)
listRecoveryPoints_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPoints' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRecoveryPoints
s@ListRecoveryPoints' {} Maybe Text
a -> ListRecoveryPoints
s {$sel:nextToken:ListRecoveryPoints' :: Maybe Text
nextToken = Maybe Text
a} :: ListRecoveryPoints)

-- | The time when the recovery point\'s creation was initiated.
listRecoveryPoints_startTime :: Lens.Lens' ListRecoveryPoints (Prelude.Maybe Prelude.UTCTime)
listRecoveryPoints_startTime :: Lens' ListRecoveryPoints (Maybe UTCTime)
listRecoveryPoints_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPoints' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: ListRecoveryPoints
s@ListRecoveryPoints' {} Maybe POSIX
a -> ListRecoveryPoints
s {$sel:startTime:ListRecoveryPoints' :: Maybe POSIX
startTime = Maybe POSIX
a} :: ListRecoveryPoints) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Core.AWSPager ListRecoveryPoints where
  page :: ListRecoveryPoints
-> AWSResponse ListRecoveryPoints -> Maybe ListRecoveryPoints
page ListRecoveryPoints
rq AWSResponse ListRecoveryPoints
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRecoveryPoints
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRecoveryPointsResponse (Maybe Text)
listRecoveryPointsResponse_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 ListRecoveryPoints
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRecoveryPointsResponse (Maybe [RecoveryPoint])
listRecoveryPointsResponse_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.$ ListRecoveryPoints
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListRecoveryPoints (Maybe Text)
listRecoveryPoints_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRecoveryPoints
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRecoveryPointsResponse (Maybe Text)
listRecoveryPointsResponse_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 ListRecoveryPoints where
  type
    AWSResponse ListRecoveryPoints =
      ListRecoveryPointsResponse
  request :: (Service -> Service)
-> ListRecoveryPoints -> Request ListRecoveryPoints
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListRecoveryPoints
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListRecoveryPoints)))
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 [RecoveryPoint] -> Int -> ListRecoveryPointsResponse
ListRecoveryPointsResponse'
            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 ListRecoveryPoints where
  hashWithSalt :: Int -> ListRecoveryPoints -> Int
hashWithSalt Int
_salt ListRecoveryPoints' {Maybe Natural
Maybe Text
Maybe POSIX
startTime :: Maybe POSIX
nextToken :: Maybe Text
namespaceName :: Maybe Text
namespaceArn :: Maybe Text
maxResults :: Maybe Natural
endTime :: Maybe POSIX
$sel:startTime:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe POSIX
$sel:nextToken:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Text
$sel:namespaceName:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Text
$sel:namespaceArn:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Text
$sel:maxResults:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Natural
$sel:endTime:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
endTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
namespaceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
namespaceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime

instance Prelude.NFData ListRecoveryPoints where
  rnf :: ListRecoveryPoints -> ()
rnf ListRecoveryPoints' {Maybe Natural
Maybe Text
Maybe POSIX
startTime :: Maybe POSIX
nextToken :: Maybe Text
namespaceName :: Maybe Text
namespaceArn :: Maybe Text
maxResults :: Maybe Natural
endTime :: Maybe POSIX
$sel:startTime:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe POSIX
$sel:nextToken:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Text
$sel:namespaceName:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Text
$sel:namespaceArn:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Text
$sel:maxResults:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Natural
$sel:endTime:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
endTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
namespaceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
namespaceName
      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 Maybe POSIX
startTime

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

instance Data.ToJSON ListRecoveryPoints where
  toJSON :: ListRecoveryPoints -> Value
toJSON ListRecoveryPoints' {Maybe Natural
Maybe Text
Maybe POSIX
startTime :: Maybe POSIX
nextToken :: Maybe Text
namespaceName :: Maybe Text
namespaceArn :: Maybe Text
maxResults :: Maybe Natural
endTime :: Maybe POSIX
$sel:startTime:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe POSIX
$sel:nextToken:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Text
$sel:namespaceName:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Text
$sel:namespaceArn:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Text
$sel:maxResults:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe Natural
$sel:endTime:ListRecoveryPoints' :: ListRecoveryPoints -> Maybe POSIX
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"endTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
endTime,
            (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"namespaceArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
namespaceArn,
            (Key
"namespaceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
namespaceName,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"startTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
startTime
          ]
      )

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

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

-- | /See:/ 'newListRecoveryPointsResponse' smart constructor.
data ListRecoveryPointsResponse = ListRecoveryPointsResponse'
  { -- | If @nextToken@ is returned, there are more results available. The value
    -- of @nextToken@ is a unique pagination token for each page. Make the call
    -- again using the returned token to retrieve the next page.
    ListRecoveryPointsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The returned recovery point objects.
    ListRecoveryPointsResponse -> Maybe [RecoveryPoint]
recoveryPoints :: Prelude.Maybe [RecoveryPoint],
    -- | The response's http status code.
    ListRecoveryPointsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListRecoveryPointsResponse -> ListRecoveryPointsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecoveryPointsResponse -> ListRecoveryPointsResponse -> Bool
$c/= :: ListRecoveryPointsResponse -> ListRecoveryPointsResponse -> Bool
== :: ListRecoveryPointsResponse -> ListRecoveryPointsResponse -> Bool
$c== :: ListRecoveryPointsResponse -> ListRecoveryPointsResponse -> Bool
Prelude.Eq, ReadPrec [ListRecoveryPointsResponse]
ReadPrec ListRecoveryPointsResponse
Int -> ReadS ListRecoveryPointsResponse
ReadS [ListRecoveryPointsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecoveryPointsResponse]
$creadListPrec :: ReadPrec [ListRecoveryPointsResponse]
readPrec :: ReadPrec ListRecoveryPointsResponse
$creadPrec :: ReadPrec ListRecoveryPointsResponse
readList :: ReadS [ListRecoveryPointsResponse]
$creadList :: ReadS [ListRecoveryPointsResponse]
readsPrec :: Int -> ReadS ListRecoveryPointsResponse
$creadsPrec :: Int -> ReadS ListRecoveryPointsResponse
Prelude.Read, Int -> ListRecoveryPointsResponse -> ShowS
[ListRecoveryPointsResponse] -> ShowS
ListRecoveryPointsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecoveryPointsResponse] -> ShowS
$cshowList :: [ListRecoveryPointsResponse] -> ShowS
show :: ListRecoveryPointsResponse -> String
$cshow :: ListRecoveryPointsResponse -> String
showsPrec :: Int -> ListRecoveryPointsResponse -> ShowS
$cshowsPrec :: Int -> ListRecoveryPointsResponse -> ShowS
Prelude.Show, forall x.
Rep ListRecoveryPointsResponse x -> ListRecoveryPointsResponse
forall x.
ListRecoveryPointsResponse -> Rep ListRecoveryPointsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRecoveryPointsResponse x -> ListRecoveryPointsResponse
$cfrom :: forall x.
ListRecoveryPointsResponse -> Rep ListRecoveryPointsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRecoveryPointsResponse' 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', 'listRecoveryPointsResponse_nextToken' - If @nextToken@ is returned, there are more results available. The value
-- of @nextToken@ is a unique pagination token for each page. Make the call
-- again using the returned token to retrieve the next page.
--
-- 'recoveryPoints', 'listRecoveryPointsResponse_recoveryPoints' - The returned recovery point objects.
--
-- 'httpStatus', 'listRecoveryPointsResponse_httpStatus' - The response's http status code.
newListRecoveryPointsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRecoveryPointsResponse
newListRecoveryPointsResponse :: Int -> ListRecoveryPointsResponse
newListRecoveryPointsResponse Int
pHttpStatus_ =
  ListRecoveryPointsResponse'
    { $sel:nextToken:ListRecoveryPointsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:recoveryPoints:ListRecoveryPointsResponse' :: Maybe [RecoveryPoint]
recoveryPoints = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRecoveryPointsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If @nextToken@ is returned, there are more results available. The value
-- of @nextToken@ is a unique pagination token for each page. Make the call
-- again using the returned token to retrieve the next page.
listRecoveryPointsResponse_nextToken :: Lens.Lens' ListRecoveryPointsResponse (Prelude.Maybe Prelude.Text)
listRecoveryPointsResponse_nextToken :: Lens' ListRecoveryPointsResponse (Maybe Text)
listRecoveryPointsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRecoveryPointsResponse' :: ListRecoveryPointsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRecoveryPointsResponse
s@ListRecoveryPointsResponse' {} Maybe Text
a -> ListRecoveryPointsResponse
s {$sel:nextToken:ListRecoveryPointsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRecoveryPointsResponse)

-- | The returned recovery point objects.
listRecoveryPointsResponse_recoveryPoints :: Lens.Lens' ListRecoveryPointsResponse (Prelude.Maybe [RecoveryPoint])
listRecoveryPointsResponse_recoveryPoints :: Lens' ListRecoveryPointsResponse (Maybe [RecoveryPoint])
listRecoveryPointsResponse_recoveryPoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsResponse' {Maybe [RecoveryPoint]
recoveryPoints :: Maybe [RecoveryPoint]
$sel:recoveryPoints:ListRecoveryPointsResponse' :: ListRecoveryPointsResponse -> Maybe [RecoveryPoint]
recoveryPoints} -> Maybe [RecoveryPoint]
recoveryPoints) (\s :: ListRecoveryPointsResponse
s@ListRecoveryPointsResponse' {} Maybe [RecoveryPoint]
a -> ListRecoveryPointsResponse
s {$sel:recoveryPoints:ListRecoveryPointsResponse' :: Maybe [RecoveryPoint]
recoveryPoints = Maybe [RecoveryPoint]
a} :: ListRecoveryPointsResponse) 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.
listRecoveryPointsResponse_httpStatus :: Lens.Lens' ListRecoveryPointsResponse Prelude.Int
listRecoveryPointsResponse_httpStatus :: Lens' ListRecoveryPointsResponse Int
listRecoveryPointsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecoveryPointsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListRecoveryPointsResponse' :: ListRecoveryPointsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListRecoveryPointsResponse
s@ListRecoveryPointsResponse' {} Int
a -> ListRecoveryPointsResponse
s {$sel:httpStatus:ListRecoveryPointsResponse' :: Int
httpStatus = Int
a} :: ListRecoveryPointsResponse)

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