{-# 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.ListWorkteams
-- 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)
--
-- Gets a list of private work teams that you have defined in a region. The
-- list may be empty if no work team satisfies the filter specified in the
-- @NameContains@ parameter.
--
-- This operation returns paginated results.
module Amazonka.SageMaker.ListWorkteams
  ( -- * Creating a Request
    ListWorkteams (..),
    newListWorkteams,

    -- * Request Lenses
    listWorkteams_nameContains,
    listWorkteams_nextToken,
    listWorkteams_sortOrder,
    listWorkteams_maxResults,
    listWorkteams_sortBy,

    -- * Destructuring the Response
    ListWorkteamsResponse (..),
    newListWorkteamsResponse,

    -- * Response Lenses
    listWorkteamsResponse_nextToken,
    listWorkteamsResponse_httpStatus,
    listWorkteamsResponse_workteams,
  )
where

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

-- | /See:/ 'newListWorkteams' smart constructor.
data ListWorkteams = ListWorkteams'
  { -- | A string in the work team\'s name. This filter returns only work teams
    -- whose name contains the specified string.
    ListWorkteams -> Maybe Text
nameContains :: Prelude.Maybe Prelude.Text,
    -- | If the result of the previous @ListWorkteams@ request was truncated, the
    -- response includes a @NextToken@. To retrieve the next set of labeling
    -- jobs, use the token in the next request.
    ListWorkteams -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The sort order for results. The default is @Ascending@.
    ListWorkteams -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
    -- | The maximum number of work teams to return in each page of the response.
    ListWorkteams -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The field to sort results by. The default is @CreationTime@.
    ListWorkteams -> Maybe ListWorkteamsSortByOptions
sortBy :: Prelude.Maybe ListWorkteamsSortByOptions
  }
  deriving (ListWorkteams -> ListWorkteams -> Bool
(ListWorkteams -> ListWorkteams -> Bool)
-> (ListWorkteams -> ListWorkteams -> Bool) -> Eq ListWorkteams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWorkteams -> ListWorkteams -> Bool
$c/= :: ListWorkteams -> ListWorkteams -> Bool
== :: ListWorkteams -> ListWorkteams -> Bool
$c== :: ListWorkteams -> ListWorkteams -> Bool
Prelude.Eq, ReadPrec [ListWorkteams]
ReadPrec ListWorkteams
Int -> ReadS ListWorkteams
ReadS [ListWorkteams]
(Int -> ReadS ListWorkteams)
-> ReadS [ListWorkteams]
-> ReadPrec ListWorkteams
-> ReadPrec [ListWorkteams]
-> Read ListWorkteams
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWorkteams]
$creadListPrec :: ReadPrec [ListWorkteams]
readPrec :: ReadPrec ListWorkteams
$creadPrec :: ReadPrec ListWorkteams
readList :: ReadS [ListWorkteams]
$creadList :: ReadS [ListWorkteams]
readsPrec :: Int -> ReadS ListWorkteams
$creadsPrec :: Int -> ReadS ListWorkteams
Prelude.Read, Int -> ListWorkteams -> ShowS
[ListWorkteams] -> ShowS
ListWorkteams -> String
(Int -> ListWorkteams -> ShowS)
-> (ListWorkteams -> String)
-> ([ListWorkteams] -> ShowS)
-> Show ListWorkteams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWorkteams] -> ShowS
$cshowList :: [ListWorkteams] -> ShowS
show :: ListWorkteams -> String
$cshow :: ListWorkteams -> String
showsPrec :: Int -> ListWorkteams -> ShowS
$cshowsPrec :: Int -> ListWorkteams -> ShowS
Prelude.Show, (forall x. ListWorkteams -> Rep ListWorkteams x)
-> (forall x. Rep ListWorkteams x -> ListWorkteams)
-> Generic ListWorkteams
forall x. Rep ListWorkteams x -> ListWorkteams
forall x. ListWorkteams -> Rep ListWorkteams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListWorkteams x -> ListWorkteams
$cfrom :: forall x. ListWorkteams -> Rep ListWorkteams x
Prelude.Generic)

-- |
-- Create a value of 'ListWorkteams' 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:
--
-- 'nameContains', 'listWorkteams_nameContains' - A string in the work team\'s name. This filter returns only work teams
-- whose name contains the specified string.
--
-- 'nextToken', 'listWorkteams_nextToken' - If the result of the previous @ListWorkteams@ request was truncated, the
-- response includes a @NextToken@. To retrieve the next set of labeling
-- jobs, use the token in the next request.
--
-- 'sortOrder', 'listWorkteams_sortOrder' - The sort order for results. The default is @Ascending@.
--
-- 'maxResults', 'listWorkteams_maxResults' - The maximum number of work teams to return in each page of the response.
--
-- 'sortBy', 'listWorkteams_sortBy' - The field to sort results by. The default is @CreationTime@.
newListWorkteams ::
  ListWorkteams
newListWorkteams :: ListWorkteams
newListWorkteams =
  ListWorkteams' :: Maybe Text
-> Maybe Text
-> Maybe SortOrder
-> Maybe Natural
-> Maybe ListWorkteamsSortByOptions
-> ListWorkteams
ListWorkteams'
    { $sel:nameContains:ListWorkteams' :: Maybe Text
nameContains = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListWorkteams' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListWorkteams' :: Maybe SortOrder
sortOrder = Maybe SortOrder
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListWorkteams' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:ListWorkteams' :: Maybe ListWorkteamsSortByOptions
sortBy = Maybe ListWorkteamsSortByOptions
forall a. Maybe a
Prelude.Nothing
    }

-- | A string in the work team\'s name. This filter returns only work teams
-- whose name contains the specified string.
listWorkteams_nameContains :: Lens.Lens' ListWorkteams (Prelude.Maybe Prelude.Text)
listWorkteams_nameContains :: (Maybe Text -> f (Maybe Text)) -> ListWorkteams -> f ListWorkteams
listWorkteams_nameContains = (ListWorkteams -> Maybe Text)
-> (ListWorkteams -> Maybe Text -> ListWorkteams)
-> Lens ListWorkteams ListWorkteams (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkteams' {Maybe Text
nameContains :: Maybe Text
$sel:nameContains:ListWorkteams' :: ListWorkteams -> Maybe Text
nameContains} -> Maybe Text
nameContains) (\s :: ListWorkteams
s@ListWorkteams' {} Maybe Text
a -> ListWorkteams
s {$sel:nameContains:ListWorkteams' :: Maybe Text
nameContains = Maybe Text
a} :: ListWorkteams)

-- | If the result of the previous @ListWorkteams@ request was truncated, the
-- response includes a @NextToken@. To retrieve the next set of labeling
-- jobs, use the token in the next request.
listWorkteams_nextToken :: Lens.Lens' ListWorkteams (Prelude.Maybe Prelude.Text)
listWorkteams_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListWorkteams -> f ListWorkteams
listWorkteams_nextToken = (ListWorkteams -> Maybe Text)
-> (ListWorkteams -> Maybe Text -> ListWorkteams)
-> Lens ListWorkteams ListWorkteams (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkteams' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListWorkteams' :: ListWorkteams -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListWorkteams
s@ListWorkteams' {} Maybe Text
a -> ListWorkteams
s {$sel:nextToken:ListWorkteams' :: Maybe Text
nextToken = Maybe Text
a} :: ListWorkteams)

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

-- | The maximum number of work teams to return in each page of the response.
listWorkteams_maxResults :: Lens.Lens' ListWorkteams (Prelude.Maybe Prelude.Natural)
listWorkteams_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListWorkteams -> f ListWorkteams
listWorkteams_maxResults = (ListWorkteams -> Maybe Natural)
-> (ListWorkteams -> Maybe Natural -> ListWorkteams)
-> Lens ListWorkteams ListWorkteams (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkteams' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListWorkteams' :: ListWorkteams -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListWorkteams
s@ListWorkteams' {} Maybe Natural
a -> ListWorkteams
s {$sel:maxResults:ListWorkteams' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListWorkteams)

-- | The field to sort results by. The default is @CreationTime@.
listWorkteams_sortBy :: Lens.Lens' ListWorkteams (Prelude.Maybe ListWorkteamsSortByOptions)
listWorkteams_sortBy :: (Maybe ListWorkteamsSortByOptions
 -> f (Maybe ListWorkteamsSortByOptions))
-> ListWorkteams -> f ListWorkteams
listWorkteams_sortBy = (ListWorkteams -> Maybe ListWorkteamsSortByOptions)
-> (ListWorkteams
    -> Maybe ListWorkteamsSortByOptions -> ListWorkteams)
-> Lens
     ListWorkteams
     ListWorkteams
     (Maybe ListWorkteamsSortByOptions)
     (Maybe ListWorkteamsSortByOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkteams' {Maybe ListWorkteamsSortByOptions
sortBy :: Maybe ListWorkteamsSortByOptions
$sel:sortBy:ListWorkteams' :: ListWorkteams -> Maybe ListWorkteamsSortByOptions
sortBy} -> Maybe ListWorkteamsSortByOptions
sortBy) (\s :: ListWorkteams
s@ListWorkteams' {} Maybe ListWorkteamsSortByOptions
a -> ListWorkteams
s {$sel:sortBy:ListWorkteams' :: Maybe ListWorkteamsSortByOptions
sortBy = Maybe ListWorkteamsSortByOptions
a} :: ListWorkteams)

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

instance Prelude.Hashable ListWorkteams

instance Prelude.NFData ListWorkteams

instance Core.ToHeaders ListWorkteams where
  toHeaders :: ListWorkteams -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListWorkteams -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"SageMaker.ListWorkteams" :: Prelude.ByteString),
            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.ToJSON ListWorkteams where
  toJSON :: ListWorkteams -> Value
