{-# 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.ListFileShares
(
ListFileShares (..),
newListFileShares,
listFileShares_gatewayARN,
listFileShares_limit,
listFileShares_marker,
ListFileSharesResponse (..),
newListFileSharesResponse,
listFileSharesResponse_fileShareInfoList,
listFileSharesResponse_marker,
listFileSharesResponse_nextMarker,
listFileSharesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.StorageGateway.Types
data ListFileShares = ListFileShares'
{
ListFileShares -> Maybe Text
gatewayARN :: Prelude.Maybe Prelude.Text,
ListFileShares -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListFileShares -> Maybe Text
marker :: Prelude.Maybe Prelude.Text
}
deriving (ListFileShares -> ListFileShares -> Bool
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]
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
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. 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)
newListFileShares ::
ListFileShares
newListFileShares :: ListFileShares
newListFileShares =
ListFileShares'
{ $sel:gatewayARN:ListFileShares' :: Maybe Text
gatewayARN = forall a. Maybe a
Prelude.Nothing,
$sel:limit:ListFileShares' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
$sel:marker:ListFileShares' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing
}
listFileShares_gatewayARN :: Lens.Lens' ListFileShares (Prelude.Maybe Prelude.Text)
listFileShares_gatewayARN :: Lens' ListFileShares (Maybe Text)
listFileShares_gatewayARN = 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)
listFileShares_limit :: Lens.Lens' ListFileShares (Prelude.Maybe Prelude.Natural)
listFileShares_limit :: Lens' ListFileShares (Maybe Natural)
listFileShares_limit = 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)
listFileShares_marker :: Lens.Lens' ListFileShares (Prelude.Maybe Prelude.Text)
listFileShares_marker :: Lens' ListFileShares (Maybe Text)
listFileShares_marker = 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)
instance Core.AWSPager ListFileShares where
page :: ListFileShares
-> AWSResponse ListFileShares -> Maybe ListFileShares
page ListFileShares
rq AWSResponse ListFileShares
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListFileShares
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFileSharesResponse (Maybe Text)
listFileSharesResponse_nextMarker
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListFileShares
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFileSharesResponse (Maybe [FileShareInfo])
listFileSharesResponse_fileShareInfoList
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListFileShares
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListFileShares (Maybe Text)
listFileShares_marker
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListFileShares
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListFileSharesResponse (Maybe Text)
listFileSharesResponse_nextMarker
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListFileShares where
type
AWSResponse ListFileShares =
ListFileSharesResponse
request :: (Service -> Service) -> ListFileShares -> Request ListFileShares
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListFileShares
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListFileShares)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"FileShareInfoList"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Marker")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextMarker")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListFileShares where
hashWithSalt :: Int -> ListFileShares -> Int
hashWithSalt Int
_salt ListFileShares' {Maybe Natural
Maybe Text
marker :: Maybe Text
limit :: Maybe Natural
gatewayARN :: Maybe Text
$sel:marker:ListFileShares' :: ListFileShares -> Maybe Text
$sel:limit:ListFileShares' :: ListFileShares -> Maybe Natural
$sel:gatewayARN:ListFileShares' :: ListFileShares -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gatewayARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
instance Prelude.NFData ListFileShares where
rnf :: ListFileShares -> ()
rnf ListFileShares' {Maybe Natural
Maybe Text
marker :: Maybe Text
limit :: Maybe Natural
gatewayARN :: Maybe Text
$sel:marker:ListFileShares' :: ListFileShares -> Maybe Text
$sel:limit:ListFileShares' :: ListFileShares -> Maybe Natural
$sel:gatewayARN:ListFileShares' :: ListFileShares -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gatewayARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
instance Data.ToHeaders ListFileShares where
toHeaders :: ListFileShares -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"StorageGateway_20130630.ListFileShares" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListFileShares where
toJSON :: ListFileShares -> Value
toJSON ListFileShares' {Maybe Natural
Maybe Text
marker :: Maybe Text
limit :: Maybe Natural
gatewayARN :: Maybe Text
$sel:marker:ListFileShares' :: ListFileShares -> Maybe Text
$sel:limit:ListFileShares' :: ListFileShares -> Maybe Natural
$sel:gatewayARN:ListFileShares' :: ListFileShares -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"GatewayARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
gatewayARN,
(Key
"Limit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
(Key
"Marker" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
marker
]
)
instance Data.ToPath ListFileShares where
toPath :: ListFileShares -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListFileShares where
toQuery :: ListFileShares -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListFileSharesResponse = ListFileSharesResponse'
{
ListFileSharesResponse -> Maybe [FileShareInfo]
fileShareInfoList :: Prelude.Maybe [FileShareInfo],
ListFileSharesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListFileSharesResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
ListFileSharesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListFileSharesResponse -> ListFileSharesResponse -> Bool
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]
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
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. 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)
newListFileSharesResponse ::
Prelude.Int ->
ListFileSharesResponse
newListFileSharesResponse :: Int -> ListFileSharesResponse
newListFileSharesResponse Int
pHttpStatus_ =
ListFileSharesResponse'
{ $sel:fileShareInfoList:ListFileSharesResponse' :: Maybe [FileShareInfo]
fileShareInfoList =
forall a. Maybe a
Prelude.Nothing,
$sel:marker:ListFileSharesResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
$sel:nextMarker:ListFileSharesResponse' :: Maybe Text
nextMarker = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListFileSharesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listFileSharesResponse_fileShareInfoList :: Lens.Lens' ListFileSharesResponse (Prelude.Maybe [FileShareInfo])
listFileSharesResponse_fileShareInfoList :: Lens' ListFileSharesResponse (Maybe [FileShareInfo])
listFileSharesResponse_fileShareInfoList = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listFileSharesResponse_marker :: Lens.Lens' ListFileSharesResponse (Prelude.Maybe Prelude.Text)
listFileSharesResponse_marker :: Lens' ListFileSharesResponse (Maybe Text)
listFileSharesResponse_marker = 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)
listFileSharesResponse_nextMarker :: Lens.Lens' ListFileSharesResponse (Prelude.Maybe Prelude.Text)
listFileSharesResponse_nextMarker :: Lens' ListFileSharesResponse (Maybe Text)
listFileSharesResponse_nextMarker = 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)
listFileSharesResponse_httpStatus :: Lens.Lens' ListFileSharesResponse Prelude.Int
listFileSharesResponse_httpStatus :: Lens' ListFileSharesResponse Int
listFileSharesResponse_httpStatus = 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 where
rnf :: ListFileSharesResponse -> ()
rnf ListFileSharesResponse' {Int
Maybe [FileShareInfo]
Maybe Text
httpStatus :: Int
nextMarker :: Maybe Text
marker :: Maybe Text
fileShareInfoList :: Maybe [FileShareInfo]
$sel:httpStatus:ListFileSharesResponse' :: ListFileSharesResponse -> Int
$sel:nextMarker:ListFileSharesResponse' :: ListFileSharesResponse -> Maybe Text
$sel:marker:ListFileSharesResponse' :: ListFileSharesResponse -> Maybe Text
$sel:fileShareInfoList:ListFileSharesResponse' :: ListFileSharesResponse -> Maybe [FileShareInfo]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [FileShareInfo]
fileShareInfoList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextMarker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus