{-# 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.WorkDocs.DescribeRootFolders
-- 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)
--
-- Describes the current user\'s special folders; the @RootFolder@ and the
-- @RecycleBin@. @RootFolder@ is the root of user\'s files and folders and
-- @RecycleBin@ is the root of recycled items. This is not a valid action
-- for SigV4 (administrative API) clients.
--
-- This action requires an authentication token. To get an authentication
-- token, register an application with Amazon WorkDocs. For more
-- information, see
-- <https://docs.aws.amazon.com/workdocs/latest/developerguide/wd-auth-user.html Authentication and Access Control for User Applications>
-- in the /Amazon WorkDocs Developer Guide/.
--
-- This operation returns paginated results.
module Amazonka.WorkDocs.DescribeRootFolders
  ( -- * Creating a Request
    DescribeRootFolders (..),
    newDescribeRootFolders,

    -- * Request Lenses
    describeRootFolders_marker,
    describeRootFolders_limit,
    describeRootFolders_authenticationToken,

    -- * Destructuring the Response
    DescribeRootFoldersResponse (..),
    newDescribeRootFoldersResponse,

    -- * Response Lenses
    describeRootFoldersResponse_folders,
    describeRootFoldersResponse_marker,
    describeRootFoldersResponse_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

-- | /See:/ 'newDescribeRootFolders' smart constructor.
data DescribeRootFolders = DescribeRootFolders'
  { -- | The marker for the next set of results. (You received this marker from a
    -- previous call.)
    DescribeRootFolders -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return.
    DescribeRootFolders -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | Amazon WorkDocs authentication token.
    DescribeRootFolders -> Sensitive Text
authenticationToken :: Core.Sensitive Prelude.Text
  }
  deriving (DescribeRootFolders -> DescribeRootFolders -> Bool
(DescribeRootFolders -> DescribeRootFolders -> Bool)
-> (DescribeRootFolders -> DescribeRootFolders -> Bool)
-> Eq DescribeRootFolders
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRootFolders -> DescribeRootFolders -> Bool
$c/= :: DescribeRootFolders -> DescribeRootFolders -> Bool
== :: DescribeRootFolders -> DescribeRootFolders -> Bool
$c== :: DescribeRootFolders -> DescribeRootFolders -> Bool
Prelude.Eq, Int -> DescribeRootFolders -> ShowS
[DescribeRootFolders] -> ShowS
DescribeRootFolders -> String
(Int -> DescribeRootFolders -> ShowS)
-> (DescribeRootFolders -> String)
-> ([DescribeRootFolders] -> ShowS)
-> Show DescribeRootFolders
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRootFolders] -> ShowS
$cshowList :: [DescribeRootFolders] -> ShowS
show :: DescribeRootFolders -> String
$cshow :: DescribeRootFolders -> String
showsPrec :: Int -> DescribeRootFolders -> ShowS
$cshowsPrec :: Int -> DescribeRootFolders -> ShowS
Prelude.Show, (forall x. DescribeRootFolders -> Rep DescribeRootFolders x)
-> (forall x. Rep DescribeRootFolders x -> DescribeRootFolders)
-> Generic DescribeRootFolders
forall x. Rep DescribeRootFolders x -> DescribeRootFolders
forall x. DescribeRootFolders -> Rep DescribeRootFolders x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeRootFolders x -> DescribeRootFolders
$cfrom :: forall x. DescribeRootFolders -> Rep DescribeRootFolders x
Prelude.Generic)

-- |
-- Create a value of 'DescribeRootFolders' 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:
--
-- 'marker', 'describeRootFolders_marker' - The marker for the next set of results. (You received this marker from a
-- previous call.)
--
-- 'limit', 'describeRootFolders_limit' - The maximum number of items to return.
--
-- 'authenticationToken', 'describeRootFolders_authenticationToken' - Amazon WorkDocs authentication token.
newDescribeRootFolders ::
  -- | 'authenticationToken'
  Prelude.Text ->
  DescribeRootFolders
newDescribeRootFolders :: Text -> DescribeRootFolders
newDescribeRootFolders Text
pAuthenticationToken_ =
  DescribeRootFolders' :: Maybe Text
-> Maybe Natural -> Sensitive Text -> DescribeRootFolders
DescribeRootFolders'
    { $sel:marker:DescribeRootFolders' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeRootFolders' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:authenticationToken:DescribeRootFolders' :: Sensitive Text
authenticationToken =
        Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pAuthenticationToken_
    }

-- | The marker for the next set of results. (You received this marker from a
-- previous call.)
describeRootFolders_marker :: Lens.Lens' DescribeRootFolders (Prelude.Maybe Prelude.Text)
describeRootFolders_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeRootFolders -> f DescribeRootFolders
describeRootFolders_marker = (DescribeRootFolders -> Maybe Text)
-> (DescribeRootFolders -> Maybe Text -> DescribeRootFolders)
-> Lens
     DescribeRootFolders DescribeRootFolders (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRootFolders' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeRootFolders' :: DescribeRootFolders -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeRootFolders
s@DescribeRootFolders' {} Maybe Text
a -> DescribeRootFolders
s {$sel:marker:DescribeRootFolders' :: Maybe Text
marker = Maybe Text
a} :: DescribeRootFolders)

-- | The maximum number of items to return.
describeRootFolders_limit :: Lens.Lens' DescribeRootFolders (Prelude.Maybe Prelude.Natural)
describeRootFolders_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeRootFolders -> f DescribeRootFolders
describeRootFolders_limit = (DescribeRootFolders -> Maybe Natural)
-> (DescribeRootFolders -> Maybe Natural -> DescribeRootFolders)
-> Lens
     DescribeRootFolders
     DescribeRootFolders
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRootFolders' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeRootFolders' :: DescribeRootFolders -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeRootFolders
s@DescribeRootFolders' {} Maybe Natural
a -> DescribeRootFolders
s {$sel:limit:DescribeRootFolders' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeRootFolders)

-- | Amazon WorkDocs authentication token.
describeRootFolders_authenticationToken :: Lens.Lens' DescribeRootFolders Prelude.Text
describeRootFolders_authenticationToken :: (Text -> f Text) -> DescribeRootFolders -> f DescribeRootFolders
describeRootFolders_authenticationToken = (DescribeRootFolders -> Sensitive Text)
-> (DescribeRootFolders -> Sensitive Text -> DescribeRootFolders)
-> Lens
     DescribeRootFolders
     DescribeRootFolders
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRootFolders' {Sensitive Text
authenticationToken :: Sensitive Text
$sel:authenticationToken:DescribeRootFolders' :: DescribeRootFolders -> Sensitive Text
authenticationToken} -> Sensitive Text
authenticationToken) (\s :: DescribeRootFolders
s@DescribeRootFolders' {} Sensitive Text
a -> DescribeRootFolders
s {$sel:authenticationToken:DescribeRootFolders' :: Sensitive Text
authenticationToken = Sensitive Text
a} :: DescribeRootFolders) ((Sensitive Text -> f (Sensitive Text))
 -> DescribeRootFolders -> f DescribeRootFolders)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> DescribeRootFolders
-> f DescribeRootFolders
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

instance Core.AWSPager DescribeRootFolders where
  page :: DescribeRootFolders
-> AWSResponse DescribeRootFolders -> Maybe DescribeRootFolders
page DescribeRootFolders
rq AWSResponse DescribeRootFolders
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeRootFolders
DescribeRootFoldersResponse
rs
            DescribeRootFoldersResponse
-> Getting (First Text) DescribeRootFoldersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeRootFoldersResponse
-> Const (First Text) DescribeRootFoldersResponse
Lens' DescribeRootFoldersResponse (Maybe Text)
describeRootFoldersResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeRootFoldersResponse
 -> Const (First Text) DescribeRootFoldersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeRootFoldersResponse 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 DescribeRootFolders
forall a. Maybe a
Prelude.Nothing
    | Maybe [FolderMetadata] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeRootFolders
DescribeRootFoldersResponse
rs
            DescribeRootFoldersResponse
-> Getting
     (First [FolderMetadata])
     DescribeRootFoldersResponse
     [FolderMetadata]
-> Maybe [FolderMetadata]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [FolderMetadata]
 -> Const (First [FolderMetadata]) (Maybe [FolderMetadata]))
-> DescribeRootFoldersResponse
-> Const (First [FolderMetadata]) DescribeRootFoldersResponse
Lens' DescribeRootFoldersResponse (Maybe [FolderMetadata])
describeRootFoldersResponse_folders
              ((Maybe [FolderMetadata]
  -> Const (First [FolderMetadata]) (Maybe [FolderMetadata]))
 -> DescribeRootFoldersResponse
 -> Const (First [FolderMetadata]) DescribeRootFoldersResponse)
-> (([FolderMetadata]
     -> Const (First [FolderMetadata]) [FolderMetadata])
    -> Maybe [FolderMetadata]
    -> Const (First [FolderMetadata]) (Maybe [FolderMetadata]))
-> Getting
     (First [FolderMetadata])
     DescribeRootFoldersResponse
     [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 DescribeRootFolders
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeRootFolders -> Maybe DescribeRootFolders
forall a. a -> Maybe a
Prelude.Just (DescribeRootFolders -> Maybe DescribeRootFolders)
-> DescribeRootFolders -> Maybe DescribeRootFolders
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeRootFolders
rq
          DescribeRootFolders
-> (DescribeRootFolders -> DescribeRootFolders)
-> DescribeRootFolders
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeRootFolders -> Identity DescribeRootFolders
Lens
  DescribeRootFolders DescribeRootFolders (Maybe Text) (Maybe Text)
describeRootFolders_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeRootFolders -> Identity DescribeRootFolders)
-> Maybe Text -> DescribeRootFolders -> DescribeRootFolders
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeRootFolders
DescribeRootFoldersResponse
rs
          DescribeRootFoldersResponse
-> Getting (First Text) DescribeRootFoldersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeRootFoldersResponse
-> Const (First Text) DescribeRootFoldersResponse
Lens' DescribeRootFoldersResponse (Maybe Text)
describeRootFoldersResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeRootFoldersResponse
 -> Const (First Text) DescribeRootFoldersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeRootFoldersResponse 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 DescribeRootFolders where
  type
    AWSResponse DescribeRootFolders =
      DescribeRootFoldersResponse
  request :: DescribeRootFolders -> Request DescribeRootFolders
request = Service -> DescribeRootFolders -> Request DescribeRootFolders
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeRootFolders
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeRootFolders)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeRootFolders))
-> Logger
-> Service
-> Proxy DescribeRootFolders
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeRootFolders)))
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 Text -> Int -> DescribeRootFoldersResponse
DescribeRootFoldersResponse'
            (Maybe [FolderMetadata]
 -> Maybe Text -> Int -> DescribeRootFoldersResponse)
-> Either String (Maybe [FolderMetadata])
-> Either String (Maybe Text -> Int -> DescribeRootFoldersResponse)
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 Text -> Int -> DescribeRootFoldersResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeRootFoldersResponse)
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 -> DescribeRootFoldersResponse)
-> Either String Int -> Either String DescribeRootFoldersResponse
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 DescribeRootFolders

instance Prelude.NFData DescribeRootFolders

instance Core.ToHeaders DescribeRootFolders where
  toHeaders :: DescribeRootFolders -> ResponseHeaders
toHeaders DescribeRootFolders' {Maybe Natural
Maybe Text
Sensitive Text
authenticationToken :: Sensitive Text
limit :: Maybe Natural
marker :: Maybe Text
$sel:authenticationToken:DescribeRootFolders' :: DescribeRootFolders -> Sensitive Text
$sel:limit:DescribeRootFolders' :: DescribeRootFolders -> Maybe Natural
$sel:marker:DescribeRootFolders' :: DescribeRootFolders -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"Authentication" HeaderName -> Sensitive Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# 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 DescribeRootFolders where
  toPath :: DescribeRootFolders -> ByteString
toPath = ByteString -> DescribeRootFolders -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/api/v1/me/root"

instance Core.ToQuery DescribeRootFolders where
  toQuery :: DescribeRootFolders -> QueryString
toQuery DescribeRootFolders' {Maybe Natural
Maybe Text
Sensitive Text
authenticationToken :: Sensitive Text
limit :: Maybe Natural
marker :: Maybe Text
$sel:authenticationToken:DescribeRootFolders' :: DescribeRootFolders -> Sensitive Text
$sel:limit:DescribeRootFolders' :: DescribeRootFolders -> Maybe Natural
$sel:marker:DescribeRootFolders' :: DescribeRootFolders -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [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]

-- | /See:/ 'newDescribeRootFoldersResponse' smart constructor.
data DescribeRootFoldersResponse = DescribeRootFoldersResponse'
  { -- | The user\'s special folders.
    DescribeRootFoldersResponse -> Maybe [FolderMetadata]
folders :: Prelude.Maybe [FolderMetadata],
    -- | The marker for the next set of results.
    DescribeRootFoldersResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeRootFoldersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeRootFoldersResponse -> DescribeRootFoldersResponse -> Bool
(DescribeRootFoldersResponse
 -> DescribeRootFoldersResponse -> Bool)
-> (DescribeRootFoldersResponse
    -> DescribeRootFoldersResponse -> Bool)
-> Eq DescribeRootFoldersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRootFoldersResponse -> DescribeRootFoldersResponse -> Bool
$c/= :: DescribeRootFoldersResponse -> DescribeRootFoldersResponse -> Bool
== :: DescribeRootFoldersResponse -> DescribeRootFoldersResponse -> Bool
$c== :: DescribeRootFoldersResponse -> DescribeRootFoldersResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRootFoldersResponse]
ReadPrec DescribeRootFoldersResponse
Int -> ReadS DescribeRootFoldersResponse
ReadS [DescribeRootFoldersResponse]
(Int -> ReadS DescribeRootFoldersResponse)
-> ReadS [DescribeRootFoldersResponse]
-> ReadPrec DescribeRootFoldersResponse
-> ReadPrec [DescribeRootFoldersResponse]
-> Read DescribeRootFoldersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRootFoldersResponse]
$creadListPrec :: ReadPrec [DescribeRootFoldersResponse]
readPrec :: ReadPrec DescribeRootFoldersResponse
$creadPrec :: ReadPrec DescribeRootFoldersResponse
readList :: ReadS [DescribeRootFoldersResponse]
$creadList :: ReadS [DescribeRootFoldersResponse]
readsPrec :: Int -> ReadS DescribeRootFoldersResponse
$creadsPrec :: Int -> ReadS DescribeRootFoldersResponse
Prelude.Read, Int -> DescribeRootFoldersResponse -> ShowS
[DescribeRootFoldersResponse] -> ShowS
DescribeRootFoldersResponse -> String
(Int -> DescribeRootFoldersResponse -> ShowS)
-> (DescribeRootFoldersResponse -> String)
-> ([DescribeRootFoldersResponse] -> ShowS)
-> Show DescribeRootFoldersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRootFoldersResponse] -> ShowS
$cshowList :: [DescribeRootFoldersResponse] -> ShowS
show :: DescribeRootFoldersResponse -> String
$cshow :: DescribeRootFoldersResponse -> String
showsPrec :: Int -> DescribeRootFoldersResponse -> ShowS
$cshowsPrec :: Int -> DescribeRootFoldersResponse -> ShowS
Prelude.Show, (forall x.
 DescribeRootFoldersResponse -> Rep DescribeRootFoldersResponse x)
-> (forall x.
    Rep DescribeRootFoldersResponse x -> DescribeRootFoldersResponse)
-> Generic DescribeRootFoldersResponse
forall x.
Rep DescribeRootFoldersResponse x -> DescribeRootFoldersResponse
forall x.
DescribeRootFoldersResponse -> Rep DescribeRootFoldersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRootFoldersResponse x -> DescribeRootFoldersResponse
$cfrom :: forall x.
DescribeRootFoldersResponse -> Rep DescribeRootFoldersResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeRootFoldersResponse' 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:
--
-- 'folders', 'describeRootFoldersResponse_folders' - The user\'s special folders.
--
-- 'marker', 'describeRootFoldersResponse_marker' - The marker for the next set of results.
--
-- 'httpStatus', 'describeRootFoldersResponse_httpStatus' - The response's http status code.
newDescribeRootFoldersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeRootFoldersResponse
newDescribeRootFoldersResponse :: Int -> DescribeRootFoldersResponse
newDescribeRootFoldersResponse Int
pHttpStatus_ =
  DescribeRootFoldersResponse' :: Maybe [FolderMetadata]
-> Maybe Text -> Int -> DescribeRootFoldersResponse
DescribeRootFoldersResponse'
    { $sel:folders:DescribeRootFoldersResponse' :: Maybe [FolderMetadata]
folders =
        Maybe [FolderMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeRootFoldersResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeRootFoldersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The user\'s special folders.
describeRootFoldersResponse_folders :: Lens.Lens' DescribeRootFoldersResponse (Prelude.Maybe [FolderMetadata])
describeRootFoldersResponse_folders :: (Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
-> DescribeRootFoldersResponse -> f DescribeRootFoldersResponse
describeRootFoldersResponse_folders = (DescribeRootFoldersResponse -> Maybe [FolderMetadata])
-> (DescribeRootFoldersResponse
    -> Maybe [FolderMetadata] -> DescribeRootFoldersResponse)
-> Lens' DescribeRootFoldersResponse (Maybe [FolderMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRootFoldersResponse' {Maybe [FolderMetadata]
folders :: Maybe [FolderMetadata]
$sel:folders:DescribeRootFoldersResponse' :: DescribeRootFoldersResponse -> Maybe [FolderMetadata]
folders} -> Maybe [FolderMetadata]
folders) (\s :: DescribeRootFoldersResponse
s@DescribeRootFoldersResponse' {} Maybe [FolderMetadata]
a -> DescribeRootFoldersResponse
s {$sel:folders:DescribeRootFoldersResponse' :: Maybe [FolderMetadata]
folders = Maybe [FolderMetadata]
a} :: DescribeRootFoldersResponse) ((Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
 -> DescribeRootFoldersResponse -> f DescribeRootFoldersResponse)
-> ((Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
    -> Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
-> (Maybe [FolderMetadata] -> f (Maybe [FolderMetadata]))
-> DescribeRootFoldersResponse
-> f DescribeRootFoldersResponse
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

-- | The marker for the next set of results.
describeRootFoldersResponse_marker :: Lens.Lens' DescribeRootFoldersResponse (Prelude.Maybe Prelude.Text)
describeRootFoldersResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeRootFoldersResponse -> f DescribeRootFoldersResponse
describeRootFoldersResponse_marker = (DescribeRootFoldersResponse -> Maybe Text)
-> (DescribeRootFoldersResponse
    -> Maybe Text -> DescribeRootFoldersResponse)
-> Lens' DescribeRootFoldersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRootFoldersResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeRootFoldersResponse' :: DescribeRootFoldersResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeRootFoldersResponse
s@DescribeRootFoldersResponse' {} Maybe Text
a -> DescribeRootFoldersResponse
s {$sel:marker:DescribeRootFoldersResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeRootFoldersResponse)

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

instance Prelude.NFData DescribeRootFoldersResponse