{-# 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.ListFileShares
-- 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)
--
-- Gets a list of the file shares for a specific S3 File Gateway, or the
-- list of file shares that belong to the calling user account. This
-- operation is only supported for S3 File Gateways.
--
-- This operation returns paginated results.
module Amazonka.StorageGateway.ListFileShares
  ( -- * Creating a Request
    ListFileShares (..),
    newListFileShares,

    -- * Request Lenses
    listFileShares_gatewayARN,
    listFileShares_marker,
    listFileShares_limit,

    -- * Destructuring the Response
    ListFileSharesResponse (..),
    newListFileSharesResponse,

    -- * Response Lenses
    listFileSharesResponse_fileShareInfoList,
    listFileSharesResponse_marker,
    listFileSharesResponse_nextMarker,
    listFileSharesResponse_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

-- | ListFileShareInput
--
-- /See:/ 'newListFileShares' smart constructor.
data ListFileShares = ListFileShares'
  { -- | The Amazon Resource Name (ARN) of the gateway whose file shares you want
    -- to list. If this field is not present, all file shares under your
    -- account are listed.
    ListFileShares -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
    -- | Opaque pagination token returned from a previous ListFileShares
    -- operation. If present, @Marker@ specifies where to continue the list
    -- from after a previous call to ListFileShares. Optional.
    ListFileShares -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of file shares to return in the response. The value
    -- must be an integer with a value greater than zero. Optional.
    ListFileShares -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListFileShares -> ListFileShares -> Bool
(ListFileShares -> ListFileShares -> Bool)
-> (ListFileShares -> ListFileShares -> Bool) -> Eq ListFileShares
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFileShares -> ListFileShares -> Bool
$c/= :: ListFileShares -> ListFileShares -> Bool
== :: ListFileShares -> ListFileShares -> Bool
$c== :: ListFileShares -> ListFileShares -> Bool
Prelude.Eq, ReadPrec [ListFileShares]
ReadPrec ListFileShares
Int -> ReadS ListFileShares
ReadS [ListFileShares]
(Int -> ReadS ListFileShares)
-> ReadS [ListFileShares]
-> ReadPrec ListFileShares
-> ReadPrec [ListFileShares]
-> Read ListFileShares
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFileShares]
$creadListPrec :: ReadPrec [ListFileShares]
readPrec :: ReadPrec ListFileShares
$creadPrec :: ReadPrec ListFileShares
readList :: ReadS [ListFileShares]
$creadList :: ReadS [ListFileShares]
readsPrec :: Int -> ReadS ListFileShares
$creadsPrec :: Int -> ReadS ListFileShares
Prelude.Read, Int -> ListFileShares -> ShowS
[ListFileShares] -> ShowS
ListFileShares -> String
(Int -> ListFileShares -> ShowS)
-> (ListFileShares -> String)
-> ([ListFileShares] -> ShowS)
-> Show ListFileShares
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFileShares] -> ShowS
$cshowList :: [ListFileShares] -> ShowS
show :: ListFileShares -> String
$cshow :: ListFileShares -> String
showsPrec :: Int -> ListFileShares -> ShowS
$cshowsPrec :: Int -> ListFileShares -> ShowS
Prelude.Show, (forall x. ListFileShares -> Rep ListFileShares x)
-> (forall x. Rep ListFileShares x -> ListFileShares)
-> Generic ListFileShares
forall x. Rep ListFileShares x -> ListFileShares
forall x. ListFileShares -> Rep ListFileShares x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFileShares x -> ListFileShares
$cfrom :: forall x. ListFileShares -> Rep ListFileShares x
Prelude.Generic)

-- |
-- Create a value of 'ListFileShares' 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', 'listFileShares_gatewayARN' - The Amazon Resource Name (ARN) of the gateway whose file shares you want
-- to list. If this field is not present, all file shares under your
-- account are listed.
--
-- 'marker', 'listFileShares_marker' - Opaque pagination token returned from a previous ListFileShares
-- operation. If present, @Marker@ specifies where to continue the list
-- from after a previous call to ListFileShares. Optional.
--
-- 'limit', 'listFileShares_limit' - The maximum number of file shares to return in the response. The value
-- must be an integer with a value greater than zero. Optional.
newListFileShares ::
  ListFileShares
newListFileShares :: ListFileShares
newListFileShares =
  ListFileShares' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListFileShares
ListFileShares'
    { $sel:gatewayARN:ListFileShares' :: Maybe Text
gatewayARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListFileShares' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListFileShares' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the gateway whose file shares you want
-- to list. If this field is not present, all file shares under your
-- account are listed.
listFileShares_gatewayARN :: Lens.Lens' ListFileShares (Prelude.Maybe Prelude.Text)
listFileShares_gatewayARN :: (Maybe Text -> f (Maybe Text))
-> ListFileShares -> f ListFileShares
listFileShares_gatewayARN = (ListFileShares -> Maybe Text)
-> (ListFileShares -> Maybe Text -> ListFileShares)
-> Lens ListFileShares ListFileShares (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFileShares' {Maybe Text
gatewayARN :: Maybe Text
$sel:gatewayARN:ListFileShares' :: ListFileShares -> Maybe Text
gatewayARN} -> Maybe Text
gatewayARN) (\s :: ListFileShares
s@ListFileShares' {} Maybe Text
a -> ListFileShares
s {$sel:gatewayARN:ListFileShares' :: Maybe Text
gatewayARN = Maybe Text
a} :: ListFileShares)

-- | Opaque pagination token returned from a previous ListFileShares
-- operation. If present, @Marker@ specifies where to continue the list
-- from after a previous call to ListFileShares. Optional.
listFileShares_marker :: Lens.Lens' ListFileShares (Prelude.Maybe Prelude.Text)
listFileShares_marker :: (Maybe Text -> f (Maybe Text))
-> ListFileShares -> f ListFileShares
listFileShares_marker = (ListFileShares -> Maybe Text)
-> (ListFileShares -> Maybe Text -> ListFileShares)
-> Lens ListFileShares ListFileShares (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFileShares' {Maybe Text
marker :: Maybe Text
$sel:marker:ListFileShares' :: ListFileShares -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListFileShares
s@ListFileShares' {} Maybe Text
a -> ListFileShares
s {$sel:marker:ListFileShares' :: Maybe Text
marker = Maybe Text
a} :: ListFileShares)

-- | The maximum number of file shares to return in the response. The value
-- must be an integer with a value greater than zero. Optional.
listFileShares_limit :: Lens.Lens' ListFileShares (Prelude.Maybe Prelude.Natural)
listFileShares_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListFileShares -> f ListFileShares
listFileShares_limit = (ListFileShares -> Maybe Natural)
-> (ListFileShares -> Maybe Natural -> ListFileShares)
-> Lens
     ListFileShares ListFileShares (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFileShares' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListFileShares' :: ListFileShares -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListFileShares
s@ListFileShares' {} Maybe Natural
a -> ListFileShares
s {$sel:limit:ListFileShares' :: Maybe Natural
limit = Maybe Natural
a} :: ListFileShares)

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

instance Prelude.NFData ListFileShares

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

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

-- | ListFileShareOutput
--
-- /See:/ 'newListFileSharesResponse' smart constructor.
data ListFileSharesResponse = ListFileSharesResponse'
  { -- | An array of information about the S3 File Gateway\'s file shares.
    ListFileSharesResponse -> Maybe [FileShareInfo]
fileShareInfoList :: Prelude.Maybe [FileShareInfo],
    -- | If the request includes @Marker@, the response returns that value in
    -- this field.
    ListFileSharesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | If a value is present, there are more file shares to return. In a
    -- subsequent request, use @NextMarker@ as the value for @Marker@ to
    -- retrieve the next set of file shares.
    ListFileSharesResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListFileSharesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListFileSharesResponse -> ListFileSharesResponse -> Bool
(ListFileSharesResponse -> ListFileSharesResponse -> Bool)
-> (ListFileSharesResponse -> ListFileSharesResponse -> Bool)
-> Eq ListFileSharesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFileSharesResponse -> ListFileSharesResponse -> Bool
$c/= :: ListFileSharesResponse -> ListFileSharesResponse -> Bool
== :: ListFileSharesResponse -> ListFileSharesResponse -> Bool
$c== :: ListFileSharesResponse -> ListFileSharesResponse -> Bool
Prelude.Eq, ReadPrec [ListFileSharesResponse]
ReadPrec ListFileSharesResponse
Int -> ReadS ListFileSharesResponse
ReadS [ListFileSharesResponse]
(Int -> ReadS ListFileSharesResponse)
-> ReadS [ListFileSharesResponse]
-> ReadPrec ListFileSharesResponse
-> ReadPrec [ListFileSharesResponse]
-> Read ListFileSharesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFileSharesResponse]
$creadListPrec :: ReadPrec [ListFileSharesResponse]
readPrec :: ReadPrec ListFileSharesResponse
$creadPrec :: ReadPrec ListFileSharesResponse
readList :: ReadS [ListFileSharesResponse]
$creadList :: ReadS [ListFileSharesResponse]
readsPrec :: Int -> ReadS ListFileSharesResponse
$creadsPrec :: Int -> ReadS ListFileSharesResponse
Prelude.Read, Int -> ListFileSharesResponse -> ShowS
[ListFileSharesResponse] -> ShowS
ListFileSharesResponse -> String
(Int -> ListFileSharesResponse -> ShowS)
-> (ListFileSharesResponse -> String)
-> ([ListFileSharesResponse] -> ShowS)
-> Show ListFileSharesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFileSharesResponse] -> ShowS
$cshowList :: [ListFileSharesResponse] -> ShowS
show :: ListFileSharesResponse -> String
$cshow :: ListFileSharesResponse -> String
showsPrec :: Int -> ListFileSharesResponse -> ShowS
$cshowsPrec :: Int -> ListFileSharesResponse -> ShowS
Prelude.Show, (forall x. ListFileSharesResponse -> Rep ListFileSharesResponse x)
-> (forall x.
    Rep ListFileSharesResponse x -> ListFileSharesResponse)
-> Generic ListFileSharesResponse
forall x. Rep ListFileSharesResponse x -> ListFileSharesResponse
forall x. ListFileSharesResponse -> Rep ListFileSharesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFileSharesResponse x -> ListFileSharesResponse
$cfrom :: forall x. ListFileSharesResponse -> Rep ListFileSharesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFileSharesResponse' 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:
--
-- 'fileShareInfoList', 'listFileSharesResponse_fileShareInfoList' - An array of information about the S3 File Gateway\'s file shares.
--
-- 'marker', 'listFileSharesResponse_marker' - If the request includes @Marker@, the response returns that value in
-- this field.
--
-- 'nextMarker', 'listFileSharesResponse_nextMarker' - If a value is present, there are more file shares to return. In a
-- subsequent request, use @NextMarker@ as the value for @Marker@ to
-- retrieve the next set of file shares.
--
-- 'httpStatus', 'listFileSharesResponse_httpStatus' - The response's http status code.
newListFileSharesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFileSharesResponse
newListFileSharesResponse :: Int -> ListFileSharesResponse
newListFileSharesResponse Int
pHttpStatus_ =
  ListFileSharesResponse' :: Maybe [FileShareInfo]
-> Maybe Text -> Maybe Text -> Int -> ListFileSharesResponse
ListFileSharesResponse'
    { $sel:fileShareInfoList:ListFileSharesResponse' :: Maybe [FileShareInfo]
fileShareInfoList =
        Maybe [FileShareInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListFileSharesResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextMarker:ListFileSharesResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFileSharesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of information about the S3 File Gateway\'s file shares.
listFileSharesResponse_fileShareInfoList :: Lens.Lens' ListFileSharesResponse (Prelude.Maybe [FileShareInfo])
listFileSharesResponse_fileShareInfoList :: (Maybe [FileShareInfo] -> f (Maybe [FileShareInfo]))
-> ListFileSharesResponse -> f ListFileSharesResponse
listFileSharesResponse_fileShareInfoList = (ListFileSharesResponse -> Maybe [FileShareInfo])
-> (ListFileSharesResponse
    -> Maybe [FileShareInfo] -> ListFileSharesResponse)
-> Lens' ListFileSharesResponse (Maybe [FileShareInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFileSharesResponse' {Maybe [FileShareInfo]
fileShareInfoList :: Maybe [FileShareInfo]
$sel:fileShareInfoList:ListFileSharesResponse' :: ListFileSharesResponse -> Maybe [FileShareInfo]
fileShareInfoList} -> Maybe [FileShareInfo]
fileShareInfoList) (\s :: ListFileSharesResponse
s@ListFileSharesResponse' {} Maybe [FileShareInfo]
a -> ListFileSharesResponse
s {$sel:fileShareInfoList:ListFileSharesResponse' :: Maybe [FileShareInfo]
fileShareInfoList = Maybe [FileShareInfo]
a} :: ListFileSharesResponse) ((Maybe [FileShareInfo] -> f (Maybe [FileShareInfo]))
 -> ListFileSharesResponse -> f ListFileSharesResponse)
-> ((Maybe [FileShareInfo] -> f (Maybe [FileShareInfo]))
    -> Maybe [FileShareInfo] -> f (Maybe [FileShareInfo]))
-> (Maybe [FileShareInfo] -> f (Maybe [FileShareInfo]))
-> ListFileSharesResponse
-> f ListFileSharesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FileShareInfo] [FileShareInfo] [FileShareInfo] [FileShareInfo]
-> Iso
     (Maybe [FileShareInfo])
     (Maybe [FileShareInfo])
     (Maybe [FileShareInfo])
     (Maybe [FileShareInfo])
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
  [FileShareInfo] [FileShareInfo] [FileShareInfo] [FileShareInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the request includes @Marker@, the response returns that value in
-- this field.
listFileSharesResponse_marker :: Lens.Lens' ListFileSharesResponse (Prelude.Maybe Prelude.Text)
listFileSharesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListFileSharesResponse -> f ListFileSharesResponse
listFileSharesResponse_marker = (ListFileSharesResponse -> Maybe Text)
-> (ListFileSharesResponse -> Maybe Text -> ListFileSharesResponse)
-> Lens' ListFileSharesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFileSharesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListFileSharesResponse' :: ListFileSharesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListFileSharesResponse
s@ListFileSharesResponse' {} Maybe Text
a -> ListFileSharesResponse
s {$sel:marker:ListFileSharesResponse' :: Maybe Text
marker = Maybe Text
a} :: ListFileSharesResponse)

-- | If a value is present, there are more file shares to return. In a
-- subsequent request, use @NextMarker@ as the value for @Marker@ to
-- retrieve the next set of file shares.
listFileSharesResponse_nextMarker :: Lens.Lens' ListFileSharesResponse (Prelude.Maybe Prelude.Text)
listFileSharesResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> ListFileSharesResponse -> f ListFileSharesResponse
listFileSharesResponse_nextMarker = (ListFileSharesResponse -> Maybe Text)
-> (ListFileSharesResponse -> Maybe Text -> ListFileSharesResponse)
-> Lens' ListFileSharesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFileSharesResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:ListFileSharesResponse' :: ListFileSharesResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: ListFileSharesResponse
s@ListFileSharesResponse' {} Maybe Text
a -> ListFileSharesResponse
s {$sel:nextMarker:ListFileSharesResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: ListFileSharesResponse)

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

instance Prelude.NFData ListFileSharesResponse