{-# 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.UpdateVocabulary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates an existing custom vocabulary with new values. This operation
-- overwrites all existing information with your new values; you cannot
-- append new terms onto an existing custom vocabulary.
module Amazonka.Transcribe.UpdateVocabulary
  ( -- * Creating a Request
    UpdateVocabulary (..),
    newUpdateVocabulary,

    -- * Request Lenses
    updateVocabulary_phrases,
    updateVocabulary_vocabularyFileUri,
    updateVocabulary_vocabularyName,
    updateVocabulary_languageCode,

    -- * Destructuring the Response
    UpdateVocabularyResponse (..),
    newUpdateVocabularyResponse,

    -- * Response Lenses
    updateVocabularyResponse_languageCode,
    updateVocabularyResponse_lastModifiedTime,
    updateVocabularyResponse_vocabularyName,
    updateVocabularyResponse_vocabularyState,
    updateVocabularyResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transcribe.Types

-- | /See:/ 'newUpdateVocabulary' smart constructor.
data UpdateVocabulary = UpdateVocabulary'
  { -- | Use this parameter if you want to update your custom vocabulary by
    -- including all desired terms, as comma-separated values, within your
    -- request. The other option for updating your custom vocabulary is to save
    -- your entries in a text file and upload them to an Amazon S3 bucket, then
    -- specify the location of your file using the @VocabularyFileUri@
    -- parameter.
    --
    -- Note that if you include @Phrases@ in your request, you cannot use
    -- @VocabularyFileUri@; you must choose one or the other.
    --
    -- Each language has a character set that contains all allowed characters
    -- for that specific language. If you use unsupported characters, your
    -- custom vocabulary filter request fails. Refer to
    -- <https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html Character Sets for Custom Vocabularies>
    -- to get the character set for your language.
    UpdateVocabulary -> Maybe [Text]
phrases :: Prelude.Maybe [Prelude.Text],
    -- | The Amazon S3 location of the text file that contains your custom
    -- vocabulary. The URI must be located in the same Amazon Web Services
    -- Region as the resource you\'re calling.
    --
    -- Here\'s an example URI path:
    -- @s3:\/\/DOC-EXAMPLE-BUCKET\/my-vocab-file.txt@
    --
    -- Note that if you include @VocabularyFileUri@ in your request, you cannot
    -- use the @Phrases@ flag; you must choose one or the other.
    UpdateVocabulary -> Maybe Text
vocabularyFileUri :: Prelude.Maybe Prelude.Text,
    -- | The name of the custom vocabulary you want to update. Custom vocabulary
    -- names are case sensitive.
    UpdateVocabulary -> Text
vocabularyName :: Prelude.Text,
    -- | The language code that represents the language of the entries in the
    -- custom vocabulary you want to update. Each custom vocabulary must
    -- contain terms in only one language.
    --
    -- A custom vocabulary can only be used to transcribe files in the same
    -- language as the custom vocabulary. For example, if you create a custom
    -- vocabulary using US English (@en-US@), you can only apply this custom
    -- vocabulary to files that contain English audio.
    --
    -- For a list of supported languages and their associated language codes,
    -- refer to the
    -- <https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html Supported languages>
    -- table.
    UpdateVocabulary -> LanguageCode
languageCode :: LanguageCode
  }
  deriving (UpdateVocabulary -> UpdateVocabulary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateVocabulary -> UpdateVocabulary -> Bool
$c/= :: UpdateVocabulary -> UpdateVocabulary -> Bool
== :: UpdateVocabulary -> UpdateVocabulary -> Bool
$c== :: UpdateVocabulary -> UpdateVocabulary -> Bool
Prelude.Eq, ReadPrec [UpdateVocabulary]
ReadPrec UpdateVocabulary
Int -> ReadS UpdateVocabulary
ReadS [UpdateVocabulary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateVocabulary]
$creadListPrec :: ReadPrec [UpdateVocabulary]
readPrec :: ReadPrec UpdateVocabulary
$creadPrec :: ReadPrec UpdateVocabulary
readList :: ReadS [UpdateVocabulary]
$creadList :: ReadS [UpdateVocabulary]
readsPrec :: Int -> ReadS UpdateVocabulary
$creadsPrec :: Int -> ReadS UpdateVocabulary
Prelude.Read, Int -> UpdateVocabulary -> ShowS
[UpdateVocabulary] -> ShowS
UpdateVocabulary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateVocabulary] -> ShowS
$cshowList :: [UpdateVocabulary] -> ShowS
show :: UpdateVocabulary -> String
$cshow :: UpdateVocabulary -> String
showsPrec :: Int -> UpdateVocabulary -> ShowS
$cshowsPrec :: Int -> UpdateVocabulary -> ShowS
Prelude.Show, forall x. Rep UpdateVocabulary x -> UpdateVocabulary
forall x. UpdateVocabulary -> Rep UpdateVocabulary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateVocabulary x -> UpdateVocabulary
$cfrom :: forall x. UpdateVocabulary -> Rep UpdateVocabulary x
Prelude.Generic)

-- |
-- Create a value of 'UpdateVocabulary' 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:
--
-- 'phrases', 'updateVocabulary_phrases' - Use this parameter if you want to update your custom vocabulary by
-- including all desired terms, as comma-separated values, within your
-- request. The other option for updating your custom vocabulary is to save
-- your entries in a text file and upload them to an Amazon S3 bucket, then
-- specify the location of your file using the @VocabularyFileUri@
-- parameter.
--
-- Note that if you include @Phrases@ in your request, you cannot use
-- @VocabularyFileUri@; you must choose one or the other.
--
-- Each language has a character set that contains all allowed characters
-- for that specific language. If you use unsupported characters, your
-- custom vocabulary filter request fails. Refer to
-- <https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html Character Sets for Custom Vocabularies>
-- to get the character set for your language.
--
-- 'vocabularyFileUri', 'updateVocabulary_vocabularyFileUri' - The Amazon S3 location of the text file that contains your custom
-- vocabulary. The URI must be located in the same Amazon Web Services
-- Region as the resource you\'re calling.
--
-- Here\'s an example URI path:
-- @s3:\/\/DOC-EXAMPLE-BUCKET\/my-vocab-file.txt@
--
-- Note that if you include @VocabularyFileUri@ in your request, you cannot
-- use the @Phrases@ flag; you must choose one or the other.
--
-- 'vocabularyName', 'updateVocabulary_vocabularyName' - The name of the custom vocabulary you want to update. Custom vocabulary
-- names are case sensitive.
--
-- 'languageCode', 'updateVocabulary_languageCode' - The language code that represents the language of the entries in the
-- custom vocabulary you want to update. Each custom vocabulary must
-- contain terms in only one language.
--
-- A custom vocabulary can only be used to transcribe files in the same
-- language as the custom vocabulary. For example, if you create a custom
-- vocabulary using US English (@en-US@), you can only apply this custom
-- vocabulary to files that contain English audio.
--
-- For a list of supported languages and their associated language codes,
-- refer to the
-- <https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html Supported languages>
-- table.
newUpdateVocabulary ::
  -- | 'vocabularyName'
  Prelude.Text ->
  -- | 'languageCode'
  LanguageCode ->
  UpdateVocabulary
newUpdateVocabulary :: Text -> LanguageCode -> UpdateVocabulary
newUpdateVocabulary Text
pVocabularyName_ LanguageCode
pLanguageCode_ =
  UpdateVocabulary'
    { $sel:phrases:UpdateVocabulary' :: Maybe [Text]
phrases = forall a. Maybe a
Prelude.Nothing,
      $sel:vocabularyFileUri:UpdateVocabulary' :: Maybe Text
vocabularyFileUri = forall a. Maybe a
Prelude.Nothing,
      $sel:vocabularyName:UpdateVocabulary' :: Text
vocabularyName = Text
pVocabularyName_,
      $sel:languageCode:UpdateVocabulary' :: LanguageCode
languageCode = LanguageCode
pLanguageCode_
    }

-- | Use this parameter if you want to update your custom vocabulary by
-- including all desired terms, as comma-separated values, within your
-- request. The other option for updating your custom vocabulary is to save
-- your entries in a text file and upload them to an Amazon S3 bucket, then
-- specify the location of your file using the @VocabularyFileUri@
-- parameter.
--
-- Note that if you include @Phrases@ in your request, you cannot use
-- @VocabularyFileUri@; you must choose one or the other.
--
-- Each language has a character set that contains all allowed characters
-- for that specific language. If you use unsupported characters, your
-- custom vocabulary filter request fails. Refer to
-- <https://docs.aws.amazon.com/transcribe/latest/dg/charsets.html Character Sets for Custom Vocabularies>
-- to get the character set for your language.
updateVocabulary_phrases :: Lens.Lens' UpdateVocabulary (Prelude.Maybe [Prelude.Text])
updateVocabulary_phrases :: Lens' UpdateVocabulary (Maybe [Text])
updateVocabulary_phrases = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVocabulary' {Maybe [Text]
phrases :: Maybe [Text]
$sel:phrases:UpdateVocabulary' :: UpdateVocabulary -> Maybe [Text]
phrases} -> Maybe [Text]
phrases) (\s :: UpdateVocabulary
s@UpdateVocabulary' {} Maybe [Text]
a -> UpdateVocabulary
s {$sel:phrases:UpdateVocabulary' :: Maybe [Text]
phrases = Maybe [Text]
a} :: UpdateVocabulary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon S3 location of the text file that contains your custom
-- vocabulary. The URI must be located in the same Amazon Web Services
-- Region as the resource you\'re calling.
--
-- Here\'s an example URI path:
-- @s3:\/\/DOC-EXAMPLE-BUCKET\/my-vocab-file.txt@
--
-- Note that if you include @VocabularyFileUri@ in your request, you cannot
-- use the @Phrases@ flag; you must choose one or the other.
updateVocabulary_vocabularyFileUri :: Lens.Lens' UpdateVocabulary (Prelude.Maybe Prelude.Text)
updateVocabulary_vocabularyFileUri :: Lens' UpdateVocabulary (Maybe Text)
updateVocabulary_vocabularyFileUri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVocabulary' {Maybe Text
vocabularyFileUri :: Maybe Text
$sel:vocabularyFileUri:UpdateVocabulary' :: UpdateVocabulary -> Maybe Text
vocabularyFileUri} -> Maybe Text
vocabularyFileUri) (\s :: UpdateVocabulary
s@UpdateVocabulary' {} Maybe Text
a -> UpdateVocabulary
s {$sel:vocabularyFileUri:UpdateVocabulary' :: Maybe Text
vocabularyFileUri = Maybe Text
a} :: UpdateVocabulary)

-- | The name of the custom vocabulary you want to update. Custom vocabulary
-- names are case sensitive.
updateVocabulary_vocabularyName :: Lens.Lens' UpdateVocabulary Prelude.Text
updateVocabulary_vocabularyName :: Lens' UpdateVocabulary Text
updateVocabulary_vocabularyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVocabulary' {Text
vocabularyName :: Text
$sel:vocabularyName:UpdateVocabulary' :: UpdateVocabulary -> Text
vocabularyName} -> Text
vocabularyName) (\s :: UpdateVocabulary
s@UpdateVocabulary' {} Text
a -> UpdateVocabulary
s {$sel:vocabularyName:UpdateVocabulary' :: Text
vocabularyName = Text
a} :: UpdateVocabulary)

-- | The language code that represents the language of the entries in the
-- custom vocabulary you want to update. Each custom vocabulary must
-- contain terms in only one language.
--
-- A custom vocabulary can only be used to transcribe files in the same
-- language as the custom vocabulary. For example, if you create a custom
-- vocabulary using US English (@en-US@), you can only apply this custom
-- vocabulary to files that contain English audio.
--
-- For a list of supported languages and their associated language codes,
-- refer to the
-- <https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html Supported languages>
-- table.
updateVocabulary_languageCode :: Lens.Lens' UpdateVocabulary LanguageCode
updateVocabulary_languageCode :: Lens' UpdateVocabulary LanguageCode
updateVocabulary_languageCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVocabulary' {LanguageCode
languageCode :: LanguageCode
$sel:languageCode:UpdateVocabulary' :: UpdateVocabulary -> LanguageCode
languageCode} -> LanguageCode
languageCode) (\s :: UpdateVocabulary
s@UpdateVocabulary' {} LanguageCode
a -> UpdateVocabulary
s {$sel:languageCode:UpdateVocabulary' :: LanguageCode
languageCode = LanguageCode
a} :: UpdateVocabulary)

instance Core.AWSRequest UpdateVocabulary where
  type
    AWSResponse UpdateVocabulary =
      UpdateVocabularyResponse
  request :: (Service -> Service)
-> UpdateVocabulary -> Request UpdateVocabulary
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateVocabulary
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateVocabulary)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe LanguageCode
-> Maybe POSIX
-> Maybe Text
-> Maybe VocabularyState
-> Int
-> UpdateVocabularyResponse
UpdateVocabularyResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LanguageCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastModifiedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"VocabularyName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"VocabularyState")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateVocabulary where
  hashWithSalt :: Int -> UpdateVocabulary -> Int
hashWithSalt Int
_salt UpdateVocabulary' {Maybe [Text]
Maybe Text
Text
LanguageCode
languageCode :: LanguageCode
vocabularyName :: Text
vocabularyFileUri :: Maybe Text
phrases :: Maybe [Text]
$sel:languageCode:UpdateVocabulary' :: UpdateVocabulary -> LanguageCode
$sel:vocabularyName:UpdateVocabulary' :: UpdateVocabulary -> Text
$sel:vocabularyFileUri:UpdateVocabulary' :: UpdateVocabulary -> Maybe Text
$sel:phrases:UpdateVocabulary' :: UpdateVocabulary -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
phrases
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vocabularyFileUri
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vocabularyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LanguageCode
languageCode

instance Prelude.NFData UpdateVocabulary where
  rnf :: UpdateVocabulary -> ()
rnf UpdateVocabulary' {Maybe [Text]
Maybe Text
Text
LanguageCode
languageCode :: LanguageCode
vocabularyName :: Text
vocabularyFileUri :: Maybe Text
phrases :: Maybe [Text]
$sel:languageCode:UpdateVocabulary' :: UpdateVocabulary -> LanguageCode
$sel:vocabularyName:UpdateVocabulary' :: UpdateVocabulary -> Text
$sel:vocabularyFileUri:UpdateVocabulary' :: UpdateVocabulary -> Maybe Text
$sel:phrases:UpdateVocabulary' :: UpdateVocabulary -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
phrases
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vocabularyFileUri
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vocabularyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LanguageCode
languageCode

instance Data.ToHeaders UpdateVocabulary where
  toHeaders :: UpdateVocabulary -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Transcribe.UpdateVocabulary" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateVocabulary where
  toJSON :: UpdateVocabulary -> Value
toJSON UpdateVocabulary' {Maybe [Text]
Maybe Text
Text
LanguageCode
languageCode :: LanguageCode
vocabularyName :: Text
vocabularyFileUri :: Maybe Text
phrases :: Maybe [Text]
$sel:languageCode:UpdateVocabulary' :: UpdateVocabulary -> LanguageCode
$sel:vocabularyName:UpdateVocabulary' :: UpdateVocabulary -> Text
$sel:vocabularyFileUri:UpdateVocabulary' :: UpdateVocabulary -> Maybe Text
$sel:phrases:UpdateVocabulary' :: UpdateVocabulary -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Phrases" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
phrases,
            (Key
"VocabularyFileUri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vocabularyFileUri,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"VocabularyName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
vocabularyName),
            forall a. a -> Maybe a
Prelude.Just (Key
"LanguageCode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= LanguageCode
languageCode)
          ]
      )

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

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

