{-# 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.ListTapes
-- 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)
--
-- Lists virtual tapes in your virtual tape library (VTL) and your virtual
-- tape shelf (VTS). You specify the tapes to list by specifying one or
-- more tape Amazon Resource Names (ARNs). If you don\'t specify a tape
-- ARN, the operation lists all virtual tapes in both your VTL and VTS.
--
-- This operation supports pagination. By default, the operation returns a
-- maximum of up to 100 tapes. You can optionally specify the @Limit@
-- parameter in the body to limit the number of tapes in the response. If
-- the number of tapes returned in the response is truncated, the response
-- includes a @Marker@ element that you can use in your subsequent request
-- to retrieve the next set of tapes. This operation is only supported in
-- the tape gateway type.
--
-- This operation returns paginated results.
module Amazonka.StorageGateway.ListTapes
  ( -- * Creating a Request
    ListTapes (..),
    newListTapes,

    -- * Request Lenses
    listTapes_marker,
    listTapes_limit,
    listTapes_tapeARNs,

    -- * Destructuring the Response
    ListTapesResponse (..),
    newListTapesResponse,

    -- * Response Lenses
    listTapesResponse_marker,
    listTapesResponse_tapeInfos,
    listTapesResponse_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

-- | A JSON object that contains one or more of the following fields:
--
-- -   ListTapesInput$Limit
--
-- -   ListTapesInput$Marker
--
-- -   ListTapesInput$TapeARNs
--
-- /See:/ 'newListTapes' smart constructor.
data ListTapes = ListTapes'
  { -- | A string that indicates the position at which to begin the returned list
    -- of tapes.
    ListTapes -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | An optional number limit for the tapes in the list returned by this
    -- call.
    ListTapes -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    ListTapes -> Maybe [Text]
tapeARNs :: Prelude.Maybe [Prelude.Text]
  }
  deriving (ListTapes -> ListTapes -> Bool
(ListTapes -> ListTapes -> Bool)
-> (ListTapes -> ListTapes -> Bool) -> Eq ListTapes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTapes -> ListTapes -> Bool
$c/= :: ListTapes -> ListTapes -> Bool
== :: ListTapes -> ListTapes -> Bool
$c== :: ListTapes -> ListTapes -> Bool
Prelude.Eq, ReadPrec [ListTapes]
ReadPrec ListTapes
Int -> ReadS ListTapes
ReadS [ListTapes]
(Int -> ReadS ListTapes)
-> ReadS [ListTapes]
-> ReadPrec ListTapes
-> ReadPrec [ListTapes]
-> Read ListTapes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTapes]
$creadListPrec :: ReadPrec [ListTapes]
readPrec :: ReadPrec ListTapes
$creadPrec :: ReadPrec ListTapes
readList :: ReadS [ListTapes]
$creadList :: ReadS [ListTapes]
readsPrec :: Int -> ReadS ListTapes
$creadsPrec :: Int -> ReadS ListTapes
Prelude.Read, Int -> ListTapes -> ShowS
[ListTapes] -> ShowS
ListTapes -> String
(Int -> ListTapes -> ShowS)
-> (ListTapes -> String)
-> ([ListTapes] -> ShowS)
-> Show ListTapes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTapes] -> ShowS
$cshowList :: [ListTapes] -> ShowS
show :: ListTapes -> String
$cshow :: ListTapes -> String
showsPrec :: Int -> ListTapes -> ShowS
$cshowsPrec :: Int -> ListTapes -> ShowS
Prelude.Show, (forall x. ListTapes -> Rep ListTapes x)
-> (forall x. Rep ListTapes x -> ListTapes) -> Generic ListTapes
forall x. Rep ListTapes x -> ListTapes
forall x. ListTapes -> Rep ListTapes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTapes x -> ListTapes
$cfrom :: forall x. ListTapes -> Rep ListTapes x
Prelude.Generic)

-- |
-- Create a value of 'ListTapes' 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', 'listTapes_marker' - A string that indicates the position at which to begin the returned list
-- of tapes.
--
-- 'limit', 'listTapes_limit' - An optional number limit for the tapes in the list returned by this
-- call.
--
-- 'tapeARNs', 'listTapes_tapeARNs' - Undocumented member.
newListTapes ::
  ListTapes
newListTapes :: ListTapes
newListTapes =
  ListTapes' :: Maybe Text -> Maybe Natural -> Maybe [Text] -> ListTapes
ListTapes'
    { $sel:marker:ListTapes' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListTapes' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:tapeARNs:ListTapes' :: Maybe [Text]
tapeARNs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | A string that indicates the position at which to begin the returned list
-- of tapes.
listTapes_marker :: Lens.Lens' ListTapes (Prelude.Maybe Prelude.Text)
listTapes_marker :: (Maybe Text -> f (Maybe Text)) -> ListTapes -> f ListTapes
listTapes_marker = (ListTapes -> Maybe Text)
-> (ListTapes -> Maybe Text -> ListTapes)
-> Lens ListTapes ListTapes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTapes' {Maybe Text
marker :: Maybe Text
$sel:marker:ListTapes' :: ListTapes -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListTapes
s@ListTapes' {} Maybe Text
a -> ListTapes
s {$sel:marker:ListTapes' :: Maybe Text
marker = Maybe Text
a} :: ListTapes)

-- | An optional number limit for the tapes in the list returned by this
-- call.
listTapes_limit :: Lens.Lens' ListTapes (Prelude.Maybe Prelude.Natural)
listTapes_limit :: (Maybe Natural -> f (Maybe Natural)) -> ListTapes -> f ListTapes
listTapes_limit = (ListTapes -> Maybe Natural)
-> (ListTapes -> Maybe Natural -> ListTapes)
-> Lens ListTapes ListTapes (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTapes' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListTapes' :: ListTapes -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListTapes
s@ListTapes' {} Maybe Natural
a -> ListTapes
s {$sel:limit:ListTapes' :: Maybe Natural
limit = Maybe Natural
a} :: ListTapes)

-- | Undocumented member.
listTapes_tapeARNs :: Lens.Lens' ListTapes (Prelude.Maybe [Prelude.Text])
listTapes_tapeARNs :: (Maybe [Text] -> f (Maybe [Text])) -> ListTapes -> f ListTapes
listTapes_tapeARNs = (ListTapes -> Maybe [Text])
-> (ListTapes -> Maybe [Text] -> ListTapes)
-> Lens ListTapes ListTapes (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTapes' {Maybe [Text]
tapeARNs :: Maybe [Text]
$sel:tapeARNs:ListTapes' :: ListTapes -> Maybe [Text]
tapeARNs} -> Maybe [Text]
tapeARNs) (\s :: ListTapes
s@ListTapes' {} Maybe [Text]
a -> ListTapes
s {$sel:tapeARNs:ListTapes' :: Maybe [Text]
tapeARNs = Maybe [Text]
a} :: ListTapes) ((Maybe [Text] -> f (Maybe [Text])) -> ListTapes -> f ListTapes)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListTapes
-> f ListTapes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListTapes

instance Core.ToHeaders ListTapes where
  toHeaders :: ListTapes -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListTapes -> 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.ListTapes" ::
                          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 ListTapes where
  toJSON :: ListTapes -> Value
toJSON ListTapes' {Maybe Natural
Maybe [Text]
Maybe Text
tapeARNs :: Maybe [Text]
limit :: Maybe Natural
marker :: Maybe Text
$sel:tapeARNs:ListTapes' :: ListTapes -> Maybe [Text]
$sel:limit:ListTapes' :: ListTapes -> Maybe Natural
$sel:marker:ListTapes' :: ListTapes -> 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,
            (Text
"TapeARNs" 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]
tapeARNs
          ]
      )

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

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

-- | A JSON object containing the following fields:
--
-- -   ListTapesOutput$Marker
--
-- -   ListTapesOutput$VolumeInfos
--
-- /See:/ 'newListTapesResponse' smart constructor.
data ListTapesResponse = ListTapesResponse'
  { -- | A string that indicates the position at which to begin returning the
    -- next list of tapes. Use the marker in your next request to continue
    -- pagination of tapes. If there are no more tapes to list, this element
    -- does not appear in the response body.
    ListTapesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    ListTapesResponse -> Maybe [TapeInfo]
tapeInfos :: Prelude.Maybe [TapeInfo],
    -- | The response's http status code.
    ListTapesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListTapesResponse -> ListTapesResponse -> Bool
(ListTapesResponse -> ListTapesResponse -> Bool)
-> (ListTapesResponse -> ListTapesResponse -> Bool)
-> Eq ListTapesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTapesResponse -> ListTapesResponse -> Bool
$c/= :: ListTapesResponse -> ListTapesResponse -> Bool
== :: ListTapesResponse -> ListTapesResponse -> Bool
$c== :: ListTapesResponse -> ListTapesResponse -> Bool
Prelude.Eq, ReadPrec [ListTapesResponse]
ReadPrec ListTapesResponse
Int -> ReadS ListTapesResponse
ReadS [ListTapesResponse]
(Int -> ReadS ListTapesResponse)
-> ReadS [ListTapesResponse]
-> ReadPrec ListTapesResponse
-> ReadPrec [ListTapesResponse]
-> Read ListTapesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTapesResponse]
$creadListPrec :: ReadPrec [ListTapesResponse]
readPrec :: ReadPrec ListTapesResponse
$creadPrec :: ReadPrec ListTapesResponse
readList :: ReadS [ListTapesResponse]
$creadList :: ReadS [ListTapesResponse]
readsPrec :: Int -> ReadS ListTapesResponse
$creadsPrec :: Int -> ReadS ListTapesResponse
Prelude.Read, Int -> ListTapesResponse -> ShowS
[ListTapesResponse] -> ShowS
ListTapesResponse -> String
(Int -> ListTapesResponse -> ShowS)
-> (ListTapesResponse -> String)
-> ([ListTapesResponse] -> ShowS)
-> Show ListTapesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTapesResponse] -> ShowS
$cshowList :: [ListTapesResponse] -> ShowS
show :: ListTapesResponse -> String
$cshow :: ListTapesResponse -> String
showsPrec :: Int -> ListTapesResponse -> ShowS
$cshowsPrec :: Int -> ListTapesResponse -> ShowS
Prelude.Show, (forall x. ListTapesResponse -> Rep ListTapesResponse x)
-> (forall x. Rep ListTapesResponse x -> ListTapesResponse)
-> Generic ListTapesResponse
forall x. Rep ListTapesResponse x -> ListTapesResponse
forall x. ListTapesResponse -> Rep ListTapesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTapesResponse x -> ListTapesResponse
$cfrom :: forall x. ListTapesResponse -> Rep ListTapesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTapesResponse' 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', 'listTapesResponse_marker' - A string that indicates the position at which to begin returning the
-- next list of tapes. Use the marker in your next request to continue
-- pagination of tapes. If there are no more tapes to list, this element
-- does not appear in the response body.
--
-- 'tapeInfos', 'listTapesResponse_tapeInfos' - Undocumented member.
--
-- 'httpStatus', 'listTapesResponse_httpStatus' - The response's http status code.
newListTapesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTapesResponse
newListTapesResponse :: Int -> ListTapesResponse
newListTapesResponse Int
pHttpStatus_ =
  ListTapesResponse' :: Maybe Text -> Maybe [TapeInfo] -> Int -> ListTapesResponse
ListTapesResponse'
    { $sel:marker:ListTapesResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tapeInfos:ListTapesResponse' :: Maybe [TapeInfo]
tapeInfos = Maybe [TapeInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTapesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A string that indicates the position at which to begin returning the
-- next list of tapes. Use the marker in your next request to continue
-- pagination of tapes. If there are no more tapes to list, this element
-- does not appear in the response body.
listTapesResponse_marker :: Lens.Lens' ListTapesResponse (Prelude.Maybe Prelude.Text)
listTapesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListTapesResponse -> f ListTapesResponse
listTapesResponse_marker = (ListTapesResponse -> Maybe Text)
-> (ListTapesResponse -> Maybe Text -> ListTapesResponse)
-> Lens' ListTapesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTapesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListTapesResponse' :: ListTapesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListTapesResponse
s@ListTapesResponse' {} Maybe Text
a -> ListTapesResponse
s {$sel:marker:ListTapesResponse' :: Maybe Text
marker = Maybe Text
a} :: ListTapesResponse)

-- | Undocumented member.
listTapesResponse_tapeInfos :: Lens.Lens' ListTapesResponse (Prelude.Maybe [TapeInfo])
listTapesResponse_tapeInfos :: (Maybe [TapeInfo] -> f (Maybe [TapeInfo]))
-> ListTapesResponse -> f ListTapesResponse
listTapesResponse_tapeInfos = (ListTapesResponse -> Maybe [TapeInfo])
-> (ListTapesResponse -> Maybe [TapeInfo] -> ListTapesResponse)
-> Lens' ListTapesResponse (Maybe [TapeInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTapesResponse' {Maybe [TapeInfo]
tapeInfos :: Maybe [TapeInfo]
$sel:tapeInfos:ListTapesResponse' :: ListTapesResponse -> Maybe [TapeInfo]
tapeInfos} -> Maybe [TapeInfo]
tapeInfos) (\s :: ListTapesResponse
s@ListTapesResponse' {} Maybe [TapeInfo]
a -> ListTapesResponse
s {$sel:tapeInfos:ListTapesResponse' :: Maybe [TapeInfo]
tapeInfos = Maybe [TapeInfo]
a} :: ListTapesResponse) ((Maybe [TapeInfo] -> f (Maybe [TapeInfo]))
 -> ListTapesResponse -> f ListTapesResponse)
-> ((Maybe [TapeInfo] -> f (Maybe [TapeInfo]))
    -> Maybe [TapeInfo] -> f (Maybe [TapeInfo]))
-> (Maybe [TapeInfo] -> f (Maybe [TapeInfo]))
-> ListTapesResponse
-> f ListTapesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TapeInfo] [TapeInfo] [TapeInfo] [TapeInfo]
-> Iso
     (Maybe [TapeInfo])
     (Maybe [TapeInfo])
     (Maybe [TapeInfo])
     (Maybe [TapeInfo])
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 [TapeInfo] [TapeInfo] [TapeInfo] [TapeInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListTapesResponse