{-# 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.SearchDashboards
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Searches for dashboards that belong to a user.
--
-- This operation is eventually consistent. The results are best effort and
-- may not reflect very recent updates and changes.
--
-- This operation returns paginated results.
module Amazonka.QuickSight.SearchDashboards
  ( -- * Creating a Request
    SearchDashboards (..),
    newSearchDashboards,

    -- * Request Lenses
    searchDashboards_maxResults,
    searchDashboards_nextToken,
    searchDashboards_awsAccountId,
    searchDashboards_filters,

    -- * Destructuring the Response
    SearchDashboardsResponse (..),
    newSearchDashboardsResponse,

    -- * Response Lenses
    searchDashboardsResponse_dashboardSummaryList,
    searchDashboardsResponse_nextToken,
    searchDashboardsResponse_requestId,
    searchDashboardsResponse_status,
  )
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 Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newSearchDashboards' smart constructor.
data SearchDashboards = SearchDashboards'
  { -- | The maximum number of results to be returned per request.
    SearchDashboards -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next set of results, or null if there are no more
    -- results.
    SearchDashboards -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Web Services account that contains the user whose
    -- dashboards you\'re searching for.
    SearchDashboards -> Text
awsAccountId :: Prelude.Text,
    -- | The filters to apply to the search. Currently, you can search only by
    -- user name, for example,
    -- @\"Filters\": [ { \"Name\": \"QUICKSIGHT_USER\", \"Operator\": \"StringEquals\", \"Value\": \"arn:aws:quicksight:us-east-1:1:user\/default\/UserName1\" } ]@
    SearchDashboards -> NonEmpty DashboardSearchFilter
filters :: Prelude.NonEmpty DashboardSearchFilter
  }
  deriving (SearchDashboards -> SearchDashboards -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchDashboards -> SearchDashboards -> Bool
$c/= :: SearchDashboards -> SearchDashboards -> Bool
== :: SearchDashboards -> SearchDashboards -> Bool
$c== :: SearchDashboards -> SearchDashboards -> Bool
Prelude.Eq, ReadPrec [SearchDashboards]
ReadPrec SearchDashboards
Int -> ReadS SearchDashboards
ReadS [SearchDashboards]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchDashboards]
$creadListPrec :: ReadPrec [SearchDashboards]
readPrec :: ReadPrec SearchDashboards
$creadPrec :: ReadPrec SearchDashboards
readList :: ReadS [SearchDashboards]
$creadList :: ReadS [SearchDashboards]
readsPrec :: Int -> ReadS SearchDashboards
$creadsPrec :: Int -> ReadS SearchDashboards
Prelude.Read, Int -> SearchDashboards -> ShowS
[SearchDashboards] -> ShowS
SearchDashboards -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchDashboards] -> ShowS
$cshowList :: [SearchDashboards] -> ShowS
show :: SearchDashboards -> String
$cshow :: SearchDashboards -> String
showsPrec :: Int -> SearchDashboards -> ShowS
$cshowsPrec :: Int -> SearchDashboards -> ShowS
Prelude.Show, forall x. Rep SearchDashboards x -> SearchDashboards
forall x. SearchDashboards -> Rep SearchDashboards x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchDashboards x -> SearchDashboards
$cfrom :: forall x. SearchDashboards -> Rep SearchDashboards x
Prelude.Generic)

-- |
-- Create a value of 'SearchDashboards' 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:
--
-- 'maxResults', 'searchDashboards_maxResults' - The maximum number of results to be returned per request.
--
-- 'nextToken', 'searchDashboards_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'awsAccountId', 'searchDashboards_awsAccountId' - The ID of the Amazon Web Services account that contains the user whose
-- dashboards you\'re searching for.
--
-- 'filters', 'searchDashboards_filters' - The filters to apply to the search. Currently, you can search only by
-- user name, for example,
-- @\"Filters\": [ { \"Name\": \"QUICKSIGHT_USER\", \"Operator\": \"StringEquals\", \"Value\": \"arn:aws:quicksight:us-east-1:1:user\/default\/UserName1\" } ]@
newSearchDashboards ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'filters'
  Prelude.NonEmpty DashboardSearchFilter ->
  SearchDashboards
newSearchDashboards :: Text -> NonEmpty DashboardSearchFilter -> SearchDashboards
newSearchDashboards Text
pAwsAccountId_ NonEmpty DashboardSearchFilter
pFilters_ =
  SearchDashboards'
    { $sel:maxResults:SearchDashboards' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchDashboards' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:SearchDashboards' :: Text
awsAccountId = Text
pAwsAccountId_,
      $sel:filters:SearchDashboards' :: NonEmpty DashboardSearchFilter
filters = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty DashboardSearchFilter
pFilters_
    }

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

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

-- | The ID of the Amazon Web Services account that contains the user whose
-- dashboards you\'re searching for.
searchDashboards_awsAccountId :: Lens.Lens' SearchDashboards Prelude.Text
searchDashboards_awsAccountId :: Lens' SearchDashboards Text
searchDashboards_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchDashboards' {Text
awsAccountId :: Text
$sel:awsAccountId:SearchDashboards' :: SearchDashboards -> Text
awsAccountId} -> Text
awsAccountId) (\s :: SearchDashboards
s@SearchDashboards' {} Text
a -> SearchDashboards
s {$sel:awsAccountId:SearchDashboards' :: Text
awsAccountId = Text
a} :: SearchDashboards)

-- | The filters to apply to the search. Currently, you can search only by
-- user name, for example,
-- @\"Filters\": [ { \"Name\": \"QUICKSIGHT_USER\", \"Operator\": \"StringEquals\", \"Value\": \"arn:aws:quicksight:us-east-1:1:user\/default\/UserName1\" } ]@
searchDashboards_filters :: Lens.Lens' SearchDashboards (Prelude.NonEmpty DashboardSearchFilter)
searchDashboards_filters :: Lens' SearchDashboards (NonEmpty DashboardSearchFilter)
searchDashboards_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchDashboards' {NonEmpty DashboardSearchFilter
filters :: NonEmpty DashboardSearchFilter
$sel:filters:SearchDashboards' :: SearchDashboards -> NonEmpty DashboardSearchFilter
filters} -> NonEmpty DashboardSearchFilter
filters) (\s :: SearchDashboards
s@SearchDashboards' {} NonEmpty DashboardSearchFilter
a -> SearchDashboards
s {$sel:filters:SearchDashboards' :: NonEmpty DashboardSearchFilter
filters = NonEmpty DashboardSearchFilter
a} :: SearchDashboards) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager SearchDashboards where
  page :: SearchDashboards
-> AWSResponse SearchDashboards -> Maybe SearchDashboards
page SearchDashboards
rq AWSResponse SearchDashboards
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse SearchDashboards
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' SearchDashboardsResponse (Maybe Text)
searchDashboardsResponse_nextToken
            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 SearchDashboards
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' SearchDashboardsResponse (Maybe [DashboardSummary])
searchDashboardsResponse_dashboardSummaryList
            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.$ SearchDashboards
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' SearchDashboards (Maybe Text)
searchDashboards_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse SearchDashboards
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' SearchDashboardsResponse (Maybe Text)
searchDashboardsResponse_nextToken
          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 SearchDashboards where
  type
    AWSResponse SearchDashboards =
      SearchDashboardsResponse
  request :: (Service -> Service)
-> SearchDashboards -> Request SearchDashboards
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 SearchDashboards
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SearchDashboards)))
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 [DashboardSummary]
-> Maybe Text -> Maybe Text -> Int -> SearchDashboardsResponse
SearchDashboardsResponse'
            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
"DashboardSummaryList"
                            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
"NextToken")
            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
"RequestId")
            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 SearchDashboards where
  hashWithSalt :: Int -> SearchDashboards -> Int
hashWithSalt Int
_salt SearchDashboards' {Maybe Natural
Maybe Text
NonEmpty DashboardSearchFilter
Text
filters :: NonEmpty DashboardSearchFilter
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:filters:SearchDashboards' :: SearchDashboards -> NonEmpty DashboardSearchFilter
$sel:awsAccountId:SearchDashboards' :: SearchDashboards -> Text
$sel:nextToken:SearchDashboards' :: SearchDashboards -> Maybe Text
$sel:maxResults:SearchDashboards' :: SearchDashboards -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsAccountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty DashboardSearchFilter
filters

instance Prelude.NFData SearchDashboards where
  rnf :: SearchDashboards -> ()
rnf SearchDashboards' {Maybe Natural
Maybe Text
NonEmpty DashboardSearchFilter
Text
filters :: NonEmpty DashboardSearchFilter
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:filters:SearchDashboards' :: SearchDashboards -> NonEmpty DashboardSearchFilter
$sel:awsAccountId:SearchDashboards' :: SearchDashboards -> Text
$sel:nextToken:SearchDashboards' :: SearchDashboards -> Maybe Text
$sel:maxResults:SearchDashboards' :: SearchDashboards -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
awsAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty DashboardSearchFilter
filters

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

instance Data.ToJSON SearchDashboards where
  toJSON :: SearchDashboards -> Value
toJSON SearchDashboards' {Maybe Natural
Maybe Text
NonEmpty DashboardSearchFilter
Text
filters :: NonEmpty DashboardSearchFilter
awsAccountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:filters:SearchDashboards' :: SearchDashboards -> NonEmpty DashboardSearchFilter
$sel:awsAccountId:SearchDashboards' :: SearchDashboards -> Text
$sel:nextToken:SearchDashboards' :: SearchDashboards -> Maybe Text
$sel:maxResults:SearchDashboards' :: SearchDashboards -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxResults" 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
maxResults,
            (Key
"NextToken" 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
nextToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"Filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty DashboardSearchFilter
filters)
          ]
      )

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

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

-- | /See:/ 'newSearchDashboardsResponse' smart constructor.
data SearchDashboardsResponse = SearchDashboardsResponse'
  { -- | The list of dashboards owned by the user specified in @Filters@ in your
    -- request.
    SearchDashboardsResponse -> Maybe [DashboardSummary]
dashboardSummaryList :: Prelude.Maybe [DashboardSummary],
    -- | The token for the next set of results, or null if there are no more
    -- results.
    SearchDashboardsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services request ID for this operation.
    SearchDashboardsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    SearchDashboardsResponse -> Int
status :: Prelude.Int
  }
  deriving (SearchDashboardsResponse -> SearchDashboardsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchDashboardsResponse -> SearchDashboardsResponse -> Bool
$c/= :: SearchDashboardsResponse -> SearchDashboardsResponse -> Bool
== :: SearchDashboardsResponse -> SearchDashboardsResponse -> Bool
$c== :: SearchDashboardsResponse -> SearchDashboardsResponse -> Bool
Prelude.Eq, ReadPrec [SearchDashboardsResponse]
ReadPrec SearchDashboardsResponse
Int -> ReadS SearchDashboardsResponse
ReadS [SearchDashboardsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchDashboardsResponse]
$creadListPrec :: ReadPrec [SearchDashboardsResponse]
readPrec :: ReadPrec SearchDashboardsResponse
$creadPrec :: ReadPrec SearchDashboardsResponse
readList :: ReadS [SearchDashboardsResponse]
$creadList :: ReadS [SearchDashboardsResponse]
readsPrec :: Int -> ReadS SearchDashboardsResponse
$creadsPrec :: Int -> ReadS SearchDashboardsResponse
Prelude.Read, Int -> SearchDashboardsResponse -> ShowS
[SearchDashboardsResponse] -> ShowS
SearchDashboardsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchDashboardsResponse] -> ShowS
$cshowList :: [SearchDashboardsResponse] -> ShowS
show :: SearchDashboardsResponse -> String
$cshow :: SearchDashboardsResponse -> String
showsPrec :: Int -> SearchDashboardsResponse -> ShowS
$cshowsPrec :: Int -> SearchDashboardsResponse -> ShowS
Prelude.Show, forall x.
Rep SearchDashboardsResponse x -> SearchDashboardsResponse
forall x.
SearchDashboardsResponse -> Rep SearchDashboardsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchDashboardsResponse x -> SearchDashboardsResponse
$cfrom :: forall x.
SearchDashboardsResponse -> Rep SearchDashboardsResponse x
Prelude.Generic)

-- |
-- Create a value of 'SearchDashboardsResponse' 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:
--
-- 'dashboardSummaryList', 'searchDashboardsResponse_dashboardSummaryList' - The list of dashboards owned by the user specified in @Filters@ in your
-- request.
--
-- 'nextToken', 'searchDashboardsResponse_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'requestId', 'searchDashboardsResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'status', 'searchDashboardsResponse_status' - The HTTP status of the request.
newSearchDashboardsResponse ::
  -- | 'status'
  Prelude.Int ->
  SearchDashboardsResponse
newSearchDashboardsResponse :: Int -> SearchDashboardsResponse
newSearchDashboardsResponse Int
pStatus_ =
  SearchDashboardsResponse'
    { $sel:dashboardSummaryList:SearchDashboardsResponse' :: Maybe [DashboardSummary]
dashboardSummaryList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchDashboardsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:requestId:SearchDashboardsResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
      $sel:status:SearchDashboardsResponse' :: Int
status = Int
pStatus_
    }

-- | The list of dashboards owned by the user specified in @Filters@ in your
-- request.
searchDashboardsResponse_dashboardSummaryList :: Lens.Lens' SearchDashboardsResponse (Prelude.Maybe [DashboardSummary])
searchDashboardsResponse_dashboardSummaryList :: Lens' SearchDashboardsResponse (Maybe [DashboardSummary])
searchDashboardsResponse_dashboardSummaryList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchDashboardsResponse' {Maybe [DashboardSummary]
dashboardSummaryList :: Maybe [DashboardSummary]
$sel:dashboardSummaryList:SearchDashboardsResponse' :: SearchDashboardsResponse -> Maybe [DashboardSummary]
dashboardSummaryList} -> Maybe [DashboardSummary]
dashboardSummaryList) (\s :: SearchDashboardsResponse
s@SearchDashboardsResponse' {} Maybe [DashboardSummary]
a -> SearchDashboardsResponse
s {$sel:dashboardSummaryList:SearchDashboardsResponse' :: Maybe [DashboardSummary]
dashboardSummaryList = Maybe [DashboardSummary]
a} :: SearchDashboardsResponse) 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

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

-- | The Amazon Web Services request ID for this operation.
searchDashboardsResponse_requestId :: Lens.Lens' SearchDashboardsResponse (Prelude.Maybe Prelude.Text)
searchDashboardsResponse_requestId :: Lens' SearchDashboardsResponse (Maybe Text)
searchDashboardsResponse_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchDashboardsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:SearchDashboardsResponse' :: SearchDashboardsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: SearchDashboardsResponse
s@SearchDashboardsResponse' {} Maybe Text
a -> SearchDashboardsResponse
s {$sel:requestId:SearchDashboardsResponse' :: Maybe Text
requestId = Maybe Text
a} :: SearchDashboardsResponse)

-- | The HTTP status of the request.
searchDashboardsResponse_status :: Lens.Lens' SearchDashboardsResponse Prelude.Int
searchDashboardsResponse_status :: Lens' SearchDashboardsResponse Int
searchDashboardsResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchDashboardsResponse' {Int
status :: Int
$sel:status:SearchDashboardsResponse' :: SearchDashboardsResponse -> Int
status} -> Int
status) (\s :: SearchDashboardsResponse
s@SearchDashboardsResponse' {} Int
a -> SearchDashboardsResponse
s {$sel:status:SearchDashboardsResponse' :: Int
status = Int
a} :: SearchDashboardsResponse)

instance Prelude.NFData SearchDashboardsResponse where
  rnf :: SearchDashboardsResponse -> ()
rnf SearchDashboardsResponse' {Int
Maybe [DashboardSummary]
Maybe Text
status :: Int
requestId :: Maybe Text
nextToken :: Maybe Text
dashboardSummaryList :: Maybe [DashboardSummary]
$sel:status:SearchDashboardsResponse' :: SearchDashboardsResponse -> Int
$sel:requestId:SearchDashboardsResponse' :: SearchDashboardsResponse -> Maybe Text
$sel:nextToken:SearchDashboardsResponse' :: SearchDashboardsResponse -> Maybe Text
$sel:dashboardSummaryList:SearchDashboardsResponse' :: SearchDashboardsResponse -> Maybe [DashboardSummary]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [DashboardSummary]
dashboardSummaryList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
status