{-# 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.ListTapePools
-- 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 custom tape pools. You specify custom tape pools to list by
-- specifying one or more custom tape pool Amazon Resource Names (ARNs). If
-- you don\'t specify a custom tape pool ARN, the operation lists all
-- custom tape pools.
--
-- This operation supports pagination. You can optionally specify the
-- @Limit@ parameter in the body to limit the number of tape pools in the
-- response. If the number of tape pools 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 tape pools.
--
-- This operation returns paginated results.
module Amazonka.StorageGateway.ListTapePools
  ( -- * Creating a Request
    ListTapePools (..),
    newListTapePools,

    -- * Request Lenses
    listTapePools_poolARNs,
    listTapePools_marker,
    listTapePools_limit,

    -- * Destructuring the Response
    ListTapePoolsResponse (..),
    newListTapePoolsResponse,

    -- * Response Lenses
    listTapePoolsResponse_poolInfos,
    listTapePoolsResponse_marker,
    listTapePoolsResponse_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

-- | /See:/ 'newListTapePools' smart constructor.
data ListTapePools = ListTapePools'
  { -- | The Amazon Resource Name (ARN) of each of the custom tape pools you want
    -- to list. If you don\'t specify a custom tape pool ARN, the response
    -- lists all custom tape pools.
    ListTapePools -> Maybe [Text]
poolARNs :: Prelude.Maybe [Prelude.Text],
    -- | A string that indicates the position at which to begin the returned list
    -- of tape pools.
    ListTapePools -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | An optional number limit for the tape pools in the list returned by this
    -- call.
    ListTapePools -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListTapePools -> ListTapePools -> Bool
(ListTapePools -> ListTapePools -> Bool)
-> (ListTapePools -> ListTapePools -> Bool) -> Eq ListTapePools
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTapePools -> ListTapePools -> Bool
$c/= :: ListTapePools -> ListTapePools -> Bool
== :: ListTapePools -> ListTapePools -> Bool
$c== :: ListTapePools -> ListTapePools -> Bool
Prelude.Eq, ReadPrec [ListTapePools]
ReadPrec ListTapePools
Int -> ReadS ListTapePools
ReadS [ListTapePools]
(Int -> ReadS ListTapePools)
-> ReadS [ListTapePools]
-> ReadPrec ListTapePools
-> ReadPrec [ListTapePools]
-> Read ListTapePools
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTapePools]
$creadListPrec :: ReadPrec [ListTapePools]
readPrec :: ReadPrec ListTapePools
$creadPrec :: ReadPrec ListTapePools
readList :: ReadS [ListTapePools]
$creadList :: ReadS [ListTapePools]
readsPrec :: Int -> ReadS ListTapePools
$creadsPrec :: Int -> ReadS ListTapePools
Prelude.Read, Int -> ListTapePools -> ShowS
[ListTapePools] -> ShowS
ListTapePools -> String
(Int -> ListTapePools -> ShowS)
-> (ListTapePools -> String)
-> ([ListTapePools] -> ShowS)
-> Show ListTapePools
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTapePools] -> ShowS
$cshowList :: [ListTapePools] -> ShowS
show :: ListTapePools -> String
$cshow :: ListTapePools -> String
showsPrec :: Int -> ListTapePools -> ShowS
$cshowsPrec :: Int -> ListTapePools -> ShowS
Prelude.Show, (forall x. ListTapePools -> Rep ListTapePools x)
-> (forall x. Rep ListTapePools x -> ListTapePools)
-> Generic ListTapePools
forall x. Rep ListTapePools x -> ListTapePools
forall x. ListTapePools -> Rep ListTapePools x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTapePools x -> ListTapePools
$cfrom :: forall x. ListTapePools -> Rep ListTapePools x
Prelude.Generic)

-- |
-- Create a value of 'ListTapePools' 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:
--
-- 'poolARNs', 'listTapePools_poolARNs' - The Amazon Resource Name (ARN) of each of the custom tape pools you want
-- to list. If you don\'t specify a custom tape pool ARN, the response
-- lists all custom tape pools.
--
-- 'marker', 'listTapePools_marker' - A string that indicates the position at which to begin the returned list
-- of tape pools.
--
-- 'limit', 'listTapePools_limit' - An optional number limit for the tape pools in the list returned by this
-- call.
newListTapePools ::
  ListTapePools
newListTapePools :: ListTapePools
newListTapePools =
  ListTapePools' :: Maybe [Text] -> Maybe Text -> Maybe Natural -> ListTapePools
