{-# 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.SageMaker.ListSpaces
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists spaces.
--
-- This operation returns paginated results.
module Amazonka.SageMaker.ListSpaces
  ( -- * Creating a Request
    ListSpaces (..),
    newListSpaces,

    -- * Request Lenses
    listSpaces_domainIdEquals,
    listSpaces_maxResults,
    listSpaces_nextToken,
    listSpaces_sortBy,
    listSpaces_sortOrder,
    listSpaces_spaceNameContains,

    -- * Destructuring the Response
    ListSpacesResponse (..),
    newListSpacesResponse,

    -- * Response Lenses
    listSpacesResponse_nextToken,
    listSpacesResponse_spaces,
    listSpacesResponse_httpStatus,
  )
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types

-- | /See:/ 'newListSpaces' smart constructor.
data ListSpaces = ListSpaces'
  { -- | A parameter to search for the Domain ID.
    ListSpaces -> Maybe Text
domainIdEquals :: Prelude.Maybe Prelude.Text,
    -- | Returns a list up to a specified limit.
    ListSpaces -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the previous response was truncated, you will receive this token. Use
    -- it in your next request to receive the next set of results.
    ListSpaces -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The parameter by which to sort the results. The default is
    -- @CreationTime@.
    ListSpaces -> Maybe SpaceSortKey
sortBy :: Prelude.Maybe SpaceSortKey,
    -- | The sort order for the results. The default is @Ascending@.
    ListSpaces -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
    -- | A parameter by which to filter the results.
    ListSpaces -> Maybe Text
spaceNameContains :: Prelude.Maybe Prelude.Text
  }
  deriving (ListSpaces -> ListSpaces -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSpaces -> ListSpaces -> Bool
$c/= :: ListSpaces -> ListSpaces -> Bool
== :: ListSpaces -> ListSpaces -> Bool
$c== :: ListSpaces -> ListSpaces -> Bool
Prelude.Eq, ReadPrec [ListSpaces]
ReadPrec ListSpaces
Int -> ReadS ListSpaces
ReadS [ListSpaces]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSpaces]
$creadListPrec :: ReadPrec [ListSpaces]
readPrec :: ReadPrec ListSpaces
$creadPrec :: ReadPrec ListSpaces
readList :: ReadS [ListSpaces]
$creadList :: ReadS [ListSpaces]
readsPrec :: Int -> ReadS ListSpaces
$creadsPrec :: Int -> ReadS ListSpaces
Prelude.Read, Int -> ListSpaces -> ShowS
[ListSpaces] -> ShowS
ListSpaces -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSpaces] -> ShowS
$cshowList :: [ListSpaces] -> ShowS
show :: ListSpaces -> String
$cshow :: ListSpaces -> String
showsPrec :: Int -> ListSpaces -> ShowS
$cshowsPrec :: Int -> ListSpaces -> ShowS
Prelude.Show, forall x. Rep ListSpaces x -> ListSpaces
forall x. ListSpaces -> Rep ListSpaces x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSpaces x -> ListSpaces
$cfrom :: forall x. ListSpaces -> Rep ListSpaces x
Prelude.Generic)

-- |
-- Create a value of 'ListSpaces' 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:
--
-- 'domainIdEquals', 'listSpaces_domainIdEquals' - A parameter to search for the Domain ID.
--
-- 'maxResults', 'listSpaces_maxResults' - Returns a list up to a specified limit.
--
-- 'nextToken', 'listSpaces_nextToken' - If the previous response was truncated, you will receive this token. Use
-- it in your next request to receive the next set of results.
--
-- 'sortBy', 'listSpaces_sortBy' - The parameter by which to sort the results. The default is
-- @CreationTime@.
--
-- 'sortOrder', 'listSpaces_sortOrder' - The sort order for the results. The default is @Ascending@.
--
-- 'spaceNameContains', 'listSpaces_spaceNameContains' - A parameter by which to filter the results.
newListSpaces ::
  ListSpaces
newListSpaces :: ListSpaces
newListSpaces =
  ListSpaces'
    { $sel:domainIdEquals:ListSpaces' :: Maybe Text
domainIdEquals = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSpaces' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSpaces' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListSpaces' :: Maybe SpaceSortKey
sortBy = forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListSpaces' :: Maybe SortOrder
sortOrder = forall a. Maybe a
Prelude.Nothing,
      $sel:spaceNameContains:ListSpaces' :: Maybe Text
spaceNameContains = forall a. Maybe a
Prelude.Nothing
    }

-- | A parameter to search for the Domain ID.
listSpaces_domainIdEquals :: Lens.Lens' ListSpaces (Prelude.Maybe Prelude.Text)
listSpaces_domainIdEquals :: Lens' ListSpaces (Maybe Text)
listSpaces_domainIdEquals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpaces' {Maybe Text
domainIdEquals :: Maybe Text
$sel:domainIdEquals:ListSpaces' :: ListSpaces -> Maybe Text
domainIdEquals} -> Maybe Text
domainIdEquals) (\s :: ListSpaces
s@ListSpaces' {} Maybe Text
a -> ListSpaces
s {$sel:domainIdEquals:ListSpaces' :: Maybe Text
domainIdEquals = Maybe Text
a} :: ListSpaces)

-- | Returns a list up to a specified limit.
listSpaces_maxResults :: Lens.Lens' ListSpaces (Prelude.Maybe Prelude.Natural)
listSpaces_maxResults :: Lens' ListSpaces (Maybe Natural)
listSpaces_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpaces' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSpaces' :: ListSpaces -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSpaces
s@ListSpaces' {} Maybe Natural
a -> ListSpaces
s {$sel:maxResults:ListSpaces' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSpaces)

-- | If the previous response was truncated, you will receive this token. Use
-- it in your next request to receive the next set of results.
listSpaces_nextToken :: Lens.Lens' ListSpaces (Prelude.Maybe Prelude.Text)
listSpaces_nextToken :: Lens' ListSpaces (Maybe Text)
listSpaces_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpaces' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSpaces' :: ListSpaces -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSpaces
s@ListSpaces' {} Maybe Text
a -> ListSpaces
s {$sel:nextToken:ListSpaces' :: Maybe Text
nextToken = Maybe Text
a} :: ListSpaces)

-- | The parameter by which to sort the results. The default is
-- @CreationTime@.
listSpaces_sortBy :: Lens.Lens' ListSpaces (Prelude.Maybe SpaceSortKey)
listSpaces_sortBy :: Lens' ListSpaces (Maybe SpaceSortKey)
listSpaces_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpaces' {Maybe SpaceSortKey
sortBy :: Maybe SpaceSortKey
$sel:sortBy:ListSpaces' :: ListSpaces -> Maybe SpaceSortKey
sortBy} -> Maybe SpaceSortKey
sortBy) (\s :: ListSpaces
s@ListSpaces' {} Maybe SpaceSortKey
a -> ListSpaces
s {$sel:sortBy:ListSpaces' :: Maybe SpaceSortKey
sortBy = Maybe SpaceSortKey
a} :: ListSpaces)

-- | The sort order for the results. The default is @Ascending@.
listSpaces_sortOrder :: Lens.Lens' ListSpaces (Prelude.Maybe SortOrder)
listSpaces_sortOrder :: Lens' ListSpaces (Maybe SortOrder)
listSpaces_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpaces' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:ListSpaces' :: ListSpaces -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: ListSpaces
s@ListSpaces' {} Maybe SortOrder
a -> ListSpaces
s {$sel:sortOrder:ListSpaces' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: ListSpaces)

-- | A parameter by which to filter the results.
listSpaces_spaceNameContains :: Lens.Lens' ListSpaces (Prelude.Maybe Prelude.Text)
listSpaces_spaceNameContains :: Lens' ListSpaces (Maybe Text)
listSpaces_spaceNameContains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpaces' {Maybe Text
spaceNameContains :: Maybe Text
$sel:spaceNameContains:ListSpaces' :: ListSpaces -> Maybe Text
spaceNameContains} -> Maybe Text
spaceNameContains) (\s :: ListSpaces
s@ListSpaces' {} Maybe Text
a -> ListSpaces
s {$sel:spaceNameContains:ListSpaces' :: Maybe Text
spaceNameContains = Maybe Text
a} :: ListSpaces)

instance Core.AWSPager ListSpaces where
  page :: ListSpaces -> AWSResponse ListSpaces -> Maybe ListSpaces
page ListSpaces
rq AWSResponse ListSpaces
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSpaces
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSpacesResponse (Maybe Text)
listSpacesResponse_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 ListSpaces
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSpacesResponse (Maybe [SpaceDetails])
listSpacesResponse_spaces
            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.$ ListSpaces
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListSpaces (Maybe Text)
listSpaces_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSpaces
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSpacesResponse (Maybe Text)
listSpacesResponse_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 ListSpaces where
  type AWSResponse ListSpaces = ListSpacesResponse
  request :: (Service -> Service) -> ListSpaces -> Request ListSpaces
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 ListSpaces
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListSpaces)))
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 Text -> Maybe [SpaceDetails] -> Int -> ListSpacesResponse
ListSpacesResponse'
            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
"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
"Spaces" 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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListSpaces where
  hashWithSalt :: Int -> ListSpaces -> Int
hashWithSalt Int
_salt ListSpaces' {Maybe Natural
Maybe Text
Maybe SortOrder
Maybe SpaceSortKey
spaceNameContains :: Maybe Text
sortOrder :: Maybe SortOrder
sortBy :: Maybe SpaceSortKey
nextToken :: Maybe Text
maxResults :: Maybe Natural
domainIdEquals :: Maybe Text
$sel:spaceNameContains:ListSpaces' :: ListSpaces -> Maybe Text
$sel:sortOrder:ListSpaces' :: ListSpaces -> Maybe SortOrder
$sel:sortBy:ListSpaces' :: ListSpaces -> Maybe SpaceSortKey
$sel:nextToken:ListSpaces' :: ListSpaces -> Maybe Text
$sel:maxResults:ListSpaces' :: ListSpaces -> Maybe Natural
$sel:domainIdEquals:ListSpaces' :: ListSpaces -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainIdEquals
      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` Maybe SpaceSortKey
sortBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortOrder
sortOrder
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
spaceNameContains

instance Prelude.NFData ListSpaces where
  rnf :: ListSpaces -> ()
rnf ListSpaces' {Maybe Natural
Maybe Text
Maybe SortOrder
Maybe SpaceSortKey
spaceNameContains :: Maybe Text
sortOrder :: Maybe SortOrder
sortBy :: Maybe SpaceSortKey
nextToken :: Maybe Text
maxResults :: Maybe Natural
domainIdEquals :: Maybe Text
$sel:spaceNameContains:ListSpaces' :: ListSpaces -> Maybe Text
$sel:sortOrder:ListSpaces' :: ListSpaces -> Maybe SortOrder
$sel:sortBy:ListSpaces' :: ListSpaces -> Maybe SpaceSortKey
$sel:nextToken:ListSpaces' :: ListSpaces -> Maybe Text
$sel:maxResults:ListSpaces' :: ListSpaces -> Maybe Natural
$sel:domainIdEquals:ListSpaces' :: ListSpaces -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainIdEquals
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe SpaceSortKey
sortBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SortOrder
sortOrder
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
spaceNameContains

instance Data.ToHeaders ListSpaces where
  toHeaders :: ListSpaces -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"SageMaker.ListSpaces" :: Prelude.ByteString),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListSpaces where
  toJSON :: ListSpaces -> Value
toJSON ListSpaces' {Maybe Natural
Maybe Text
Maybe SortOrder
Maybe SpaceSortKey
spaceNameContains :: Maybe Text
sortOrder :: Maybe SortOrder
sortBy :: Maybe SpaceSortKey
nextToken :: Maybe Text
maxResults :: Maybe Natural
domainIdEquals :: Maybe Text
$sel:spaceNameContains:ListSpaces' :: ListSpaces -> Maybe Text
$sel:sortOrder:ListSpaces' :: ListSpaces -> Maybe SortOrder
$sel:sortBy:ListSpaces' :: ListSpaces -> Maybe SpaceSortKey
$sel:nextToken:ListSpaces' :: ListSpaces -> Maybe Text
$sel:maxResults:ListSpaces' :: ListSpaces -> Maybe Natural
$sel:domainIdEquals:ListSpaces' :: ListSpaces -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DomainIdEquals" 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
domainIdEquals,
            (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,
            (Key
"SortBy" 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 SpaceSortKey
sortBy,
            (Key
"SortOrder" 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 SortOrder
sortOrder,
            (Key
"SpaceNameContains" 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
spaceNameContains
          ]
      )

instance Data.ToPath ListSpaces where
  toPath :: ListSpaces -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListSpacesResponse' smart constructor.
data ListSpacesResponse = ListSpacesResponse'
  { -- | If the previous response was truncated, you will receive this token. Use
    -- it in your next request to receive the next set of results.
    ListSpacesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of spaces.
    ListSpacesResponse -> Maybe [SpaceDetails]
spaces :: Prelude.Maybe [SpaceDetails],
    -- | The response's http status code.
    ListSpacesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSpacesResponse -> ListSpacesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSpacesResponse -> ListSpacesResponse -> Bool
$c/= :: ListSpacesResponse -> ListSpacesResponse -> Bool
== :: ListSpacesResponse -> ListSpacesResponse -> Bool
$c== :: ListSpacesResponse -> ListSpacesResponse -> Bool
Prelude.Eq, ReadPrec [ListSpacesResponse]
ReadPrec ListSpacesResponse
Int -> ReadS ListSpacesResponse
ReadS [ListSpacesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSpacesResponse]
$creadListPrec :: ReadPrec [ListSpacesResponse]
readPrec :: ReadPrec ListSpacesResponse
$creadPrec :: ReadPrec ListSpacesResponse
readList :: ReadS [ListSpacesResponse]
$creadList :: ReadS [ListSpacesResponse]
readsPrec :: Int -> ReadS ListSpacesResponse
$creadsPrec :: Int -> ReadS ListSpacesResponse
Prelude.Read, Int -> ListSpacesResponse -> ShowS
[ListSpacesResponse] -> ShowS
ListSpacesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSpacesResponse] -> ShowS
$cshowList :: [ListSpacesResponse] -> ShowS
show :: ListSpacesResponse -> String
$cshow :: ListSpacesResponse -> String
showsPrec :: Int -> ListSpacesResponse -> ShowS
$cshowsPrec :: Int -> ListSpacesResponse -> ShowS
Prelude.Show, forall x. Rep ListSpacesResponse x -> ListSpacesResponse
forall x. ListSpacesResponse -> Rep ListSpacesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSpacesResponse x -> ListSpacesResponse
$cfrom :: forall x. ListSpacesResponse -> Rep ListSpacesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSpacesResponse' 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', 'listSpacesResponse_nextToken' - If the previous response was truncated, you will receive this token. Use
-- it in your next request to receive the next set of results.
--
-- 'spaces', 'listSpacesResponse_spaces' - The list of spaces.
--
-- 'httpStatus', 'listSpacesResponse_httpStatus' - The response's http status code.
newListSpacesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSpacesResponse
newListSpacesResponse :: Int -> ListSpacesResponse
newListSpacesResponse Int
pHttpStatus_ =
  ListSpacesResponse'
    { $sel:nextToken:ListSpacesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:spaces:ListSpacesResponse' :: Maybe [SpaceDetails]
spaces = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSpacesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If the previous response was truncated, you will receive this token. Use
-- it in your next request to receive the next set of results.
listSpacesResponse_nextToken :: Lens.Lens' ListSpacesResponse (Prelude.Maybe Prelude.Text)
listSpacesResponse_nextToken :: Lens' ListSpacesResponse (Maybe Text)
listSpacesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpacesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSpacesResponse' :: ListSpacesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSpacesResponse
s@ListSpacesResponse' {} Maybe Text
a -> ListSpacesResponse
s {$sel:nextToken:ListSpacesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSpacesResponse)

-- | The list of spaces.
listSpacesResponse_spaces :: Lens.Lens' ListSpacesResponse (Prelude.Maybe [SpaceDetails])
listSpacesResponse_spaces :: Lens' ListSpacesResponse (Maybe [SpaceDetails])
listSpacesResponse_spaces = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpacesResponse' {Maybe [SpaceDetails]
spaces :: Maybe [SpaceDetails]
$sel:spaces:ListSpacesResponse' :: ListSpacesResponse -> Maybe [SpaceDetails]
spaces} -> Maybe [SpaceDetails]
spaces) (\s :: ListSpacesResponse
s@ListSpacesResponse' {} Maybe [SpaceDetails]
a -> ListSpacesResponse
s {$sel:spaces:ListSpacesResponse' :: Maybe [SpaceDetails]
spaces = Maybe [SpaceDetails]
a} :: ListSpacesResponse) 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 response's http status code.
listSpacesResponse_httpStatus :: Lens.Lens' ListSpacesResponse Prelude.Int
listSpacesResponse_httpStatus :: Lens' ListSpacesResponse Int
listSpacesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSpacesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListSpacesResponse' :: ListSpacesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListSpacesResponse
s@ListSpacesResponse' {} Int
a -> ListSpacesResponse
s {$sel:httpStatus:ListSpacesResponse' :: Int
httpStatus = Int
a} :: ListSpacesResponse)

instance Prelude.NFData ListSpacesResponse where
  rnf :: ListSpacesResponse -> ()
rnf ListSpacesResponse' {Int
Maybe [SpaceDetails]
Maybe Text
httpStatus :: Int
spaces :: Maybe [SpaceDetails]
nextToken :: Maybe Text
$sel:httpStatus:ListSpacesResponse' :: ListSpacesResponse -> Int
$sel:spaces:ListSpacesResponse' :: ListSpacesResponse -> Maybe [SpaceDetails]
$sel:nextToken:ListSpacesResponse' :: ListSpacesResponse -> Maybe Text
..} =
    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 [SpaceDetails]
spaces
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus