{-# 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.WorkDocs.DescribeFolderContents
(
DescribeFolderContents (..),
newDescribeFolderContents,
describeFolderContents_include,
describeFolderContents_authenticationToken,
describeFolderContents_sort,
describeFolderContents_marker,
describeFolderContents_limit,
describeFolderContents_type,
describeFolderContents_order,
describeFolderContents_folderId,
DescribeFolderContentsResponse (..),
newDescribeFolderContentsResponse,
describeFolderContentsResponse_folders,
describeFolderContentsResponse_documents,
describeFolderContentsResponse_marker,
describeFolderContentsResponse_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.WorkDocs.Types
data DescribeFolderContents = DescribeFolderContents'
{
DescribeFolderContents -> Maybe Text
include :: Prelude.Maybe Prelude.Text,
DescribeFolderContents -> Maybe (Sensitive Text)
authenticationToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
DescribeFolderContents -> Maybe ResourceSortType
sort :: Prelude.Maybe ResourceSortType,
DescribeFolderContents -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
DescribeFolderContents -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
DescribeFolderContents -> Maybe FolderContentType
type' :: Prelude.Maybe FolderContentType,
DescribeFolderContents -> Maybe OrderType
order :: Prelude.Maybe OrderType,
DescribeFolderContents -> Text
folderId :: Prelude.Text
}
deriving (DescribeFolderContents -> DescribeFolderContents -> Bool
(DescribeFolderContents -> DescribeFolderContents -> Bool)
-> (DescribeFolderContents -> DescribeFolderContents -> Bool)
-> Eq DescribeFolderContents
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFolderContents -> DescribeFolderContents -> Bool
$c/= :: DescribeFolderContents -> DescribeFolderContents -> Bool
== :: DescribeFolderContents -> DescribeFolderContents -> Bool
$c== :: DescribeFolderContents -> DescribeFolderContents -> Bool
Prelude.Eq, Int -> DescribeFolderContents -> ShowS
[DescribeFolderContents] -> ShowS
DescribeFolderContents -> String
(Int -> DescribeFolderContents -> ShowS)
-> (DescribeFolderContents -> String)
-> ([DescribeFolderContents] -> ShowS)
-> Show DescribeFolderContents
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFolderContents] -> ShowS
$cshowList :: [DescribeFolderContents] -> ShowS
show :: DescribeFolderContents -> String
$cshow :: DescribeFolderContents -> String
showsPrec :: Int -> DescribeFolderContents -> ShowS
$cshowsPrec :: Int -> DescribeFolderContents -> ShowS
Prelude.Show, (forall x. DescribeFolderContents -> Rep DescribeFolderContents x)
-> (forall x.
Rep DescribeFolderContents x -> DescribeFolderContents)
-> Generic DescribeFolderContents
forall x. Rep DescribeFolderContents x -> DescribeFolderContents
forall x. DescribeFolderContents -> Rep DescribeFolderContents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeFolderContents x -> DescribeFolderContents
$cfrom :: forall x. DescribeFolderContents -> Rep DescribeFolderContents x
Prelude.Generic)
newDescribeFolderContents ::
Prelude.Text ->
DescribeFolderContents
newDescribeFolderContents :: Text -> DescribeFolderContents
newDescribeFolderContents Text
pFolderId_ =
DescribeFolderContents' :: Maybe Text
-> Maybe (Sensitive Text)
-> Maybe ResourceSortType
-> Maybe Text
-> Maybe Natural
-> Maybe FolderContentType
-> Maybe OrderType
-> Text
-> DescribeFolderContents
DescribeFolderContents'
{ $sel:include:DescribeFolderContents' :: Maybe Text
include = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:authenticationToken:DescribeFolderContents' :: Maybe (Sensitive Text)
authenticationToken = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:sort:DescribeFolderContents' :: Maybe ResourceSortType
sort = Maybe ResourceSortType
forall a. Maybe a
Prelude.Nothing,
$sel:marker:DescribeFolderContents' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:limit:DescribeFolderContents' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:type':DescribeFolderContents' :: Maybe FolderContentType
type' = Maybe FolderContentType
forall a. Maybe a
Prelude.Nothing,
$sel:order:DescribeFolderContents' :: Maybe OrderType
order = Maybe OrderType
forall a. Maybe a
Prelude.Nothing,
$sel:folderId:DescribeFolderContents' :: Text
folderId = Text
pFolderId_
}
describeFolderContents_include :: Lens.Lens' DescribeFolderContents (Prelude.Maybe Prelude.Text)
describeFolderContents_include :: (Maybe Text -> f (Maybe Text))
-> DescribeFolderContents -> f DescribeFolderContents
describeFolderContents_include = (DescribeFolderContents -> Maybe Text)
-> (DescribeFolderContents -> Maybe Text -> DescribeFolderContents)
-> Lens
DescribeFolderContents
DescribeFolderContents
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFolderContents' {Maybe Text
include :: Maybe Text
$sel:include:DescribeFolderContents' :: DescribeFolderContents -> Maybe Text
include} -> Maybe Text
include) (\s :: DescribeFolderContents
s@DescribeFolderContents' {} Maybe Text
a -> DescribeFolderContents
s {$sel:include:DescribeFolderContents' :: Maybe Text
include = Maybe Text
a} :: DescribeFolderContents)
describeFolderContents_authenticationToken :: Lens.Lens' DescribeFolderContents (Prelude.Maybe Prelude.Text)
describeFolderContents_authenticationToken :: (Maybe Text -> f (Maybe Text))
-> DescribeFolderContents -> f DescribeFolderContents
describeFolderContents_authenticationToken = (DescribeFolderContents -> Maybe (Sensitive Text))
-> (DescribeFolderContents
-> Maybe (Sensitive Text) -> DescribeFolderContents)
-> Lens
DescribeFolderContents
DescribeFolderContents
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFolderContents' {Maybe (Sensitive Text)
authenticationToken :: Maybe (Sensitive Text)
$sel:authenticationToken:DescribeFolderContents' :: DescribeFolderContents -> Maybe (Sensitive Text)
authenticationToken} -> Maybe (Sensitive Text)
authenticationToken) (\s :: DescribeFolderContents
s@DescribeFolderContents' {} Maybe (Sensitive Text)
a -> DescribeFolderContents
s {$sel:authenticationToken:DescribeFolderContents' :: Maybe (Sensitive Text)
authenticationToken = Maybe (Sensitive Text)
a} :: DescribeFolderContents) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> DescribeFolderContents -> f DescribeFolderContents)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> DescribeFolderContents
-> f DescribeFolderContents
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
describeFolderContents_sort :: Lens.Lens' DescribeFolderContents (Prelude.Maybe ResourceSortType)
describeFolderContents_sort :: (Maybe ResourceSortType -> f (Maybe ResourceSortType))
-> DescribeFolderContents -> f DescribeFolderContents
describeFolderContents_sort = (DescribeFolderContents -> Maybe ResourceSortType)
-> (DescribeFolderContents
-> Maybe ResourceSortType -> DescribeFolderContents)
-> Lens
DescribeFolderContents
DescribeFolderContents
(Maybe ResourceSortType)
(Maybe ResourceSortType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFolderContents' {Maybe ResourceSortType
sort :: Maybe ResourceSortType
$sel:sort:DescribeFolderContents' :: DescribeFolderContents -> Maybe ResourceSortType
sort} -> Maybe ResourceSortType
sort) (\s :: DescribeFolderContents
s@DescribeFolderContents' {} Maybe ResourceSortType
a -> DescribeFolderContents
s {$sel:sort:DescribeFolderContents' :: Maybe ResourceSortType
sort = Maybe ResourceSortType
a} :: DescribeFolderContents)
describeFolderContents_marker :: Lens.Lens' DescribeFolderContents (Prelude.Maybe Prelude.Text)
describeFolderContents_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeFolderContents -> f DescribeFolderContents
describeFolderContents_marker = (DescribeFolderContents -> Maybe Text)
-> (DescribeFolderContents -> Maybe Text -> DescribeFolderContents)
-> Lens
DescribeFolderContents
DescribeFolderContents
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFolderContents' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeFolderContents' :: DescribeFolderContents -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeFolderContents
s@DescribeFolderContents' {} Maybe Text
a -> DescribeFolderContents
s {$sel:marker:DescribeFolderContents' :: Maybe Text
marker = Maybe Text
a} :: DescribeFolderContents)
describeFolderContents_limit :: Lens.Lens' DescribeFolderContents (Prelude.Maybe Prelude.Natural)
describeFolderContents_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeFolderContents -> f DescribeFolderContents
describeFolderContents_limit = (DescribeFolderContents -> Maybe Natural)
-> (DescribeFolderContents
-> Maybe Natural -> DescribeFolderContents)
-> Lens
DescribeFolderContents
DescribeFolderContents
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFolderContents' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeFolderContents' :: DescribeFolderContents -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeFolderContents
s@DescribeFolderContents' {} Maybe Natural
a -> DescribeFolderContents
s {$sel:limit:DescribeFolderContents' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeFolderContents)
describeFolderContents_type :: Lens.Lens' DescribeFolderContents (Prelude.Maybe FolderContentType)
describeFolderContents_type :: (Maybe FolderContentType -> f (Maybe FolderContentType))
-> DescribeFolderContents -> f DescribeFolderContents
describeFolderContents_type = (DescribeFolderContents -> Maybe FolderContentType)
-> (DescribeFolderContents
-> Maybe FolderContentType -> DescribeFolderContents)
-> Lens
DescribeFolderContents
DescribeFolderContents
(Maybe FolderContentType)
(Maybe FolderContentType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFolderContents' {Maybe FolderContentType
type' :: Maybe FolderContentType
$sel:type':DescribeFolderContents' :: DescribeFolderContents -> Maybe FolderContentType
type'} -> Maybe FolderContentType
type') (\s :: DescribeFolderContents
s@DescribeFolderContents' {} Maybe FolderContentType
a -> DescribeFolderContents
s {$sel:type':DescribeFolderContents' :: Maybe FolderContentType
type' = Maybe FolderContentType
a} :: DescribeFolderContents)
describeFolderContents_order :: Lens.Lens' DescribeFolderContents (Prelude.Maybe OrderType)
describeFolderContents_order :: (Maybe OrderType -> f (Maybe OrderType))
-> DescribeFolderContents -> f DescribeFolderContents
describeFolderContents_order = (DescribeFolderContents -> Maybe OrderType)
-> (DescribeFolderContents
-> Maybe OrderType -> DescribeFolderContents)
-> Lens
DescribeFolderContents
DescribeFolderContents
(Maybe OrderType)
(Maybe OrderType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFolderContents' {Maybe OrderType
order :: Maybe OrderType
$sel:order:DescribeFolderContents' :: DescribeFolderContents -> Maybe OrderType
order} -> Maybe OrderType
order) (\s :: DescribeFolderContents
s@DescribeFolderContents' {} Maybe OrderType
a -> DescribeFolderContents
s {$sel:order:DescribeFolderContents' :: Maybe OrderType
order = Maybe OrderType
a} :: DescribeFolderContents)
describeFolderContents_folderId :: Lens.Lens' DescribeFolderContents Prelude.Text
describeFolderContents_folderId :: (Text -> f Text)
-> DescribeFolderContents -> f DescribeFolderContents
describeFolderContents_folderId = (DescribeFolderContents -> Text)
-> (DescribeFolderContents -> Text -> DescribeFolderContents)
-> Lens DescribeFolderContents DescribeFolderContents Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFolderContents' {Text
folderId :: Text
$sel:folderId:DescribeFolderContents' :: DescribeFolderContents -> Text
folderId} -> Text
folderId) (\s :: DescribeFolderContents
s@DescribeFolderContents' {} Text
a -> DescribeFolderContents
s {$sel:folderId:DescribeFolderContents' :: Text
folderId = Text
a} :: DescribeFolderContents)
instance Core.AWSPager DescribeFolderContents where
page :: DescribeFolderContents
-> AWSResponse DescribeFolderContents
-> Maybe DescribeFolderContents
page DescribeFolderContents
rq AWSResponse DescribeFolderContents
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeFolderContents
DescribeFolderContentsResponse
rs
DescribeFolderContentsResponse
-> Getting (First Text) DescribeFolderContentsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeFolderContentsResponse
-> Const (First Text) DescribeFolderContentsResponse
Lens' DescribeFolderContentsResponse (Maybe Text)
describeFolderContentsResponse_marker
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeFolderContentsResponse
-> Const (First Text) DescribeFolderContentsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeFolderContentsResponse 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 DescribeFolderContents
forall a. Maybe a
Prelude.Nothing
| Maybe [FolderMetadata] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeFolderContents
DescribeFolderContentsResponse
rs
DescribeFolderContentsResponse
-> Getting
(First [FolderMetadata])
DescribeFolderContentsResponse
[FolderMetadata]
-> Maybe [FolderMetadata]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [FolderMetadata]
-> Const (First [FolderMetadata]) (Maybe [FolderMetadata]))
-> DescribeFolderContentsResponse
-> Const (First [FolderMetadata]) DescribeFolderContentsResponse
Lens' DescribeFolderContentsResponse (Maybe [FolderMetadata])
describeFolderContentsResponse_folders
((Maybe [FolderMetadata]
-> Const (First [FolderMetadata]) (Maybe [FolderMetadata]))
-> DescribeFolderContentsResponse
-> Const (First [FolderMetadata]) DescribeFolderContentsResponse)
-> (([FolderMetadata]
-> Const (First [FolderMetadata]) [FolderMetadata])
-> Maybe [FolderMetadata]
-> Const (First [FolderMetadata]) (Maybe [FolderMetadata]))
-> Getting
(First [FolderMetadata])
DescribeFolderContentsResponse
[FolderMetadata]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([FolderMetadata]
-> Const (First [FolderMetadata]) [FolderMetadata])
-> Maybe [FolderMetadata]
-> Const (First [FolderMetadata]) (Maybe [FolderMetadata])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeFolderContents
forall a. Maybe a
Prelude.Nothing
| Maybe [DocumentMetadata] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse DescribeFolderContents
DescribeFolderContentsResponse
rs
DescribeFolderContentsResponse
-> Getting
(First [DocumentMetadata])
DescribeFolderContentsResponse
[DocumentMetadata]
-> Maybe [DocumentMetadata]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [DocumentMetadata]
-> Const (First [DocumentMetadata]) (Maybe [DocumentMetadata]))
-> DescribeFolderContentsResponse
-> Const (First [DocumentMetadata]) DescribeFolderContentsResponse
Lens' DescribeFolderContentsResponse (Maybe [DocumentMetadata])
describeFolderContentsResponse_documents
((Maybe [DocumentMetadata]
-> Const (First [DocumentMetadata]) (Maybe [DocumentMetadata]))
-> DescribeFolderContentsResponse
-> Const (First [DocumentMetadata]) DescribeFolderContentsResponse)
-> (([DocumentMetadata]
-> Const (First [DocumentMetadata]) [DocumentMetadata])
-> Maybe [DocumentMetadata]
-> Const (First [DocumentMetadata]) (Maybe [DocumentMetadata]))
-> Getting
(First [DocumentMetadata])
DescribeFolderContentsResponse
[DocumentMetadata]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DocumentMetadata]
-> Const (First [DocumentMetadata]) [DocumentMetadata])
-> Maybe [DocumentMetadata]
-> Const (First [DocumentMetadata]) (Maybe [DocumentMetadata])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe DescribeFolderContents
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
DescribeFolderContents -> Maybe DescribeFolderContents
forall a. a -> Maybe a
Prelude.Just (DescribeFolderContents -> Maybe DescribeFolderContents)
-> DescribeFolderContents -> Maybe DescribeFolderContents
forall a b. (a -> b) -> a -> b
Prelude.$
DescribeFolderContents
rq
DescribeFolderContents
-> (DescribeFolderContents -> DescribeFolderContents)
-> DescribeFolderContents
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeFolderContents -> Identity DescribeFolderContents
Lens
DescribeFolderContents
DescribeFolderContents
(Maybe Text)
(Maybe Text)
describeFolderContents_marker
((Maybe Text -> Identity (Maybe Text))
-> DescribeFolderContents -> Identity DescribeFolderContents)
-> Maybe Text -> DescribeFolderContents -> DescribeFolderContents
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeFolderContents
DescribeFolderContentsResponse
rs
DescribeFolderContentsResponse
-> Getting (First Text) DescribeFolderContentsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeFolderContentsResponse
-> Const (First Text) DescribeFolderContentsResponse
Lens' DescribeFolderContentsResponse (Maybe Text)
describeFolderContentsResponse_marker
((Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeFolderContentsResponse
-> Const (First Text) DescribeFolderContentsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeFolderContentsResponse 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 DescribeFolderContents where
type
AWSResponse DescribeFolderContents =
DescribeFolderContentsResponse
request :: DescribeFolderContents -> Request DescribeFolderContents
request = Service -> DescribeFolderContents -> Request DescribeFolderContents
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeFolderContents
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeFolderContents)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeFolderContents))
-> Logger
-> Service
-> Proxy DescribeFolderContents
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeFolderContents)))
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 [FolderMetadata]
-> Maybe [DocumentMetadata]
-> Maybe Text
-> Int
-> DescribeFolderContentsResponse
DescribeFolderContentsResponse'
(Maybe [FolderMetadata]
-> Maybe [DocumentMetadata]
-> Maybe Text
-> Int
-> DescribeFolderContentsResponse)
-> Either String (Maybe [FolderMetadata])
-> Either
String
(Maybe [DocumentMetadata]
-> Maybe Text -> Int -> DescribeFolderContentsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [FolderMetadata]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Folders" Either String (Maybe (Maybe [FolderMetadata]))
-> Maybe [FolderMetadata] -> Either String (Maybe [FolderMetadata])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FolderMetadata]
forall a. Monoid a => a
Prelude.mempty)
Either
String
(Maybe [DocumentMetadata]
-> Maybe Text -> Int -> DescribeFolderContentsResponse)
-> Either String (Maybe [DocumentMetadata])
-> Either
String (Maybe Text -> Int -> DescribeFolderContentsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [DocumentMetadata]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Documents" Either String (Maybe (Maybe [DocumentMetadata]))
-> Maybe [DocumentMetadata]
-> Either String (Maybe [DocumentMetadata])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DocumentMetadata]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> DescribeFolderContentsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeFolderContentsResponse)
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 (Int -> DescribeFolderContentsResponse)
-> Either String Int
-> Either String DescribeFolderContentsResponse
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 DescribeFolderContents
instance Prelude.NFData DescribeFolderContents
instance Core.ToHeaders DescribeFolderContents where
toHeaders :: DescribeFolderContents -> ResponseHeaders
toHeaders DescribeFolderContents' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe FolderContentType
Maybe OrderType
Maybe ResourceSortType
Text
folderId :: Text
order :: Maybe OrderType
type' :: Maybe FolderContentType
limit :: Maybe Natural
marker :: Maybe Text
sort :: Maybe ResourceSortType
authenticationToken :: Maybe (Sensitive Text)
include :: Maybe Text
$sel:folderId:DescribeFolderContents' :: DescribeFolderContents -> Text
$sel:order:DescribeFolderContents' :: DescribeFolderContents -> Maybe OrderType
$sel:type':DescribeFolderContents' :: DescribeFolderContents -> Maybe FolderContentType
$sel:limit:DescribeFolderContents' :: DescribeFolderContents -> Maybe Natural
$sel:marker:DescribeFolderContents' :: DescribeFolderContents -> Maybe Text
$sel:sort:DescribeFolderContents' :: DescribeFolderContents -> Maybe ResourceSortType
$sel:authenticationToken:DescribeFolderContents' :: DescribeFolderContents -> Maybe (Sensitive Text)
$sel:include:DescribeFolderContents' :: DescribeFolderContents -> Maybe Text
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Authentication" HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
authenticationToken,
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.ToPath DescribeFolderContents where
toPath :: DescribeFolderContents -> ByteString
toPath DescribeFolderContents' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe FolderContentType
Maybe OrderType
Maybe ResourceSortType
Text
folderId :: Text
order :: Maybe OrderType
type' :: Maybe FolderContentType
limit :: Maybe Natural
marker :: Maybe Text
sort :: Maybe ResourceSortType
authenticationToken :: Maybe (Sensitive Text)
include :: Maybe Text
$sel:folderId:DescribeFolderContents' :: DescribeFolderContents -> Text
$sel:order:DescribeFolderContents' :: DescribeFolderContents -> Maybe OrderType
$sel:type':DescribeFolderContents' :: DescribeFolderContents -> Maybe FolderContentType
$sel:limit:DescribeFolderContents' :: DescribeFolderContents -> Maybe Natural
$sel:marker:DescribeFolderContents' :: DescribeFolderContents -> Maybe Text
$sel:sort:DescribeFolderContents' :: DescribeFolderContents -> Maybe ResourceSortType
$sel:authenticationToken:DescribeFolderContents' :: DescribeFolderContents -> Maybe (Sensitive Text)
$sel:include:DescribeFolderContents' :: DescribeFolderContents -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/api/v1/folders/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
folderId, ByteString
"/contents"]
instance Core.ToQuery DescribeFolderContents where
toQuery :: DescribeFolderContents -> QueryString
toQuery DescribeFolderContents' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe FolderContentType
Maybe OrderType
Maybe ResourceSortType
Text
folderId :: Text
order :: Maybe OrderType
type' :: Maybe FolderContentType
limit :: Maybe Natural
marker :: Maybe Text
sort :: Maybe ResourceSortType
authenticationToken :: Maybe (Sensitive Text)
include :: Maybe Text
$sel:folderId:DescribeFolderContents' :: DescribeFolderContents -> Text
$sel:order:DescribeFolderContents' :: DescribeFolderContents -> Maybe OrderType
$sel:type':DescribeFolderContents' :: DescribeFolderContents -> Maybe FolderContentType
$sel:limit:DescribeFolderContents' :: DescribeFolderContents -> Maybe Natural
$sel:marker:DescribeFolderContents' :: DescribeFolderContents -> Maybe Text
$sel:sort:DescribeFolderContents' :: DescribeFolderContents -> Maybe ResourceSortType
$sel:authenticationToken:DescribeFolderContents' :: DescribeFolderContents -> Maybe (Sensitive Text)
$sel:include:DescribeFolderContents' :: DescribeFolderContents -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"include" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
include,
ByteString
"sort" ByteString -> Maybe ResourceSortType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ResourceSortType
sort,
ByteString
"marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
ByteString
"limit" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
limit,
ByteString
"type" ByteString -> Maybe FolderContentType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe FolderContentType
type',
ByteString
"order" ByteString -> Maybe OrderType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe OrderType
order
]
data DescribeFolderContentsResponse = DescribeFolderContentsResponse'
{
DescribeFolderContentsResponse -> Maybe [FolderMetadata]
folders :: Prelude.Maybe [FolderMetadata],
DescribeFolderContentsResponse -> Maybe [DocumentMetadata]
documents :: Prelude.Maybe [DocumentMetadata],
DescribeFolderContentsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
DescribeFolderContentsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeFolderContentsResponse
-> DescribeFolderContentsResponse -> Bool
(DescribeFolderContentsResponse
-> DescribeFolderContentsResponse -> Bool)
-> (DescribeFolderContentsResponse
-> DescribeFolderContentsResponse -> Bool)
-> Eq DescribeFolderContentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFolderContentsResponse
-> DescribeFolderContentsResponse -> Bool
$c/= :: DescribeFolderContentsResponse
-> DescribeFolderContentsResponse -> Bool
== :: DescribeFolderContentsResponse
-> DescribeFolderContentsResponse -> Bool
$c== :: DescribeFolderContentsResponse
-> DescribeFolderContentsResponse -> Bool
Prelude.Eq, Int -> DescribeFolderContentsResponse -> ShowS
[DescribeFolderContentsResponse] -> ShowS
DescribeFolderContentsResponse -> String
(Int -> DescribeFolderContentsResponse -> ShowS)
-> (DescribeFolderContentsResponse -> String)
-> ([DescribeFolderContentsResponse] -> ShowS)
-> Show DescribeFolderContentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFolderContentsResponse] -> ShowS
$cshowList :: [DescribeFolderContentsResponse] -> ShowS
show :: DescribeFolderContentsResponse -> String
$cshow :: DescribeFolderContentsResponse -> String
showsPrec :: Int -> DescribeFolderContentsResponse -> ShowS
$cshowsPrec :: Int -> DescribeFolderContentsResponse -> ShowS
Prelude.Show, (forall x.
DescribeFolderContentsResponse
-> Rep DescribeFolderContentsResponse x)
-> (forall x.
Rep DescribeFolderContentsResponse x
-> DescribeFolderContentsResponse)
-> Generic DescribeFolderContentsResponse
forall x.
Rep DescribeFolderContentsResponse x
-> DescribeFolderContentsResponse
forall x.
DescribeFolderContentsResponse
-> Rep DescribeFolderContentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFolderContentsResponse x
-> DescribeFolderContentsResponse
$cfrom :: forall x.
DescribeFolderContentsResponse
-> Rep DescribeFolderContentsResponse x
Prelude.Generic)
newDescribeFolderContentsResponse ::
Prelude.Int ->
DescribeFolderContentsResponse
newDescribeFolderContentsResponse :: Int -> DescribeFolderContentsResponse
newDescribeFolderContentsResponse Int
pHttpStatus_ =
DescribeFolderContentsResponse' :: Maybe [FolderMetadata]
-> Maybe [DocumentMetadata]
-> Maybe Text
-> Int
-> DescribeFolderContentsResponse
DescribeFolderContentsResponse'
{ $sel:folders:DescribeFolderContentsResponse' :: Maybe [FolderMetadata]
folders =
Maybe [FolderMetadata]
forall a. Maybe a
Prelude.Nothing,
$sel:documents:DescribeFolderContentsResponse' :: Maybe [DocumentMetadata]
documents = Maybe [DocumentMetadata]
forall a. Maybe a
Prelude.Nothing,
$sel:marker:DescribeFolderContentsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeFolderContentsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeFolderContentsResponse_folders :: Lens.Lens' DescribeFolderContentsResponse (Prelude.Maybe [FolderMetadata])
describeFolderContentsResponse_folders :: (Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
-> DescribeFolderContentsResponse
-> f DescribeFolderContentsResponse
describeFolderContentsResponse_folders = (DescribeFolderContentsResponse -> Maybe [FolderMetadata])
-> (DescribeFolderContentsResponse
-> Maybe [FolderMetadata] -> DescribeFolderContentsResponse)
-> Lens' DescribeFolderContentsResponse (Maybe [FolderMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFolderContentsResponse' {Maybe [FolderMetadata]
folders :: Maybe [FolderMetadata]
$sel:folders:DescribeFolderContentsResponse' :: DescribeFolderContentsResponse -> Maybe [FolderMetadata]
folders} -> Maybe [FolderMetadata]
folders) (\s :: DescribeFolderContentsResponse
s@DescribeFolderContentsResponse' {} Maybe [FolderMetadata]
a -> DescribeFolderContentsResponse
s {$sel:folders:DescribeFolderContentsResponse' :: Maybe [FolderMetadata]
folders = Maybe [FolderMetadata]
a} :: DescribeFolderContentsResponse) ((Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
-> DescribeFolderContentsResponse
-> f DescribeFolderContentsResponse)
-> ((Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
-> Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
-> (Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
-> DescribeFolderContentsResponse
-> f DescribeFolderContentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[FolderMetadata] [FolderMetadata] [FolderMetadata] [FolderMetadata]
-> Iso
(Maybe [FolderMetadata])
(Maybe [FolderMetadata])
(Maybe [FolderMetadata])
(Maybe [FolderMetadata])
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
[FolderMetadata] [FolderMetadata] [FolderMetadata] [FolderMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeFolderContentsResponse_documents :: Lens.Lens' DescribeFolderContentsResponse (Prelude.Maybe [DocumentMetadata])
describeFolderContentsResponse_documents :: (Maybe [DocumentMetadata] -> f (Maybe [DocumentMetadata]))
-> DescribeFolderContentsResponse
-> f DescribeFolderContentsResponse
describeFolderContentsResponse_documents = (DescribeFolderContentsResponse -> Maybe [DocumentMetadata])
-> (DescribeFolderContentsResponse
-> Maybe [DocumentMetadata] -> DescribeFolderContentsResponse)
-> Lens' DescribeFolderContentsResponse (Maybe [DocumentMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFolderContentsResponse' {Maybe [DocumentMetadata]
documents :: Maybe [DocumentMetadata]
$sel:documents:DescribeFolderContentsResponse' :: DescribeFolderContentsResponse -> Maybe [DocumentMetadata]
documents} -> Maybe [DocumentMetadata]
documents) (\s :: DescribeFolderContentsResponse
s@DescribeFolderContentsResponse' {} Maybe [DocumentMetadata]
a -> DescribeFolderContentsResponse
s {$sel:documents:DescribeFolderContentsResponse' :: Maybe [DocumentMetadata]
documents = Maybe [DocumentMetadata]
a} :: DescribeFolderContentsResponse) ((Maybe [DocumentMetadata] -> f (Maybe [DocumentMetadata]))
-> DescribeFolderContentsResponse
-> f DescribeFolderContentsResponse)
-> ((Maybe [DocumentMetadata] -> f (Maybe [DocumentMetadata]))
-> Maybe [DocumentMetadata] -> f (Maybe [DocumentMetadata]))
-> (Maybe [DocumentMetadata] -> f (Maybe [DocumentMetadata]))
-> DescribeFolderContentsResponse
-> f DescribeFolderContentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[DocumentMetadata]
[DocumentMetadata]
[DocumentMetadata]
[DocumentMetadata]
-> Iso
(Maybe [DocumentMetadata])
(Maybe [DocumentMetadata])
(Maybe [DocumentMetadata])
(Maybe [DocumentMetadata])
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
[DocumentMetadata]
[DocumentMetadata]
[DocumentMetadata]
[DocumentMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeFolderContentsResponse_marker :: Lens.Lens' DescribeFolderContentsResponse (Prelude.Maybe Prelude.Text)
describeFolderContentsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeFolderContentsResponse
-> f DescribeFolderContentsResponse
describeFolderContentsResponse_marker = (DescribeFolderContentsResponse -> Maybe Text)
-> (DescribeFolderContentsResponse
-> Maybe Text -> DescribeFolderContentsResponse)
-> Lens' DescribeFolderContentsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFolderContentsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeFolderContentsResponse' :: DescribeFolderContentsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeFolderContentsResponse
s@DescribeFolderContentsResponse' {} Maybe Text
a -> DescribeFolderContentsResponse
s {$sel:marker:DescribeFolderContentsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeFolderContentsResponse)
describeFolderContentsResponse_httpStatus :: Lens.Lens' DescribeFolderContentsResponse Prelude.Int
describeFolderContentsResponse_httpStatus :: (Int -> f Int)
-> DescribeFolderContentsResponse
-> f DescribeFolderContentsResponse
describeFolderContentsResponse_httpStatus = (DescribeFolderContentsResponse -> Int)
-> (DescribeFolderContentsResponse
-> Int -> DescribeFolderContentsResponse)
-> Lens
DescribeFolderContentsResponse
DescribeFolderContentsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFolderContentsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeFolderContentsResponse' :: DescribeFolderContentsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeFolderContentsResponse
s@DescribeFolderContentsResponse' {} Int
a -> DescribeFolderContentsResponse
s {$sel:httpStatus:DescribeFolderContentsResponse' :: Int
httpStatus = Int
a} :: DescribeFolderContentsResponse)
instance
Prelude.NFData
DescribeFolderContentsResponse