{-# 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.DescribeTapeArchives
-- 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 description of specified virtual tapes in the virtual tape
-- shelf (VTS). This operation is only supported in the tape gateway type.
--
-- If a specific @TapeARN@ is not specified, Storage Gateway returns a
-- description of all virtual tapes found in the VTS associated with your
-- account.
--
-- This operation returns paginated results.
module Amazonka.StorageGateway.DescribeTapeArchives
  ( -- * Creating a Request
    DescribeTapeArchives (..),
    newDescribeTapeArchives,

    -- * Request Lenses
    describeTapeArchives_marker,
    describeTapeArchives_limit,
    describeTapeArchives_tapeARNs,

    -- * Destructuring the Response
    DescribeTapeArchivesResponse (..),
    newDescribeTapeArchivesResponse,

    -- * Response Lenses
    describeTapeArchivesResponse_tapeArchives,
    describeTapeArchivesResponse_marker,
    describeTapeArchivesResponse_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

-- | DescribeTapeArchivesInput
--
-- /See:/ 'newDescribeTapeArchives' smart constructor.
data DescribeTapeArchives = DescribeTapeArchives'
  { -- | An opaque string that indicates the position at which to begin
    -- describing virtual tapes.
    DescribeTapeArchives -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Specifies that the number of virtual tapes described be limited to the
    -- specified number.
    DescribeTapeArchives -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | Specifies one or more unique Amazon Resource Names (ARNs) that represent
    -- the virtual tapes you want to describe.
    DescribeTapeArchives -> Maybe [Text]
tapeARNs :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeTapeArchives -> DescribeTapeArchives -> Bool
(DescribeTapeArchives -> DescribeTapeArchives -> Bool)
-> (DescribeTapeArchives -> DescribeTapeArchives -> Bool)
-> Eq DescribeTapeArchives
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTapeArchives -> DescribeTapeArchives -> Bool
$c/= :: DescribeTapeArchives -> DescribeTapeArchives -> Bool
== :: DescribeTapeArchives -> DescribeTapeArchives -> Bool
$c== :: DescribeTapeArchives -> DescribeTapeArchives -> Bool
Prelude.Eq, ReadPrec [DescribeTapeArchives]
ReadPrec DescribeTapeArchives
Int -> ReadS DescribeTapeArchives
ReadS [DescribeTapeArchives]
(Int -> ReadS DescribeTapeArchives)
-> ReadS [DescribeTapeArchives]
-> ReadPrec DescribeTapeArchives
-> ReadPrec [DescribeTapeArchives]
-> Read DescribeTapeArchives
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTapeArchives]
$creadListPrec :: ReadPrec [DescribeTapeArchives]
readPrec :: ReadPrec DescribeTapeArchives
$creadPrec :: ReadPrec DescribeTapeArchives
readList :: ReadS [DescribeTapeArchives]
$creadList :: ReadS [DescribeTapeArchives]
readsPrec :: Int -> ReadS DescribeTapeArchives
$creadsPrec :: Int -> ReadS DescribeTapeArchives
Prelude.Read, Int -> DescribeTapeArchives -> ShowS
[DescribeTapeArchives] -> ShowS
DescribeTapeArchives -> String
(Int -> DescribeTapeArchives -> ShowS)
-> (DescribeTapeArchives -> String)
-> ([DescribeTapeArchives] -> ShowS)
-> Show DescribeTapeArchives
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTapeArchives] -> ShowS
$cshowList :: [DescribeTapeArchives] -> ShowS
show :: DescribeTapeArchives -> String
$cshow :: DescribeTapeArchives -> String
showsPrec :: Int -> DescribeTapeArchives -> ShowS
$cshowsPrec :: Int -> DescribeTapeArchives -> ShowS
Prelude.Show, (forall x. DescribeTapeArchives -> Rep DescribeTapeArchives x)
-> (forall x. Rep DescribeTapeArchives x -> DescribeTapeArchives)
-> Generic DescribeTapeArchives
forall x. Rep DescribeTapeArchives x -> DescribeTapeArchives
forall x. DescribeTapeArchives -> Rep DescribeTapeArchives x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTapeArchives x -> DescribeTapeArchives
$cfrom :: forall x. DescribeTapeArchives -> Rep DescribeTapeArchives x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTapeArchives' 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', 'describeTapeArchives_marker' - An opaque string that indicates the position at which to begin
-- describing virtual tapes.
--
-- 'limit', 'describeTapeArchives_limit' - Specifies that the number of virtual tapes described be limited to the
-- specified number.
--
-- 'tapeARNs', 'describeTapeArchives_tapeARNs' - Specifies one or more unique Amazon Resource Names (ARNs) that represent
-- the virtual tapes you want to describe.
newDescribeTapeArchives ::
  DescribeTapeArchives
newDescribeTapeArchives :: DescribeTapeArchives
newDescribeTapeArchives =
  DescribeTapeArchives' :: Maybe Text -> Maybe Natural -> Maybe [Text] -> DescribeTapeArchives
DescribeTapeArchives'
    { $sel:marker:DescribeTapeArchives' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeTapeArchives' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:tapeARNs:DescribeTapeArchives' :: Maybe [Text]
tapeARNs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | Specifies one or more unique Amazon Resource Names (ARNs) that represent
-- the virtual tapes you want to describe.
describeTapeArchives_tapeARNs :: Lens.Lens' DescribeTapeArchives (Prelude.Maybe [Prelude.Text])
describeTapeArchives_tapeARNs :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeTapeArchives -> f DescribeTapeArchives
describeTapeArchives_tapeARNs = (DescribeTapeArchives -> Maybe [Text])
-> (DescribeTapeArchives -> Maybe [Text] -> DescribeTapeArchives)
-> Lens
     DescribeTapeArchives
     DescribeTapeArchives
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTapeArchives' {Maybe [Text]
tapeARNs :: Maybe [Text]
$sel:tapeARNs:DescribeTapeArchives' :: DescribeTapeArchives -> Maybe [Text]
tapeARNs} -> Maybe [Text]
tapeARNs) (\s :: DescribeTapeArchives
s@DescribeTapeArchives' {} Maybe [Text]
a -> DescribeTapeArchives
s {$sel:tapeARNs:DescribeTapeArchives' :: Maybe [Text]
tapeARNs = Maybe [Text]
a} :: DescribeTapeArchives) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeTapeArchives -> f DescribeTapeArchives)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeTapeArchives
-> f DescribeTapeArchives
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 DescribeTapeArchives where
  page :: DescribeTapeArchives
-> AWSResponse DescribeTapeArchives -> Maybe DescribeTapeArchives
page DescribeTapeArchives
rq AWSResponse DescribeTapeArchives
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeTapeArchives
DescribeTapeArchivesResponse
rs
            DescribeTapeArchivesResponse
-> Getting (First Text) DescribeTapeArchivesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeTapeArchivesResponse
-> Const (First Text) DescribeTapeArchivesResponse
Lens' DescribeTapeArchivesResponse (Maybe Text)
describeTapeArchivesResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeTapeArchivesResponse
 -> Const (First Text) DescribeTapeArchivesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeTapeArchivesResponse 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 DescribeTapeArchives
forall a. Maybe a
Prelude.Nothing
    | Maybe [TapeArchive] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeTapeArchives
DescribeTapeArchivesResponse
rs
            DescribeTapeArchivesResponse
-> Getting
     (First [TapeArchive]) DescribeTapeArchivesResponse [TapeArchive]
-> Maybe [TapeArchive]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [TapeArchive]
 -> Const (First [TapeArchive]) (Maybe [TapeArchive]))
-> DescribeTapeArchivesResponse
-> Const (First [TapeArchive]) DescribeTapeArchivesResponse
Lens' DescribeTapeArchivesResponse (Maybe [TapeArchive])
describeTapeArchivesResponse_tapeArchives
              ((Maybe [TapeArchive]
  -> Const (First [TapeArchive]) (Maybe [TapeArchive]))
 -> DescribeTapeArchivesResponse
 -> Const (First [TapeArchive]) DescribeTapeArchivesResponse)
-> (([TapeArchive] -> Const (First [TapeArchive]) [TapeArchive])
    -> Maybe [TapeArchive]
    -> Const (First [TapeArchive]) (Maybe [TapeArchive]))
-> Getting
     (First [TapeArchive]) DescribeTapeArchivesResponse [TapeArchive]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TapeArchive] -> Const (First [TapeArchive]) [TapeArchive])
-> Maybe [TapeArchive]
-> Const (First [TapeArchive]) (Maybe [TapeArchive])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeTapeArchives
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeTapeArchives -> Maybe DescribeTapeArchives
forall a. a -> Maybe a
Prelude.Just (DescribeTapeArchives -> Maybe DescribeTapeArchives)
-> DescribeTapeArchives -> Maybe DescribeTapeArchives
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeTapeArchives
rq
          DescribeTapeArchives
-> (DescribeTapeArchives -> DescribeTapeArchives)
-> DescribeTapeArchives
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeTapeArchives -> Identity DescribeTapeArchives
Lens
  DescribeTapeArchives DescribeTapeArchives (Maybe Text) (Maybe Text)
describeTapeArchives_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeTapeArchives -> Identity DescribeTapeArchives)
-> Maybe Text -> DescribeTapeArchives -> DescribeTapeArchives
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeTapeArchives
DescribeTapeArchivesResponse
rs
          DescribeTapeArchivesResponse
-> Getting (First Text) DescribeTapeArchivesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeTapeArchivesResponse
-> Const (First Text) DescribeTapeArchivesResponse
Lens' DescribeTapeArchivesResponse (Maybe Text)
describeTapeArchivesResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeTapeArchivesResponse
 -> Const (First Text) DescribeTapeArchivesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeTapeArchivesResponse 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 DescribeTapeArchives where
  type
    AWSResponse DescribeTapeArchives =
      DescribeTapeArchivesResponse
  request :: DescribeTapeArchives -> Request DescribeTapeArchives
request = Service -> DescribeTapeArchives -> Request DescribeTapeArchives
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeTapeArchives
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeTapeArchives)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeTapeArchives))
-> Logger
-> Service
-> Proxy DescribeTapeArchives
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeTapeArchives)))
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 [TapeArchive]
-> Maybe Text -> Int -> DescribeTapeArchivesResponse
DescribeTapeArchivesResponse'
            (Maybe [TapeArchive]
 -> Maybe Text -> Int -> DescribeTapeArchivesResponse)
-> Either String (Maybe [TapeArchive])
-> Either
     String (Maybe Text -> Int -> DescribeTapeArchivesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [TapeArchive]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TapeArchives" Either String (Maybe (Maybe [TapeArchive]))
-> Maybe [TapeArchive] -> Either String (Maybe [TapeArchive])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [TapeArchive]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> DescribeTapeArchivesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeTapeArchivesResponse)
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 -> DescribeTapeArchivesResponse)
-> Either String Int -> Either String DescribeTapeArchivesResponse
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 DescribeTapeArchives

instance Prelude.NFData DescribeTapeArchives

instance Core.ToHeaders DescribeTapeArchives where
  toHeaders :: DescribeTapeArchives -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeTapeArchives -> 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.DescribeTapeArchives" ::
                          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 DescribeTapeArchives where
  toJSON :: DescribeTapeArchives -> Value
toJSON DescribeTapeArchives' {Maybe Natural
Maybe [Text]
Maybe Text
tapeARNs :: Maybe [Text]
limit :: Maybe Natural
marker :: Maybe Text
$sel:tapeARNs:DescribeTapeArchives' :: DescribeTapeArchives -> Maybe [Text]
$sel:limit:DescribeTapeArchives' :: DescribeTapeArchives -> Maybe Natural
$sel:marker:DescribeTapeArchives' :: DescribeTapeArchives -> 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 DescribeTapeArchives where
  toPath :: DescribeTapeArchives -> ByteString
toPath = ByteString -> DescribeTapeArchives -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | DescribeTapeArchivesOutput
--
-- /See:/ 'newDescribeTapeArchivesResponse' smart constructor.
data DescribeTapeArchivesResponse = DescribeTapeArchivesResponse'
  { -- | An array of virtual tape objects in the virtual tape shelf (VTS). The
    -- description includes of the Amazon Resource Name (ARN) of the virtual
    -- tapes. The information returned includes the Amazon Resource Names
    -- (ARNs) of the tapes, size of the tapes, status of the tapes, progress of
    -- the description, and tape barcode.
    DescribeTapeArchivesResponse -> Maybe [TapeArchive]
tapeArchives :: Prelude.Maybe [TapeArchive],
    -- | An opaque string that indicates the position at which the virtual tapes
    -- that were fetched for description ended. Use this marker in your next
    -- request to fetch the next set of virtual tapes in the virtual tape shelf
    -- (VTS). If there are no more virtual tapes to describe, this field does
    -- not appear in the response.
    DescribeTapeArchivesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeTapeArchivesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeTapeArchivesResponse
-> DescribeTapeArchivesResponse -> Bool
(DescribeTapeArchivesResponse
 -> DescribeTapeArchivesResponse -> Bool)
-> (DescribeTapeArchivesResponse
    -> DescribeTapeArchivesResponse -> Bool)
-> Eq DescribeTapeArchivesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTapeArchivesResponse
-> DescribeTapeArchivesResponse -> Bool
$c/= :: DescribeTapeArchivesResponse
-> DescribeTapeArchivesResponse -> Bool
== :: DescribeTapeArchivesResponse
-> DescribeTapeArchivesResponse -> Bool
$c== :: DescribeTapeArchivesResponse
-> DescribeTapeArchivesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTapeArchivesResponse]
ReadPrec DescribeTapeArchivesResponse
Int -> ReadS DescribeTapeArchivesResponse
ReadS [DescribeTapeArchivesResponse]
(Int -> ReadS DescribeTapeArchivesResponse)
-> ReadS [DescribeTapeArchivesResponse]
-> ReadPrec DescribeTapeArchivesResponse
-> ReadPrec [DescribeTapeArchivesResponse]
-> Read DescribeTapeArchivesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTapeArchivesResponse]
$creadListPrec :: ReadPrec [DescribeTapeArchivesResponse]
readPrec :: ReadPrec DescribeTapeArchivesResponse
$creadPrec :: ReadPrec DescribeTapeArchivesResponse
readList :: ReadS [DescribeTapeArchivesResponse]
$creadList :: ReadS [DescribeTapeArchivesResponse]
readsPrec :: Int -> ReadS DescribeTapeArchivesResponse
$creadsPrec :: Int -> ReadS DescribeTapeArchivesResponse
Prelude.Read, Int -> DescribeTapeArchivesResponse -> ShowS
[DescribeTapeArchivesResponse] -> ShowS
DescribeTapeArchivesResponse -> String
(Int -> DescribeTapeArchivesResponse -> ShowS)
-> (DescribeTapeArchivesResponse -> String)
-> ([DescribeTapeArchivesResponse] -> ShowS)
-> Show DescribeTapeArchivesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTapeArchivesResponse] -> ShowS
$cshowList :: [DescribeTapeArchivesResponse] -> ShowS
show :: DescribeTapeArchivesResponse -> String
$cshow :: DescribeTapeArchivesResponse -> String
showsPrec :: Int -> DescribeTapeArchivesResponse -> ShowS
$cshowsPrec :: Int -> DescribeTapeArchivesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeTapeArchivesResponse -> Rep DescribeTapeArchivesResponse x)
-> (forall x.
    Rep DescribeTapeArchivesResponse x -> DescribeTapeArchivesResponse)
-> Generic DescribeTapeArchivesResponse
forall x.
Rep DescribeTapeArchivesResponse x -> DescribeTapeArchivesResponse
forall x.
DescribeTapeArchivesResponse -> Rep DescribeTapeArchivesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTapeArchivesResponse x -> DescribeTapeArchivesResponse
$cfrom :: forall x.
DescribeTapeArchivesResponse -> Rep DescribeTapeArchivesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTapeArchivesResponse' 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:
--
-- 'tapeArchives', 'describeTapeArchivesResponse_tapeArchives' - An array of virtual tape objects in the virtual tape shelf (VTS). The
-- description includes of the Amazon Resource Name (ARN) of the virtual
-- tapes. The information returned includes the Amazon Resource Names
-- (ARNs) of the tapes, size of the tapes, status of the tapes, progress of
-- the description, and tape barcode.
--
-- 'marker', 'describeTapeArchivesResponse_marker' - An opaque string that indicates the position at which the virtual tapes
-- that were fetched for description ended. Use this marker in your next
-- request to fetch the next set of virtual tapes in the virtual tape shelf
-- (VTS). If there are no more virtual tapes to describe, this field does
-- not appear in the response.
--
-- 'httpStatus', 'describeTapeArchivesResponse_httpStatus' - The response's http status code.
newDescribeTapeArchivesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeTapeArchivesResponse
newDescribeTapeArchivesResponse :: Int -> DescribeTapeArchivesResponse
newDescribeTapeArchivesResponse Int
pHttpStatus_ =
  DescribeTapeArchivesResponse' :: Maybe [TapeArchive]
-> Maybe Text -> Int -> DescribeTapeArchivesResponse
DescribeTapeArchivesResponse'
    { $sel:tapeArchives:DescribeTapeArchivesResponse' :: Maybe [TapeArchive]
tapeArchives =
        Maybe [TapeArchive]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeTapeArchivesResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeTapeArchivesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of virtual tape objects in the virtual tape shelf (VTS). The
-- description includes of the Amazon Resource Name (ARN) of the virtual
-- tapes. The information returned includes the Amazon Resource Names
-- (ARNs) of the tapes, size of the tapes, status of the tapes, progress of
-- the description, and tape barcode.
describeTapeArchivesResponse_tapeArchives :: Lens.Lens' DescribeTapeArchivesResponse (Prelude.Maybe [TapeArchive])
describeTapeArchivesResponse_tapeArchives :: (Maybe [TapeArchive] -> f (Maybe [TapeArchive]))
-> DescribeTapeArchivesResponse -> f DescribeTapeArchivesResponse
describeTapeArchivesResponse_tapeArchives = (DescribeTapeArchivesResponse -> Maybe [TapeArchive])
-> (DescribeTapeArchivesResponse
    -> Maybe [TapeArchive] -> DescribeTapeArchivesResponse)
-> Lens' DescribeTapeArchivesResponse (Maybe [TapeArchive])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTapeArchivesResponse' {Maybe [TapeArchive]
tapeArchives :: Maybe [TapeArchive]
$sel:tapeArchives:DescribeTapeArchivesResponse' :: DescribeTapeArchivesResponse -> Maybe [TapeArchive]
tapeArchives} -> Maybe [TapeArchive]
tapeArchives) (\s :: DescribeTapeArchivesResponse
s@DescribeTapeArchivesResponse' {} Maybe [TapeArchive]
a -> DescribeTapeArchivesResponse
s {$sel:tapeArchives:DescribeTapeArchivesResponse' :: Maybe [TapeArchive]
tapeArchives = Maybe [TapeArchive]
a} :: DescribeTapeArchivesResponse) ((Maybe [TapeArchive] -> f (Maybe [TapeArchive]))
 -> DescribeTapeArchivesResponse -> f DescribeTapeArchivesResponse)
-> ((Maybe [TapeArchive] -> f (Maybe [TapeArchive]))
    -> Maybe [TapeArchive] -> f (Maybe [TapeArchive]))
-> (Maybe [TapeArchive] -> f (Maybe [TapeArchive]))
-> DescribeTapeArchivesResponse
-> f DescribeTapeArchivesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [TapeArchive] [TapeArchive] [TapeArchive] [TapeArchive]
-> Iso
     (Maybe [TapeArchive])
     (Maybe [TapeArchive])
     (Maybe [TapeArchive])
     (Maybe [TapeArchive])
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 [TapeArchive] [TapeArchive] [TapeArchive] [TapeArchive]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance Prelude.NFData DescribeTapeArchivesResponse