{-# 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.AMP.ListWorkspaces
-- 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)
--
-- Lists all AMP workspaces, including workspaces being created or deleted.
--
-- This operation returns paginated results.
module Amazonka.AMP.ListWorkspaces
  ( -- * Creating a Request
    ListWorkspaces (..),
    newListWorkspaces,

    -- * Request Lenses
    listWorkspaces_alias,
    listWorkspaces_nextToken,
    listWorkspaces_maxResults,

    -- * Destructuring the Response
    ListWorkspacesResponse (..),
    newListWorkspacesResponse,

    -- * Response Lenses
    listWorkspacesResponse_nextToken,
    listWorkspacesResponse_httpStatus,
    listWorkspacesResponse_workspaces,
  )
where

import Amazonka.AMP.Types
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

-- | Represents the input of a ListWorkspaces operation.
--
-- /See:/ 'newListWorkspaces' smart constructor.
data ListWorkspaces = ListWorkspaces'
  { -- | Optional filter for workspace alias. Only the workspaces with aliases
    -- that begin with this value will be returned.
    ListWorkspaces -> Maybe Text
alias :: Prelude.Maybe Prelude.Text,
    -- | Pagination token to request the next page in a paginated list. This
    -- token is obtained from the output of the previous ListWorkspaces
    -- request.
    ListWorkspaces -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Maximum results to return in response (default=100, maximum=1000).
    ListWorkspaces -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListWorkspaces -> ListWorkspaces -> Bool
(ListWorkspaces -> ListWorkspaces -> Bool)
-> (ListWorkspaces -> ListWorkspaces -> Bool) -> Eq ListWorkspaces
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWorkspaces -> ListWorkspaces -> Bool
$c/= :: ListWorkspaces -> ListWorkspaces -> Bool
== :: ListWorkspaces -> ListWorkspaces -> Bool
$c== :: ListWorkspaces -> ListWorkspaces -> Bool
Prelude.Eq, ReadPrec [ListWorkspaces]
ReadPrec ListWorkspaces
Int -> ReadS ListWorkspaces
ReadS [ListWorkspaces]
(Int -> ReadS ListWorkspaces)
-> ReadS [ListWorkspaces]
-> ReadPrec ListWorkspaces
-> ReadPrec [ListWorkspaces]
-> Read ListWorkspaces
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWorkspaces]
$creadListPrec :: ReadPrec [ListWorkspaces]
readPrec :: ReadPrec ListWorkspaces
$creadPrec :: ReadPrec ListWorkspaces
readList :: ReadS [ListWorkspaces]
$creadList :: ReadS [ListWorkspaces]
readsPrec :: Int -> ReadS ListWorkspaces
$creadsPrec :: Int -> ReadS ListWorkspaces
Prelude.Read, Int -> ListWorkspaces -> ShowS
[ListWorkspaces] -> ShowS
ListWorkspaces -> String
(Int -> ListWorkspaces -> ShowS)
-> (ListWorkspaces -> String)
-> ([ListWorkspaces] -> ShowS)
-> Show ListWorkspaces
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWorkspaces] -> ShowS
$cshowList :: [ListWorkspaces] -> ShowS
show :: ListWorkspaces -> String
$cshow :: ListWorkspaces -> String
showsPrec :: Int -> ListWorkspaces -> ShowS
$cshowsPrec :: Int -> ListWorkspaces -> ShowS
Prelude.Show, (forall x. ListWorkspaces -> Rep ListWorkspaces x)
-> (forall x. Rep ListWorkspaces x -> ListWorkspaces)
-> Generic ListWorkspaces
forall x. Rep ListWorkspaces x -> ListWorkspaces
forall x. ListWorkspaces -> Rep ListWorkspaces x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListWorkspaces x -> ListWorkspaces
$cfrom :: forall x. ListWorkspaces -> Rep ListWorkspaces x
Prelude.Generic)

-- |
-- Create a value of 'ListWorkspaces' 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:
--
-- 'alias', 'listWorkspaces_alias' - Optional filter for workspace alias. Only the workspaces with aliases
-- that begin with this value will be returned.
--
-- 'nextToken', 'listWorkspaces_nextToken' - Pagination token to request the next page in a paginated list. This
-- token is obtained from the output of the previous ListWorkspaces
-- request.
--
-- 'maxResults', 'listWorkspaces_maxResults' - Maximum results to return in response (default=100, maximum=1000).
newListWorkspaces ::
  ListWorkspaces
newListWorkspaces :: ListWorkspaces
newListWorkspaces =
  ListWorkspaces' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListWorkspaces
ListWorkspaces'
    { $sel:alias:ListWorkspaces' :: Maybe Text
alias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListWorkspaces' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListWorkspaces' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Optional filter for workspace alias. Only the workspaces with aliases
-- that begin with this value will be returned.
listWorkspaces_alias :: Lens.Lens' ListWorkspaces (Prelude.Maybe Prelude.Text)
listWorkspaces_alias :: (Maybe Text -> f (Maybe Text))
-> ListWorkspaces -> f ListWorkspaces
listWorkspaces_alias = (ListWorkspaces -> Maybe Text)
-> (ListWorkspaces -> Maybe Text -> ListWorkspaces)
-> Lens ListWorkspaces ListWorkspaces (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkspaces' {Maybe Text
alias :: Maybe Text
$sel:alias:ListWorkspaces' :: ListWorkspaces -> Maybe Text
alias} -> Maybe Text
alias) (\s :: ListWorkspaces
s@ListWorkspaces' {} Maybe Text
a -> ListWorkspaces
s {$sel:alias:ListWorkspaces' :: Maybe Text
alias = Maybe Text
a} :: ListWorkspaces)

-- | Pagination token to request the next page in a paginated list. This
-- token is obtained from the output of the previous ListWorkspaces
-- request.
listWorkspaces_nextToken :: Lens.Lens' ListWorkspaces (Prelude.Maybe Prelude.Text)
listWorkspaces_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListWorkspaces -> f ListWorkspaces
listWorkspaces_nextToken = (ListWorkspaces -> Maybe Text)
-> (ListWorkspaces -> Maybe Text -> ListWorkspaces)
-> Lens ListWorkspaces ListWorkspaces (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkspaces' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListWorkspaces' :: ListWorkspaces -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListWorkspaces
s@ListWorkspaces' {} Maybe Text
a -> ListWorkspaces
s {$sel:nextToken:ListWorkspaces' :: Maybe Text
nextToken = Maybe Text
a} :: ListWorkspaces)

-- | Maximum results to return in response (default=100, maximum=1000).
listWorkspaces_maxResults :: Lens.Lens' ListWorkspaces (Prelude.Maybe Prelude.Natural)
listWorkspaces_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListWorkspaces -> f ListWorkspaces
listWorkspaces_maxResults = (ListWorkspaces -> Maybe Natural)
-> (ListWorkspaces -> Maybe Natural -> ListWorkspaces)
-> Lens
     ListWorkspaces ListWorkspaces (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkspaces' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListWorkspaces' :: ListWorkspaces -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListWorkspaces
s@ListWorkspaces' {} Maybe Natural
a -> ListWorkspaces
s {$sel:maxResults:ListWorkspaces' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListWorkspaces)

instance Core.AWSPager ListWorkspaces where
  page :: ListWorkspaces
-> AWSResponse ListWorkspaces -> Maybe ListWorkspaces
page ListWorkspaces
rq AWSResponse ListWorkspaces
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListWorkspaces
ListWorkspacesResponse
rs
            ListWorkspacesResponse
-> Getting (First Text) ListWorkspacesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListWorkspacesResponse
-> Const (First Text) ListWorkspacesResponse
Lens' ListWorkspacesResponse (Maybe Text)
listWorkspacesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListWorkspacesResponse
 -> Const (First Text) ListWorkspacesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListWorkspacesResponse 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 ListWorkspaces
forall a. Maybe a
Prelude.Nothing
    | [WorkspaceSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListWorkspaces
ListWorkspacesResponse
rs ListWorkspacesResponse
-> Getting
     [WorkspaceSummary] ListWorkspacesResponse [WorkspaceSummary]
-> [WorkspaceSummary]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [WorkspaceSummary] ListWorkspacesResponse [WorkspaceSummary]
Lens' ListWorkspacesResponse [WorkspaceSummary]
listWorkspacesResponse_workspaces) =
      Maybe ListWorkspaces
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListWorkspaces -> Maybe ListWorkspaces
forall a. a -> Maybe a
Prelude.Just (ListWorkspaces -> Maybe ListWorkspaces)
-> ListWorkspaces -> Maybe ListWorkspaces
forall a b. (a -> b) -> a -> b
Prelude.$
        ListWorkspaces
rq
          ListWorkspaces
-> (ListWorkspaces -> ListWorkspaces) -> ListWorkspaces
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListWorkspaces -> Identity ListWorkspaces
Lens ListWorkspaces ListWorkspaces (Maybe Text) (Maybe Text)
listWorkspaces_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListWorkspaces -> Identity ListWorkspaces)
-> Maybe Text -> ListWorkspaces -> ListWorkspaces
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListWorkspaces
ListWorkspacesResponse
rs
          ListWorkspacesResponse
-> Getting (First Text) ListWorkspacesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListWorkspacesResponse
-> Const (First Text) ListWorkspacesResponse
Lens' ListWorkspacesResponse (Maybe Text)
listWorkspacesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListWorkspacesResponse
 -> Const (First Text) ListWorkspacesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListWorkspacesResponse 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 ListWorkspaces where
  type
    AWSResponse ListWorkspaces =
      ListWorkspacesResponse
  request :: ListWorkspaces -> Request ListWorkspaces
request = Service -> ListWorkspaces -> Request ListWorkspaces
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListWorkspaces
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListWorkspaces)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListWorkspaces))
-> Logger
-> Service
-> Proxy ListWorkspaces
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListWorkspaces)))
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 -> Int -> [WorkspaceSummary] -> ListWorkspacesResponse
ListWorkspacesResponse'
            (Maybe Text -> Int -> [WorkspaceSummary] -> ListWorkspacesResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> [WorkspaceSummary] -> ListWorkspacesResponse)
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
"nextToken")
            Either String (Int -> [WorkspaceSummary] -> ListWorkspacesResponse)
-> Either String Int
-> Either String ([WorkspaceSummary] -> ListWorkspacesResponse)
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))
            Either String ([WorkspaceSummary] -> ListWorkspacesResponse)
-> Either String [WorkspaceSummary]
-> Either String ListWorkspacesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [WorkspaceSummary])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"workspaces" Either String (Maybe [WorkspaceSummary])
-> [WorkspaceSummary] -> Either String [WorkspaceSummary]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [WorkspaceSummary]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListWorkspaces

instance Prelude.NFData ListWorkspaces

instance Core.ToHeaders ListWorkspaces where
  toHeaders :: ListWorkspaces -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListWorkspaces -> 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.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath ListWorkspaces where
  toPath :: ListWorkspaces -> ByteString
toPath = ByteString -> ListWorkspaces -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/workspaces"

instance Core.ToQuery ListWorkspaces where
  toQuery :: ListWorkspaces -> QueryString
toQuery ListWorkspaces' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
alias :: Maybe Text
$sel:maxResults:ListWorkspaces' :: ListWorkspaces -> Maybe Natural
$sel:nextToken:ListWorkspaces' :: ListWorkspaces -> Maybe Text
$sel:alias:ListWorkspaces' :: ListWorkspaces -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"alias" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
alias,
        ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | Represents the output of a ListWorkspaces operation.
--
-- /See:/ 'newListWorkspacesResponse' smart constructor.
data ListWorkspacesResponse = ListWorkspacesResponse'
  { -- | Pagination token to use when requesting the next page in this list.
    ListWorkspacesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListWorkspacesResponse -> Int
httpStatus :: Prelude.Int,
    -- | The list of existing workspaces, including those undergoing creation or
    -- deletion.
    ListWorkspacesResponse -> [WorkspaceSummary]
workspaces :: [WorkspaceSummary]
  }
  deriving (ListWorkspacesResponse -> ListWorkspacesResponse -> Bool
(ListWorkspacesResponse -> ListWorkspacesResponse -> Bool)
-> (ListWorkspacesResponse -> ListWorkspacesResponse -> Bool)
-> Eq ListWorkspacesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWorkspacesResponse -> ListWorkspacesResponse -> Bool
$c/= :: ListWorkspacesResponse -> ListWorkspacesResponse -> Bool
== :: ListWorkspacesResponse -> ListWorkspacesResponse -> Bool
$c== :: ListWorkspacesResponse -> ListWorkspacesResponse -> Bool
Prelude.Eq, ReadPrec [ListWorkspacesResponse]
ReadPrec ListWorkspacesResponse
Int -> ReadS ListWorkspacesResponse
ReadS [ListWorkspacesResponse]
(Int -> ReadS ListWorkspacesResponse)
-> ReadS [ListWorkspacesResponse]
-> ReadPrec ListWorkspacesResponse
-> ReadPrec [ListWorkspacesResponse]
-> Read ListWorkspacesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWorkspacesResponse]
$creadListPrec :: ReadPrec [ListWorkspacesResponse]
readPrec :: ReadPrec ListWorkspacesResponse
$creadPrec :: ReadPrec ListWorkspacesResponse
readList :: ReadS [ListWorkspacesResponse]
$creadList :: ReadS [ListWorkspacesResponse]
readsPrec :: Int -> ReadS ListWorkspacesResponse
$creadsPrec :: Int -> ReadS ListWorkspacesResponse
Prelude.Read, Int -> ListWorkspacesResponse -> ShowS
[ListWorkspacesResponse] -> ShowS
ListWorkspacesResponse -> String
(Int -> ListWorkspacesResponse -> ShowS)
-> (ListWorkspacesResponse -> String)
-> ([ListWorkspacesResponse] -> ShowS)
-> Show ListWorkspacesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWorkspacesResponse] -> ShowS
$cshowList :: [ListWorkspacesResponse] -> ShowS
show :: ListWorkspacesResponse -> String
$cshow :: ListWorkspacesResponse -> String
showsPrec :: Int -> ListWorkspacesResponse -> ShowS
$cshowsPrec :: Int -> ListWorkspacesResponse -> ShowS
Prelude.Show, (forall x. ListWorkspacesResponse -> Rep ListWorkspacesResponse x)
-> (forall x.
    Rep ListWorkspacesResponse x -> ListWorkspacesResponse)
-> Generic ListWorkspacesResponse
forall x. Rep ListWorkspacesResponse x -> ListWorkspacesResponse
forall x. ListWorkspacesResponse -> Rep ListWorkspacesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListWorkspacesResponse x -> ListWorkspacesResponse
$cfrom :: forall x. ListWorkspacesResponse -> Rep ListWorkspacesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListWorkspacesResponse' 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', 'listWorkspacesResponse_nextToken' - Pagination token to use when requesting the next page in this list.
--
-- 'httpStatus', 'listWorkspacesResponse_httpStatus' - The response's http status code.
--
-- 'workspaces', 'listWorkspacesResponse_workspaces' - The list of existing workspaces, including those undergoing creation or
-- deletion.
newListWorkspacesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListWorkspacesResponse
newListWorkspacesResponse :: Int -> ListWorkspacesResponse
newListWorkspacesResponse Int
pHttpStatus_ =
  ListWorkspacesResponse' :: Maybe Text -> Int -> [WorkspaceSummary] -> ListWorkspacesResponse
ListWorkspacesResponse'
    { $sel:nextToken:ListWorkspacesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListWorkspacesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:workspaces:ListWorkspacesResponse' :: [WorkspaceSummary]
workspaces = [WorkspaceSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | Pagination token to use when requesting the next page in this list.
listWorkspacesResponse_nextToken :: Lens.Lens' ListWorkspacesResponse (Prelude.Maybe Prelude.Text)
listWorkspacesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListWorkspacesResponse -> f ListWorkspacesResponse
listWorkspacesResponse_nextToken = (ListWorkspacesResponse -> Maybe Text)
-> (ListWorkspacesResponse -> Maybe Text -> ListWorkspacesResponse)
-> Lens' ListWorkspacesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkspacesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListWorkspacesResponse' :: ListWorkspacesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListWorkspacesResponse
s@ListWorkspacesResponse' {} Maybe Text
a -> ListWorkspacesResponse
s {$sel:nextToken:ListWorkspacesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListWorkspacesResponse)

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

-- | The list of existing workspaces, including those undergoing creation or
-- deletion.
listWorkspacesResponse_workspaces :: Lens.Lens' ListWorkspacesResponse [WorkspaceSummary]
listWorkspacesResponse_workspaces :: ([WorkspaceSummary] -> f [WorkspaceSummary])
-> ListWorkspacesResponse -> f ListWorkspacesResponse
listWorkspacesResponse_workspaces = (ListWorkspacesResponse -> [WorkspaceSummary])
-> (ListWorkspacesResponse
    -> [WorkspaceSummary] -> ListWorkspacesResponse)
-> Lens' ListWorkspacesResponse [WorkspaceSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkspacesResponse' {[WorkspaceSummary]
workspaces :: [WorkspaceSummary]
$sel:workspaces:ListWorkspacesResponse' :: ListWorkspacesResponse -> [WorkspaceSummary]
workspaces} -> [WorkspaceSummary]
workspaces) (\s :: ListWorkspacesResponse
s@ListWorkspacesResponse' {} [WorkspaceSummary]
a -> ListWorkspacesResponse
s {$sel:workspaces:ListWorkspacesResponse' :: [WorkspaceSummary]
workspaces = [WorkspaceSummary]
a} :: ListWorkspacesResponse) (([WorkspaceSummary] -> f [WorkspaceSummary])
 -> ListWorkspacesResponse -> f ListWorkspacesResponse)
-> (([WorkspaceSummary] -> f [WorkspaceSummary])
    -> [WorkspaceSummary] -> f [WorkspaceSummary])
-> ([WorkspaceSummary] -> f [WorkspaceSummary])
-> ListWorkspacesResponse
-> f ListWorkspacesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([WorkspaceSummary] -> f [WorkspaceSummary])
-> [WorkspaceSummary] -> f [WorkspaceSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListWorkspacesResponse