{-# 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.ListFileSystemAssociations
-- 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 @FileSystemAssociationSummary@ objects. Each object
-- contains a summary of a file system association. This operation is only
-- supported for FSx File Gateways.
--
-- This operation returns paginated results.
module Amazonka.StorageGateway.ListFileSystemAssociations
  ( -- * Creating a Request
    ListFileSystemAssociations (..),
    newListFileSystemAssociations,

    -- * Request Lenses
    listFileSystemAssociations_gatewayARN,
    listFileSystemAssociations_marker,
    listFileSystemAssociations_limit,

    -- * Destructuring the Response
    ListFileSystemAssociationsResponse (..),
    newListFileSystemAssociationsResponse,

    -- * Response Lenses
    listFileSystemAssociationsResponse_fileSystemAssociationSummaryList,
    listFileSystemAssociationsResponse_marker,
    listFileSystemAssociationsResponse_nextMarker,
    listFileSystemAssociationsResponse_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:/ 'newListFileSystemAssociations' smart constructor.
data ListFileSystemAssociations = ListFileSystemAssociations'
  { ListFileSystemAssociations -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
    -- | Opaque pagination token returned from a previous
    -- @ListFileSystemAssociations@ operation. If present, @Marker@ specifies
    -- where to continue the list from after a previous call to
    -- @ListFileSystemAssociations@. Optional.
    ListFileSystemAssociations -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of file system associations to return in the
    -- response. If present, @Limit@ must be an integer with a value greater
    -- than zero. Optional.
    ListFileSystemAssociations -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListFileSystemAssociations -> ListFileSystemAssociations -> Bool
(ListFileSystemAssociations -> ListFileSystemAssociations -> Bool)
-> (ListFileSystemAssociations
    -> ListFileSystemAssociations -> Bool)
-> Eq ListFileSystemAssociations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFileSystemAssociations -> ListFileSystemAssociations -> Bool
$c/= :: ListFileSystemAssociations -> ListFileSystemAssociations -> Bool
== :: ListFileSystemAssociations -> ListFileSystemAssociations -> Bool
$c== :: ListFileSystemAssociations -> ListFileSystemAssociations -> Bool
Prelude.Eq, ReadPrec [ListFileSystemAssociations]
ReadPrec ListFileSystemAssociations
Int -> ReadS ListFileSystemAssociations
ReadS [ListFileSystemAssociations]
(Int -> ReadS ListFileSystemAssociations)
-> ReadS [ListFileSystemAssociations]
-> ReadPrec ListFileSystemAssociations
-> ReadPrec [ListFileSystemAssociations]
-> Read ListFileSystemAssociations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFileSystemAssociations]
$creadListPrec :: ReadPrec [ListFileSystemAssociations]
readPrec :: ReadPrec ListFileSystemAssociations
$creadPrec :: ReadPrec ListFileSystemAssociations
readList :: ReadS [ListFileSystemAssociations]
$creadList :: ReadS [ListFileSystemAssociations]
readsPrec :: Int -> ReadS ListFileSystemAssociations
$creadsPrec :: Int -> ReadS ListFileSystemAssociations
Prelude.Read, Int -> ListFileSystemAssociations -> ShowS
[ListFileSystemAssociations] -> ShowS
ListFileSystemAssociations -> String
(Int -> ListFileSystemAssociations -> ShowS)
-> (ListFileSystemAssociations -> String)
-> ([ListFileSystemAssociations] -> ShowS)
-> Show ListFileSystemAssociations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFileSystemAssociations] -> ShowS
$cshowList :: [ListFileSystemAssociations] -> ShowS
show :: ListFileSystemAssociations -> String
$cshow :: ListFileSystemAssociations -> String
showsPrec :: Int -> ListFileSystemAssociations -> ShowS
$cshowsPrec :: Int -> ListFileSystemAssociations -> ShowS
Prelude.Show, (forall x.
 ListFileSystemAssociations -> Rep ListFileSystemAssociations x)
-> (forall x.
    Rep ListFileSystemAssociations x -> ListFileSystemAssociations)
-> Generic ListFileSystemAssociations
forall x.
Rep ListFileSystemAssociations x -> ListFileSystemAssociations
forall x.
ListFileSystemAssociations -> Rep ListFileSystemAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFileSystemAssociations x -> ListFileSystemAssociations
$cfrom :: forall x.
ListFileSystemAssociations -> Rep ListFileSystemAssociations x
Prelude.Generic)

-- |
-- Create a value of 'ListFileSystemAssociations' 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', 'listFileSystemAssociations_gatewayARN' - Undocumented member.
--
-- 'marker', 'listFileSystemAssociations_marker' - Opaque pagination token returned from a previous
-- @ListFileSystemAssociations@ operation. If present, @Marker@ specifies
-- where to continue the list from after a previous call to
-- @ListFileSystemAssociations@. Optional.
--
-- 'limit', 'listFileSystemAssociations_limit' - The maximum number of file system associations to return in the
-- response. If present, @Limit@ must be an integer with a value greater
-- than zero. Optional.
newListFileSystemAssociations ::
  ListFileSystemAssociations
newListFileSystemAssociations :: ListFileSystemAssociations
newListFileSystemAssociations =
  ListFileSystemAssociations' :: Maybe Text
-> Maybe Text -> Maybe Natural -> ListFileSystemAssociations
ListFileSystemAssociations'
    { $sel:gatewayARN:ListFileSystemAssociations' :: Maybe Text
gatewayARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListFileSystemAssociations' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListFileSystemAssociations' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

instance Prelude.NFData ListFileSystemAssociations

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

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

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

-- |
-- Create a value of 'ListFileSystemAssociationsResponse' 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:
--
-- 'fileSystemAssociationSummaryList', 'listFileSystemAssociationsResponse_fileSystemAssociationSummaryList' - An array of information about the Amazon FSx gateway\'s file system
-- associations.
--
-- 'marker', 'listFileSystemAssociationsResponse_marker' - If the request includes @Marker@, the response returns that value in
-- this field.
--
-- 'nextMarker', 'listFileSystemAssociationsResponse_nextMarker' - If a value is present, there are more file system associations to
-- return. In a subsequent request, use @NextMarker@ as the value for
-- @Marker@ to retrieve the next set of file system associations.
--
-- 'httpStatus', 'listFileSystemAssociationsResponse_httpStatus' - The response's http status code.
newListFileSystemAssociationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFileSystemAssociationsResponse
newListFileSystemAssociationsResponse :: Int -> ListFileSystemAssociationsResponse
newListFileSystemAssociationsResponse Int
pHttpStatus_ =
  ListFileSystemAssociationsResponse' :: Maybe [FileSystemAssociationSummary]
-> Maybe Text
-> Maybe Text
-> Int
-> ListFileSystemAssociationsResponse
ListFileSystemAssociationsResponse'
    { $sel:fileSystemAssociationSummaryList:ListFileSystemAssociationsResponse' :: Maybe [FileSystemAssociationSummary]
fileSystemAssociationSummaryList =
        Maybe [FileSystemAssociationSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListFileSystemAssociationsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextMarker:ListFileSystemAssociationsResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFileSystemAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of information about the Amazon FSx gateway\'s file system
-- associations.
listFileSystemAssociationsResponse_fileSystemAssociationSummaryList :: Lens.Lens' ListFileSystemAssociationsResponse (Prelude.Maybe [FileSystemAssociationSummary])
listFileSystemAssociationsResponse_fileSystemAssociationSummaryList :: (Maybe [FileSystemAssociationSummary]
 -> f (Maybe [FileSystemAssociationSummary]))
-> ListFileSystemAssociationsResponse
-> f ListFileSystemAssociationsResponse
listFileSystemAssociationsResponse_fileSystemAssociationSummaryList = (ListFileSystemAssociationsResponse
 -> Maybe [FileSystemAssociationSummary])
-> (ListFileSystemAssociationsResponse
    -> Maybe [FileSystemAssociationSummary]
    -> ListFileSystemAssociationsResponse)
-> Lens'
     ListFileSystemAssociationsResponse
     (Maybe [FileSystemAssociationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFileSystemAssociationsResponse' {Maybe [FileSystemAssociationSummary]
fileSystemAssociationSummaryList :: Maybe [FileSystemAssociationSummary]
$sel:fileSystemAssociationSummaryList:ListFileSystemAssociationsResponse' :: ListFileSystemAssociationsResponse
-> Maybe [FileSystemAssociationSummary]
fileSystemAssociationSummaryList} -> Maybe [FileSystemAssociationSummary]
fileSystemAssociationSummaryList) (\s :: ListFileSystemAssociationsResponse
s@ListFileSystemAssociationsResponse' {} Maybe [FileSystemAssociationSummary]
a -> ListFileSystemAssociationsResponse
s {$sel:fileSystemAssociationSummaryList:ListFileSystemAssociationsResponse' :: Maybe [FileSystemAssociationSummary]
fileSystemAssociationSummaryList = Maybe [FileSystemAssociationSummary]
a} :: ListFileSystemAssociationsResponse) ((Maybe [FileSystemAssociationSummary]
  -> f (Maybe [FileSystemAssociationSummary]))
 -> ListFileSystemAssociationsResponse
 -> f ListFileSystemAssociationsResponse)
-> ((Maybe [FileSystemAssociationSummary]
     -> f (Maybe [FileSystemAssociationSummary]))
    -> Maybe [FileSystemAssociationSummary]
    -> f (Maybe [FileSystemAssociationSummary]))
-> (Maybe [FileSystemAssociationSummary]
    -> f (Maybe [FileSystemAssociationSummary]))
-> ListFileSystemAssociationsResponse
-> f ListFileSystemAssociationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FileSystemAssociationSummary]
  [FileSystemAssociationSummary]
  [FileSystemAssociationSummary]
  [FileSystemAssociationSummary]
-> Iso
     (Maybe [FileSystemAssociationSummary])
     (Maybe [FileSystemAssociationSummary])
     (Maybe [FileSystemAssociationSummary])
     (Maybe [FileSystemAssociationSummary])
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
  [FileSystemAssociationSummary]
  [FileSystemAssociationSummary]
  [FileSystemAssociationSummary]
  [FileSystemAssociationSummary]
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.
listFileSystemAssociationsResponse_marker :: Lens.Lens' ListFileSystemAssociationsResponse (Prelude.Maybe Prelude.Text)
listFileSystemAssociationsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListFileSystemAssociationsResponse
-> f ListFileSystemAssociationsResponse
listFileSystemAssociationsResponse_marker = (ListFileSystemAssociationsResponse -> Maybe Text)
-> (ListFileSystemAssociationsResponse
    -> Maybe Text -> ListFileSystemAssociationsResponse)
-> Lens' ListFileSystemAssociationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFileSystemAssociationsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListFileSystemAssociationsResponse' :: ListFileSystemAssociationsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListFileSystemAssociationsResponse
s@ListFileSystemAssociationsResponse' {} Maybe Text
a -> ListFileSystemAssociationsResponse
s {$sel:marker:ListFileSystemAssociationsResponse' :: Maybe Text
marker = Maybe Text
a} :: ListFileSystemAssociationsResponse)

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

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

instance
  Prelude.NFData
    ListFileSystemAssociationsResponse