{-# 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.ListVolumes
-- 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 the iSCSI stored volumes of a gateway. Results are sorted by
-- volume ARN. The response includes only the volume ARNs. If you want
-- additional volume information, use the DescribeStorediSCSIVolumes or the
-- DescribeCachediSCSIVolumes API.
--
-- The operation supports pagination. By default, the operation returns a
-- maximum of up to 100 volumes. You can optionally specify the @Limit@
-- field in the body to limit the number of volumes in the response. If the
-- number of volumes returned in the response is truncated, the response
-- includes a Marker field. You can use this Marker value in your
-- subsequent request to retrieve the next set of volumes. This operation
-- is only supported in the cached volume and stored volume gateway types.
--
-- This operation returns paginated results.
module Amazonka.StorageGateway.ListVolumes
  ( -- * Creating a Request
    ListVolumes (..),
    newListVolumes,

    -- * Request Lenses
    listVolumes_gatewayARN,
    listVolumes_marker,
    listVolumes_limit,

    -- * Destructuring the Response
    ListVolumesResponse (..),
    newListVolumesResponse,

    -- * Response Lenses
    listVolumesResponse_gatewayARN,
    listVolumesResponse_marker,
    listVolumesResponse_volumeInfos,
    listVolumesResponse_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:
--
-- -   ListVolumesInput$Limit
--
-- -   ListVolumesInput$Marker
--
-- /See:/ 'newListVolumes' smart constructor.
data ListVolumes = ListVolumes'
  { ListVolumes -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
    -- | A string that indicates the position at which to begin the returned list
    -- of volumes. Obtain the marker from the response of a previous List iSCSI
    -- Volumes request.
    ListVolumes -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Specifies that the list of volumes returned be limited to the specified
    -- number of items.
    ListVolumes -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListVolumes -> ListVolumes -> Bool
(ListVolumes -> ListVolumes -> Bool)
-> (ListVolumes -> ListVolumes -> Bool) -> Eq ListVolumes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVolumes -> ListVolumes -> Bool
$c/= :: ListVolumes -> ListVolumes -> Bool
== :: ListVolumes -> ListVolumes -> Bool
$c== :: ListVolumes -> ListVolumes -> Bool
Prelude.Eq, ReadPrec [ListVolumes]
ReadPrec ListVolumes
Int -> ReadS ListVolumes
ReadS [ListVolumes]
(Int -> ReadS ListVolumes)
-> ReadS [ListVolumes]
-> ReadPrec ListVolumes
-> ReadPrec [ListVolumes]
-> Read ListVolumes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVolumes]
$creadListPrec :: ReadPrec [ListVolumes]
readPrec :: ReadPrec ListVolumes
$creadPrec :: ReadPrec ListVolumes
readList :: ReadS [ListVolumes]
$creadList :: ReadS [ListVolumes]
readsPrec :: Int -> ReadS ListVolumes
$creadsPrec :: Int -> ReadS ListVolumes
Prelude.Read, Int -> ListVolumes -> ShowS
[ListVolumes] -> ShowS
ListVolumes -> String
(Int -> ListVolumes -> ShowS)
-> (ListVolumes -> String)
-> ([ListVolumes] -> ShowS)
-> Show ListVolumes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVolumes] -> ShowS
$cshowList :: [ListVolumes] -> ShowS
show :: ListVolumes -> String
$cshow :: ListVolumes -> String
showsPrec :: Int -> ListVolumes -> ShowS
$cshowsPrec :: Int -> ListVolumes -> ShowS
Prelude.Show, (forall x. ListVolumes -> Rep ListVolumes x)
-> (forall x. Rep ListVolumes x -> ListVolumes)
-> Generic ListVolumes
forall x. Rep ListVolumes x -> ListVolumes
forall x. ListVolumes -> Rep ListVolumes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListVolumes x -> ListVolumes
$cfrom :: forall x. ListVolumes -> Rep ListVolumes x
Prelude.Generic)

-- |
-- Create a value of 'ListVolumes' 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:
--
-- 'gatewayARN', 'listVolumes_gatewayARN' - Undocumented member.
--
-- 'marker', 'listVolumes_marker' - A string that indicates the position at which to begin the returned list
-- of volumes. Obtain the marker from the response of a previous List iSCSI
-- Volumes request.
--
-- 'limit', 'listVolumes_limit' - Specifies that the list of volumes returned be limited to the specified
-- number of items.
newListVolumes ::
  ListVolumes
newListVolumes :: ListVolumes
newListVolumes =
  ListVolumes' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListVolumes
ListVolumes'
    { $sel:gatewayARN:ListVolumes' :: Maybe Text
gatewayARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListVolumes' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListVolumes' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

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

-- | A string that indicates the position at which to begin the returned list
-- of volumes. Obtain the marker from the response of a previous List iSCSI
-- Volumes request.
listVolumes_marker :: Lens.Lens' ListVolumes (Prelude.Maybe Prelude.Text)
listVolumes_marker :: (Maybe Text -> f (Maybe Text)) -> ListVolumes -> f ListVolumes
listVolumes_marker = (ListVolumes -> Maybe Text)
-> (ListVolumes -> Maybe Text -> ListVolumes)
-> Lens ListVolumes ListVolumes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVolumes' {Maybe Text
marker :: Maybe Text
$sel:marker:ListVolumes' :: ListVolumes -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListVolumes
s@ListVolumes' {} Maybe Text
a -> ListVolumes
s {$sel:marker:ListVolumes' :: Maybe Text
marker = Maybe Text
a} :: ListVolumes)

-- | Specifies that the list of volumes returned be limited to the specified
-- number of items.
listVolumes_limit :: Lens.Lens' ListVolumes (Prelude.Maybe Prelude.Natural)
listVolumes_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListVolumes -> f ListVolumes
listVolumes_limit = (ListVolumes -> Maybe Natural)
-> (ListVolumes -> Maybe Natural -> ListVolumes)
-> Lens ListVolumes ListVolumes (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVolumes' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListVolumes' :: ListVolumes -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListVolumes
s@ListVolumes' {} Maybe Natural
a -> ListVolumes
s {$sel:limit:ListVolumes' :: Maybe Natural
limit = Maybe Natural
a} :: ListVolumes)

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

instance Prelude.NFData ListVolumes

instance Core.ToHeaders ListVolumes where
  toHeaders :: ListVolumes -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListVolumes -> 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.ListVolumes" ::
                          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 ListVolumes where
  toJSON :: ListVolumes -> Value
toJSON ListVolumes' {Maybe Natural
Maybe Text
limit :: Maybe Natural
marker :: Maybe Text
gatewayARN :: Maybe Text
$sel:limit:ListVolumes' :: ListVolumes -> Maybe Natural
$sel:marker:ListVolumes' :: ListVolumes -> Maybe Text
$sel:gatewayARN:ListVolumes' :: ListVolumes -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"GatewayARN" 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
gatewayARN,
            (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 ListVolumes where
  toPath :: ListVolumes -> ByteString
toPath = ByteString -> ListVolumes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | A JSON object containing the following fields:
--
-- -   ListVolumesOutput$Marker
--
-- -   ListVolumesOutput$VolumeInfos
--
-- /See:/ 'newListVolumesResponse' smart constructor.
data ListVolumesResponse = ListVolumesResponse'
  { ListVolumesResponse -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
    -- | Use the marker in your next request to continue pagination of iSCSI
    -- volumes. If there are no more volumes to list, this field does not
    -- appear in the response body.
    ListVolumesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | An array of VolumeInfo objects, where each object describes an iSCSI
    -- volume. If no volumes are defined for the gateway, then @VolumeInfos@ is
    -- an empty array \"[]\".
    ListVolumesResponse -> Maybe [VolumeInfo]
volumeInfos :: Prelude.Maybe [VolumeInfo],
    -- | The response's http status code.
    ListVolumesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListVolumesResponse -> ListVolumesResponse -> Bool
(ListVolumesResponse -> ListVolumesResponse -> Bool)
-> (ListVolumesResponse -> ListVolumesResponse -> Bool)
-> Eq ListVolumesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVolumesResponse -> ListVolumesResponse -> Bool
$c/= :: ListVolumesResponse -> ListVolumesResponse -> Bool
== :: ListVolumesResponse -> ListVolumesResponse -> Bool
$c== :: ListVolumesResponse -> ListVolumesResponse -> Bool
Prelude.Eq, ReadPrec [ListVolumesResponse]
ReadPrec ListVolumesResponse
Int -> ReadS ListVolumesResponse
ReadS [ListVolumesResponse]
(Int -> ReadS ListVolumesResponse)
-> ReadS [ListVolumesResponse]
-> ReadPrec ListVolumesResponse
-> ReadPrec [ListVolumesResponse]
-> Read ListVolumesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVolumesResponse]
$creadListPrec :: ReadPrec [ListVolumesResponse]
readPrec :: ReadPrec ListVolumesResponse
$creadPrec :: ReadPrec ListVolumesResponse
readList :: ReadS [ListVolumesResponse]
$creadList :: ReadS [ListVolumesResponse]
readsPrec :: Int -> ReadS ListVolumesResponse
$creadsPrec :: Int -> ReadS ListVolumesResponse
Prelude.Read, Int -> ListVolumesResponse -> ShowS
[ListVolumesResponse] -> ShowS
ListVolumesResponse -> String
(Int -> ListVolumesResponse -> ShowS)
-> (ListVolumesResponse -> String)
-> ([ListVolumesResponse] -> ShowS)
-> Show ListVolumesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVolumesResponse] -> ShowS
$cshowList :: [ListVolumesResponse] -> ShowS
show :: ListVolumesResponse -> String
$cshow :: ListVolumesResponse -> String
showsPrec :: Int -> ListVolumesResponse -> ShowS
$cshowsPrec :: Int -> ListVolumesResponse -> ShowS
Prelude.Show, (forall x. ListVolumesResponse -> Rep ListVolumesResponse x)
-> (forall x. Rep ListVolumesResponse x -> ListVolumesResponse)
-> Generic ListVolumesResponse
forall x. Rep ListVolumesResponse x -> ListVolumesResponse
forall x. ListVolumesResponse -> Rep ListVolumesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListVolumesResponse x -> ListVolumesResponse
$cfrom :: forall x. ListVolumesResponse -> Rep ListVolumesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListVolumesResponse' 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:
--
-- 'gatewayARN', 'listVolumesResponse_gatewayARN' - Undocumented member.
--
-- 'marker', 'listVolumesResponse_marker' - Use the marker in your next request to continue pagination of iSCSI
-- volumes. If there are no more volumes to list, this field does not
-- appear in the response body.
--
-- 'volumeInfos', 'listVolumesResponse_volumeInfos' - An array of VolumeInfo objects, where each object describes an iSCSI
-- volume. If no volumes are defined for the gateway, then @VolumeInfos@ is
-- an empty array \"[]\".
--
-- 'httpStatus', 'listVolumesResponse_httpStatus' - The response's http status code.
newListVolumesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListVolumesResponse
newListVolumesResponse :: Int -> ListVolumesResponse
newListVolumesResponse Int
pHttpStatus_ =
  ListVolumesResponse' :: Maybe Text
-> Maybe Text -> Maybe [VolumeInfo] -> Int -> ListVolumesResponse
ListVolumesResponse'
    { $sel:gatewayARN:ListVolumesResponse' :: Maybe Text
gatewayARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListVolumesResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeInfos:ListVolumesResponse' :: Maybe [VolumeInfo]
volumeInfos = Maybe [VolumeInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListVolumesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | Use the marker in your next request to continue pagination of iSCSI
-- volumes. If there are no more volumes to list, this field does not
-- appear in the response body.
listVolumesResponse_marker :: Lens.Lens' ListVolumesResponse (Prelude.Maybe Prelude.Text)
listVolumesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListVolumesResponse -> f ListVolumesResponse
listVolumesResponse_marker = (ListVolumesResponse -> Maybe Text)
-> (ListVolumesResponse -> Maybe Text -> ListVolumesResponse)
-> Lens' ListVolumesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVolumesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListVolumesResponse' :: ListVolumesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListVolumesResponse
s@ListVolumesResponse' {} Maybe Text
a -> ListVolumesResponse
s {$sel:marker:ListVolumesResponse' :: Maybe Text
marker = Maybe Text
a} :: ListVolumesResponse)

-- | An array of VolumeInfo objects, where each object describes an iSCSI
-- volume. If no volumes are defined for the gateway, then @VolumeInfos@ is
-- an empty array \"[]\".
listVolumesResponse_volumeInfos :: Lens.Lens' ListVolumesResponse (Prelude.Maybe [VolumeInfo])
listVolumesResponse_volumeInfos :: (Maybe [VolumeInfo] -> f (Maybe [VolumeInfo]))
-> ListVolumesResponse -> f ListVolumesResponse
listVolumesResponse_volumeInfos = (ListVolumesResponse -> Maybe [VolumeInfo])
-> (ListVolumesResponse
    -> Maybe [VolumeInfo] -> ListVolumesResponse)
-> Lens' ListVolumesResponse (Maybe [VolumeInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVolumesResponse' {Maybe [VolumeInfo]
volumeInfos :: Maybe [VolumeInfo]
$sel:volumeInfos:ListVolumesResponse' :: ListVolumesResponse -> Maybe [VolumeInfo]
volumeInfos} -> Maybe [VolumeInfo]
volumeInfos) (\s :: ListVolumesResponse
s@ListVolumesResponse' {} Maybe [VolumeInfo]
a -> ListVolumesResponse
s {$sel:volumeInfos:ListVolumesResponse' :: Maybe [VolumeInfo]
volumeInfos = Maybe [VolumeInfo]
a} :: ListVolumesResponse) ((Maybe [VolumeInfo] -> f (Maybe [VolumeInfo]))
 -> ListVolumesResponse -> f ListVolumesResponse)
-> ((Maybe [VolumeInfo] -> f (Maybe [VolumeInfo]))
    -> Maybe [VolumeInfo] -> f (Maybe [VolumeInfo]))
-> (Maybe [VolumeInfo] -> f (Maybe [VolumeInfo]))
-> ListVolumesResponse
-> f ListVolumesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [VolumeInfo] [VolumeInfo] [VolumeInfo] [VolumeInfo]
-> Iso
     (Maybe [VolumeInfo])
     (Maybe [VolumeInfo])
     (Maybe [VolumeInfo])
     (Maybe [VolumeInfo])
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 [VolumeInfo] [VolumeInfo] [VolumeInfo] [VolumeInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListVolumesResponse