{-# 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.StorageGateway.DescribeTapeRecoveryPoints
-- 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 list of virtual tape recovery points that are available for
-- the specified tape gateway.
--
-- A recovery point is a point-in-time view of a virtual tape at which all
-- the data on the virtual tape is consistent. If your gateway crashes,
-- virtual tapes that have recovery points can be recovered to a new
-- gateway. This operation is only supported in the tape gateway type.
--
-- This operation returns paginated results.
module Amazonka.StorageGateway.DescribeTapeRecoveryPoints
  ( -- * Creating a Request
    DescribeTapeRecoveryPoints (..),
    newDescribeTapeRecoveryPoints,

    -- * Request Lenses
    describeTapeRecoveryPoints_marker,
    describeTapeRecoveryPoints_limit,
    describeTapeRecoveryPoints_gatewayARN,

    -- * Destructuring the Response
    DescribeTapeRecoveryPointsResponse (..),
    newDescribeTapeRecoveryPointsResponse,

    -- * Response Lenses
    describeTapeRecoveryPointsResponse_tapeRecoveryPointInfos,
    describeTapeRecoveryPointsResponse_gatewayARN,
    describeTapeRecoveryPointsResponse_marker,
    describeTapeRecoveryPointsResponse_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.StorageGateway.Types

-- | DescribeTapeRecoveryPointsInput
--
-- /See:/ 'newDescribeTapeRecoveryPoints' smart constructor.
data DescribeTapeRecoveryPoints = DescribeTapeRecoveryPoints'
  { -- | An opaque string that indicates the position at which to begin
    -- describing the virtual tape recovery points.
    DescribeTapeRecoveryPoints -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Specifies that the number of virtual tape recovery points that are
    -- described be limited to the specified number.
    DescribeTapeRecoveryPoints -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    DescribeTapeRecoveryPoints -> Text
gatewayARN :: Prelude.Text
  }
  deriving (DescribeTapeRecoveryPoints -> DescribeTapeRecoveryPoints -> Bool
(DescribeTapeRecoveryPoints -> DescribeTapeRecoveryPoints -> Bool)
-> (DescribeTapeRecoveryPoints
    -> DescribeTapeRecoveryPoints -> Bool)
-> Eq DescribeTapeRecoveryPoints
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTapeRecoveryPoints -> DescribeTapeRecoveryPoints -> Bool
$c/= :: DescribeTapeRecoveryPoints -> DescribeTapeRecoveryPoints -> Bool
== :: DescribeTapeRecoveryPoints -> DescribeTapeRecoveryPoints -> Bool
$c== :: DescribeTapeRecoveryPoints -> DescribeTapeRecoveryPoints -> Bool
Prelude.Eq, ReadPrec [DescribeTapeRecoveryPoints]
ReadPrec DescribeTapeRecoveryPoints
Int -> ReadS DescribeTapeRecoveryPoints
ReadS [DescribeTapeRecoveryPoints]
(Int -> ReadS DescribeTapeRecoveryPoints)
-> ReadS [DescribeTapeRecoveryPoints]
-> ReadPrec DescribeTapeRecoveryPoints
-> ReadPrec [DescribeTapeRecoveryPoints]
-> Read DescribeTapeRecoveryPoints
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTapeRecoveryPoints]
$creadListPrec :: ReadPrec [DescribeTapeRecoveryPoints]
readPrec :: ReadPrec DescribeTapeRecoveryPoints
$creadPrec :: ReadPrec DescribeTapeRecoveryPoints
readList :: ReadS [DescribeTapeRecoveryPoints]
$creadList :: ReadS [DescribeTapeRecoveryPoints]
readsPrec :: Int -> ReadS DescribeTapeRecoveryPoints
$creadsPrec :: Int -> ReadS DescribeTapeRecoveryPoints
Prelude.Read, Int -> DescribeTapeRecoveryPoints -> ShowS
[DescribeTapeRecoveryPoints] -> ShowS
DescribeTapeRecoveryPoints -> String
(Int -> DescribeTapeRecoveryPoints -> ShowS)
-> (DescribeTapeRecoveryPoints -> String)
-> ([DescribeTapeRecoveryPoints] -> ShowS)
-> Show DescribeTapeRecoveryPoints
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTapeRecoveryPoints] -> ShowS
$cshowList :: [DescribeTapeRecoveryPoints] -> ShowS
show :: DescribeTapeRecoveryPoints -> String
$cshow :: DescribeTapeRecoveryPoints -> String
showsPrec :: Int -> DescribeTapeRecoveryPoints -> ShowS
$cshowsPrec :: Int -> DescribeTapeRecoveryPoints -> ShowS
Prelude.Show, (forall x.
 DescribeTapeRecoveryPoints -> Rep DescribeTapeRecoveryPoints x)
-> (forall x.
    Rep DescribeTapeRecoveryPoints x -> DescribeTapeRecoveryPoints)
-> Generic DescribeTapeRecoveryPoints
forall x.
Rep DescribeTapeRecoveryPoints x -> DescribeTapeRecoveryPoints
forall x.
DescribeTapeRecoveryPoints -> Rep DescribeTapeRecoveryPoints x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTapeRecoveryPoints x -> DescribeTapeRecoveryPoints
$cfrom :: forall x.
DescribeTapeRecoveryPoints -> Rep DescribeTapeRecoveryPoints x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTapeRecoveryPoints' 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:
--
-- 'marker', 'describeTapeRecoveryPoints_marker' - An opaque string that indicates the position at which to begin
-- describing the virtual tape recovery points.
--
-- 'limit', 'describeTapeRecoveryPoints_limit' - Specifies that the number of virtual tape recovery points that are
-- described be limited to the specified number.
--
-- 'gatewayARN', 'describeTapeRecoveryPoints_gatewayARN' - Undocumented member.
newDescribeTapeRecoveryPoints ::
  -- | 'gatewayARN'
  Prelude.Text ->
  DescribeTapeRecoveryPoints
newDescribeTapeRecoveryPoints :: Text -> DescribeTapeRecoveryPoints
newDescribeTapeRecoveryPoints Text
pGatewayARN_ =
  DescribeTapeRecoveryPoints' :: Maybe Text -> Maybe Natural -> Text -> DescribeTapeRecoveryPoints
DescribeTapeRecoveryPoints'
    { $sel:marker:DescribeTapeRecoveryPoints' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeTapeRecoveryPoints' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayARN:DescribeTapeRecoveryPoints' :: Text
gatewayARN = Text
pGatewayARN_
    }

-- | An opaque string that indicates the position at which to begin
-- describing the virtual tape recovery points.
describeTapeRecoveryPoints_marker :: Lens.Lens' DescribeTapeRecoveryPoints (Prelude.Maybe Prelude.Text)
describeTapeRecoveryPoints_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeTapeRecoveryPoints -> f DescribeTapeRecoveryPoints
describeTapeRecoveryPoints_marker = (DescribeTapeRecoveryPoints -> Maybe Text)
-> (DescribeTapeRecoveryPoints
    -> Maybe Text -> DescribeTapeRecoveryPoints)
-> Lens
     DescribeTapeRecoveryPoints
     DescribeTapeRecoveryPoints
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTapeRecoveryPoints' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeTapeRecoveryPoints' :: DescribeTapeRecoveryPoints -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeTapeRecoveryPoints
s@DescribeTapeRecoveryPoints' {} Maybe Text
a -> DescribeTapeRecoveryPoints
s {$sel:marker:DescribeTapeRecoveryPoints' :: Maybe Text
marker = Maybe Text
a} :: DescribeTapeRecoveryPoints)

-- | Specifies that the number of virtual tape recovery points that are
-- described be limited to the specified number.
describeTapeRecoveryPoints_limit :: Lens.Lens' DescribeTapeRecoveryPoints (Prelude.Maybe Prelude.Natural)
describeTapeRecoveryPoints_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeTapeRecoveryPoints -> f DescribeTapeRecoveryPoints
describeTapeRecoveryPoints_limit = (DescribeTapeRecoveryPoints -> Maybe Natural)
-> (DescribeTapeRecoveryPoints
    -> Maybe Natural -> DescribeTapeRecoveryPoints)
-> Lens
     DescribeTapeRecoveryPoints
     DescribeTapeRecoveryPoints
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTapeRecoveryPoints' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeTapeRecoveryPoints' :: DescribeTapeRecoveryPoints -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeTapeRecoveryPoints
s@DescribeTapeRecoveryPoints' {} Maybe Natural
a -> DescribeTapeRecoveryPoints
s {$sel:limit:DescribeTapeRecoveryPoints' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeTapeRecoveryPoints)

-- | Undocumented member.
describeTapeRecoveryPoints_gatewayARN :: Lens.Lens' DescribeTapeRecoveryPoints Prelude.Text
describeTapeRecoveryPoints_gatewayARN :: (Text -> f Text)
-> DescribeTapeRecoveryPoints -> f DescribeTapeRecoveryPoints
describeTapeRecoveryPoints_gatewayARN = (DescribeTapeRecoveryPoints -> Text)
-> (DescribeTapeRecoveryPoints
    -> Text -> DescribeTapeRecoveryPoints)
-> Lens
     DescribeTapeRecoveryPoints DescribeTapeRecoveryPoints Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTapeRecoveryPoints' {Text
gatewayARN :: Text
$sel:gatewayARN:DescribeTapeRecoveryPoints' :: DescribeTapeRecoveryPoints -> Text
gatewayARN} -> Text
gatewayARN) (\s :: DescribeTapeRecoveryPoints
s@DescribeTapeRecoveryPoints' {} Text
a -> DescribeTapeRecoveryPoints
s {$sel:gatewayARN:DescribeTapeRecoveryPoints' :: Text
gatewayARN = Text
a} :: DescribeTapeRecoveryPoints)

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

instance Prelude.NFData DescribeTapeRecoveryPoints

instance Core.ToHeaders DescribeTapeRecoveryPoints where
  toHeaders :: DescribeTapeRecoveryPoints -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeTapeRecoveryPoints -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"StorageGateway_20130630.DescribeTapeRecoveryPoints" ::
                          Prelude.ByteString
                      ),
            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.ToJSON DescribeTapeRecoveryPoints where
  toJSON :: DescribeTapeRecoveryPoints -> Value
toJSON DescribeTapeRecoveryPoints' {Maybe Natural
Maybe Text
Text
gatewayARN :: Text
limit :: Maybe Natural
marker :: Maybe Text
$sel:gatewayARN:DescribeTapeRecoveryPoints' :: DescribeTapeRecoveryPoints -> Text
$sel:limit:DescribeTapeRecoveryPoints' :: DescribeTapeRecoveryPoints -> Maybe Natural
$sel:marker:DescribeTapeRecoveryPoints' :: DescribeTapeRecoveryPoints -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Marker" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
marker,
            (Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GatewayARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gatewayARN)
          ]
      )

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

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

-- | DescribeTapeRecoveryPointsOutput
--
-- /See:/ 'newDescribeTapeRecoveryPointsResponse' smart constructor.
data DescribeTapeRecoveryPointsResponse = DescribeTapeRecoveryPointsResponse'
  { -- | An array of TapeRecoveryPointInfos that are available for the specified
    -- gateway.
    DescribeTapeRecoveryPointsResponse -> Maybe [TapeRecoveryPointInfo]
tapeRecoveryPointInfos :: Prelude.Maybe [TapeRecoveryPointInfo],
    DescribeTapeRecoveryPointsResponse -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
    -- | An opaque string that indicates the position at which the virtual tape
    -- recovery points that were listed for description ended.
    --
    -- Use this marker in your next request to list the next set of virtual
    -- tape recovery points in the list. If there are no more recovery points
    -- to describe, this field does not appear in the response.
    DescribeTapeRecoveryPointsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeTapeRecoveryPointsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeTapeRecoveryPointsResponse
-> DescribeTapeRecoveryPointsResponse -> Bool
(DescribeTapeRecoveryPointsResponse
 -> DescribeTapeRecoveryPointsResponse -> Bool)
-> (DescribeTapeRecoveryPointsResponse
    -> DescribeTapeRecoveryPointsResponse -> Bool)
-> Eq DescribeTapeRecoveryPointsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTapeRecoveryPointsResponse
-> DescribeTapeRecoveryPointsResponse -> Bool
$c/= :: DescribeTapeRecoveryPointsResponse
-> DescribeTapeRecoveryPointsResponse -> Bool
== :: DescribeTapeRecoveryPointsResponse
-> DescribeTapeRecoveryPointsResponse -> Bool
$c== :: DescribeTapeRecoveryPointsResponse
-> DescribeTapeRecoveryPointsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTapeRecoveryPointsResponse]
ReadPrec DescribeTapeRecoveryPointsResponse
Int -> ReadS DescribeTapeRecoveryPointsResponse
ReadS [DescribeTapeRecoveryPointsResponse]
(Int -> ReadS DescribeTapeRecoveryPointsResponse)
-> ReadS [DescribeTapeRecoveryPointsResponse]
-> ReadPrec DescribeTapeRecoveryPointsResponse
-> ReadPrec [DescribeTapeRecoveryPointsResponse]
-> Read DescribeTapeRecoveryPointsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTapeRecoveryPointsResponse]
$creadListPrec :: ReadPrec [DescribeTapeRecoveryPointsResponse]
readPrec :: ReadPrec DescribeTapeRecoveryPointsResponse
$creadPrec :: ReadPrec DescribeTapeRecoveryPointsResponse
readList :: ReadS [DescribeTapeRecoveryPointsResponse]
$creadList :: ReadS [DescribeTapeRecoveryPointsResponse]
readsPrec :: Int -> ReadS DescribeTapeRecoveryPointsResponse
$creadsPrec :: Int -> ReadS DescribeTapeRecoveryPointsResponse
Prelude.Read, Int -> DescribeTapeRecoveryPointsResponse -> ShowS
[DescribeTapeRecoveryPointsResponse] -> ShowS
DescribeTapeRecoveryPointsResponse -> String
(Int -> DescribeTapeRecoveryPointsResponse -> ShowS)
-> (DescribeTapeRecoveryPointsResponse -> String)
-> ([DescribeTapeRecoveryPointsResponse] -> ShowS)
-> Show DescribeTapeRecoveryPointsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTapeRecoveryPointsResponse] -> ShowS
$cshowList :: [DescribeTapeRecoveryPointsResponse] -> ShowS
show :: DescribeTapeRecoveryPointsResponse -> String
$cshow :: DescribeTapeRecoveryPointsResponse -> String
showsPrec :: Int -> DescribeTapeRecoveryPointsResponse -> ShowS
$cshowsPrec :: Int -> DescribeTapeRecoveryPointsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeTapeRecoveryPointsResponse
 -> Rep DescribeTapeRecoveryPointsResponse x)
-> (forall x.
    Rep DescribeTapeRecoveryPointsResponse x
    -> DescribeTapeRecoveryPointsResponse)
-> Generic DescribeTapeRecoveryPointsResponse
forall x.
Rep DescribeTapeRecoveryPointsResponse x
-> DescribeTapeRecoveryPointsResponse
forall x.
DescribeTapeRecoveryPointsResponse
-> Rep DescribeTapeRecoveryPointsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTapeRecoveryPointsResponse x
-> DescribeTapeRecoveryPointsResponse
$cfrom :: forall x.
DescribeTapeRecoveryPointsResponse
-> Rep DescribeTapeRecoveryPointsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTapeRecoveryPointsResponse' 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:
--
-- 'tapeRecoveryPointInfos', 'describeTapeRecoveryPointsResponse_tapeRecoveryPointInfos' - An array of TapeRecoveryPointInfos that are available for the specified
-- gateway.
--
-- 'gatewayARN', 'describeTapeRecoveryPointsResponse_gatewayARN' - Undocumented member.
--
-- 'marker', 'describeTapeRecoveryPointsResponse_marker' - An opaque string that indicates the position at which the virtual tape
-- recovery points that were listed for description ended.
--
-- Use this marker in your next request to list the next set of virtual
-- tape recovery points in the list. If there are no more recovery points
-- to describe, this field does not appear in the response.
--
-- 'httpStatus', 'describeTapeRecoveryPointsResponse_httpStatus' - The response's http status code.
newDescribeTapeRecoveryPointsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeTapeRecoveryPointsResponse
newDescribeTapeRecoveryPointsResponse :: Int -> DescribeTapeRecoveryPointsResponse
newDescribeTapeRecoveryPointsResponse Int
pHttpStatus_ =
  DescribeTapeRecoveryPointsResponse' :: Maybe [TapeRecoveryPointInfo]
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeTapeRecoveryPointsResponse
DescribeTapeRecoveryPointsResponse'
    { $sel:tapeRecoveryPointInfos:DescribeTapeRecoveryPointsResponse' :: Maybe [TapeRecoveryPointInfo]
tapeRecoveryPointInfos =
        Maybe [TapeRecoveryPointInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayARN:DescribeTapeRecoveryPointsResponse' :: Maybe Text
gatewayARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeTapeRecoveryPointsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeTapeRecoveryPointsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of TapeRecoveryPointInfos that are available for the specified
-- gateway.
describeTapeRecoveryPointsResponse_tapeRecoveryPointInfos :: Lens.Lens' DescribeTapeRecoveryPointsResponse (Prelude.Maybe [TapeRecoveryPointInfo])
describeTapeRecoveryPointsResponse_tapeRecoveryPointInfos :: (Maybe [TapeRecoveryPointInfo]
 -> f (Maybe [TapeRecoveryPointInfo]))
-> DescribeTapeRecoveryPointsResponse
-> f DescribeTapeRecoveryPointsResponse
describeTapeRecoveryPointsResponse_tapeRecoveryPointInfos = (DescribeTapeRecoveryPointsResponse
 -> Maybe [TapeRecoveryPointInfo])
-> (DescribeTapeRecoveryPointsResponse
    -> Maybe [TapeRecoveryPointInfo]
    -> DescribeTapeRecoveryPointsResponse)
-> Lens'
     DescribeTapeRecoveryPointsResponse (Maybe [TapeRecoveryPointInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTapeRecoveryPointsResponse' {Maybe [TapeRecoveryPointInfo]
tapeRecoveryPointInfos :: Maybe [TapeRecoveryPointInfo]
$sel:tapeRecoveryPointInfos:DescribeTapeRecoveryPointsResponse' :: DescribeTapeRecoveryPointsResponse -> Maybe [TapeRecoveryPointInfo]
tapeRecoveryPointInfos} -> Maybe [TapeRecoveryPointInfo]
tapeRecoveryPointInfos) (\s :: DescribeTapeRecoveryPointsResponse
s@DescribeTapeRecoveryPointsResponse' {} Maybe [TapeRecoveryPointInfo]
a -> DescribeTapeRecoveryPointsResponse
s {$sel:tapeRecoveryPointInfos:DescribeTapeRecoveryPointsResponse' :: Maybe [TapeRecoveryPointInfo]
tapeRecoveryPointInfos = Maybe [TapeRecoveryPointInfo]
a} :: DescribeTapeRecoveryPointsResponse) ((Maybe [TapeRecoveryPointInfo]
  -> f (Maybe [TapeRecoveryPointInfo]))
 -> DescribeTapeRecoveryPointsResponse
 -> f DescribeTapeRecoveryPointsResponse)
-> ((Maybe [TapeRecoveryPointInfo]
     -> f (Maybe [TapeRecoveryPointInfo]))
    -> Maybe [TapeRecoveryPointInfo]
    -> f (Maybe [TapeRecoveryPointInfo]))
-> (Maybe [TapeRecoveryPointInfo]
    -> f (Maybe [TapeRecoveryPointInfo]))
-> DescribeTapeRecoveryPointsResponse
-> f DescribeTapeRecoveryPointsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TapeRecoveryPointInfo]
  [TapeRecoveryPointInfo]
  [TapeRecoveryPointInfo]
  [TapeRecoveryPointInfo]
-> Iso
     (Maybe [TapeRecoveryPointInfo])
     (Maybe [TapeRecoveryPointInfo])
     (Maybe [TapeRecoveryPointInfo])
     (Maybe [TapeRecoveryPointInfo])
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
  [TapeRecoveryPointInfo]
  [TapeRecoveryPointInfo]
  [TapeRecoveryPointInfo]
  [TapeRecoveryPointInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
describeTapeRecoveryPointsResponse_gatewayARN :: Lens.Lens' DescribeTapeRecoveryPointsResponse (Prelude.Maybe Prelude.Text)
describeTapeRecoveryPointsResponse_gatewayARN :: (Maybe Text -> f (Maybe Text))
-> DescribeTapeRecoveryPointsResponse
-> f DescribeTapeRecoveryPointsResponse
describeTapeRecoveryPointsResponse_gatewayARN = (DescribeTapeRecoveryPointsResponse -> Maybe Text)
-> (DescribeTapeRecoveryPointsResponse
    -> Maybe Text -> DescribeTapeRecoveryPointsResponse)
-> Lens' DescribeTapeRecoveryPointsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTapeRecoveryPointsResponse' {Maybe Text
gatewayARN :: Maybe Text
$sel:gatewayARN:DescribeTapeRecoveryPointsResponse' :: DescribeTapeRecoveryPointsResponse -> Maybe Text
gatewayARN} -> Maybe Text
gatewayARN) (\s :: DescribeTapeRecoveryPointsResponse
s@DescribeTapeRecoveryPointsResponse' {} Maybe Text
a -> DescribeTapeRecoveryPointsResponse
s {$sel:gatewayARN:DescribeTapeRecoveryPointsResponse' :: Maybe Text
gatewayARN = Maybe Text
a} :: DescribeTapeRecoveryPointsResponse)

-- | An opaque string that indicates the position at which the virtual tape
-- recovery points that were listed for description ended.
--
-- Use this marker in your next request to list the next set of virtual
-- tape recovery points in the list. If there are no more recovery points
-- to describe, this field does not appear in the response.
describeTapeRecoveryPointsResponse_marker :: Lens.Lens' DescribeTapeRecoveryPointsResponse (Prelude.Maybe Prelude.Text)
describeTapeRecoveryPointsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeTapeRecoveryPointsResponse
-> f DescribeTapeRecoveryPointsResponse
describeTapeRecoveryPointsResponse_marker = (DescribeTapeRecoveryPointsResponse -> Maybe Text)
-> (DescribeTapeRecoveryPointsResponse
    -> Maybe Text -> DescribeTapeRecoveryPointsResponse)
-> Lens' DescribeTapeRecoveryPointsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTapeRecoveryPointsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeTapeRecoveryPointsResponse' :: DescribeTapeRecoveryPointsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeTapeRecoveryPointsResponse
s@DescribeTapeRecoveryPointsResponse' {} Maybe Text
a -> DescribeTapeRecoveryPointsResponse
s {$sel:marker:DescribeTapeRecoveryPointsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeTapeRecoveryPointsResponse)

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

instance
  Prelude.NFData
    DescribeTapeRecoveryPointsResponse