{-# 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.EFS.DescribeMountTargets
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the descriptions of all the current mount targets, or a specific
-- mount target, for a file system. When requesting all of the current
-- mount targets, the order of mount targets returned in the response is
-- unspecified.
--
-- This operation requires permissions for the
-- @elasticfilesystem:DescribeMountTargets@ action, on either the file
-- system ID that you specify in @FileSystemId@, or on the file system of
-- the mount target that you specify in @MountTargetId@.
--
-- This operation returns paginated results.
module Amazonka.EFS.DescribeMountTargets
  ( -- * Creating a Request
    DescribeMountTargets (..),
    newDescribeMountTargets,

    -- * Request Lenses
    describeMountTargets_accessPointId,
    describeMountTargets_fileSystemId,
    describeMountTargets_marker,
    describeMountTargets_maxItems,
    describeMountTargets_mountTargetId,

    -- * Destructuring the Response
    DescribeMountTargetsResponse (..),
    newDescribeMountTargetsResponse,

    -- * Response Lenses
    describeMountTargetsResponse_mountTargets,
    describeMountTargetsResponse_marker,
    describeMountTargetsResponse_nextMarker,
    describeMountTargetsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.EFS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newDescribeMountTargets' smart constructor.
data DescribeMountTargets = DescribeMountTargets'
  { -- | (Optional) The ID of the access point whose mount targets that you want
    -- to list. It must be included in your request if a @FileSystemId@ or
    -- @MountTargetId@ is not included in your request. Accepts either an
    -- access point ID or ARN as input.
    DescribeMountTargets -> Maybe Text
accessPointId :: Prelude.Maybe Prelude.Text,
    -- | (Optional) ID of the file system whose mount targets you want to list
    -- (String). It must be included in your request if an @AccessPointId@ or
    -- @MountTargetId@ is not included. Accepts either a file system ID or ARN
    -- as input.
    DescribeMountTargets -> Maybe Text
fileSystemId :: Prelude.Maybe Prelude.Text,
    -- | (Optional) Opaque pagination token returned from a previous
    -- @DescribeMountTargets@ operation (String). If present, it specifies to
    -- continue the list from where the previous returning call left off.
    DescribeMountTargets -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | (Optional) Maximum number of mount targets to return in the response.
    -- Currently, this number is automatically set to 10, and other values are
    -- ignored. The response is paginated at 100 per page if you have more than
    -- 100 mount targets.
    DescribeMountTargets -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | (Optional) ID of the mount target that you want to have described
    -- (String). It must be included in your request if @FileSystemId@ is not
    -- included. Accepts either a mount target ID or ARN as input.
    DescribeMountTargets -> Maybe Text
mountTargetId :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeMountTargets -> DescribeMountTargets -> Bool
(DescribeMountTargets -> DescribeMountTargets -> Bool)
-> (DescribeMountTargets -> DescribeMountTargets -> Bool)
-> Eq DescribeMountTargets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeMountTargets -> DescribeMountTargets -> Bool
$c/= :: DescribeMountTargets -> DescribeMountTargets -> Bool
== :: DescribeMountTargets -> DescribeMountTargets -> Bool
$c== :: DescribeMountTargets -> DescribeMountTargets -> Bool
Prelude.Eq, ReadPrec [DescribeMountTargets]
ReadPrec DescribeMountTargets
Int -> ReadS DescribeMountTargets
ReadS [DescribeMountTargets]
(Int -> ReadS DescribeMountTargets)
-> ReadS [DescribeMountTargets]
-> ReadPrec DescribeMountTargets
-> ReadPrec [DescribeMountTargets]
-> Read DescribeMountTargets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeMountTargets]
$creadListPrec :: ReadPrec [DescribeMountTargets]
readPrec :: ReadPrec DescribeMountTargets
$creadPrec :: ReadPrec DescribeMountTargets
readList :: ReadS [DescribeMountTargets]
$creadList :: ReadS [DescribeMountTargets]
readsPrec :: Int -> ReadS DescribeMountTargets
$creadsPrec :: Int -> ReadS DescribeMountTargets
Prelude.Read, Int -> DescribeMountTargets -> ShowS
[DescribeMountTargets] -> ShowS
DescribeMountTargets -> String
(Int -> DescribeMountTargets -> ShowS)
-> (DescribeMountTargets -> String)
-> ([DescribeMountTargets] -> ShowS)
-> Show DescribeMountTargets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeMountTargets] -> ShowS
$cshowList :: [DescribeMountTargets] -> ShowS
show :: DescribeMountTargets -> String
$cshow :: DescribeMountTargets -> String
showsPrec :: Int -> DescribeMountTargets -> ShowS
$cshowsPrec :: Int -> DescribeMountTargets -> ShowS
Prelude.Show, (forall x. DescribeMountTargets -> Rep DescribeMountTargets x)
-> (forall x. Rep DescribeMountTargets x -> DescribeMountTargets)
-> Generic DescribeMountTargets
forall x. Rep DescribeMountTargets x -> DescribeMountTargets
forall x. DescribeMountTargets -> Rep DescribeMountTargets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeMountTargets x -> DescribeMountTargets
$cfrom :: forall x. DescribeMountTargets -> Rep DescribeMountTargets x
Prelude.Generic)

-- |
-- Create a value of 'DescribeMountTargets' 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:
--
-- 'accessPointId', 'describeMountTargets_accessPointId' - (Optional) The ID of the access point whose mount targets that you want
-- to list. It must be included in your request if a @FileSystemId@ or
-- @MountTargetId@ is not included in your request. Accepts either an
-- access point ID or ARN as input.
--
-- 'fileSystemId', 'describeMountTargets_fileSystemId' - (Optional) ID of the file system whose mount targets you want to list
-- (String). It must be included in your request if an @AccessPointId@ or
-- @MountTargetId@ is not included. Accepts either a file system ID or ARN
-- as input.
--
-- 'marker', 'describeMountTargets_marker' - (Optional) Opaque pagination token returned from a previous
-- @DescribeMountTargets@ operation (String). If present, it specifies to
-- continue the list from where the previous returning call left off.
--
-- 'maxItems', 'describeMountTargets_maxItems' - (Optional) Maximum number of mount targets to return in the response.
-- Currently, this number is automatically set to 10, and other values are
-- ignored. The response is paginated at 100 per page if you have more than
-- 100 mount targets.
--
-- 'mountTargetId', 'describeMountTargets_mountTargetId' - (Optional) ID of the mount target that you want to have described
-- (String). It must be included in your request if @FileSystemId@ is not
-- included. Accepts either a mount target ID or ARN as input.
newDescribeMountTargets ::
  DescribeMountTargets
newDescribeMountTargets :: DescribeMountTargets
newDescribeMountTargets =
  DescribeMountTargets' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> DescribeMountTargets
DescribeMountTargets'
    { $sel:accessPointId:DescribeMountTargets' :: Maybe Text
accessPointId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fileSystemId:DescribeMountTargets' :: Maybe Text
fileSystemId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeMountTargets' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:DescribeMountTargets' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:mountTargetId:DescribeMountTargets' :: Maybe Text
mountTargetId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | (Optional) The ID of the access point whose mount targets that you want
-- to list. It must be included in your request if a @FileSystemId@ or
-- @MountTargetId@ is not included in your request. Accepts either an
-- access point ID or ARN as input.
describeMountTargets_accessPointId :: Lens.Lens' DescribeMountTargets (Prelude.Maybe Prelude.Text)
describeMountTargets_accessPointId :: (Maybe Text -> f (Maybe Text))
-> DescribeMountTargets -> f DescribeMountTargets
describeMountTargets_accessPointId = (DescribeMountTargets -> Maybe Text)
-> (DescribeMountTargets -> Maybe Text -> DescribeMountTargets)
-> Lens
     DescribeMountTargets DescribeMountTargets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMountTargets' {Maybe Text
accessPointId :: Maybe Text
$sel:accessPointId:DescribeMountTargets' :: DescribeMountTargets -> Maybe Text
accessPointId} -> Maybe Text
accessPointId) (\s :: DescribeMountTargets
s@DescribeMountTargets' {} Maybe Text
a -> DescribeMountTargets
s {$sel:accessPointId:DescribeMountTargets' :: Maybe Text
accessPointId = Maybe Text
a} :: DescribeMountTargets)

-- | (Optional) ID of the file system whose mount targets you want to list
-- (String). It must be included in your request if an @AccessPointId@ or
-- @MountTargetId@ is not included. Accepts either a file system ID or ARN
-- as input.
describeMountTargets_fileSystemId :: Lens.Lens' DescribeMountTargets (Prelude.Maybe Prelude.Text)
describeMountTargets_fileSystemId :: (Maybe Text -> f (Maybe Text))
-> DescribeMountTargets -> f DescribeMountTargets
describeMountTargets_fileSystemId = (DescribeMountTargets -> Maybe Text)
-> (DescribeMountTargets -> Maybe Text -> DescribeMountTargets)
-> Lens
     DescribeMountTargets DescribeMountTargets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMountTargets' {Maybe Text
fileSystemId :: Maybe Text
$sel:fileSystemId:DescribeMountTargets' :: DescribeMountTargets -> Maybe Text
fileSystemId} -> Maybe Text
fileSystemId) (\s :: DescribeMountTargets
s@DescribeMountTargets' {} Maybe Text
a -> DescribeMountTargets
s {$sel:fileSystemId:DescribeMountTargets' :: Maybe Text
fileSystemId = Maybe Text
a} :: DescribeMountTargets)

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

-- | (Optional) Maximum number of mount targets to return in the response.
-- Currently, this number is automatically set to 10, and other values are
-- ignored. The response is paginated at 100 per page if you have more than
-- 100 mount targets.
describeMountTargets_maxItems :: Lens.Lens' DescribeMountTargets (Prelude.Maybe Prelude.Natural)
describeMountTargets_maxItems :: (Maybe Natural -> f (Maybe Natural))
-> DescribeMountTargets -> f DescribeMountTargets
describeMountTargets_maxItems = (DescribeMountTargets -> Maybe Natural)
-> (DescribeMountTargets -> Maybe Natural -> DescribeMountTargets)
-> Lens
     DescribeMountTargets
     DescribeMountTargets
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMountTargets' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:DescribeMountTargets' :: DescribeMountTargets -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: DescribeMountTargets
s@DescribeMountTargets' {} Maybe Natural
a -> DescribeMountTargets
s {$sel:maxItems:DescribeMountTargets' :: Maybe Natural
maxItems = Maybe Natural
a} :: DescribeMountTargets)

-- | (Optional) ID of the mount target that you want to have described
-- (String). It must be included in your request if @FileSystemId@ is not
-- included. Accepts either a mount target ID or ARN as input.
describeMountTargets_mountTargetId :: Lens.Lens' DescribeMountTargets (Prelude.Maybe Prelude.Text)
describeMountTargets_mountTargetId :: (Maybe Text -> f (Maybe Text))
-> DescribeMountTargets -> f DescribeMountTargets
describeMountTargets_mountTargetId = (DescribeMountTargets -> Maybe Text)
-> (DescribeMountTargets -> Maybe Text -> DescribeMountTargets)
-> Lens
     DescribeMountTargets DescribeMountTargets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMountTargets' {Maybe Text
mountTargetId :: Maybe Text
$sel:mountTargetId:DescribeMountTargets' :: DescribeMountTargets -> Maybe Text
mountTargetId} -> Maybe Text
mountTargetId) (\s :: DescribeMountTargets
s@DescribeMountTargets' {} Maybe Text
a -> DescribeMountTargets
s {$sel:mountTargetId:DescribeMountTargets' :: Maybe Text
mountTargetId = Maybe Text
a} :: DescribeMountTargets)

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

instance Prelude.NFData DescribeMountTargets

instance Core.ToHeaders DescribeMountTargets where
  toHeaders :: DescribeMountTargets -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeMountTargets -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DescribeMountTargets where
  toPath :: DescribeMountTargets -> ByteString
toPath = ByteString -> DescribeMountTargets -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2015-02-01/mount-targets"

instance Core.ToQuery DescribeMountTargets where
  toQuery :: DescribeMountTargets -> QueryString
toQuery DescribeMountTargets' {Maybe Natural
Maybe Text
mountTargetId :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
fileSystemId :: Maybe Text
accessPointId :: Maybe Text
$sel:mountTargetId:DescribeMountTargets' :: DescribeMountTargets -> Maybe Text
$sel:maxItems:DescribeMountTargets' :: DescribeMountTargets -> Maybe Natural
$sel:marker:DescribeMountTargets' :: DescribeMountTargets -> Maybe Text
$sel:fileSystemId:DescribeMountTargets' :: DescribeMountTargets -> Maybe Text
$sel:accessPointId:DescribeMountTargets' :: DescribeMountTargets -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"AccessPointId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
accessPointId,
        ByteString
"FileSystemId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
fileSystemId,
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxItems" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxItems,
        ByteString
"MountTargetId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
mountTargetId
      ]

-- |
--
-- /See:/ 'newDescribeMountTargetsResponse' smart constructor.
data DescribeMountTargetsResponse = DescribeMountTargetsResponse'
  { -- | Returns the file system\'s mount targets as an array of
    -- @MountTargetDescription@ objects.
    DescribeMountTargetsResponse -> Maybe [MountTargetDescription]
mountTargets :: Prelude.Maybe [MountTargetDescription],
    -- | If the request included the @Marker@, the response returns that value in
    -- this field.
    DescribeMountTargetsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | If a value is present, there are more mount targets to return. In a
    -- subsequent request, you can provide @Marker@ in your request with this
    -- value to retrieve the next set of mount targets.
    DescribeMountTargetsResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeMountTargetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeMountTargetsResponse
-> DescribeMountTargetsResponse -> Bool
(DescribeMountTargetsResponse
 -> DescribeMountTargetsResponse -> Bool)
-> (DescribeMountTargetsResponse
    -> DescribeMountTargetsResponse -> Bool)
-> Eq DescribeMountTargetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeMountTargetsResponse
-> DescribeMountTargetsResponse -> Bool
$c/= :: DescribeMountTargetsResponse
-> DescribeMountTargetsResponse -> Bool
== :: DescribeMountTargetsResponse
-> DescribeMountTargetsResponse -> Bool
$c== :: DescribeMountTargetsResponse
-> DescribeMountTargetsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeMountTargetsResponse]
ReadPrec DescribeMountTargetsResponse
Int -> ReadS DescribeMountTargetsResponse
ReadS [DescribeMountTargetsResponse]
(Int -> ReadS DescribeMountTargetsResponse)
-> ReadS [DescribeMountTargetsResponse]
-> ReadPrec DescribeMountTargetsResponse
-> ReadPrec [DescribeMountTargetsResponse]
-> Read DescribeMountTargetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeMountTargetsResponse]
$creadListPrec :: ReadPrec [DescribeMountTargetsResponse]
readPrec :: ReadPrec DescribeMountTargetsResponse
$creadPrec :: ReadPrec DescribeMountTargetsResponse
readList :: ReadS [DescribeMountTargetsResponse]
$creadList :: ReadS [DescribeMountTargetsResponse]
readsPrec :: Int -> ReadS DescribeMountTargetsResponse
$creadsPrec :: Int -> ReadS DescribeMountTargetsResponse
Prelude.Read, Int -> DescribeMountTargetsResponse -> ShowS
[DescribeMountTargetsResponse] -> ShowS
DescribeMountTargetsResponse -> String
(Int -> DescribeMountTargetsResponse -> ShowS)
-> (DescribeMountTargetsResponse -> String)
-> ([DescribeMountTargetsResponse] -> ShowS)
-> Show DescribeMountTargetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeMountTargetsResponse] -> ShowS
$cshowList :: [DescribeMountTargetsResponse] -> ShowS
show :: DescribeMountTargetsResponse -> String
$cshow :: DescribeMountTargetsResponse -> String
showsPrec :: Int -> DescribeMountTargetsResponse -> ShowS
$cshowsPrec :: Int -> DescribeMountTargetsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeMountTargetsResponse -> Rep DescribeMountTargetsResponse x)
-> (forall x.
    Rep DescribeMountTargetsResponse x -> DescribeMountTargetsResponse)
-> Generic DescribeMountTargetsResponse
forall x.
Rep DescribeMountTargetsResponse x -> DescribeMountTargetsResponse
forall x.
DescribeMountTargetsResponse -> Rep DescribeMountTargetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeMountTargetsResponse x -> DescribeMountTargetsResponse
$cfrom :: forall x.
DescribeMountTargetsResponse -> Rep DescribeMountTargetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeMountTargetsResponse' 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:
--
-- 'mountTargets', 'describeMountTargetsResponse_mountTargets' - Returns the file system\'s mount targets as an array of
-- @MountTargetDescription@ objects.
--
-- 'marker', 'describeMountTargetsResponse_marker' - If the request included the @Marker@, the response returns that value in
-- this field.
--
-- 'nextMarker', 'describeMountTargetsResponse_nextMarker' - If a value is present, there are more mount targets to return. In a
-- subsequent request, you can provide @Marker@ in your request with this
-- value to retrieve the next set of mount targets.
--
-- 'httpStatus', 'describeMountTargetsResponse_httpStatus' - The response's http status code.
newDescribeMountTargetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeMountTargetsResponse
newDescribeMountTargetsResponse :: Int -> DescribeMountTargetsResponse
newDescribeMountTargetsResponse Int
pHttpStatus_ =
  DescribeMountTargetsResponse' :: Maybe [MountTargetDescription]
-> Maybe Text -> Maybe Text -> Int -> DescribeMountTargetsResponse
DescribeMountTargetsResponse'
    { $sel:mountTargets:DescribeMountTargetsResponse' :: Maybe [MountTargetDescription]
mountTargets =
        Maybe [MountTargetDescription]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeMountTargetsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextMarker:DescribeMountTargetsResponse' :: Maybe Text
nextMarker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeMountTargetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Returns the file system\'s mount targets as an array of
-- @MountTargetDescription@ objects.
describeMountTargetsResponse_mountTargets :: Lens.Lens' DescribeMountTargetsResponse (Prelude.Maybe [MountTargetDescription])
describeMountTargetsResponse_mountTargets :: (Maybe [MountTargetDescription]
 -> f (Maybe [MountTargetDescription]))
-> DescribeMountTargetsResponse -> f DescribeMountTargetsResponse
describeMountTargetsResponse_mountTargets = (DescribeMountTargetsResponse -> Maybe [MountTargetDescription])
-> (DescribeMountTargetsResponse
    -> Maybe [MountTargetDescription] -> DescribeMountTargetsResponse)
-> Lens'
     DescribeMountTargetsResponse (Maybe [MountTargetDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMountTargetsResponse' {Maybe [MountTargetDescription]
mountTargets :: Maybe [MountTargetDescription]
$sel:mountTargets:DescribeMountTargetsResponse' :: DescribeMountTargetsResponse -> Maybe [MountTargetDescription]
mountTargets} -> Maybe [MountTargetDescription]
mountTargets) (\s :: DescribeMountTargetsResponse
s@DescribeMountTargetsResponse' {} Maybe [MountTargetDescription]
a -> DescribeMountTargetsResponse
s {$sel:mountTargets:DescribeMountTargetsResponse' :: Maybe [MountTargetDescription]
mountTargets = Maybe [MountTargetDescription]
a} :: DescribeMountTargetsResponse) ((Maybe [MountTargetDescription]
  -> f (Maybe [MountTargetDescription]))
 -> DescribeMountTargetsResponse -> f DescribeMountTargetsResponse)
-> ((Maybe [MountTargetDescription]
     -> f (Maybe [MountTargetDescription]))
    -> Maybe [MountTargetDescription]
    -> f (Maybe [MountTargetDescription]))
-> (Maybe [MountTargetDescription]
    -> f (Maybe [MountTargetDescription]))
-> DescribeMountTargetsResponse
-> f DescribeMountTargetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MountTargetDescription]
  [MountTargetDescription]
  [MountTargetDescription]
  [MountTargetDescription]
-> Iso
     (Maybe [MountTargetDescription])
     (Maybe [MountTargetDescription])
     (Maybe [MountTargetDescription])
     (Maybe [MountTargetDescription])
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
  [MountTargetDescription]
  [MountTargetDescription]
  [MountTargetDescription]
  [MountTargetDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | If a value is present, there are more mount targets to return. In a
-- subsequent request, you can provide @Marker@ in your request with this
-- value to retrieve the next set of mount targets.
describeMountTargetsResponse_nextMarker :: Lens.Lens' DescribeMountTargetsResponse (Prelude.Maybe Prelude.Text)
describeMountTargetsResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> DescribeMountTargetsResponse -> f DescribeMountTargetsResponse
describeMountTargetsResponse_nextMarker = (DescribeMountTargetsResponse -> Maybe Text)
-> (DescribeMountTargetsResponse
    -> Maybe Text -> DescribeMountTargetsResponse)
-> Lens' DescribeMountTargetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeMountTargetsResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:DescribeMountTargetsResponse' :: DescribeMountTargetsResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: DescribeMountTargetsResponse
s@DescribeMountTargetsResponse' {} Maybe Text
a -> DescribeMountTargetsResponse
s {$sel:nextMarker:DescribeMountTargetsResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: DescribeMountTargetsResponse)

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

instance Prelude.NFData DescribeMountTargetsResponse