ListTapePools'
    { $sel:poolARNs:ListTapePools' :: Maybe [Text]
poolARNs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListTapePools' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListTapePools' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of each of the custom tape pools you want
-- to list. If you don\'t specify a custom tape pool ARN, the response
-- lists all custom tape pools.
listTapePools_poolARNs :: Lens.Lens' ListTapePools (Prelude.Maybe [Prelude.Text])
listTapePools_poolARNs :: (Maybe [Text] -> f (Maybe [Text]))
-> ListTapePools -> f ListTapePools
listTapePools_poolARNs = (ListTapePools -> Maybe [Text])
-> (ListTapePools -> Maybe [Text] -> ListTapePools)
-> Lens ListTapePools ListTapePools (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTapePools' {Maybe [Text]
poolARNs :: Maybe [Text]
$sel:poolARNs:ListTapePools' :: ListTapePools -> Maybe [Text]
poolARNs} -> Maybe [Text]
poolARNs) (\s :: ListTapePools
s@ListTapePools' {} Maybe [Text]
a -> ListTapePools
s {$sel:poolARNs:ListTapePools' :: Maybe [Text]
poolARNs = Maybe [Text]
a} :: ListTapePools) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListTapePools -> f ListTapePools)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListTapePools
-> f ListTapePools
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

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

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

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

instance Prelude.NFData ListTapePools

instance Core.ToHeaders ListTapePools where
  toHeaders :: ListTapePools -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListTapePools -> 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.ListTapePools" ::
                          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 ListTapePools where
  toJSON :: ListTapePools -> Value
toJSON ListTapePools' {Maybe Natural
Maybe [Text]
Maybe Text
limit :: Maybe Natural
marker :: Maybe Text
poolARNs :: Maybe [Text]
$sel:limit:ListTapePools' :: ListTapePools -> Maybe Natural
$sel:marker:ListTapePools' :: ListTapePools -> Maybe Text
$sel:poolARNs:ListTapePools' :: ListTapePools -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"PoolARNs" 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]
poolARNs,
            (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
          ]
      )

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

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

-- | /See:/ 'newListTapePoolsResponse' smart constructor.
data ListTapePoolsResponse = ListTapePoolsResponse'
  { -- | An array of @PoolInfo@ objects, where each object describes a single
    -- custom tape pool. If there are no custom tape pools, the @PoolInfos@ is
    -- an empty array.
    ListTapePoolsResponse -> Maybe [PoolInfo]
poolInfos :: Prelude.Maybe [PoolInfo],
    -- | A string that indicates the position at which to begin the returned list
    -- of tape pools. Use the marker in your next request to continue
    -- pagination of tape pools. If there are no more tape pools to list, this
    -- element does not appear in the response body.
    ListTapePoolsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListTapePoolsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListTapePoolsResponse -> ListTapePoolsResponse -> Bool
(ListTapePoolsResponse -> ListTapePoolsResponse -> Bool)
-> (ListTapePoolsResponse -> ListTapePoolsResponse -> Bool)
-> Eq ListTapePoolsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTapePoolsResponse -> ListTapePoolsResponse -> Bool
$c/= :: ListTapePoolsResponse -> ListTapePoolsResponse -> Bool
== :: ListTapePoolsResponse -> ListTapePoolsResponse -> Bool
$c== :: ListTapePoolsResponse -> ListTapePoolsResponse -> Bool
Prelude.Eq, ReadPrec [ListTapePoolsResponse]
ReadPrec ListTapePoolsResponse
Int -> ReadS ListTapePoolsResponse
ReadS [ListTapePoolsResponse]
(Int -> ReadS ListTapePoolsResponse)
-> ReadS [ListTapePoolsResponse]
-> ReadPrec ListTapePoolsResponse
-> ReadPrec [ListTapePoolsResponse]
-> Read ListTapePoolsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTapePoolsResponse]
$creadListPrec :: ReadPrec [ListTapePoolsResponse]
readPrec :: ReadPrec ListTapePoolsResponse
$creadPrec :: ReadPrec ListTapePoolsResponse
readList :: ReadS [ListTapePoolsResponse]
$creadList :: ReadS [ListTapePoolsResponse]
readsPrec :: Int -> ReadS ListTapePoolsResponse
$creadsPrec :: Int -> ReadS ListTapePoolsResponse
Prelude.Read, Int -> ListTapePoolsResponse -> ShowS
[ListTapePoolsResponse] -> ShowS
ListTapePoolsResponse -> String
(Int -> ListTapePoolsResponse -> ShowS)
-> (ListTapePoolsResponse -> String)
-> ([ListTapePoolsResponse] -> ShowS)
-> Show ListTapePoolsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTapePoolsResponse] -> ShowS
$cshowList :: [ListTapePoolsResponse] -> ShowS
show :: ListTapePoolsResponse -> String
$cshow :: ListTapePoolsResponse -> String
showsPrec :: Int -> ListTapePoolsResponse -> ShowS
$cshowsPrec :: Int -> ListTapePoolsResponse -> ShowS
Prelude.Show, (forall x. ListTapePoolsResponse -> Rep ListTapePoolsResponse x)
-> (forall x. Rep ListTapePoolsResponse x -> ListTapePoolsResponse)
-> Generic ListTapePoolsResponse
forall x. Rep ListTapePoolsResponse x -> ListTapePoolsResponse
forall x. ListTapePoolsResponse -> Rep ListTapePoolsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTapePoolsResponse x -> ListTapePoolsResponse
$cfrom :: forall x. ListTapePoolsResponse -> Rep ListTapePoolsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTapePoolsResponse' 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:
--
-- 'poolInfos', 'listTapePoolsResponse_poolInfos' - An array of @PoolInfo@ objects, where each object describes a single
-- custom tape pool. If there are no custom tape pools, the @PoolInfos@ is
-- an empty array.
--
-- 'marker', 'listTapePoolsResponse_marker' - A string that indicates the position at which to begin the returned list
-- of tape pools. Use the marker in your next request to continue
-- pagination of tape pools. If there are no more tape pools to list, this
-- element does not appear in the response body.
--
-- 'httpStatus', 'listTapePoolsResponse_httpStatus' - The response's http status code.
newListTapePoolsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTapePoolsResponse
newListTapePoolsResponse :: Int -> ListTapePoolsResponse
newListTapePoolsResponse Int
pHttpStatus_ =
  ListTapePoolsResponse' :: Maybe [PoolInfo] -> Maybe Text -> Int -> ListTapePoolsResponse
ListTapePoolsResponse'
    { $sel:poolInfos:ListTapePoolsResponse' :: Maybe [PoolInfo]
poolInfos = Maybe [PoolInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListTapePoolsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTapePoolsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of @PoolInfo@ objects, where each object describes a single
-- custom tape pool. If there are no custom tape pools, the @PoolInfos@ is
-- an empty array.
listTapePoolsResponse_poolInfos :: Lens.Lens' ListTapePoolsResponse (Prelude.Maybe [PoolInfo])
listTapePoolsResponse_poolInfos :: (Maybe [PoolInfo] -> f (Maybe [PoolInfo]))
-> ListTapePoolsResponse -> f ListTapePoolsResponse
listTapePoolsResponse_poolInfos = (ListTapePoolsResponse -> Maybe [PoolInfo])
-> (ListTapePoolsResponse
    -> Maybe [PoolInfo] -> ListTapePoolsResponse)
-> Lens' ListTapePoolsResponse (Maybe [PoolInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTapePoolsResponse' {Maybe [PoolInfo]
poolInfos :: Maybe [PoolInfo]
$sel:poolInfos:ListTapePoolsResponse' :: ListTapePoolsResponse -> Maybe [PoolInfo]
poolInfos} -> Maybe [PoolInfo]
poolInfos) (\s :: ListTapePoolsResponse
s@ListTapePoolsResponse' {} Maybe [PoolInfo]
a -> ListTapePoolsResponse
s {$sel:poolInfos:ListTapePoolsResponse' :: Maybe [PoolInfo]
poolInfos = Maybe [PoolInfo]
a} :: ListTapePoolsResponse) ((Maybe [PoolInfo] -> f (Maybe [PoolInfo]))
 -> ListTapePoolsResponse -> f ListTapePoolsResponse)
-> ((Maybe [PoolInfo] -> f (Maybe [PoolInfo]))
    -> Maybe [PoolInfo] -> f (Maybe [PoolInfo]))
-> (Maybe [PoolInfo] -> f (Maybe [PoolInfo]))
-> ListTapePoolsResponse
-> f ListTapePoolsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [PoolInfo] [PoolInfo] [PoolInfo] [PoolInfo]
-> Iso
     (Maybe [PoolInfo])
     (Maybe [PoolInfo])
     (Maybe [PoolInfo])
     (Maybe [PoolInfo])
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 [PoolInfo] [PoolInfo] [PoolInfo] [PoolInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance Prelude.NFData ListTapePoolsResponse