{-# 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.CreateWorkforce
-- 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)
--
-- Use this operation to create a workforce. This operation will return an
-- error if a workforce already exists in the Amazon Web Services Region
-- that you specify. You can only create one workforce in each Amazon Web
-- Services Region per Amazon Web Services account.
--
-- If you want to create a new workforce in an Amazon Web Services Region
-- where a workforce already exists, use the API operation to delete the
-- existing workforce and then use @CreateWorkforce@ to create a new
-- workforce.
--
-- To create a private workforce using Amazon Cognito, you must specify a
-- Cognito user pool in @CognitoConfig@. You can also create an Amazon
-- Cognito workforce using the Amazon SageMaker console. For more
-- information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sms-workforce-create-private.html Create a Private Workforce (Amazon Cognito)>.
--
-- To create a private workforce using your own OIDC Identity Provider
-- (IdP), specify your IdP configuration in @OidcConfig@. Your OIDC IdP
-- must support /groups/ because groups are used by Ground Truth and Amazon
-- A2I to create work teams. For more information, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/sms-workforce-create-private-oidc.html Create a Private Workforce (OIDC IdP)>.
module Amazonka.SageMaker.CreateWorkforce
  ( -- * Creating a Request
    CreateWorkforce (..),
    newCreateWorkforce,

    -- * Request Lenses
    createWorkforce_sourceIpConfig,
    createWorkforce_cognitoConfig,
    createWorkforce_oidcConfig,
    createWorkforce_tags,
    createWorkforce_workforceName,

    -- * Destructuring the Response
    CreateWorkforceResponse (..),
    newCreateWorkforceResponse,

    -- * Response Lenses
    createWorkforceResponse_httpStatus,
    createWorkforceResponse_workforceArn,
  )
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:/ 'newCreateWorkforce' smart constructor.
data CreateWorkforce = CreateWorkforce'
  { CreateWorkforce -> Maybe SourceIpConfig
sourceIpConfig :: Prelude.Maybe SourceIpConfig,
    -- | Use this parameter to configure an Amazon Cognito private workforce. A
    -- single Cognito workforce is created using and corresponds to a single
    -- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html Amazon Cognito user pool>.
    --
    -- Do not use @OidcConfig@ if you specify values for @CognitoConfig@.
    CreateWorkforce -> Maybe CognitoConfig
cognitoConfig :: Prelude.Maybe CognitoConfig,
    -- | Use this parameter to configure a private workforce using your own OIDC
    -- Identity Provider.
    --
    -- Do not use @CognitoConfig@ if you specify values for @OidcConfig@.
    CreateWorkforce -> Maybe OidcConfig
oidcConfig :: Prelude.Maybe OidcConfig,
    -- | An array of key-value pairs that contain metadata to help you categorize
    -- and organize our workforce. Each tag consists of a key and a value, both
    -- of which you define.
    CreateWorkforce -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the private workforce.
    CreateWorkforce -> Text
workforceName :: Prelude.Text
  }
  deriving (CreateWorkforce -> CreateWorkforce -> Bool
(CreateWorkforce -> CreateWorkforce -> Bool)
-> (CreateWorkforce -> CreateWorkforce -> Bool)
-> Eq CreateWorkforce
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkforce -> CreateWorkforce -> Bool
$c/= :: CreateWorkforce -> CreateWorkforce -> Bool
== :: CreateWorkforce -> CreateWorkforce -> Bool
$c== :: CreateWorkforce -> CreateWorkforce -> Bool
Prelude.Eq, Int -> CreateWorkforce -> ShowS
[CreateWorkforce] -> ShowS
CreateWorkforce -> String
(Int -> CreateWorkforce -> ShowS)
-> (CreateWorkforce -> String)
-> ([CreateWorkforce] -> ShowS)
-> Show CreateWorkforce
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkforce] -> ShowS
$cshowList :: [CreateWorkforce] -> ShowS
show :: CreateWorkforce -> String
$cshow :: CreateWorkforce -> String
showsPrec :: Int -> CreateWorkforce -> ShowS
$cshowsPrec :: Int -> CreateWorkforce -> ShowS
Prelude.Show, (forall x. CreateWorkforce -> Rep CreateWorkforce x)
-> (forall x. Rep CreateWorkforce x -> CreateWorkforce)
-> Generic CreateWorkforce
forall x. Rep CreateWorkforce x -> CreateWorkforce
forall x. CreateWorkforce -> Rep CreateWorkforce x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWorkforce x -> CreateWorkforce
$cfrom :: forall x. CreateWorkforce -> Rep CreateWorkforce x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkforce' 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:
--
-- 'sourceIpConfig', 'createWorkforce_sourceIpConfig' - Undocumented member.
--
-- 'cognitoConfig', 'createWorkforce_cognitoConfig' - Use this parameter to configure an Amazon Cognito private workforce. A
-- single Cognito workforce is created using and corresponds to a single
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html Amazon Cognito user pool>.
--
-- Do not use @OidcConfig@ if you specify values for @CognitoConfig@.
--
-- 'oidcConfig', 'createWorkforce_oidcConfig' - Use this parameter to configure a private workforce using your own OIDC
-- Identity Provider.
--
-- Do not use @CognitoConfig@ if you specify values for @OidcConfig@.
--
-- 'tags', 'createWorkforce_tags' - An array of key-value pairs that contain metadata to help you categorize
-- and organize our workforce. Each tag consists of a key and a value, both
-- of which you define.
--
-- 'workforceName', 'createWorkforce_workforceName' - The name of the private workforce.
newCreateWorkforce ::
  -- | 'workforceName'
  Prelude.Text ->
  CreateWorkforce
newCreateWorkforce :: Text -> CreateWorkforce
newCreateWorkforce Text
pWorkforceName_ =
  CreateWorkforce' :: Maybe SourceIpConfig
-> Maybe CognitoConfig
-> Maybe OidcConfig
-> Maybe [Tag]
-> Text
-> CreateWorkforce
CreateWorkforce'
    { $sel:sourceIpConfig:CreateWorkforce' :: Maybe SourceIpConfig
sourceIpConfig = Maybe SourceIpConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:cognitoConfig:CreateWorkforce' :: Maybe CognitoConfig
cognitoConfig = Maybe CognitoConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:oidcConfig:CreateWorkforce' :: Maybe OidcConfig
oidcConfig = Maybe OidcConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateWorkforce' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:workforceName:CreateWorkforce' :: Text
workforceName = Text
pWorkforceName_
    }

-- | Undocumented member.
createWorkforce_sourceIpConfig :: Lens.Lens' CreateWorkforce (Prelude.Maybe SourceIpConfig)
createWorkforce_sourceIpConfig :: (Maybe SourceIpConfig -> f (Maybe SourceIpConfig))
-> CreateWorkforce -> f CreateWorkforce
createWorkforce_sourceIpConfig = (CreateWorkforce -> Maybe SourceIpConfig)
-> (CreateWorkforce -> Maybe SourceIpConfig -> CreateWorkforce)
-> Lens
     CreateWorkforce
     CreateWorkforce
     (Maybe SourceIpConfig)
     (Maybe SourceIpConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkforce' {Maybe SourceIpConfig
sourceIpConfig :: Maybe SourceIpConfig
$sel:sourceIpConfig:CreateWorkforce' :: CreateWorkforce -> Maybe SourceIpConfig
sourceIpConfig} -> Maybe SourceIpConfig
sourceIpConfig) (\s :: CreateWorkforce
s@CreateWorkforce' {} Maybe SourceIpConfig
a -> CreateWorkforce
s {$sel:sourceIpConfig:CreateWorkforce' :: Maybe SourceIpConfig
sourceIpConfig = Maybe SourceIpConfig
a} :: CreateWorkforce)

-- | Use this parameter to configure an Amazon Cognito private workforce. A
-- single Cognito workforce is created using and corresponds to a single
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html Amazon Cognito user pool>.
--
-- Do not use @OidcConfig@ if you specify values for @CognitoConfig@.
createWorkforce_cognitoConfig :: Lens.Lens' CreateWorkforce (Prelude.Maybe CognitoConfig)
createWorkforce_cognitoConfig :: (Maybe CognitoConfig -> f (Maybe CognitoConfig))
-> CreateWorkforce -> f CreateWorkforce
createWorkforce_cognitoConfig = (CreateWorkforce -> Maybe CognitoConfig)
-> (CreateWorkforce -> Maybe CognitoConfig -> CreateWorkforce)
-> Lens
     CreateWorkforce
     CreateWorkforce
     (Maybe CognitoConfig)
     (Maybe CognitoConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkforce' {Maybe CognitoConfig
cognitoConfig :: Maybe CognitoConfig
$sel:cognitoConfig:CreateWorkforce' :: CreateWorkforce -> Maybe CognitoConfig
cognitoConfig} -> Maybe CognitoConfig
cognitoConfig) (\s :: CreateWorkforce
s@CreateWorkforce' {} Maybe CognitoConfig
a -> CreateWorkforce
s {$sel:cognitoConfig:CreateWorkforce' :: Maybe CognitoConfig
cognitoConfig = Maybe CognitoConfig
a} :: CreateWorkforce)

-- | Use this parameter to configure a private workforce using your own OIDC
-- Identity Provider.
--
-- Do not use @CognitoConfig@ if you specify values for @OidcConfig@.
createWorkforce_oidcConfig :: Lens.Lens' CreateWorkforce (Prelude.Maybe OidcConfig)
createWorkforce_oidcConfig :: (Maybe OidcConfig -> f (Maybe OidcConfig))
-> CreateWorkforce -> f CreateWorkforce
createWorkforce_oidcConfig = (CreateWorkforce -> Maybe OidcConfig)
-> (CreateWorkforce -> Maybe OidcConfig -> CreateWorkforce)
-> Lens
     CreateWorkforce
     CreateWorkforce
     (Maybe OidcConfig)
     (Maybe OidcConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkforce' {Maybe OidcConfig
oidcConfig :: Maybe OidcConfig
$sel:oidcConfig:CreateWorkforce' :: CreateWorkforce -> Maybe OidcConfig
oidcConfig} -> Maybe OidcConfig
oidcConfig) (\s :: CreateWorkforce
s@CreateWorkforce' {} Maybe OidcConfig
a -> CreateWorkforce
s {$sel:oidcConfig:CreateWorkforce' :: Maybe OidcConfig
oidcConfig = Maybe OidcConfig
a} :: CreateWorkforce)

-- | An array of key-value pairs that contain metadata to help you categorize
-- and organize our workforce. Each tag consists of a key and a value, both
-- of which you define.
createWorkforce_tags :: Lens.Lens' CreateWorkforce (Prelude.Maybe [Tag])
createWorkforce_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateWorkforce -> f CreateWorkforce
createWorkforce_tags = (CreateWorkforce -> Maybe [Tag])
-> (CreateWorkforce -> Maybe [Tag] -> CreateWorkforce)
-> Lens CreateWorkforce CreateWorkforce (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkforce' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateWorkforce' :: CreateWorkforce -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateWorkforce
s@CreateWorkforce' {} Maybe [Tag]
a -> CreateWorkforce
s {$sel:tags:CreateWorkforce' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateWorkforce) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateWorkforce -> f CreateWorkforce)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateWorkforce
-> f CreateWorkforce
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 private workforce.
createWorkforce_workforceName :: Lens.Lens' CreateWorkforce Prelude.Text
createWorkforce_workforceName :: (Text -> f Text) -> CreateWorkforce -> f CreateWorkforce
createWorkforce_workforceName = (CreateWorkforce -> Text)
-> (CreateWorkforce -> Text -> CreateWorkforce)
-> Lens CreateWorkforce CreateWorkforce Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkforce' {Text
workforceName :: Text
$sel:workforceName:CreateWorkforce' :: CreateWorkforce -> Text
workforceName} -> Text
workforceName) (\s :: CreateWorkforce
s@CreateWorkforce' {} Text
a -> CreateWorkforce
s {$sel:workforceName:CreateWorkforce' :: Text
workforceName = Text
a} :: CreateWorkforce)

instance Core.AWSRequest CreateWorkforce where
  type
    AWSResponse CreateWorkforce =
      CreateWorkforceResponse
  request :: CreateWorkforce -> Request CreateWorkforce
request = Service -> CreateWorkforce -> Request CreateWorkforce
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateWorkforce
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateWorkforce)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateWorkforce))
-> Logger
-> Service
-> Proxy CreateWorkforce
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateWorkforce)))
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 ->
          Int -> Text -> CreateWorkforceResponse
CreateWorkforceResponse'
            (Int -> Text -> CreateWorkforceResponse)
-> Either String Int
-> Either String (Text -> CreateWorkforceResponse)
forall (f :: * -> *) a b. Functor 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 (Text -> CreateWorkforceResponse)
-> Either String Text -> Either String CreateWorkforceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"WorkforceArn")
      )

instance Prelude.Hashable CreateWorkforce

instance Prelude.NFData CreateWorkforce

instance Core.ToHeaders CreateWorkforce where
  toHeaders :: CreateWorkforce -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateWorkforce -> 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.CreateWorkforce" :: 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 CreateWorkforce where
  toJSON :: CreateWorkforce -> Value
toJSON CreateWorkforce' {Maybe [Tag]
Maybe CognitoConfig
Maybe OidcConfig
Maybe SourceIpConfig
Text
workforceName :: Text
tags :: Maybe [Tag]
oidcConfig :: Maybe OidcConfig
cognitoConfig :: Maybe CognitoConfig
sourceIpConfig :: Maybe SourceIpConfig
$sel:workforceName:CreateWorkforce' :: CreateWorkforce -> Text
$sel:tags:CreateWorkforce' :: CreateWorkforce -> Maybe [Tag]
$sel:oidcConfig:CreateWorkforce' :: CreateWorkforce -> Maybe OidcConfig
$sel:cognitoConfig:CreateWorkforce' :: CreateWorkforce -> Maybe CognitoConfig
$sel:sourceIpConfig:CreateWorkforce' :: CreateWorkforce -> Maybe SourceIpConfig
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SourceIpConfig" Text -> SourceIpConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SourceIpConfig -> Pair) -> Maybe SourceIpConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SourceIpConfig
sourceIpConfig,
            (Text
"CognitoConfig" Text -> CognitoConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CognitoConfig -> Pair) -> Maybe CognitoConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CognitoConfig
cognitoConfig,
            (Text
"OidcConfig" Text -> OidcConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (OidcConfig -> Pair) -> Maybe OidcConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OidcConfig
oidcConfig,
            (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
"WorkforceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
workforceName)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateWorkforceResponse' 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:
--
-- 'httpStatus', 'createWorkforceResponse_httpStatus' - The response's http status code.
--
-- 'workforceArn', 'createWorkforceResponse_workforceArn' - The Amazon Resource Name (ARN) of the workforce.
newCreateWorkforceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'workforceArn'
  Prelude.Text ->
  CreateWorkforceResponse
newCreateWorkforceResponse :: Int -> Text -> CreateWorkforceResponse
newCreateWorkforceResponse
  Int
pHttpStatus_
  Text
pWorkforceArn_ =
    CreateWorkforceResponse' :: Int -> Text -> CreateWorkforceResponse
CreateWorkforceResponse'
      { $sel:httpStatus:CreateWorkforceResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:workforceArn:CreateWorkforceResponse' :: Text
workforceArn = Text
pWorkforceArn_
      }

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

-- | The Amazon Resource Name (ARN) of the workforce.
createWorkforceResponse_workforceArn :: Lens.Lens' CreateWorkforceResponse Prelude.Text
createWorkforceResponse_workforceArn :: (Text -> f Text)
-> CreateWorkforceResponse -> f CreateWorkforceResponse
createWorkforceResponse_workforceArn = (CreateWorkforceResponse -> Text)
-> (CreateWorkforceResponse -> Text -> CreateWorkforceResponse)
-> Lens CreateWorkforceResponse CreateWorkforceResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkforceResponse' {Text
workforceArn :: Text
$sel:workforceArn:CreateWorkforceResponse' :: CreateWorkforceResponse -> Text
workforceArn} -> Text
workforceArn) (\s :: CreateWorkforceResponse
s@CreateWorkforceResponse' {} Text
a -> CreateWorkforceResponse
s {$sel:workforceArn:CreateWorkforceResponse' :: Text
workforceArn = Text
a} :: CreateWorkforceResponse)

instance Prelude.NFData CreateWorkforceResponse