toJSON ListWorkteams' {Maybe Natural
Maybe Text
Maybe ListWorkteamsSortByOptions
Maybe SortOrder
sortBy :: Maybe ListWorkteamsSortByOptions
maxResults :: Maybe Natural
sortOrder :: Maybe SortOrder
nextToken :: Maybe Text
nameContains :: Maybe Text
$sel:sortBy:ListWorkteams' :: ListWorkteams -> Maybe ListWorkteamsSortByOptions
$sel:maxResults:ListWorkteams' :: ListWorkteams -> Maybe Natural
$sel:sortOrder:ListWorkteams' :: ListWorkteams -> Maybe SortOrder
$sel:nextToken:ListWorkteams' :: ListWorkteams -> Maybe Text
$sel:nameContains:ListWorkteams' :: ListWorkteams -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NameContains" 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
nameContains,
            (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
"SortOrder" Text -> SortOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortOrder -> Pair) -> Maybe SortOrder -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrder
sortOrder,
            (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,
            (Text
"SortBy" Text -> ListWorkteamsSortByOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ListWorkteamsSortByOptions -> Pair)
-> Maybe ListWorkteamsSortByOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ListWorkteamsSortByOptions
sortBy
          ]
      )

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

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

-- | /See:/ 'newListWorkteamsResponse' smart constructor.
data ListWorkteamsResponse = ListWorkteamsResponse'
  { -- | If the response is truncated, Amazon SageMaker returns this token. To
    -- retrieve the next set of work teams, use it in the subsequent request.
    ListWorkteamsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListWorkteamsResponse -> Int
httpStatus :: Prelude.Int,
    -- | An array of @Workteam@ objects, each describing a work team.
    ListWorkteamsResponse -> [Workteam]
workteams :: [Workteam]
  }
  deriving (ListWorkteamsResponse -> ListWorkteamsResponse -> Bool
(ListWorkteamsResponse -> ListWorkteamsResponse -> Bool)
-> (ListWorkteamsResponse -> ListWorkteamsResponse -> Bool)
-> Eq ListWorkteamsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWorkteamsResponse -> ListWorkteamsResponse -> Bool
$c/= :: ListWorkteamsResponse -> ListWorkteamsResponse -> Bool
== :: ListWorkteamsResponse -> ListWorkteamsResponse -> Bool
$c== :: ListWorkteamsResponse -> ListWorkteamsResponse -> Bool
Prelude.Eq, ReadPrec [ListWorkteamsResponse]
ReadPrec ListWorkteamsResponse
Int -> ReadS ListWorkteamsResponse
ReadS [ListWorkteamsResponse]
(Int -> ReadS ListWorkteamsResponse)
-> ReadS [ListWorkteamsResponse]
-> ReadPrec ListWorkteamsResponse
-> ReadPrec [ListWorkteamsResponse]
-> Read ListWorkteamsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWorkteamsResponse]
$creadListPrec :: ReadPrec [ListWorkteamsResponse]
readPrec :: ReadPrec ListWorkteamsResponse
$creadPrec :: ReadPrec ListWorkteamsResponse
readList :: ReadS [ListWorkteamsResponse]
$creadList :: ReadS [ListWorkteamsResponse]
readsPrec :: Int -> ReadS ListWorkteamsResponse
$creadsPrec :: Int -> ReadS ListWorkteamsResponse
Prelude.Read, Int -> ListWorkteamsResponse -> ShowS
[ListWorkteamsResponse] -> ShowS
ListWorkteamsResponse -> String
(Int -> ListWorkteamsResponse -> ShowS)
-> (ListWorkteamsResponse -> String)
-> ([ListWorkteamsResponse] -> ShowS)
-> Show ListWorkteamsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWorkteamsResponse] -> ShowS
$cshowList :: [ListWorkteamsResponse] -> ShowS
show :: ListWorkteamsResponse -> String
$cshow :: ListWorkteamsResponse -> String
showsPrec :: Int -> ListWorkteamsResponse -> ShowS
$cshowsPrec :: Int -> ListWorkteamsResponse -> ShowS
Prelude.Show, (forall x. ListWorkteamsResponse -> Rep ListWorkteamsResponse x)
-> (forall x. Rep ListWorkteamsResponse x -> ListWorkteamsResponse)
-> Generic ListWorkteamsResponse
forall x. Rep ListWorkteamsResponse x -> ListWorkteamsResponse
forall x. ListWorkteamsResponse -> Rep ListWorkteamsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListWorkteamsResponse x -> ListWorkteamsResponse
$cfrom :: forall x. ListWorkteamsResponse -> Rep ListWorkteamsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListWorkteamsResponse' 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', 'listWorkteamsResponse_nextToken' - If the response is truncated, Amazon SageMaker returns this token. To
-- retrieve the next set of work teams, use it in the subsequent request.
--
-- 'httpStatus', 'listWorkteamsResponse_httpStatus' - The response's http status code.
--
-- 'workteams', 'listWorkteamsResponse_workteams' - An array of @Workteam@ objects, each describing a work team.
newListWorkteamsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListWorkteamsResponse
newListWorkteamsResponse :: Int -> ListWorkteamsResponse
newListWorkteamsResponse Int
pHttpStatus_ =
  ListWorkteamsResponse' :: Maybe Text -> Int -> [Workteam] -> ListWorkteamsResponse
ListWorkteamsResponse'
    { $sel:nextToken:ListWorkteamsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListWorkteamsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:workteams:ListWorkteamsResponse' :: [Workteam]
workteams = [Workteam]
forall a. Monoid a => a
Prelude.mempty
    }

-- | If the response is truncated, Amazon SageMaker returns this token. To
-- retrieve the next set of work teams, use it in the subsequent request.
listWorkteamsResponse_nextToken :: Lens.Lens' ListWorkteamsResponse (Prelude.Maybe Prelude.Text)
listWorkteamsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListWorkteamsResponse -> f ListWorkteamsResponse
listWorkteamsResponse_nextToken = (ListWorkteamsResponse -> Maybe Text)
-> (ListWorkteamsResponse -> Maybe Text -> ListWorkteamsResponse)
-> Lens' ListWorkteamsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkteamsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListWorkteamsResponse' :: ListWorkteamsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListWorkteamsResponse
s@ListWorkteamsResponse' {} Maybe Text
a -> ListWorkteamsResponse
s {$sel:nextToken:ListWorkteamsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListWorkteamsResponse)

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

-- | An array of @Workteam@ objects, each describing a work team.
listWorkteamsResponse_workteams :: Lens.Lens' ListWorkteamsResponse [Workteam]
listWorkteamsResponse_workteams :: ([Workteam] -> f [Workteam])
-> ListWorkteamsResponse -> f ListWorkteamsResponse
listWorkteamsResponse_workteams = (ListWorkteamsResponse -> [Workteam])
-> (ListWorkteamsResponse -> [Workteam] -> ListWorkteamsResponse)
-> Lens' ListWorkteamsResponse [Workteam]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkteamsResponse' {[Workteam]
workteams :: [Workteam]
$sel:workteams:ListWorkteamsResponse' :: ListWorkteamsResponse -> [Workteam]
workteams} -> [Workteam]
workteams) (\s :: ListWorkteamsResponse
s@ListWorkteamsResponse' {} [Workteam]
a -> ListWorkteamsResponse
s {$sel:workteams:ListWorkteamsResponse' :: [Workteam]
workteams = [Workteam]
a} :: ListWorkteamsResponse) (([Workteam] -> f [Workteam])
 -> ListWorkteamsResponse -> f ListWorkteamsResponse)
-> (([Workteam] -> f [Workteam]) -> [Workteam] -> f [Workteam])
-> ([Workteam] -> f [Workteam])
-> ListWorkteamsResponse
-> f ListWorkteamsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Workteam] -> f [Workteam]) -> [Workteam] -> f [Workteam]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListWorkteamsResponse