{-# 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.QuickSight.SearchFolders
-- 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)
--
-- Searches the subfolders in a folder.
module Amazonka.QuickSight.SearchFolders
  ( -- * Creating a Request
    SearchFolders (..),
    newSearchFolders,

    -- * Request Lenses
    searchFolders_nextToken,
    searchFolders_maxResults,
    searchFolders_awsAccountId,
    searchFolders_filters,

    -- * Destructuring the Response
    SearchFoldersResponse (..),
    newSearchFoldersResponse,

    -- * Response Lenses
    searchFoldersResponse_requestId,
    searchFoldersResponse_nextToken,
    searchFoldersResponse_folderSummaryList,
    searchFoldersResponse_status,
  )
where

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

-- | /See:/ 'newSearchFolders' smart constructor.
data SearchFolders = SearchFolders'
  { -- | The token for the next set of results, or null if there are no more
    -- results.
    SearchFolders -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per request.
    SearchFolders -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The AWS account ID.
    SearchFolders -> Text
awsAccountId :: Prelude.Text,
    -- | The filters to apply to the search. Currently, you can search only by
    -- the parent folder ARN. For example,
    -- @\"Filters\": [ { \"Name\": \"PARENT_FOLDER_ARN\", \"Operator\": \"StringEquals\", \"Value\": \"arn:aws:quicksight:us-east-1:1:folder\/folderId\" } ]@.
    SearchFolders -> [FolderSearchFilter]
filters :: [FolderSearchFilter]
  }
  deriving (SearchFolders -> SearchFolders -> Bool
(SearchFolders -> SearchFolders -> Bool)
-> (SearchFolders -> SearchFolders -> Bool) -> Eq SearchFolders
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchFolders -> SearchFolders -> Bool
$c/= :: SearchFolders -> SearchFolders -> Bool
== :: SearchFolders -> SearchFolders -> Bool
$c== :: SearchFolders -> SearchFolders -> Bool
Prelude.Eq, ReadPrec [SearchFolders]
ReadPrec SearchFolders
Int -> ReadS SearchFolders
ReadS [SearchFolders]
(Int -> ReadS SearchFolders)
-> ReadS [SearchFolders]
-> ReadPrec SearchFolders
-> ReadPrec [SearchFolders]
-> Read SearchFolders
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchFolders]
$creadListPrec :: ReadPrec [SearchFolders]
readPrec :: ReadPrec SearchFolders
$creadPrec :: ReadPrec SearchFolders
readList :: ReadS [SearchFolders]
$creadList :: ReadS [SearchFolders]
readsPrec :: Int -> ReadS SearchFolders
$creadsPrec :: Int -> ReadS SearchFolders
Prelude.Read, Int -> SearchFolders -> ShowS
[SearchFolders] -> ShowS
SearchFolders -> String
(Int -> SearchFolders -> ShowS)
-> (SearchFolders -> String)
-> ([SearchFolders] -> ShowS)
-> Show SearchFolders
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchFolders] -> ShowS
$cshowList :: [SearchFolders] -> ShowS
show :: SearchFolders -> String
$cshow :: SearchFolders -> String
showsPrec :: Int -> SearchFolders -> ShowS
$cshowsPrec :: Int -> SearchFolders -> ShowS
Prelude.Show, (forall x. SearchFolders -> Rep SearchFolders x)
-> (forall x. Rep SearchFolders x -> SearchFolders)
-> Generic SearchFolders
forall x. Rep SearchFolders x -> SearchFolders
forall x. SearchFolders -> Rep SearchFolders x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchFolders x -> SearchFolders
$cfrom :: forall x. SearchFolders -> Rep SearchFolders x
Prelude.Generic)

-- |
-- Create a value of 'SearchFolders' 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:
--
-- 'nextToken', 'searchFolders_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'maxResults', 'searchFolders_maxResults' - The maximum number of results to be returned per request.
--
-- 'awsAccountId', 'searchFolders_awsAccountId' - The AWS account ID.
--
-- 'filters', 'searchFolders_filters' - The filters to apply to the search. Currently, you can search only by
-- the parent folder ARN. For example,
-- @\"Filters\": [ { \"Name\": \"PARENT_FOLDER_ARN\", \"Operator\": \"StringEquals\", \"Value\": \"arn:aws:quicksight:us-east-1:1:folder\/folderId\" } ]@.
newSearchFolders ::
  -- | 'awsAccountId'
  Prelude.Text ->
  SearchFolders
newSearchFolders :: Text -> SearchFolders
newSearchFolders Text
pAwsAccountId_ =
  SearchFolders' :: Maybe Text
-> Maybe Natural -> Text -> [FolderSearchFilter] -> SearchFolders
SearchFolders'
    { $sel:nextToken:SearchFolders' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:SearchFolders' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:SearchFolders' :: Text
awsAccountId = Text
pAwsAccountId_,
      $sel:filters:SearchFolders' :: [FolderSearchFilter]
filters = [FolderSearchFilter]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The token for the next set of results, or null if there are no more
-- results.
searchFolders_nextToken :: Lens.Lens' SearchFolders (Prelude.Maybe Prelude.Text)
searchFolders_nextToken :: (Maybe Text -> f (Maybe Text)) -> SearchFolders -> f SearchFolders
searchFolders_nextToken = (SearchFolders -> Maybe Text)
-> (SearchFolders -> Maybe Text -> SearchFolders)
-> Lens SearchFolders SearchFolders (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchFolders' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchFolders' :: SearchFolders -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchFolders
s@SearchFolders' {} Maybe Text
a -> SearchFolders
s {$sel:nextToken:SearchFolders' :: Maybe Text
nextToken = Maybe Text
a} :: SearchFolders)

-- | The maximum number of results to be returned per request.
searchFolders_maxResults :: Lens.Lens' SearchFolders (Prelude.Maybe Prelude.Natural)
searchFolders_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> SearchFolders -> f SearchFolders
searchFolders_maxResults = (SearchFolders -> Maybe Natural)
-> (SearchFolders -> Maybe Natural -> SearchFolders)
-> Lens SearchFolders SearchFolders (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchFolders' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:SearchFolders' :: SearchFolders -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: SearchFolders
s@SearchFolders' {} Maybe Natural
a -> SearchFolders
s {$sel:maxResults:SearchFolders' :: Maybe Natural
maxResults = Maybe Natural
a} :: SearchFolders)

-- | The AWS account ID.
searchFolders_awsAccountId :: Lens.Lens' SearchFolders Prelude.Text
searchFolders_awsAccountId :: (Text -> f Text) -> SearchFolders -> f SearchFolders
searchFolders_awsAccountId = (SearchFolders -> Text)
-> (SearchFolders -> Text -> SearchFolders)
-> Lens SearchFolders SearchFolders Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchFolders' {Text
awsAccountId :: Text
$sel:awsAccountId:SearchFolders' :: SearchFolders -> Text
awsAccountId} -> Text
awsAccountId) (\s :: SearchFolders
s@SearchFolders' {} Text
a -> SearchFolders
s {$sel:awsAccountId:SearchFolders' :: Text
awsAccountId = Text
a} :: SearchFolders)

-- | The filters to apply to the search. Currently, you can search only by
-- the parent folder ARN. For example,
-- @\"Filters\": [ { \"Name\": \"PARENT_FOLDER_ARN\", \"Operator\": \"StringEquals\", \"Value\": \"arn:aws:quicksight:us-east-1:1:folder\/folderId\" } ]@.
searchFolders_filters :: Lens.Lens' SearchFolders [FolderSearchFilter]
searchFolders_filters :: ([FolderSearchFilter] -> f [FolderSearchFilter])
-> SearchFolders -> f SearchFolders
searchFolders_filters = (SearchFolders -> [FolderSearchFilter])
-> (SearchFolders -> [FolderSearchFilter] -> SearchFolders)
-> Lens
     SearchFolders
     SearchFolders
     [FolderSearchFilter]
     [FolderSearchFilter]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchFolders' {[FolderSearchFilter]
filters :: [FolderSearchFilter]
$sel:filters:SearchFolders' :: SearchFolders -> [FolderSearchFilter]
filters} -> [FolderSearchFilter]
filters) (\s :: SearchFolders
s@SearchFolders' {} [FolderSearchFilter]
a -> SearchFolders
s {$sel:filters:SearchFolders' :: [FolderSearchFilter]
filters = [FolderSearchFilter]
a} :: SearchFolders) (([FolderSearchFilter] -> f [FolderSearchFilter])
 -> SearchFolders -> f SearchFolders)
-> (([FolderSearchFilter] -> f [FolderSearchFilter])
    -> [FolderSearchFilter] -> f [FolderSearchFilter])
-> ([FolderSearchFilter] -> f [FolderSearchFilter])
-> SearchFolders
-> f SearchFolders
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([FolderSearchFilter] -> f [FolderSearchFilter])
-> [FolderSearchFilter] -> f [FolderSearchFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest SearchFolders where
  type
    AWSResponse SearchFolders =
      SearchFoldersResponse
  request :: SearchFolders -> Request SearchFolders
request = Service -> SearchFolders -> Request SearchFolders
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy SearchFolders
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SearchFolders)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse SearchFolders))
-> Logger
-> Service
-> Proxy SearchFolders
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SearchFolders)))
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 Text
-> Maybe Text
-> Maybe [FolderSummary]
-> Int
-> SearchFoldersResponse
SearchFoldersResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe [FolderSummary]
 -> Int
 -> SearchFoldersResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [FolderSummary] -> Int -> SearchFoldersResponse)
forall (f :: * -> *) a b. Functor 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
"RequestId")
            Either
  String
  (Maybe Text
   -> Maybe [FolderSummary] -> Int -> SearchFoldersResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [FolderSummary] -> Int -> SearchFoldersResponse)
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
"NextToken")
            Either
  String (Maybe [FolderSummary] -> Int -> SearchFoldersResponse)
-> Either String (Maybe [FolderSummary])
-> Either String (Int -> SearchFoldersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [FolderSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FolderSummaryList"
                            Either String (Maybe (Maybe [FolderSummary]))
-> Maybe [FolderSummary] -> Either String (Maybe [FolderSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FolderSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> SearchFoldersResponse)
-> Either String Int -> Either String SearchFoldersResponse
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 SearchFolders

instance Prelude.NFData SearchFolders

instance Core.ToHeaders SearchFolders where
  toHeaders :: SearchFolders -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SearchFolders -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON SearchFolders where
  toJSON :: SearchFolders -> Value
toJSON SearchFolders' {[FolderSearchFilter]
Maybe Natural
Maybe Text
Text
filters :: [FolderSearchFilter]
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:filters:SearchFolders' :: SearchFolders -> [FolderSearchFilter]
$sel:awsAccountId:SearchFolders' :: SearchFolders -> Text
$sel:maxResults:SearchFolders' :: SearchFolders -> Maybe Natural
$sel:nextToken:SearchFolders' :: SearchFolders -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Filters" Text -> [FolderSearchFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [FolderSearchFilter]
filters)
          ]
      )

instance Core.ToPath SearchFolders where
  toPath :: SearchFolders -> ByteString
toPath SearchFolders' {[FolderSearchFilter]
Maybe Natural
Maybe Text
Text
filters :: [FolderSearchFilter]
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:filters:SearchFolders' :: SearchFolders -> [FolderSearchFilter]
$sel:awsAccountId:SearchFolders' :: SearchFolders -> Text
$sel:maxResults:SearchFolders' :: SearchFolders -> Maybe Natural
$sel:nextToken:SearchFolders' :: SearchFolders -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
        ByteString
"/search/folders"
      ]

instance Core.ToQuery SearchFolders where
  toQuery :: SearchFolders -> QueryString
toQuery = QueryString -> SearchFolders -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newSearchFoldersResponse' smart constructor.
data SearchFoldersResponse = SearchFoldersResponse'
  { -- | The request ID.
    SearchFoldersResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of results, or null if there are no more
    -- results.
    SearchFoldersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A structure that contains all of the folders in your AWS account. This
    -- structure provides basic information about the folders.
    SearchFoldersResponse -> Maybe [FolderSummary]
folderSummaryList :: Prelude.Maybe [FolderSummary],
    -- | The status. If succeeded, the status is @SC_OK@.
    SearchFoldersResponse -> Int
status :: Prelude.Int
  }
  deriving (SearchFoldersResponse -> SearchFoldersResponse -> Bool
(SearchFoldersResponse -> SearchFoldersResponse -> Bool)
-> (SearchFoldersResponse -> SearchFoldersResponse -> Bool)
-> Eq SearchFoldersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchFoldersResponse -> SearchFoldersResponse -> Bool
$c/= :: SearchFoldersResponse -> SearchFoldersResponse -> Bool
== :: SearchFoldersResponse -> SearchFoldersResponse -> Bool
$c== :: SearchFoldersResponse -> SearchFoldersResponse -> Bool
Prelude.Eq, ReadPrec [SearchFoldersResponse]
ReadPrec SearchFoldersResponse
Int -> ReadS SearchFoldersResponse
ReadS [SearchFoldersResponse]
(Int -> ReadS SearchFoldersResponse)
-> ReadS [SearchFoldersResponse]
-> ReadPrec SearchFoldersResponse
-> ReadPrec [SearchFoldersResponse]
-> Read SearchFoldersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchFoldersResponse]
$creadListPrec :: ReadPrec [SearchFoldersResponse]
readPrec :: ReadPrec SearchFoldersResponse
$creadPrec :: ReadPrec SearchFoldersResponse
readList :: ReadS [SearchFoldersResponse]
$creadList :: ReadS [SearchFoldersResponse]
readsPrec :: Int -> ReadS SearchFoldersResponse
$creadsPrec :: Int -> ReadS SearchFoldersResponse
Prelude.Read, Int -> SearchFoldersResponse -> ShowS
[SearchFoldersResponse] -> ShowS
SearchFoldersResponse -> String
(Int -> SearchFoldersResponse -> ShowS)
-> (SearchFoldersResponse -> String)
-> ([SearchFoldersResponse] -> ShowS)
-> Show SearchFoldersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchFoldersResponse] -> ShowS
$cshowList :: [SearchFoldersResponse] -> ShowS
show :: SearchFoldersResponse -> String
$cshow :: SearchFoldersResponse -> String
showsPrec :: Int -> SearchFoldersResponse -> ShowS
$cshowsPrec :: Int -> SearchFoldersResponse -> ShowS
Prelude.Show, (forall x. SearchFoldersResponse -> Rep SearchFoldersResponse x)
-> (forall x. Rep SearchFoldersResponse x -> SearchFoldersResponse)
-> Generic SearchFoldersResponse
forall x. Rep SearchFoldersResponse x -> SearchFoldersResponse
forall x. SearchFoldersResponse -> Rep SearchFoldersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchFoldersResponse x -> SearchFoldersResponse
$cfrom :: forall x. SearchFoldersResponse -> Rep SearchFoldersResponse x
Prelude.Generic)

-- |
-- Create a value of 'SearchFoldersResponse' 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:
--
-- 'requestId', 'searchFoldersResponse_requestId' - The request ID.
--
-- 'nextToken', 'searchFoldersResponse_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'folderSummaryList', 'searchFoldersResponse_folderSummaryList' - A structure that contains all of the folders in your AWS account. This
-- structure provides basic information about the folders.
--
-- 'status', 'searchFoldersResponse_status' - The status. If succeeded, the status is @SC_OK@.
newSearchFoldersResponse ::
  -- | 'status'
  Prelude.Int ->
  SearchFoldersResponse
newSearchFoldersResponse :: Int -> SearchFoldersResponse
newSearchFoldersResponse Int
pStatus_ =
  SearchFoldersResponse' :: Maybe Text
-> Maybe Text
-> Maybe [FolderSummary]
-> Int
-> SearchFoldersResponse
SearchFoldersResponse'
    { $sel:requestId:SearchFoldersResponse' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchFoldersResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:folderSummaryList:SearchFoldersResponse' :: Maybe [FolderSummary]
folderSummaryList = Maybe [FolderSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:status:SearchFoldersResponse' :: Int
status = Int
pStatus_
    }

-- | The request ID.
searchFoldersResponse_requestId :: Lens.Lens' SearchFoldersResponse (Prelude.Maybe Prelude.Text)
searchFoldersResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> SearchFoldersResponse -> f SearchFoldersResponse
searchFoldersResponse_requestId = (SearchFoldersResponse -> Maybe Text)
-> (SearchFoldersResponse -> Maybe Text -> SearchFoldersResponse)
-> Lens
     SearchFoldersResponse
     SearchFoldersResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchFoldersResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:SearchFoldersResponse' :: SearchFoldersResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: SearchFoldersResponse
s@SearchFoldersResponse' {} Maybe Text
a -> SearchFoldersResponse
s {$sel:requestId:SearchFoldersResponse' :: Maybe Text
requestId = Maybe Text
a} :: SearchFoldersResponse)

