{-# 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.Transcribe.CreateLanguageModel
-- 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 custom language model. Use Amazon S3 prefixes to provide
-- the location of your input files. The time it takes to create your model
-- depends on the size of your training data.
module Amazonka.Transcribe.CreateLanguageModel
  ( -- * Creating a Request
    CreateLanguageModel (..),
    newCreateLanguageModel,

    -- * Request Lenses
    createLanguageModel_tags,
    createLanguageModel_languageCode,
    createLanguageModel_baseModelName,
    createLanguageModel_modelName,
    createLanguageModel_inputDataConfig,

    -- * Destructuring the Response
    CreateLanguageModelResponse (..),
    newCreateLanguageModelResponse,

    -- * Response Lenses
    createLanguageModelResponse_languageCode,
    createLanguageModelResponse_modelName,
    createLanguageModelResponse_inputDataConfig,
    createLanguageModelResponse_baseModelName,
    createLanguageModelResponse_modelStatus,
    createLanguageModelResponse_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.Transcribe.Types

-- | /See:/ 'newCreateLanguageModel' smart constructor.
data CreateLanguageModel = CreateLanguageModel'
  { -- | Adds one or more tags, each in the form of a key:value pair, to a new
    -- language model at the time you create this new model.
    CreateLanguageModel -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The language of the input text you\'re using to train your custom
    -- language model.
    CreateLanguageModel -> CLMLanguageCode
languageCode :: CLMLanguageCode,
    -- | The Amazon Transcribe standard language model, or base model used to
    -- create your custom language model.
    --
    -- If you want to use your custom language model to transcribe audio with a
    -- sample rate of 16,000 Hz or greater, choose @Wideband@.
    --
    -- If you want to use your custom language model to transcribe audio with a
    -- sample rate that is less than 16,000 Hz, choose @Narrowband@.
    CreateLanguageModel -> BaseModelName
baseModelName :: BaseModelName,
    -- | The name you choose for your custom language model when you create it.
    CreateLanguageModel -> Text
modelName :: Prelude.Text,
    -- | Contains the data access role and the Amazon S3 prefixes to read the
    -- required input files to create a custom language model.
    CreateLanguageModel -> InputDataConfig
inputDataConfig :: InputDataConfig
  }
  deriving (CreateLanguageModel -> CreateLanguageModel -> Bool
(CreateLanguageModel -> CreateLanguageModel -> Bool)
-> (CreateLanguageModel -> CreateLanguageModel -> Bool)
-> Eq CreateLanguageModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLanguageModel -> CreateLanguageModel -> Bool
$c/= :: CreateLanguageModel -> CreateLanguageModel -> Bool
== :: CreateLanguageModel -> CreateLanguageModel -> Bool
$c== :: CreateLanguageModel -> CreateLanguageModel -> Bool
Prelude.Eq, ReadPrec [CreateLanguageModel]
ReadPrec CreateLanguageModel
Int -> ReadS CreateLanguageModel
ReadS [CreateLanguageModel]
(Int -> ReadS CreateLanguageModel)
-> ReadS [CreateLanguageModel]
-> ReadPrec CreateLanguageModel
-> ReadPrec [CreateLanguageModel]
-> Read CreateLanguageModel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLanguageModel]
$creadListPrec :: ReadPrec [CreateLanguageModel]
readPrec :: ReadPrec CreateLanguageModel
$creadPrec :: ReadPrec CreateLanguageModel
readList :: ReadS [CreateLanguageModel]
$creadList :: ReadS [CreateLanguageModel]
readsPrec :: Int -> ReadS CreateLanguageModel
$creadsPrec :: Int -> ReadS CreateLanguageModel
Prelude.Read, Int -> CreateLanguageModel -> ShowS
[CreateLanguageModel] -> ShowS
CreateLanguageModel -> String
(Int -> CreateLanguageModel -> ShowS)
-> (CreateLanguageModel -> String)
-> ([CreateLanguageModel] -> ShowS)
-> Show CreateLanguageModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLanguageModel] -> ShowS
$cshowList :: [CreateLanguageModel] -> ShowS
show :: CreateLanguageModel -> String
$cshow :: CreateLanguageModel -> String
showsPrec :: Int -> CreateLanguageModel -> ShowS
$cshowsPrec :: Int -> CreateLanguageModel -> ShowS
Prelude.Show, (forall x. CreateLanguageModel -> Rep CreateLanguageModel x)
-> (forall x. Rep CreateLanguageModel x -> CreateLanguageModel)
-> Generic CreateLanguageModel
forall x. Rep CreateLanguageModel x -> CreateLanguageModel
forall x. CreateLanguageModel -> Rep CreateLanguageModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLanguageModel x -> CreateLanguageModel
$cfrom :: forall x. CreateLanguageModel -> Rep CreateLanguageModel x
Prelude.Generic)

-- |
-- Create a value of 'CreateLanguageModel' 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:
--
-- 'tags', 'createLanguageModel_tags' - Adds one or more tags, each in the form of a key:value pair, to a new
-- language model at the time you create this new model.
--
-- 'languageCode', 'createLanguageModel_languageCode' - The language of the input text you\'re using to train your custom
-- language model.
--
-- 'baseModelName', 'createLanguageModel_baseModelName' - The Amazon Transcribe standard language model, or base model used to
-- create your custom language model.
--
-- If you want to use your custom language model to transcribe audio with a
-- sample rate of 16,000 Hz or greater, choose @Wideband@.
--
-- If you want to use your custom language model to transcribe audio with a
-- sample rate that is less than 16,000 Hz, choose @Narrowband@.
--
-- 'modelName', 'createLanguageModel_modelName' - The name you choose for your custom language model when you create it.
--
-- 'inputDataConfig', 'createLanguageModel_inputDataConfig' - Contains the data access role and the Amazon S3 prefixes to read the
-- required input files to create a custom language model.
newCreateLanguageModel ::
  -- | 'languageCode'
  CLMLanguageCode ->
  -- | 'baseModelName'
  BaseModelName ->
  -- | 'modelName'
  Prelude.Text ->
  -- | 'inputDataConfig'
  InputDataConfig ->
  CreateLanguageModel
newCreateLanguageModel :: CLMLanguageCode
-> BaseModelName -> Text -> InputDataConfig -> CreateLanguageModel
newCreateLanguageModel
  CLMLanguageCode
pLanguageCode_
  BaseModelName
pBaseModelName_
  Text
pModelName_
  InputDataConfig
pInputDataConfig_ =
    CreateLanguageModel' :: Maybe (NonEmpty Tag)
-> CLMLanguageCode
-> BaseModelName
-> Text
-> InputDataConfig
-> CreateLanguageModel
CreateLanguageModel'
      { $sel:tags:CreateLanguageModel' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
        $sel:languageCode:CreateLanguageModel' :: CLMLanguageCode
languageCode = CLMLanguageCode
pLanguageCode_,
        $sel:baseModelName:CreateLanguageModel' :: BaseModelName
baseModelName = BaseModelName
pBaseModelName_,
        $sel:modelName:CreateLanguageModel' :: Text
modelName = Text
pModelName_,
        $sel:inputDataConfig:CreateLanguageModel' :: InputDataConfig
inputDataConfig = InputDataConfig
pInputDataConfig_
      }

-- | Adds one or more tags, each in the form of a key:value pair, to a new
-- language model at the time you create this new model.
createLanguageModel_tags :: Lens.Lens' CreateLanguageModel (Prelude.Maybe (Prelude.NonEmpty Tag))
createLanguageModel_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateLanguageModel -> f CreateLanguageModel
createLanguageModel_tags = (CreateLanguageModel -> Maybe (NonEmpty Tag))
-> (CreateLanguageModel
    -> Maybe (NonEmpty Tag) -> CreateLanguageModel)
-> Lens
     CreateLanguageModel
     CreateLanguageModel
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLanguageModel' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateLanguageModel' :: CreateLanguageModel -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateLanguageModel
s@CreateLanguageModel' {} Maybe (NonEmpty Tag)
a -> CreateLanguageModel
s {$sel:tags:CreateLanguageModel' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateLanguageModel) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateLanguageModel -> f CreateLanguageModel)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateLanguageModel
-> f CreateLanguageModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty 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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The language of the input text you\'re using to train your custom
-- language model.
createLanguageModel_languageCode :: Lens.Lens' CreateLanguageModel CLMLanguageCode
createLanguageModel_languageCode :: (CLMLanguageCode -> f CLMLanguageCode)
-> CreateLanguageModel -> f CreateLanguageModel
createLanguageModel_languageCode = (CreateLanguageModel -> CLMLanguageCode)
-> (CreateLanguageModel -> CLMLanguageCode -> CreateLanguageModel)
-> Lens
     CreateLanguageModel
     CreateLanguageModel
     CLMLanguageCode
     CLMLanguageCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLanguageModel' {CLMLanguageCode
languageCode :: CLMLanguageCode
$sel:languageCode:CreateLanguageModel' :: CreateLanguageModel -> CLMLanguageCode
languageCode} -> CLMLanguageCode
languageCode) (\s :: CreateLanguageModel
s@CreateLanguageModel' {} CLMLanguageCode
a -> CreateLanguageModel
s {$sel:languageCode:CreateLanguageModel' :: CLMLanguageCode
languageCode = CLMLanguageCode
a} :: CreateLanguageModel)

-- | The Amazon Transcribe standard language model, or base model used to
-- create your custom language model.
--
-- If you want to use your custom language model to transcribe audio with a
-- sample rate of 16,000 Hz or greater, choose @Wideband@.
--
-- If you want to use your custom language model to transcribe audio with a
-- sample rate that is less than 16,000 Hz, choose @Narrowband@.
createLanguageModel_baseModelName :: Lens.Lens' CreateLanguageModel BaseModelName
createLanguageModel_baseModelName :: (BaseModelName -> f BaseModelName)
-> CreateLanguageModel -> f CreateLanguageModel
createLanguageModel_baseModelName = (CreateLanguageModel -> BaseModelName)
-> (CreateLanguageModel -> BaseModelName -> CreateLanguageModel)
-> Lens
     CreateLanguageModel CreateLanguageModel BaseModelName BaseModelName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLanguageModel' {BaseModelName
baseModelName :: BaseModelName
$sel:baseModelName:CreateLanguageModel' :: CreateLanguageModel -> BaseModelName
baseModelName} -> BaseModelName
baseModelName) (\s :: CreateLanguageModel
s@CreateLanguageModel' {} BaseModelName
a -> CreateLanguageModel
s {$sel:baseModelName:CreateLanguageModel' :: BaseModelName
baseModelName = BaseModelName
a} :: CreateLanguageModel)

-- | The name you choose for your custom language model when you create it.
createLanguageModel_modelName :: Lens.Lens' CreateLanguageModel Prelude.Text
createLanguageModel_modelName :: (Text -> f Text) -> CreateLanguageModel -> f CreateLanguageModel
createLanguageModel_modelName = (CreateLanguageModel -> Text)
-> (CreateLanguageModel -> Text -> CreateLanguageModel)
-> Lens CreateLanguageModel CreateLanguageModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLanguageModel' {Text
modelName :: Text
$sel:modelName:CreateLanguageModel' :: CreateLanguageModel -> Text
modelName} -> Text
modelName) (\s :: CreateLanguageModel
s@CreateLanguageModel' {} Text
a -> CreateLanguageModel
s {$sel:modelName:CreateLanguageModel' :: Text
modelName = Text
a} :: CreateLanguageModel)

-- | Contains the data access role and the Amazon S3 prefixes to read the
-- required input files to create a custom language model.
createLanguageModel_inputDataConfig :: Lens.Lens' CreateLanguageModel InputDataConfig
createLanguageModel_inputDataConfig :: (InputDataConfig -> f InputDataConfig)
-> CreateLanguageModel -> f CreateLanguageModel
createLanguageModel_inputDataConfig = (CreateLanguageModel -> InputDataConfig)
-> (CreateLanguageModel -> InputDataConfig -> CreateLanguageModel)
-> Lens
     CreateLanguageModel
     CreateLanguageModel
     InputDataConfig
     InputDataConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLanguageModel' {InputDataConfig
inputDataConfig :: InputDataConfig
$sel:inputDataConfig:CreateLanguageModel' :: CreateLanguageModel -> InputDataConfig
inputDataConfig} -> InputDataConfig
inputDataConfig) (\s :: CreateLanguageModel
s@CreateLanguageModel' {} InputDataConfig
a -> CreateLanguageModel
s {$sel:inputDataConfig:CreateLanguageModel' :: InputDataConfig
inputDataConfig = InputDataConfig
a} :: CreateLanguageModel)

instance Core.AWSRequest CreateLanguageModel where
  type
    AWSResponse CreateLanguageModel =
      CreateLanguageModelResponse
  request :: CreateLanguageModel -> Request CreateLanguageModel
request = Service -> CreateLanguageModel -> Request CreateLanguageModel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateLanguageModel
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateLanguageModel)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateLanguageModel))
-> Logger
-> Service
-> Proxy CreateLanguageModel
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateLanguageModel)))
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 CLMLanguageCode
-> Maybe Text
-> Maybe InputDataConfig
-> Maybe BaseModelName
-> Maybe ModelStatus
-> Int
-> CreateLanguageModelResponse
CreateLanguageModelResponse'
            (Maybe CLMLanguageCode
 -> Maybe Text
 -> Maybe InputDataConfig
 -> Maybe BaseModelName
 -> Maybe ModelStatus
 -> Int
 -> CreateLanguageModelResponse)
-> Either String (Maybe CLMLanguageCode)
-> Either
     String
     (Maybe Text
      -> Maybe InputDataConfig
      -> Maybe BaseModelName
      -> Maybe ModelStatus
      -> Int
      -> CreateLanguageModelResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe CLMLanguageCode)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LanguageCode")
            Either
  String
  (Maybe Text
   -> Maybe InputDataConfig
   -> Maybe BaseModelName
   -> Maybe ModelStatus
   -> Int
   -> CreateLanguageModelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe InputDataConfig
      -> Maybe BaseModelName
      -> Maybe ModelStatus
      -> Int
      -> CreateLanguageModelResponse)
forall (f :: * -> *) a b. Applicative f => 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
"ModelName")
            Either
  String
  (Maybe InputDataConfig
   -> Maybe BaseModelName
   -> Maybe ModelStatus
   -> Int
   -> CreateLanguageModelResponse)
-> Either String (Maybe InputDataConfig)
-> Either
     String
     (Maybe BaseModelName
      -> Maybe ModelStatus -> Int -> CreateLanguageModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe InputDataConfig)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"InputDataConfig")
            Either
  String
  (Maybe BaseModelName
   -> Maybe ModelStatus -> Int -> CreateLanguageModelResponse)
-> Either String (Maybe BaseModelName)
-> Either
     String (Maybe ModelStatus -> Int -> CreateLanguageModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe BaseModelName)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"BaseModelName")
            Either
  String (Maybe ModelStatus -> Int -> CreateLanguageModelResponse)
-> Either String (Maybe ModelStatus)
-> Either String (Int -> CreateLanguageModelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ModelStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ModelStatus")
            Either String (Int -> CreateLanguageModelResponse)
-> Either String Int -> Either String CreateLanguageModelResponse
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 CreateLanguageModel

instance Prelude.NFData CreateLanguageModel

instance Core.ToHeaders CreateLanguageModel where
  toHeaders :: CreateLanguageModel -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateLanguageModel -> 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
"Transcribe.CreateLanguageModel" ::
                          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 CreateLanguageModel where
  toJSON :: CreateLanguageModel -> Value
toJSON CreateLanguageModel' {Maybe (NonEmpty Tag)
Text
BaseModelName
CLMLanguageCode
InputDataConfig
inputDataConfig :: InputDataConfig
modelName :: Text
baseModelName :: BaseModelName
languageCode :: CLMLanguageCode
tags :: Maybe (NonEmpty Tag)
$sel:inputDataConfig:CreateLanguageModel' :: CreateLanguageModel -> InputDataConfig
$sel:modelName:CreateLanguageModel' :: CreateLanguageModel -> Text
$sel:baseModelName:CreateLanguageModel' :: CreateLanguageModel -> BaseModelName
$sel:languageCode:CreateLanguageModel' :: CreateLanguageModel -> CLMLanguageCode
$sel:tags:CreateLanguageModel' :: CreateLanguageModel -> Maybe (NonEmpty Tag)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LanguageCode" Text -> CLMLanguageCode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CLMLanguageCode
languageCode),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"BaseModelName" Text -> BaseModelName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= BaseModelName
baseModelName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ModelName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
modelName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"InputDataConfig" Text -> InputDataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InputDataConfig
inputDataConfig)
          ]
      )

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

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

-- | /See:/ 'newCreateLanguageModelResponse' smart constructor.
data CreateLanguageModelResponse = CreateLanguageModelResponse'
  { -- | The language code of the text you\'ve used to create a custom language
    -- model.
    CreateLanguageModelResponse -> Maybe CLMLanguageCode
languageCode :: Prelude.Maybe CLMLanguageCode,
    -- | The name you\'ve chosen for your custom language model.
    CreateLanguageModelResponse -> Maybe Text
modelName :: Prelude.Maybe Prelude.Text,
    -- | The data access role and Amazon S3 prefixes you\'ve chosen to create
    -- your custom language model.
    CreateLanguageModelResponse -> Maybe InputDataConfig
inputDataConfig :: Prelude.Maybe InputDataConfig,
    -- | The Amazon Transcribe standard language model, or base model you\'ve
    -- used to create a custom language model.
    CreateLanguageModelResponse -> Maybe BaseModelName
baseModelName :: Prelude.Maybe BaseModelName,
    -- | The status of the custom language model. When the status is @COMPLETED@
    -- the model is ready to use.
    CreateLanguageModelResponse -> Maybe ModelStatus
modelStatus :: Prelude.Maybe ModelStatus,
    -- | The response's http status code.
    CreateLanguageModelResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateLanguageModelResponse -> CreateLanguageModelResponse -> Bool
(CreateLanguageModelResponse
 -> CreateLanguageModelResponse -> Bool)
-> (CreateLanguageModelResponse
    -> CreateLanguageModelResponse -> Bool)
-> Eq CreateLanguageModelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLanguageModelResponse -> CreateLanguageModelResponse -> Bool
$c/= :: CreateLanguageModelResponse -> CreateLanguageModelResponse -> Bool
== :: CreateLanguageModelResponse -> CreateLanguageModelResponse -> Bool
$c== :: CreateLanguageModelResponse -> CreateLanguageModelResponse -> Bool
Prelude.Eq, ReadPrec [CreateLanguageModelResponse]
ReadPrec CreateLanguageModelResponse
Int -> ReadS CreateLanguageModelResponse
ReadS [CreateLanguageModelResponse]
(Int -> ReadS CreateLanguageModelResponse)
-> ReadS [CreateLanguageModelResponse]
-> ReadPrec CreateLanguageModelResponse
-> ReadPrec [CreateLanguageModelResponse]
-> Read CreateLanguageModelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLanguageModelResponse]
$creadListPrec :: ReadPrec [CreateLanguageModelResponse]
readPrec :: ReadPrec CreateLanguageModelResponse
$creadPrec :: ReadPrec CreateLanguageModelResponse
readList :: ReadS [CreateLanguageModelResponse]
$creadList :: ReadS [CreateLanguageModelResponse]
readsPrec :: Int -> ReadS CreateLanguageModelResponse
$creadsPrec :: Int -> ReadS CreateLanguageModelResponse
Prelude.Read, Int -> CreateLanguageModelResponse -> ShowS
[CreateLanguageModelResponse] -> ShowS
CreateLanguageModelResponse -> String
(Int -> CreateLanguageModelResponse -> ShowS)
-> (CreateLanguageModelResponse -> String)
-> ([CreateLanguageModelResponse] -> ShowS)
-> Show CreateLanguageModelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLanguageModelResponse] -> ShowS
$cshowList :: [CreateLanguageModelResponse] -> ShowS
show :: CreateLanguageModelResponse -> String
$cshow :: CreateLanguageModelResponse -> String
showsPrec :: Int -> CreateLanguageModelResponse -> ShowS
$cshowsPrec :: Int -> CreateLanguageModelResponse -> ShowS
Prelude.Show, (forall x.
 CreateLanguageModelResponse -> Rep CreateLanguageModelResponse x)
-> (forall x.
    Rep CreateLanguageModelResponse x -> CreateLanguageModelResponse)
-> Generic CreateLanguageModelResponse
forall x.
Rep CreateLanguageModelResponse x -> CreateLanguageModelResponse
forall x.
CreateLanguageModelResponse -> Rep CreateLanguageModelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLanguageModelResponse x -> CreateLanguageModelResponse
$cfrom :: forall x.
CreateLanguageModelResponse -> Rep CreateLanguageModelResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateLanguageModelResponse' 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:
--
-- 'languageCode', 'createLanguageModelResponse_languageCode' - The language code of the text you\'ve used to create a custom language
-- model.
--
-- 'modelName', 'createLanguageModelResponse_modelName' - The name you\'ve chosen for your custom language model.
--
-- 'inputDataConfig', 'createLanguageModelResponse_inputDataConfig' - The data access role and Amazon S3 prefixes you\'ve chosen to create
-- your custom language model.
--
-- 'baseModelName', 'createLanguageModelResponse_baseModelName' - The Amazon Transcribe standard language model, or base model you\'ve
-- used to create a custom language model.
--
-- 'modelStatus', 'createLanguageModelResponse_modelStatus' - The status of the custom language model. When the status is @COMPLETED@
-- the model is ready to use.
--
-- 'httpStatus', 'createLanguageModelResponse_httpStatus' - The response's http status code.
newCreateLanguageModelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateLanguageModelResponse
newCreateLanguageModelResponse :: Int -> CreateLanguageModelResponse
newCreateLanguageModelResponse Int
pHttpStatus_ =
  CreateLanguageModelResponse' :: Maybe CLMLanguageCode
-> Maybe Text
-> Maybe InputDataConfig
-> Maybe BaseModelName
-> Maybe ModelStatus
-> Int
-> CreateLanguageModelResponse
CreateLanguageModelResponse'
    { $sel:languageCode:CreateLanguageModelResponse' :: Maybe CLMLanguageCode
languageCode =
        Maybe CLMLanguageCode
forall a. Maybe a
Prelude.Nothing,
      $sel:modelName:CreateLanguageModelResponse' :: Maybe Text
modelName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:inputDataConfig:CreateLanguageModelResponse' :: Maybe InputDataConfig
inputDataConfig = Maybe InputDataConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:baseModelName:CreateLanguageModelResponse' :: Maybe BaseModelName
baseModelName = Maybe BaseModelName
forall a. Maybe a
Prelude.Nothing,
      $sel:modelStatus:CreateLanguageModelResponse' :: Maybe ModelStatus
modelStatus = Maybe ModelStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateLanguageModelResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The language code of the text you\'ve used to create a custom language
-- model.
createLanguageModelResponse_languageCode :: Lens.Lens' CreateLanguageModelResponse (Prelude.Maybe CLMLanguageCode)
createLanguageModelResponse_languageCode :: (Maybe CLMLanguageCode -> f (Maybe CLMLanguageCode))
-> CreateLanguageModelResponse -> f CreateLanguageModelResponse
createLanguageModelResponse_languageCode = (CreateLanguageModelResponse -> Maybe CLMLanguageCode)
-> (CreateLanguageModelResponse
    -> Maybe CLMLanguageCode -> CreateLanguageModelResponse)
-> Lens
     CreateLanguageModelResponse
     CreateLanguageModelResponse
     (Maybe CLMLanguageCode)
     (Maybe CLMLanguageCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLanguageModelResponse' {Maybe CLMLanguageCode
languageCode :: Maybe CLMLanguageCode
$sel:languageCode:CreateLanguageModelResponse' :: CreateLanguageModelResponse -> Maybe CLMLanguageCode
languageCode} -> Maybe CLMLanguageCode
languageCode) (\s :: CreateLanguageModelResponse
s@CreateLanguageModelResponse' {} Maybe CLMLanguageCode
a -> CreateLanguageModelResponse
s {$sel:languageCode:CreateLanguageModelResponse' :: Maybe CLMLanguageCode
languageCode = Maybe CLMLanguageCode
a} :: CreateLanguageModelResponse)

-- | The name you\'ve chosen for your custom language model.
createLanguageModelResponse_modelName :: Lens.Lens' CreateLanguageModelResponse (Prelude.Maybe Prelude.Text)
createLanguageModelResponse_modelName :: (Maybe Text -> f (Maybe Text))
-> CreateLanguageModelResponse -> f CreateLanguageModelResponse
createLanguageModelResponse_modelName = (CreateLanguageModelResponse -> Maybe Text)
-> (CreateLanguageModelResponse
    -> Maybe Text -> CreateLanguageModelResponse)
-> Lens
     CreateLanguageModelResponse
     CreateLanguageModelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLanguageModelResponse' {Maybe Text
modelName :: Maybe Text
$sel:modelName:CreateLanguageModelResponse' :: CreateLanguageModelResponse -> Maybe Text
modelName} -> Maybe Text
modelName) (\s :: CreateLanguageModelResponse
s@CreateLanguageModelResponse' {} Maybe Text
a -> CreateLanguageModelResponse
s {$sel:modelName:CreateLanguageModelResponse' :: Maybe Text
modelName = Maybe Text
a} :: CreateLanguageModelResponse)

-- | The data access role and Amazon S3 prefixes you\'ve chosen to create
-- your custom language model.
createLanguageModelResponse_inputDataConfig :: Lens.Lens' CreateLanguageModelResponse (Prelude.Maybe InputDataConfig)
createLanguageModelResponse_inputDataConfig :: (Maybe InputDataConfig -> f (Maybe InputDataConfig))
-> CreateLanguageModelResponse -> f CreateLanguageModelResponse
createLanguageModelResponse_inputDataConfig = (CreateLanguageModelResponse -> Maybe InputDataConfig)
-> (CreateLanguageModelResponse
    -> Maybe InputDataConfig -> CreateLanguageModelResponse)
-> Lens
     CreateLanguageModelResponse
     CreateLanguageModelResponse
     (Maybe InputDataConfig)
     (Maybe InputDataConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLanguageModelResponse' {Maybe InputDataConfig
inputDataConfig :: Maybe InputDataConfig
$sel:inputDataConfig:CreateLanguageModelResponse' :: CreateLanguageModelResponse -> Maybe InputDataConfig
inputDataConfig} -> Maybe InputDataConfig
inputDataConfig) (\s :: CreateLanguageModelResponse
s@CreateLanguageModelResponse' {} Maybe InputDataConfig
a -> CreateLanguageModelResponse
s {$sel:inputDataConfig:CreateLanguageModelResponse' :: Maybe InputDataConfig
inputDataConfig = Maybe InputDataConfig
a} :: CreateLanguageModelResponse)

-- | The Amazon Transcribe standard language model, or base model you\'ve
-- used to create a custom language model.
createLanguageModelResponse_baseModelName :: Lens.Lens' CreateLanguageModelResponse (Prelude.Maybe BaseModelName)
createLanguageModelResponse_baseModelName :: (Maybe BaseModelName -> f (Maybe BaseModelName))
-> CreateLanguageModelResponse -> f CreateLanguageModelResponse
createLanguageModelResponse_baseModelName = (CreateLanguageModelResponse -> Maybe BaseModelName)
-> (CreateLanguageModelResponse
    -> Maybe BaseModelName -> CreateLanguageModelResponse)
-> Lens
     CreateLanguageModelResponse
     CreateLanguageModelResponse
     (Maybe BaseModelName)
     (Maybe BaseModelName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLanguageModelResponse' {Maybe BaseModelName
baseModelName :: Maybe BaseModelName
$sel:baseModelName:CreateLanguageModelResponse' :: CreateLanguageModelResponse -> Maybe BaseModelName
baseModelName} -> Maybe BaseModelName
baseModelName) (\s :: CreateLanguageModelResponse
s@CreateLanguageModelResponse' {} Maybe BaseModelName
a -> CreateLanguageModelResponse
s {$sel:baseModelName:CreateLanguageModelResponse' :: Maybe BaseModelName
baseModelName = Maybe BaseModelName
a} :: CreateLanguageModelResponse)

-- | The status of the custom language model. When the status is @COMPLETED@
-- the model is ready to use.
createLanguageModelResponse_modelStatus :: Lens.Lens' CreateLanguageModelResponse (Prelude.Maybe ModelStatus)
createLanguageModelResponse_modelStatus :: (Maybe ModelStatus -> f (Maybe ModelStatus))
-> CreateLanguageModelResponse -> f CreateLanguageModelResponse
createLanguageModelResponse_modelStatus = (CreateLanguageModelResponse -> Maybe ModelStatus)
-> (CreateLanguageModelResponse
    -> Maybe ModelStatus -> CreateLanguageModelResponse)
-> Lens
     CreateLanguageModelResponse
     CreateLanguageModelResponse
     (Maybe ModelStatus)
     (Maybe ModelStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLanguageModelResponse' {Maybe ModelStatus
modelStatus :: Maybe ModelStatus
$sel:modelStatus:CreateLanguageModelResponse' :: CreateLanguageModelResponse -> Maybe ModelStatus
modelStatus} -> Maybe ModelStatus
modelStatus) (\s :: CreateLanguageModelResponse
s@CreateLanguageModelResponse' {} Maybe ModelStatus
a -> CreateLanguageModelResponse
s {$sel:modelStatus:CreateLanguageModelResponse' :: Maybe ModelStatus
modelStatus = Maybe ModelStatus
a} :: CreateLanguageModelResponse)

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

instance Prelude.NFData CreateLanguageModelResponse