{-# 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.CreateWorkteam
-- 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)
--
-- Creates a new work team for labeling your data. A work team is defined
-- by one or more Amazon Cognito user pools. You must first create the user
-- pools before you can create a work team.
--
-- You cannot create more than 25 work teams in an account and region.
module Amazonka.SageMaker.CreateWorkteam
  ( -- * Creating a Request
    CreateWorkteam (..),
    newCreateWorkteam,

    -- * Request Lenses
    createWorkteam_notificationConfiguration,
    createWorkteam_workforceName,
    createWorkteam_tags,
    createWorkteam_workteamName,
    createWorkteam_memberDefinitions,
    createWorkteam_description,

    -- * Destructuring the Response
    CreateWorkteamResponse (..),
    newCreateWorkteamResponse,

    -- * Response Lenses
    createWorkteamResponse_workteamArn,
    createWorkteamResponse_httpStatus,
  )
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:/ 'newCreateWorkteam' smart constructor.
data CreateWorkteam = CreateWorkteam'
  { -- | Configures notification of workers regarding available or expiring work
    -- items.
    CreateWorkteam -> Maybe NotificationConfiguration
notificationConfiguration :: Prelude.Maybe NotificationConfiguration,
    -- | The name of the workforce.
    CreateWorkteam -> Maybe Text
workforceName :: Prelude.Maybe Prelude.Text,
    -- | An array of key-value pairs.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html Resource Tag>
    -- and
    -- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what Using Cost Allocation Tags>
    -- in the /Amazon Web Services Billing and Cost Management User Guide/.
    CreateWorkteam -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the work team. Use this name to identify the work team.
    CreateWorkteam -> Text
workteamName :: Prelude.Text,
    -- | A list of @MemberDefinition@ objects that contains objects that identify
    -- the workers that make up the work team.
    --
    -- Workforces can be created using Amazon Cognito or your own OIDC Identity
    -- Provider (IdP). For private workforces created using Amazon Cognito use
    -- @CognitoMemberDefinition@. For workforces created using your own OIDC
    -- identity provider (IdP) use @OidcMemberDefinition@. Do not provide input
    -- for both of these parameters in a single request.
    --
    -- For workforces created using Amazon Cognito, private work teams
    -- correspond to Amazon Cognito /user groups/ within the user pool used to
    -- create a workforce. All of the @CognitoMemberDefinition@ objects that
    -- make up the member definition must have the same @ClientId@ and
    -- @UserPool@ values. To add a Amazon Cognito user group to an existing
    -- worker pool, see < Adding groups to a User Pool>. For more information
    -- about user pools, see
    -- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html Amazon Cognito User Pools>.
    --
    -- For workforces created using your own OIDC IdP, specify the user groups
    -- that you want to include in your private work team in
    -- @OidcMemberDefinition@ by listing those groups in @Groups@.
    CreateWorkteam -> NonEmpty MemberDefinition
memberDefinitions :: Prelude.NonEmpty MemberDefinition,
    -- | A description of the work team.
    CreateWorkteam -> Text
description :: Prelude.Text
  }
  deriving (CreateWorkteam -> CreateWorkteam -> Bool
(CreateWorkteam -> CreateWorkteam -> Bool)
-> (CreateWorkteam -> CreateWorkteam -> Bool) -> Eq CreateWorkteam
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkteam -> CreateWorkteam -> Bool
$c/= :: CreateWorkteam -> CreateWorkteam -> Bool
== :: CreateWorkteam -> CreateWorkteam -> Bool
$c== :: CreateWorkteam -> CreateWorkteam -> Bool
Prelude.Eq, ReadPrec [CreateWorkteam]
ReadPrec CreateWorkteam
Int -> ReadS CreateWorkteam
ReadS [CreateWorkteam]
(Int -> ReadS CreateWorkteam)
-> ReadS [CreateWorkteam]
-> ReadPrec CreateWorkteam
-> ReadPrec [CreateWorkteam]
-> Read CreateWorkteam
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkteam]
$creadListPrec :: ReadPrec [CreateWorkteam]
readPrec :: ReadPrec CreateWorkteam
$creadPrec :: ReadPrec CreateWorkteam
readList :: ReadS [CreateWorkteam]
$creadList :: ReadS [CreateWorkteam]
readsPrec :: Int -> ReadS CreateWorkteam
$creadsPrec :: Int -> ReadS CreateWorkteam
Prelude.Read, Int -> CreateWorkteam -> ShowS
[CreateWorkteam] -> ShowS
CreateWorkteam -> String
(Int -> CreateWorkteam -> ShowS)
-> (CreateWorkteam -> String)
-> ([CreateWorkteam] -> ShowS)
-> Show CreateWorkteam
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkteam] -> ShowS
$cshowList :: [CreateWorkteam] -> ShowS
show :: CreateWorkteam -> String
$cshow :: CreateWorkteam -> String
showsPrec :: Int -> CreateWorkteam -> ShowS
$cshowsPrec :: Int -> CreateWorkteam -> ShowS
Prelude.Show, (forall x. CreateWorkteam -> Rep CreateWorkteam x)
-> (forall x. Rep CreateWorkteam x -> CreateWorkteam)
-> Generic CreateWorkteam
forall x. Rep CreateWorkteam x -> CreateWorkteam
forall x. CreateWorkteam -> Rep CreateWorkteam x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWorkteam x -> CreateWorkteam
$cfrom :: forall x. CreateWorkteam -> Rep CreateWorkteam x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkteam' 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:
--
-- 'notificationConfiguration', 'createWorkteam_notificationConfiguration' - Configures notification of workers regarding available or expiring work
-- items.
--
-- 'workforceName', 'createWorkteam_workforceName' - The name of the workforce.
--
-- 'tags', 'createWorkteam_tags' - An array of key-value pairs.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html Resource Tag>
-- and
-- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what Using Cost Allocation Tags>
-- in the /Amazon Web Services Billing and Cost Management User Guide/.
--
-- 'workteamName', 'createWorkteam_workteamName' - The name of the work team. Use this name to identify the work team.
--
-- 'memberDefinitions', 'createWorkteam_memberDefinitions' - A list of @MemberDefinition@ objects that contains objects that identify
-- the workers that make up the work team.
--
-- Workforces can be created using Amazon Cognito or your own OIDC Identity
-- Provider (IdP). For private workforces created using Amazon Cognito use
-- @CognitoMemberDefinition@. For workforces created using your own OIDC
-- identity provider (IdP) use @OidcMemberDefinition@. Do not provide input
-- for both of these parameters in a single request.
--
-- For workforces created using Amazon Cognito, private work teams
-- correspond to Amazon Cognito /user groups/ within the user pool used to
-- create a workforce. All of the @CognitoMemberDefinition@ objects that
-- make up the member definition must have the same @ClientId@ and
-- @UserPool@ values. To add a Amazon Cognito user group to an existing
-- worker pool, see < Adding groups to a User Pool>. For more information
-- about user pools, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html Amazon Cognito User Pools>.
--
-- For workforces created using your own OIDC IdP, specify the user groups
-- that you want to include in your private work team in
-- @OidcMemberDefinition@ by listing those groups in @Groups@.
--
-- 'description', 'createWorkteam_description' - A description of the work team.
newCreateWorkteam ::
  -- | 'workteamName'
  Prelude.Text ->
  -- | 'memberDefinitions'
  Prelude.NonEmpty MemberDefinition ->
  -- | 'description'
  Prelude.Text ->
  CreateWorkteam
newCreateWorkteam :: Text -> NonEmpty MemberDefinition -> Text -> CreateWorkteam
newCreateWorkteam
  Text
pWorkteamName_
  NonEmpty MemberDefinition
pMemberDefinitions_
  Text
pDescription_ =
    CreateWorkteam' :: Maybe NotificationConfiguration
-> Maybe Text
-> Maybe [Tag]
-> Text
-> NonEmpty MemberDefinition
-> Text
-> CreateWorkteam
CreateWorkteam'
      { $sel:notificationConfiguration:CreateWorkteam' :: Maybe NotificationConfiguration
notificationConfiguration =
          Maybe NotificationConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:workforceName:CreateWorkteam' :: Maybe Text
workforceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateWorkteam' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:workteamName:CreateWorkteam' :: Text
workteamName = Text
pWorkteamName_,
        $sel:memberDefinitions:CreateWorkteam' :: NonEmpty MemberDefinition
memberDefinitions =
          Tagged
  (NonEmpty MemberDefinition) (Identity (NonEmpty MemberDefinition))
-> Tagged
     (NonEmpty MemberDefinition) (Identity (NonEmpty MemberDefinition))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty MemberDefinition) (Identity (NonEmpty MemberDefinition))
 -> Tagged
      (NonEmpty MemberDefinition) (Identity (NonEmpty MemberDefinition)))
-> NonEmpty MemberDefinition -> NonEmpty MemberDefinition
forall t b. AReview t b -> b -> t
Lens.# NonEmpty MemberDefinition
pMemberDefinitions_,
        $sel:description:CreateWorkteam' :: Text
description = Text
pDescription_
      }

-- | Configures notification of workers regarding available or expiring work
-- items.
createWorkteam_notificationConfiguration :: Lens.Lens' CreateWorkteam (Prelude.Maybe NotificationConfiguration)
createWorkteam_notificationConfiguration :: (Maybe NotificationConfiguration
 -> f (Maybe NotificationConfiguration))
-> CreateWorkteam -> f CreateWorkteam
createWorkteam_notificationConfiguration = (CreateWorkteam -> Maybe NotificationConfiguration)
-> (CreateWorkteam
    -> Maybe NotificationConfiguration -> CreateWorkteam)
-> Lens
     CreateWorkteam
     CreateWorkteam
     (Maybe NotificationConfiguration)
     (Maybe NotificationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkteam' {Maybe NotificationConfiguration
notificationConfiguration :: Maybe NotificationConfiguration
$sel:notificationConfiguration:CreateWorkteam' :: CreateWorkteam -> Maybe NotificationConfiguration
notificationConfiguration} -> Maybe NotificationConfiguration
notificationConfiguration) (\s :: CreateWorkteam
s@CreateWorkteam' {} Maybe NotificationConfiguration
a -> CreateWorkteam
s {$sel:notificationConfiguration:CreateWorkteam' :: Maybe NotificationConfiguration
notificationConfiguration = Maybe NotificationConfiguration
a} :: CreateWorkteam)

-- | The name of the workforce.
createWorkteam_workforceName :: Lens.Lens' CreateWorkteam (Prelude.Maybe Prelude.Text)
createWorkteam_workforceName :: (Maybe Text -> f (Maybe Text))
-> CreateWorkteam -> f CreateWorkteam
createWorkteam_workforceName = (CreateWorkteam -> Maybe Text)
-> (CreateWorkteam -> Maybe Text -> CreateWorkteam)
-> Lens CreateWorkteam CreateWorkteam (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkteam' {Maybe Text
workforceName :: Maybe Text
$sel:workforceName:CreateWorkteam' :: CreateWorkteam -> Maybe Text
workforceName} -> Maybe Text
workforceName) (\s :: CreateWorkteam
s@CreateWorkteam' {} Maybe Text
a -> CreateWorkteam
s {$sel:workforceName:CreateWorkteam' :: Maybe Text
workforceName = Maybe Text
a} :: CreateWorkteam)

-- | An array of key-value pairs.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html Resource Tag>
-- and
-- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what Using Cost Allocation Tags>
-- in the /Amazon Web Services Billing and Cost Management User Guide/.
createWorkteam_tags :: Lens.Lens' CreateWorkteam (Prelude.Maybe [Tag])
createWorkteam_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateWorkteam -> f CreateWorkteam
createWorkteam_tags = (CreateWorkteam -> Maybe [Tag])
-> (CreateWorkteam -> Maybe [Tag] -> CreateWorkteam)
-> Lens CreateWorkteam CreateWorkteam (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkteam' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateWorkteam' :: CreateWorkteam -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateWorkteam
s@CreateWorkteam' {} Maybe [Tag]
a -> CreateWorkteam
s {$sel:tags:CreateWorkteam' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateWorkteam) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateWorkteam -> f CreateWorkteam)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateWorkteam
-> f CreateWorkteam
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the work team. Use this name to identify the work team.
createWorkteam_workteamName :: Lens.Lens' CreateWorkteam Prelude.Text
createWorkteam_workteamName :: (Text -> f Text) -> CreateWorkteam -> f CreateWorkteam
createWorkteam_workteamName = (CreateWorkteam -> Text)
-> (CreateWorkteam -> Text -> CreateWorkteam)
-> Lens CreateWorkteam CreateWorkteam Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkteam' {Text
workteamName :: Text
$sel:workteamName:CreateWorkteam' :: CreateWorkteam -> Text
workteamName} -> Text
workteamName) (\s :: CreateWorkteam
s@CreateWorkteam' {} Text
a -> CreateWorkteam
s {$sel:workteamName:CreateWorkteam' :: Text
workteamName = Text
a} :: CreateWorkteam)

-- | A list of @MemberDefinition@ objects that contains objects that identify
-- the workers that make up the work team.
--
-- Workforces can be created using Amazon Cognito or your own OIDC Identity
-- Provider (IdP). For private workforces created using Amazon Cognito use
-- @CognitoMemberDefinition@. For workforces created using your own OIDC
-- identity provider (IdP) use @OidcMemberDefinition@. Do not provide input
-- for both of these parameters in a single request.
--
-- For workforces created using Amazon Cognito, private work teams
-- correspond to Amazon Cognito /user groups/ within the user pool used to
-- create a workforce. All of the @CognitoMemberDefinition@ objects that
-- make up the member definition must have the same @ClientId@ and
-- @UserPool@ values. To add a Amazon Cognito user group to an existing
-- worker pool, see < Adding groups to a User Pool>. For more information
-- about user pools, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html Amazon Cognito User Pools>.
--
-- For workforces created using your own OIDC IdP, specify the user groups
-- that you want to include in your private work team in
-- @OidcMemberDefinition@ by listing those groups in @Groups@.
createWorkteam_memberDefinitions :: Lens.Lens' CreateWorkteam (Prelude.NonEmpty MemberDefinition)
createWorkteam_memberDefinitions :: (NonEmpty MemberDefinition -> f (NonEmpty MemberDefinition))
-> CreateWorkteam -> f CreateWorkteam
createWorkteam_memberDefinitions = (CreateWorkteam -> NonEmpty MemberDefinition)
-> (CreateWorkteam -> NonEmpty MemberDefinition -> CreateWorkteam)
-> Lens
     CreateWorkteam
     CreateWorkteam
     (NonEmpty MemberDefinition)
     (NonEmpty MemberDefinition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkteam' {NonEmpty MemberDefinition
memberDefinitions :: NonEmpty MemberDefinition
$sel:memberDefinitions:CreateWorkteam' :: CreateWorkteam -> NonEmpty MemberDefinition
memberDefinitions} -> NonEmpty MemberDefinition
memberDefinitions) (\s :: CreateWorkteam
s@CreateWorkteam' {} NonEmpty MemberDefinition
a -> CreateWorkteam
s {$sel:memberDefinitions:CreateWorkteam' :: NonEmpty MemberDefinition
memberDefinitions = NonEmpty MemberDefinition
a} :: CreateWorkteam) ((NonEmpty MemberDefinition -> f (NonEmpty MemberDefinition))
 -> CreateWorkteam -> f CreateWorkteam)
-> ((NonEmpty MemberDefinition -> f (NonEmpty MemberDefinition))
    -> NonEmpty MemberDefinition -> f (NonEmpty MemberDefinition))
-> (NonEmpty MemberDefinition -> f (NonEmpty MemberDefinition))
-> CreateWorkteam
-> f CreateWorkteam
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty MemberDefinition -> f (NonEmpty MemberDefinition))
-> NonEmpty MemberDefinition -> f (NonEmpty MemberDefinition)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A description of the work team.
createWorkteam_description :: Lens.Lens' CreateWorkteam Prelude.Text
createWorkteam_description :: (Text -> f Text) -> CreateWorkteam -> f CreateWorkteam
createWorkteam_description = (CreateWorkteam -> Text)
-> (CreateWorkteam -> Text -> CreateWorkteam)
-> Lens CreateWorkteam CreateWorkteam Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkteam' {Text
description :: Text
$sel:description:CreateWorkteam' :: CreateWorkteam -> Text
description} -> Text
description) (\s :: CreateWorkteam
s@CreateWorkteam' {} Text
a -> CreateWorkteam
s {$sel:description:CreateWorkteam' :: Text
description = Text
a} :: CreateWorkteam)

instance Core.AWSRequest CreateWorkteam where
  type
    AWSResponse CreateWorkteam =
      CreateWorkteamResponse
  request :: CreateWorkteam -> Request CreateWorkteam
request = Service -> CreateWorkteam -> Request CreateWorkteam
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateWorkteam
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateWorkteam)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateWorkteam))
-> Logger
-> Service
-> Proxy CreateWorkteam
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateWorkteam)))
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 -> CreateWorkteamResponse
CreateWorkteamResponse'
            (Maybe Text -> Int -> CreateWorkteamResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateWorkteamResponse)
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
"WorkteamArn")
            Either String (Int -> CreateWorkteamResponse)
-> Either String Int -> Either String CreateWorkteamResponse
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))
      )

instance Prelude.Hashable CreateWorkteam

instance Prelude.NFData CreateWorkteam

instance Core.ToHeaders CreateWorkteam where
  toHeaders :: CreateWorkteam -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateWorkteam -> 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.CreateWorkteam" :: 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 CreateWorkteam where
  toJSON :: CreateWorkteam -> Value
toJSON CreateWorkteam' {Maybe [Tag]
Maybe Text
Maybe NotificationConfiguration
NonEmpty MemberDefinition
Text
description :: Text
memberDefinitions :: NonEmpty MemberDefinition
workteamName :: Text
tags :: Maybe [Tag]
workforceName :: Maybe Text
notificationConfiguration :: Maybe NotificationConfiguration
$sel:description:CreateWorkteam' :: CreateWorkteam -> Text
$sel:memberDefinitions:CreateWorkteam' :: CreateWorkteam -> NonEmpty MemberDefinition
$sel:workteamName:CreateWorkteam' :: CreateWorkteam -> Text
$sel:tags:CreateWorkteam' :: CreateWorkteam -> Maybe [Tag]
$sel:workforceName:CreateWorkteam' :: CreateWorkteam -> Maybe Text
$sel:notificationConfiguration:CreateWorkteam' :: CreateWorkteam -> Maybe NotificationConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NotificationConfiguration" Text -> NotificationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NotificationConfiguration -> Pair)
-> Maybe NotificationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotificationConfiguration
notificationConfiguration,
            (Text
"WorkforceName" 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
workforceName,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WorkteamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
workteamName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"MemberDefinitions" Text -> NonEmpty MemberDefinition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty MemberDefinition
memberDefinitions),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
description)
          ]
      )

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

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

-- | /See:/ 'newCreateWorkteamResponse' smart constructor.
data CreateWorkteamResponse = CreateWorkteamResponse'
  { -- | The Amazon Resource Name (ARN) of the work team. You can use this ARN to
    -- identify the work team.
    CreateWorkteamResponse -> Maybe Text
workteamArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateWorkteamResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateWorkteamResponse -> CreateWorkteamResponse -> Bool
(CreateWorkteamResponse -> CreateWorkteamResponse -> Bool)
-> (CreateWorkteamResponse -> CreateWorkteamResponse -> Bool)
-> Eq CreateWorkteamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkteamResponse -> CreateWorkteamResponse -> Bool
$c/= :: CreateWorkteamResponse -> CreateWorkteamResponse -> Bool
== :: CreateWorkteamResponse -> CreateWorkteamResponse -> Bool
$c== :: CreateWorkteamResponse -> CreateWorkteamResponse -> Bool
Prelude.Eq, ReadPrec [CreateWorkteamResponse]
ReadPrec CreateWorkteamResponse
Int -> ReadS CreateWorkteamResponse
ReadS [CreateWorkteamResponse]
(Int -> ReadS CreateWorkteamResponse)
-> ReadS [CreateWorkteamResponse]
-> ReadPrec CreateWorkteamResponse
-> ReadPrec [CreateWorkteamResponse]
-> Read CreateWorkteamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkteamResponse]
$creadListPrec :: ReadPrec [CreateWorkteamResponse]
readPrec :: ReadPrec CreateWorkteamResponse
$creadPrec :: ReadPrec CreateWorkteamResponse
readList :: ReadS [CreateWorkteamResponse]
$creadList :: ReadS [CreateWorkteamResponse]
readsPrec :: Int -> ReadS CreateWorkteamResponse
$creadsPrec :: Int -> ReadS CreateWorkteamResponse
Prelude.Read, Int -> CreateWorkteamResponse -> ShowS
[CreateWorkteamResponse] -> ShowS
CreateWorkteamResponse -> String
(Int -> CreateWorkteamResponse -> ShowS)
-> (CreateWorkteamResponse -> String)
-> ([CreateWorkteamResponse] -> ShowS)
-> Show CreateWorkteamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkteamResponse] -> ShowS
$cshowList :: [CreateWorkteamResponse] -> ShowS
show :: CreateWorkteamResponse -> String
$cshow :: CreateWorkteamResponse -> String
showsPrec :: Int -> CreateWorkteamResponse -> ShowS
$cshowsPrec :: Int -> CreateWorkteamResponse -> ShowS
Prelude.Show, (forall x. CreateWorkteamResponse -> Rep CreateWorkteamResponse x)
-> (forall x.
    Rep CreateWorkteamResponse x -> CreateWorkteamResponse)
-> Generic CreateWorkteamResponse
forall x. Rep CreateWorkteamResponse x -> CreateWorkteamResponse
forall x. CreateWorkteamResponse -> Rep CreateWorkteamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWorkteamResponse x -> CreateWorkteamResponse
$cfrom :: forall x. CreateWorkteamResponse -> Rep CreateWorkteamResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkteamResponse' 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:
--
-- 'workteamArn', 'createWorkteamResponse_workteamArn' - The Amazon Resource Name (ARN) of the work team. You can use this ARN to
-- identify the work team.
--
-- 'httpStatus', 'createWorkteamResponse_httpStatus' - The response's http status code.
newCreateWorkteamResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWorkteamResponse
newCreateWorkteamResponse :: Int -> CreateWorkteamResponse
newCreateWorkteamResponse Int
pHttpStatus_ =
  CreateWorkteamResponse' :: Maybe Text -> Int -> CreateWorkteamResponse
CreateWorkteamResponse'
    { $sel:workteamArn:CreateWorkteamResponse' :: Maybe Text
workteamArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWorkteamResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the work team. You can use this ARN to
-- identify the work team.
createWorkteamResponse_workteamArn :: Lens.Lens' CreateWorkteamResponse (Prelude.Maybe Prelude.Text)
createWorkteamResponse_workteamArn :: (Maybe Text -> f (Maybe Text))
-> CreateWorkteamResponse -> f CreateWorkteamResponse
createWorkteamResponse_workteamArn = (CreateWorkteamResponse -> Maybe Text)
-> (CreateWorkteamResponse -> Maybe Text -> CreateWorkteamResponse)
-> Lens
     CreateWorkteamResponse
     CreateWorkteamResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkteamResponse' {Maybe Text
workteamArn :: Maybe Text
$sel:workteamArn:CreateWorkteamResponse' :: CreateWorkteamResponse -> Maybe Text
workteamArn} -> Maybe Text
workteamArn) (\s :: CreateWorkteamResponse
s@CreateWorkteamResponse' {} Maybe Text
a -> CreateWorkteamResponse
s {$sel:workteamArn:CreateWorkteamResponse' :: Maybe Text
workteamArn = Maybe Text
a} :: CreateWorkteamResponse)

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

instance Prelude.NFData CreateWorkteamResponse