-- | The token for the next set of results, or null if there are no more
-- results.
searchFoldersResponse_nextToken :: Lens.Lens' SearchFoldersResponse (Prelude.Maybe Prelude.Text)
searchFoldersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchFoldersResponse -> f SearchFoldersResponse
searchFoldersResponse_nextToken = (SearchFoldersResponse -> Maybe Text)
-> (SearchFoldersResponse -> Maybe Text -> SearchFoldersResponse)
-> Lens
     SearchFoldersResponse
     SearchFoldersResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchFoldersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchFoldersResponse' :: SearchFoldersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchFoldersResponse
s@SearchFoldersResponse' {} Maybe Text
a -> SearchFoldersResponse
s {$sel:nextToken:SearchFoldersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SearchFoldersResponse)

-- | A structure that contains all of the folders in your AWS account. This
-- structure provides basic information about the folders.
searchFoldersResponse_folderSummaryList :: Lens.Lens' SearchFoldersResponse (Prelude.Maybe [FolderSummary])
searchFoldersResponse_folderSummaryList :: (Maybe [FolderSummary] -> f (Maybe [FolderSummary]))
-> SearchFoldersResponse -> f SearchFoldersResponse
searchFoldersResponse_folderSummaryList = (SearchFoldersResponse -> Maybe [FolderSummary])
-> (SearchFoldersResponse
    -> Maybe [FolderSummary] -> SearchFoldersResponse)
-> Lens
     SearchFoldersResponse
     SearchFoldersResponse
     (Maybe [FolderSummary])
     (Maybe [FolderSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchFoldersResponse' {Maybe [FolderSummary]
folderSummaryList :: Maybe [FolderSummary]
$sel:folderSummaryList:SearchFoldersResponse' :: SearchFoldersResponse -> Maybe [FolderSummary]
folderSummaryList} -> Maybe [FolderSummary]
folderSummaryList) (\s :: SearchFoldersResponse
s@SearchFoldersResponse' {} Maybe [FolderSummary]
a -> SearchFoldersResponse
s {$sel:folderSummaryList:SearchFoldersResponse' :: Maybe [FolderSummary]
folderSummaryList = Maybe [FolderSummary]
a} :: SearchFoldersResponse) ((Maybe [FolderSummary] -> f (Maybe [FolderSummary]))
 -> SearchFoldersResponse -> f SearchFoldersResponse)
-> ((Maybe [FolderSummary] -> f (Maybe [FolderSummary]))
    -> Maybe [FolderSummary] -> f (Maybe [FolderSummary]))
-> (Maybe [FolderSummary] -> f (Maybe [FolderSummary]))
-> SearchFoldersResponse
-> f SearchFoldersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FolderSummary] [FolderSummary] [FolderSummary] [FolderSummary]
-> Iso
     (Maybe [FolderSummary])
     (Maybe [FolderSummary])
     (Maybe [FolderSummary])
     (Maybe [FolderSummary])
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
  [FolderSummary] [FolderSummary] [FolderSummary] [FolderSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The status. If succeeded, the status is @SC_OK@.
searchFoldersResponse_status :: Lens.Lens' SearchFoldersResponse Prelude.Int
searchFoldersResponse_status :: (Int -> f Int) -> SearchFoldersResponse -> f SearchFoldersResponse
searchFoldersResponse_status = (SearchFoldersResponse -> Int)
-> (SearchFoldersResponse -> Int -> SearchFoldersResponse)
-> Lens SearchFoldersResponse SearchFoldersResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchFoldersResponse' {Int
status :: Int
$sel:status:SearchFoldersResponse' :: SearchFoldersResponse -> Int
status} -> Int
status) (\s :: SearchFoldersResponse
s@SearchFoldersResponse' {} Int
a -> SearchFoldersResponse
s {$sel:status:SearchFoldersResponse' :: Int
status = Int
a} :: SearchFoldersResponse)

instance Prelude.NFData SearchFoldersResponse