-- | /See:/ 'newUpdateVocabularyResponse' smart constructor.
data UpdateVocabularyResponse = UpdateVocabularyResponse'
  { -- | The language code you selected for your custom vocabulary.
    UpdateVocabularyResponse -> Maybe LanguageCode
languageCode :: Prelude.Maybe LanguageCode,
    -- | The date and time the specified custom vocabulary was last updated.
    --
    -- Timestamps are in the format @YYYY-MM-DD\'T\'HH:MM:SS.SSSSSS-UTC@. For
    -- example, @2022-05-04T12:32:58.761000-07:00@ represents 12:32 PM UTC-7 on
    -- May 4, 2022.
    UpdateVocabularyResponse -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Data.POSIX,
    -- | The name of the updated custom vocabulary.
    UpdateVocabularyResponse -> Maybe Text
vocabularyName :: Prelude.Maybe Prelude.Text,
    -- | The processing state of your custom vocabulary. If the state is @READY@,
    -- you can use the custom vocabulary in a @StartTranscriptionJob@ request.
    UpdateVocabularyResponse -> Maybe VocabularyState
vocabularyState :: Prelude.Maybe VocabularyState,
    -- | The response's http status code.
    UpdateVocabularyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateVocabularyResponse -> UpdateVocabularyResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateVocabularyResponse -> UpdateVocabularyResponse -> Bool
$c/= :: UpdateVocabularyResponse -> UpdateVocabularyResponse -> Bool
== :: UpdateVocabularyResponse -> UpdateVocabularyResponse -> Bool
$c== :: UpdateVocabularyResponse -> UpdateVocabularyResponse -> Bool
Prelude.Eq, ReadPrec [UpdateVocabularyResponse]
ReadPrec UpdateVocabularyResponse
Int -> ReadS UpdateVocabularyResponse
ReadS [UpdateVocabularyResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateVocabularyResponse]
$creadListPrec :: ReadPrec [UpdateVocabularyResponse]
readPrec :: ReadPrec UpdateVocabularyResponse
$creadPrec :: ReadPrec UpdateVocabularyResponse
readList :: ReadS [UpdateVocabularyResponse]
$creadList :: ReadS [UpdateVocabularyResponse]
readsPrec :: Int -> ReadS UpdateVocabularyResponse
$creadsPrec :: Int -> ReadS UpdateVocabularyResponse
Prelude.Read, Int -> UpdateVocabularyResponse -> ShowS
[UpdateVocabularyResponse] -> ShowS
UpdateVocabularyResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateVocabularyResponse] -> ShowS
$cshowList :: [UpdateVocabularyResponse] -> ShowS
show :: UpdateVocabularyResponse -> String
$cshow :: UpdateVocabularyResponse -> String
showsPrec :: Int -> UpdateVocabularyResponse -> ShowS
$cshowsPrec :: Int -> UpdateVocabularyResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateVocabularyResponse x -> UpdateVocabularyResponse
forall x.
UpdateVocabularyResponse -> Rep UpdateVocabularyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateVocabularyResponse x -> UpdateVocabularyResponse
$cfrom :: forall x.
UpdateVocabularyResponse -> Rep UpdateVocabularyResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateVocabularyResponse' 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', 'updateVocabularyResponse_languageCode' - The language code you selected for your custom vocabulary.
--
-- 'lastModifiedTime', 'updateVocabularyResponse_lastModifiedTime' - The date and time the specified custom vocabulary was last updated.
--
-- Timestamps are in the format @YYYY-MM-DD\'T\'HH:MM:SS.SSSSSS-UTC@. For
-- example, @2022-05-04T12:32:58.761000-07:00@ represents 12:32 PM UTC-7 on
-- May 4, 2022.
--
-- 'vocabularyName', 'updateVocabularyResponse_vocabularyName' - The name of the updated custom vocabulary.
--
-- 'vocabularyState', 'updateVocabularyResponse_vocabularyState' - The processing state of your custom vocabulary. If the state is @READY@,
-- you can use the custom vocabulary in a @StartTranscriptionJob@ request.
--
-- 'httpStatus', 'updateVocabularyResponse_httpStatus' - The response's http status code.
newUpdateVocabularyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateVocabularyResponse
newUpdateVocabularyResponse :: Int -> UpdateVocabularyResponse
newUpdateVocabularyResponse Int
pHttpStatus_ =
  UpdateVocabularyResponse'
    { $sel:languageCode:UpdateVocabularyResponse' :: Maybe LanguageCode
languageCode =
        forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:UpdateVocabularyResponse' :: Maybe POSIX
lastModifiedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:vocabularyName:UpdateVocabularyResponse' :: Maybe Text
vocabularyName = forall a. Maybe a
Prelude.Nothing,
      $sel:vocabularyState:UpdateVocabularyResponse' :: Maybe VocabularyState
vocabularyState = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateVocabularyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The language code you selected for your custom vocabulary.
updateVocabularyResponse_languageCode :: Lens.Lens' UpdateVocabularyResponse (Prelude.Maybe LanguageCode)
updateVocabularyResponse_languageCode :: Lens' UpdateVocabularyResponse (Maybe LanguageCode)
updateVocabularyResponse_languageCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVocabularyResponse' {Maybe LanguageCode
languageCode :: Maybe LanguageCode
$sel:languageCode:UpdateVocabularyResponse' :: UpdateVocabularyResponse -> Maybe LanguageCode
languageCode} -> Maybe LanguageCode
languageCode) (\s :: UpdateVocabularyResponse
s@UpdateVocabularyResponse' {} Maybe LanguageCode
a -> UpdateVocabularyResponse
s {$sel:languageCode:UpdateVocabularyResponse' :: Maybe LanguageCode
languageCode = Maybe LanguageCode
a} :: UpdateVocabularyResponse)

