{-# 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.ListSubscribedWorkteams
-- 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 the work teams that you are subscribed to in the Amazon
-- Web Services Marketplace. 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.ListSubscribedWorkteams
  ( -- * Creating a Request
    ListSubscribedWorkteams (..),
    newListSubscribedWorkteams,

    -- * Request Lenses
    listSubscribedWorkteams_nameContains,
    listSubscribedWorkteams_nextToken,
    listSubscribedWorkteams_maxResults,

    -- * Destructuring the Response
    ListSubscribedWorkteamsResponse (..),
    newListSubscribedWorkteamsResponse,

    -- * Response Lenses
    listSubscribedWorkteamsResponse_nextToken,
    listSubscribedWorkteamsResponse_httpStatus,
    listSubscribedWorkteamsResponse_subscribedWorkteams,
  )
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:/ 'newListSubscribedWorkteams' smart constructor.
data ListSubscribedWorkteams = ListSubscribedWorkteams'
  { -- | A string in the work team name. This filter returns only work teams
    -- whose name contains the specified string.
    ListSubscribedWorkteams -> Maybe Text
nameContains :: Prelude.Maybe Prelude.Text,
    -- | If the result of the previous @ListSubscribedWorkteams@ request was
    -- truncated, the response includes a @NextToken@. To retrieve the next set
    -- of labeling jobs, use the token in the next request.
    ListSubscribedWorkteams -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of work teams to return in each page of the response.
    ListSubscribedWorkteams -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListSubscribedWorkteams -> ListSubscribedWorkteams -> Bool
(ListSubscribedWorkteams -> ListSubscribedWorkteams -> Bool)
-> (ListSubscribedWorkteams -> ListSubscribedWorkteams -> Bool)
-> Eq ListSubscribedWorkteams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSubscribedWorkteams -> ListSubscribedWorkteams -> Bool
$c/= :: ListSubscribedWorkteams -> ListSubscribedWorkteams -> Bool
== :: ListSubscribedWorkteams -> ListSubscribedWorkteams -> Bool
$c== :: ListSubscribedWorkteams -> ListSubscribedWorkteams -> Bool
Prelude.Eq, ReadPrec [ListSubscribedWorkteams]
ReadPrec ListSubscribedWorkteams
Int -> ReadS ListSubscribedWorkteams
ReadS [ListSubscribedWorkteams]
(Int -> ReadS ListSubscribedWorkteams)
-> ReadS [ListSubscribedWorkteams]
-> ReadPrec ListSubscribedWorkteams
-> ReadPrec [ListSubscribedWorkteams]
-> Read ListSubscribedWorkteams
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSubscribedWorkteams]
$creadListPrec :: ReadPrec [ListSubscribedWorkteams]
readPrec :: ReadPrec ListSubscribedWorkteams
$creadPrec :: ReadPrec ListSubscribedWorkteams
readList :: ReadS [ListSubscribedWorkteams]
$creadList :: ReadS [ListSubscribedWorkteams]
readsPrec :: Int -> ReadS ListSubscribedWorkteams
$creadsPrec :: Int -> ReadS ListSubscribedWorkteams
Prelude.Read, Int -> ListSubscribedWorkteams -> ShowS
[ListSubscribedWorkteams] -> ShowS
ListSubscribedWorkteams -> String
(Int -> ListSubscribedWorkteams -> ShowS)
-> (ListSubscribedWorkteams -> String)
-> ([ListSubscribedWorkteams] -> ShowS)
-> Show ListSubscribedWorkteams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSubscribedWorkteams] -> ShowS
$cshowList :: [ListSubscribedWorkteams] -> ShowS
show :: ListSubscribedWorkteams -> String
$cshow :: ListSubscribedWorkteams -> String
showsPrec :: Int -> ListSubscribedWorkteams -> ShowS
$cshowsPrec :: Int -> ListSubscribedWorkteams -> ShowS
Prelude.Show, (forall x.
 ListSubscribedWorkteams -> Rep ListSubscribedWorkteams x)
-> (forall x.
    Rep ListSubscribedWorkteams x -> ListSubscribedWorkteams)
-> Generic ListSubscribedWorkteams
forall x. Rep ListSubscribedWorkteams x -> ListSubscribedWorkteams
forall x. ListSubscribedWorkteams -> Rep ListSubscribedWorkteams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSubscribedWorkteams x -> ListSubscribedWorkteams
$cfrom :: forall x. ListSubscribedWorkteams -> Rep ListSubscribedWorkteams x
Prelude.Generic)

-- |
-- Create a value of 'ListSubscribedWorkteams' 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', 'listSubscribedWorkteams_nameContains' - A string in the work team name. This filter returns only work teams
-- whose name contains the specified string.
--
-- 'nextToken', 'listSubscribedWorkteams_nextToken' - If the result of the previous @ListSubscribedWorkteams@ request was
-- truncated, the response includes a @NextToken@. To retrieve the next set
-- of labeling jobs, use the token in the next request.
--
-- 'maxResults', 'listSubscribedWorkteams_maxResults' - The maximum number of work teams to return in each page of the response.
newListSubscribedWorkteams ::
  ListSubscribedWorkteams
newListSubscribedWorkteams :: ListSubscribedWorkteams
newListSubscribedWorkteams =
  ListSubscribedWorkteams' :: Maybe Text
-> Maybe Text -> Maybe Natural -> ListSubscribedWorkteams
ListSubscribedWorkteams'
    { $sel:nameContains:ListSubscribedWorkteams' :: Maybe Text
nameContains =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSubscribedWorkteams' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSubscribedWorkteams' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

instance Prelude.Hashable ListSubscribedWorkteams

instance Prelude.NFData ListSubscribedWorkteams

instance Core.ToHeaders ListSubscribedWorkteams where
  toHeaders :: ListSubscribedWorkteams -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListSubscribedWorkteams -> 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.ListSubscribedWorkteams" ::
                          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 ListSubscribedWorkteams where
  toJSON :: ListSubscribedWorkteams -> Value
toJSON ListSubscribedWorkteams' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
nameContains :: Maybe Text
$sel:maxResults:ListSubscribedWorkteams' :: ListSubscribedWorkteams -> Maybe Natural
$sel:nextToken:ListSubscribedWorkteams' :: ListSubscribedWorkteams -> Maybe Text
$sel:nameContains:ListSubscribedWorkteams' :: ListSubscribedWorkteams -> 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
"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
          ]
      )

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

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

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

-- |
-- Create a value of 'ListSubscribedWorkteamsResponse' 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', 'listSubscribedWorkteamsResponse_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', 'listSubscribedWorkteamsResponse_httpStatus' - The response's http status code.
--
-- 'subscribedWorkteams', 'listSubscribedWorkteamsResponse_subscribedWorkteams' - An array of @Workteam@ objects, each describing a work team.
newListSubscribedWorkteamsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSubscribedWorkteamsResponse
newListSubscribedWorkteamsResponse :: Int -> ListSubscribedWorkteamsResponse
newListSubscribedWorkteamsResponse Int
pHttpStatus_ =
  ListSubscribedWorkteamsResponse' :: Maybe Text
-> Int -> [SubscribedWorkteam] -> ListSubscribedWorkteamsResponse
ListSubscribedWorkteamsResponse'
    { $sel:nextToken:ListSubscribedWorkteamsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSubscribedWorkteamsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:subscribedWorkteams:ListSubscribedWorkteamsResponse' :: [SubscribedWorkteam]
subscribedWorkteams = [SubscribedWorkteam]
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.
listSubscribedWorkteamsResponse_nextToken :: Lens.Lens' ListSubscribedWorkteamsResponse (Prelude.Maybe Prelude.Text)
listSubscribedWorkteamsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSubscribedWorkteamsResponse
-> f ListSubscribedWorkteamsResponse
listSubscribedWorkteamsResponse_nextToken = (ListSubscribedWorkteamsResponse -> Maybe Text)
-> (ListSubscribedWorkteamsResponse
    -> Maybe Text -> ListSubscribedWorkteamsResponse)
-> Lens' ListSubscribedWorkteamsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSubscribedWorkteamsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSubscribedWorkteamsResponse' :: ListSubscribedWorkteamsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSubscribedWorkteamsResponse
s@ListSubscribedWorkteamsResponse' {} Maybe Text
a -> ListSubscribedWorkteamsResponse
s {$sel:nextToken:ListSubscribedWorkteamsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSubscribedWorkteamsResponse)

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

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

instance
  Prelude.NFData
    ListSubscribedWorkteamsResponse