{-# 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 #-}
module Amazonka.StorageGateway.DescribeFileSystemAssociations
(
DescribeFileSystemAssociations (..),
newDescribeFileSystemAssociations,
describeFileSystemAssociations_fileSystemAssociationARNList,
DescribeFileSystemAssociationsResponse (..),
newDescribeFileSystemAssociationsResponse,
describeFileSystemAssociationsResponse_fileSystemAssociationInfoList,
describeFileSystemAssociationsResponse_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
data DescribeFileSystemAssociations = DescribeFileSystemAssociations'
{
DescribeFileSystemAssociations -> NonEmpty Text
fileSystemAssociationARNList :: Prelude.NonEmpty Prelude.Text
}
deriving (DescribeFileSystemAssociations
-> DescribeFileSystemAssociations -> Bool
(DescribeFileSystemAssociations
-> DescribeFileSystemAssociations -> Bool)
-> (DescribeFileSystemAssociations
-> DescribeFileSystemAssociations -> Bool)
-> Eq DescribeFileSystemAssociations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFileSystemAssociations
-> DescribeFileSystemAssociations -> Bool
$c/= :: DescribeFileSystemAssociations
-> DescribeFileSystemAssociations -> Bool
== :: DescribeFileSystemAssociations
-> DescribeFileSystemAssociations -> Bool
$c== :: DescribeFileSystemAssociations
-> DescribeFileSystemAssociations -> Bool
Prelude.Eq, ReadPrec [DescribeFileSystemAssociations]
ReadPrec DescribeFileSystemAssociations
Int -> ReadS DescribeFileSystemAssociations
ReadS [DescribeFileSystemAssociations]
(Int -> ReadS DescribeFileSystemAssociations)
-> ReadS [DescribeFileSystemAssociations]
-> ReadPrec DescribeFileSystemAssociations
-> ReadPrec [DescribeFileSystemAssociations]
-> Read DescribeFileSystemAssociations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFileSystemAssociations]
$creadListPrec :: ReadPrec [DescribeFileSystemAssociations]
readPrec :: ReadPrec DescribeFileSystemAssociations
$creadPrec :: ReadPrec DescribeFileSystemAssociations
readList :: ReadS [DescribeFileSystemAssociations]
$creadList :: ReadS [DescribeFileSystemAssociations]
readsPrec :: Int -> ReadS DescribeFileSystemAssociations
$creadsPrec :: Int -> ReadS DescribeFileSystemAssociations
Prelude.Read, Int -> DescribeFileSystemAssociations -> ShowS
[DescribeFileSystemAssociations] -> ShowS
DescribeFileSystemAssociations -> String
(Int -> DescribeFileSystemAssociations -> ShowS)
-> (DescribeFileSystemAssociations -> String)
-> ([DescribeFileSystemAssociations] -> ShowS)
-> Show DescribeFileSystemAssociations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFileSystemAssociations] -> ShowS
$cshowList :: [DescribeFileSystemAssociations] -> ShowS
show :: DescribeFileSystemAssociations -> String
$cshow :: DescribeFileSystemAssociations -> String
showsPrec :: Int -> DescribeFileSystemAssociations -> ShowS
$cshowsPrec :: Int -> DescribeFileSystemAssociations -> ShowS
Prelude.Show, (forall x.
DescribeFileSystemAssociations
-> Rep DescribeFileSystemAssociations x)
-> (forall x.
Rep DescribeFileSystemAssociations x
-> DescribeFileSystemAssociations)
-> Generic DescribeFileSystemAssociations
forall x.
Rep DescribeFileSystemAssociations x
-> DescribeFileSystemAssociations
forall x.
DescribeFileSystemAssociations
-> Rep DescribeFileSystemAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFileSystemAssociations x
-> DescribeFileSystemAssociations
$cfrom :: forall x.
DescribeFileSystemAssociations
-> Rep DescribeFileSystemAssociations x
Prelude.Generic)
newDescribeFileSystemAssociations ::
Prelude.NonEmpty Prelude.Text ->
DescribeFileSystemAssociations
newDescribeFileSystemAssociations :: NonEmpty Text -> DescribeFileSystemAssociations
newDescribeFileSystemAssociations
NonEmpty Text
pFileSystemAssociationARNList_ =
DescribeFileSystemAssociations' :: NonEmpty Text -> DescribeFileSystemAssociations
DescribeFileSystemAssociations'
{ $sel:fileSystemAssociationARNList:DescribeFileSystemAssociations' :: NonEmpty Text
fileSystemAssociationARNList =
Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
(Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pFileSystemAssociationARNList_
}
describeFileSystemAssociations_fileSystemAssociationARNList :: Lens.Lens' DescribeFileSystemAssociations (Prelude.NonEmpty Prelude.Text)
describeFileSystemAssociations_fileSystemAssociationARNList :: (NonEmpty Text -> f (NonEmpty Text))
-> DescribeFileSystemAssociations
-> f DescribeFileSystemAssociations
describeFileSystemAssociations_fileSystemAssociationARNList = (DescribeFileSystemAssociations -> NonEmpty Text)
-> (DescribeFileSystemAssociations
-> NonEmpty Text -> DescribeFileSystemAssociations)
-> Lens
DescribeFileSystemAssociations
DescribeFileSystemAssociations
(NonEmpty Text)
(NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFileSystemAssociations' {NonEmpty Text
fileSystemAssociationARNList :: NonEmpty Text
$sel:fileSystemAssociationARNList:DescribeFileSystemAssociations' :: DescribeFileSystemAssociations -> NonEmpty Text
fileSystemAssociationARNList} -> NonEmpty Text
fileSystemAssociationARNList) (\s :: DescribeFileSystemAssociations
s@DescribeFileSystemAssociations' {} NonEmpty Text
a -> DescribeFileSystemAssociations
s {$sel:fileSystemAssociationARNList:DescribeFileSystemAssociations' :: NonEmpty Text
fileSystemAssociationARNList = NonEmpty Text
a} :: DescribeFileSystemAssociations) ((NonEmpty Text -> f (NonEmpty Text))
-> DescribeFileSystemAssociations
-> f DescribeFileSystemAssociations)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> DescribeFileSystemAssociations
-> f DescribeFileSystemAssociations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Core.AWSRequest
DescribeFileSystemAssociations
where
type
AWSResponse DescribeFileSystemAssociations =
DescribeFileSystemAssociationsResponse
request :: DescribeFileSystemAssociations
-> Request DescribeFileSystemAssociations
request = Service
-> DescribeFileSystemAssociations
-> Request DescribeFileSystemAssociations
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeFileSystemAssociations
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeFileSystemAssociations)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeFileSystemAssociations))
-> Logger
-> Service
-> Proxy DescribeFileSystemAssociations
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeFileSystemAssociations)))
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 [FileSystemAssociationInfo]
-> Int -> DescribeFileSystemAssociationsResponse
DescribeFileSystemAssociationsResponse'
(Maybe [FileSystemAssociationInfo]
-> Int -> DescribeFileSystemAssociationsResponse)
-> Either String (Maybe [FileSystemAssociationInfo])
-> Either String (Int -> DescribeFileSystemAssociationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [FileSystemAssociationInfo]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FileSystemAssociationInfoList"
Either String (Maybe (Maybe [FileSystemAssociationInfo]))
-> Maybe [FileSystemAssociationInfo]
-> Either String (Maybe [FileSystemAssociationInfo])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FileSystemAssociationInfo]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DescribeFileSystemAssociationsResponse)
-> Either String Int
-> Either String DescribeFileSystemAssociationsResponse
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
DescribeFileSystemAssociations
instance
Prelude.NFData
DescribeFileSystemAssociations
instance
Core.ToHeaders
DescribeFileSystemAssociations
where
toHeaders :: DescribeFileSystemAssociations -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DescribeFileSystemAssociations -> 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.DescribeFileSystemAssociations" ::
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 DescribeFileSystemAssociations where
toJSON :: DescribeFileSystemAssociations -> Value
toJSON DescribeFileSystemAssociations' {NonEmpty Text
fileSystemAssociationARNList :: NonEmpty Text
$sel:fileSystemAssociationARNList:DescribeFileSystemAssociations' :: DescribeFileSystemAssociations -> NonEmpty Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"FileSystemAssociationARNList"
Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
fileSystemAssociationARNList
)
]
)
instance Core.ToPath DescribeFileSystemAssociations where
toPath :: DescribeFileSystemAssociations -> ByteString
toPath = ByteString -> DescribeFileSystemAssociations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeFileSystemAssociations where
toQuery :: DescribeFileSystemAssociations -> QueryString
toQuery = QueryString -> DescribeFileSystemAssociations -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeFileSystemAssociationsResponse = DescribeFileSystemAssociationsResponse'
{
DescribeFileSystemAssociationsResponse
-> Maybe [FileSystemAssociationInfo]
fileSystemAssociationInfoList :: Prelude.Maybe [FileSystemAssociationInfo],
DescribeFileSystemAssociationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeFileSystemAssociationsResponse
-> DescribeFileSystemAssociationsResponse -> Bool
(DescribeFileSystemAssociationsResponse
-> DescribeFileSystemAssociationsResponse -> Bool)
-> (DescribeFileSystemAssociationsResponse
-> DescribeFileSystemAssociationsResponse -> Bool)
-> Eq DescribeFileSystemAssociationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFileSystemAssociationsResponse
-> DescribeFileSystemAssociationsResponse -> Bool
$c/= :: DescribeFileSystemAssociationsResponse
-> DescribeFileSystemAssociationsResponse -> Bool
== :: DescribeFileSystemAssociationsResponse
-> DescribeFileSystemAssociationsResponse -> Bool
$c== :: DescribeFileSystemAssociationsResponse
-> DescribeFileSystemAssociationsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFileSystemAssociationsResponse]
ReadPrec DescribeFileSystemAssociationsResponse
Int -> ReadS DescribeFileSystemAssociationsResponse
ReadS [DescribeFileSystemAssociationsResponse]
(Int -> ReadS DescribeFileSystemAssociationsResponse)
-> ReadS [DescribeFileSystemAssociationsResponse]
-> ReadPrec DescribeFileSystemAssociationsResponse
-> ReadPrec [DescribeFileSystemAssociationsResponse]
-> Read DescribeFileSystemAssociationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFileSystemAssociationsResponse]
$creadListPrec :: ReadPrec [DescribeFileSystemAssociationsResponse]
readPrec :: ReadPrec DescribeFileSystemAssociationsResponse
$creadPrec :: ReadPrec DescribeFileSystemAssociationsResponse
readList :: ReadS [DescribeFileSystemAssociationsResponse]
$creadList :: ReadS [DescribeFileSystemAssociationsResponse]
readsPrec :: Int -> ReadS DescribeFileSystemAssociationsResponse
$creadsPrec :: Int -> ReadS DescribeFileSystemAssociationsResponse
Prelude.Read, Int -> DescribeFileSystemAssociationsResponse -> ShowS
[DescribeFileSystemAssociationsResponse] -> ShowS
DescribeFileSystemAssociationsResponse -> String
(Int -> DescribeFileSystemAssociationsResponse -> ShowS)
-> (DescribeFileSystemAssociationsResponse -> String)
-> ([DescribeFileSystemAssociationsResponse] -> ShowS)
-> Show DescribeFileSystemAssociationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFileSystemAssociationsResponse] -> ShowS
$cshowList :: [DescribeFileSystemAssociationsResponse] -> ShowS
show :: DescribeFileSystemAssociationsResponse -> String
$cshow :: DescribeFileSystemAssociationsResponse -> String
showsPrec :: Int -> DescribeFileSystemAssociationsResponse -> ShowS
$cshowsPrec :: Int -> DescribeFileSystemAssociationsResponse -> ShowS
Prelude.Show, (forall x.
DescribeFileSystemAssociationsResponse
-> Rep DescribeFileSystemAssociationsResponse x)
-> (forall x.
Rep DescribeFileSystemAssociationsResponse x
-> DescribeFileSystemAssociationsResponse)
-> Generic DescribeFileSystemAssociationsResponse
forall x.
Rep DescribeFileSystemAssociationsResponse x
-> DescribeFileSystemAssociationsResponse
forall x.
DescribeFileSystemAssociationsResponse
-> Rep DescribeFileSystemAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFileSystemAssociationsResponse x
-> DescribeFileSystemAssociationsResponse
$cfrom :: forall x.
DescribeFileSystemAssociationsResponse
-> Rep DescribeFileSystemAssociationsResponse x
Prelude.Generic)
newDescribeFileSystemAssociationsResponse ::
Prelude.Int ->
DescribeFileSystemAssociationsResponse
newDescribeFileSystemAssociationsResponse :: Int -> DescribeFileSystemAssociationsResponse
newDescribeFileSystemAssociationsResponse
Int
pHttpStatus_ =
DescribeFileSystemAssociationsResponse' :: Maybe [FileSystemAssociationInfo]
-> Int -> DescribeFileSystemAssociationsResponse
DescribeFileSystemAssociationsResponse'
{ $sel:fileSystemAssociationInfoList:DescribeFileSystemAssociationsResponse' :: Maybe [FileSystemAssociationInfo]
fileSystemAssociationInfoList =
Maybe [FileSystemAssociationInfo]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeFileSystemAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeFileSystemAssociationsResponse_fileSystemAssociationInfoList :: Lens.Lens' DescribeFileSystemAssociationsResponse (Prelude.Maybe [FileSystemAssociationInfo])
describeFileSystemAssociationsResponse_fileSystemAssociationInfoList :: (Maybe [FileSystemAssociationInfo]
-> f (Maybe [FileSystemAssociationInfo]))
-> DescribeFileSystemAssociationsResponse
-> f DescribeFileSystemAssociationsResponse
describeFileSystemAssociationsResponse_fileSystemAssociationInfoList = (DescribeFileSystemAssociationsResponse
-> Maybe [FileSystemAssociationInfo])
-> (DescribeFileSystemAssociationsResponse
-> Maybe [FileSystemAssociationInfo]
-> DescribeFileSystemAssociationsResponse)
-> Lens
DescribeFileSystemAssociationsResponse
DescribeFileSystemAssociationsResponse
(Maybe [FileSystemAssociationInfo])
(Maybe [FileSystemAssociationInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFileSystemAssociationsResponse' {Maybe [FileSystemAssociationInfo]
fileSystemAssociationInfoList :: Maybe [FileSystemAssociationInfo]
$sel:fileSystemAssociationInfoList:DescribeFileSystemAssociationsResponse' :: DescribeFileSystemAssociationsResponse
-> Maybe [FileSystemAssociationInfo]
fileSystemAssociationInfoList} -> Maybe [FileSystemAssociationInfo]
fileSystemAssociationInfoList) (\s :: DescribeFileSystemAssociationsResponse
s@DescribeFileSystemAssociationsResponse' {} Maybe [FileSystemAssociationInfo]
a -> DescribeFileSystemAssociationsResponse
s {$sel:fileSystemAssociationInfoList:DescribeFileSystemAssociationsResponse' :: Maybe [FileSystemAssociationInfo]
fileSystemAssociationInfoList = Maybe [FileSystemAssociationInfo]
a} :: DescribeFileSystemAssociationsResponse) ((Maybe [FileSystemAssociationInfo]
-> f (Maybe [FileSystemAssociationInfo]))
-> DescribeFileSystemAssociationsResponse
-> f DescribeFileSystemAssociationsResponse)
-> ((Maybe [FileSystemAssociationInfo]
-> f (Maybe [FileSystemAssociationInfo]))
-> Maybe [FileSystemAssociationInfo]
-> f (Maybe [FileSystemAssociationInfo]))
-> (Maybe [FileSystemAssociationInfo]
-> f (Maybe [FileSystemAssociationInfo]))
-> DescribeFileSystemAssociationsResponse
-> f DescribeFileSystemAssociationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[FileSystemAssociationInfo]
[FileSystemAssociationInfo]
[FileSystemAssociationInfo]
[FileSystemAssociationInfo]
-> Iso
(Maybe [FileSystemAssociationInfo])
(Maybe [FileSystemAssociationInfo])
(Maybe [FileSystemAssociationInfo])
(Maybe [FileSystemAssociationInfo])
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
[FileSystemAssociationInfo]
[FileSystemAssociationInfo]
[FileSystemAssociationInfo]
[FileSystemAssociationInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeFileSystemAssociationsResponse_httpStatus :: Lens.Lens' DescribeFileSystemAssociationsResponse Prelude.Int
describeFileSystemAssociationsResponse_httpStatus :: (Int -> f Int)
-> DescribeFileSystemAssociationsResponse
-> f DescribeFileSystemAssociationsResponse
describeFileSystemAssociationsResponse_httpStatus = (DescribeFileSystemAssociationsResponse -> Int)
-> (DescribeFileSystemAssociationsResponse
-> Int -> DescribeFileSystemAssociationsResponse)
-> Lens
DescribeFileSystemAssociationsResponse
DescribeFileSystemAssociationsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFileSystemAssociationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeFileSystemAssociationsResponse' :: DescribeFileSystemAssociationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeFileSystemAssociationsResponse
s@DescribeFileSystemAssociationsResponse' {} Int
a -> DescribeFileSystemAssociationsResponse
s {$sel:httpStatus:DescribeFileSystemAssociationsResponse' :: Int
httpStatus = Int
a} :: DescribeFileSystemAssociationsResponse)
instance
Prelude.NFData
DescribeFileSystemAssociationsResponse