-- | The date and time the specified custom vocabulary was last updated.
--
-- Timestamps are in the format @YYYY-MM-DD\'T\'HH:MM:SS.SSSSSS-UTC@. For
-- example, @2022-05-04T12:32:58.761000-07:00@ represents 12:32 PM UTC-7 on
-- May 4, 2022.
updateVocabularyResponse_lastModifiedTime :: Lens.Lens' UpdateVocabularyResponse (Prelude.Maybe Prelude.UTCTime)
updateVocabularyResponse_lastModifiedTime :: Lens' UpdateVocabularyResponse (Maybe UTCTime)
updateVocabularyResponse_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVocabularyResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:UpdateVocabularyResponse' :: UpdateVocabularyResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: UpdateVocabularyResponse
s@UpdateVocabularyResponse' {} Maybe POSIX
a -> UpdateVocabularyResponse
s {$sel:lastModifiedTime:UpdateVocabularyResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: UpdateVocabularyResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the updated custom vocabulary.
updateVocabularyResponse_vocabularyName :: Lens.Lens' UpdateVocabularyResponse (Prelude.Maybe Prelude.Text)
updateVocabularyResponse_vocabularyName :: Lens' UpdateVocabularyResponse (Maybe Text)
updateVocabularyResponse_vocabularyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVocabularyResponse' {Maybe Text
vocabularyName :: Maybe Text
$sel:vocabularyName:UpdateVocabularyResponse' :: UpdateVocabularyResponse -> Maybe Text
vocabularyName} -> Maybe Text
vocabularyName) (\s :: UpdateVocabularyResponse
s@UpdateVocabularyResponse' {} Maybe Text
a -> UpdateVocabularyResponse
s {$sel:vocabularyName:UpdateVocabularyResponse' :: Maybe Text
vocabularyName = Maybe Text
a} :: UpdateVocabularyResponse)

-- | The processing state of your custom vocabulary. If the state is @READY@,
-- you can use the custom vocabulary in a @StartTranscriptionJob@ request.
updateVocabularyResponse_vocabularyState :: Lens.Lens' UpdateVocabularyResponse (Prelude.Maybe VocabularyState)
updateVocabularyResponse_vocabularyState :: Lens' UpdateVocabularyResponse (Maybe VocabularyState)
updateVocabularyResponse_vocabularyState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVocabularyResponse' {Maybe VocabularyState
vocabularyState :: Maybe VocabularyState
$sel:vocabularyState:UpdateVocabularyResponse' :: UpdateVocabularyResponse -> Maybe VocabularyState
vocabularyState} -> Maybe VocabularyState
vocabularyState) (\s :: UpdateVocabularyResponse
s@UpdateVocabularyResponse' {} Maybe VocabularyState
a -> UpdateVocabularyResponse
s {$sel:vocabularyState:UpdateVocabularyResponse' :: Maybe VocabularyState
vocabularyState = Maybe VocabularyState
a} :: UpdateVocabularyResponse)

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

instance Prelude.NFData UpdateVocabularyResponse where
  rnf :: UpdateVocabularyResponse -> ()
rnf UpdateVocabularyResponse' {Int
Maybe Text
Maybe POSIX
Maybe LanguageCode
Maybe VocabularyState
httpStatus :: Int
vocabularyState :: Maybe VocabularyState
vocabularyName :: Maybe Text
lastModifiedTime :: Maybe POSIX
languageCode :: Maybe LanguageCode
$sel:httpStatus:UpdateVocabularyResponse' :: UpdateVocabularyResponse -> Int
$sel:vocabularyState:UpdateVocabularyResponse' :: UpdateVocabularyResponse -> Maybe VocabularyState
$sel:vocabularyName:UpdateVocabularyResponse' :: UpdateVocabularyResponse -> Maybe Text
$sel:lastModifiedTime:UpdateVocabularyResponse' :: UpdateVocabularyResponse -> Maybe POSIX
$sel:languageCode:UpdateVocabularyResponse' :: UpdateVocabularyResponse -> Maybe LanguageCode
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe LanguageCode
languageCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vocabularyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VocabularyState
vocabularyState
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus