{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.LexV2Models.Types.CustomVocabularyImportSpecification
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.LexV2Models.Types.CustomVocabularyImportSpecification 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

-- | Provides the parameters required for importing a custom vocabulary.
--
-- /See:/ 'newCustomVocabularyImportSpecification' smart constructor.
data CustomVocabularyImportSpecification = CustomVocabularyImportSpecification'
  { -- | The identifier of the bot to import the custom vocabulary to.
    CustomVocabularyImportSpecification -> Text
botId :: Prelude.Text,
    -- | The version of the bot to import the custom vocabulary to.
    CustomVocabularyImportSpecification -> Text
botVersion :: Prelude.Text,
    -- | The identifier of the local to import the custom vocabulary to. The
    -- value must be @en_GB@.
    CustomVocabularyImportSpecification -> Text
localeId :: Prelude.Text
  }
  deriving (CustomVocabularyImportSpecification
-> CustomVocabularyImportSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomVocabularyImportSpecification
-> CustomVocabularyImportSpecification -> Bool
$c/= :: CustomVocabularyImportSpecification
-> CustomVocabularyImportSpecification -> Bool
== :: CustomVocabularyImportSpecification
-> CustomVocabularyImportSpecification -> Bool
$c== :: CustomVocabularyImportSpecification
-> CustomVocabularyImportSpecification -> Bool
Prelude.Eq, ReadPrec [CustomVocabularyImportSpecification]
ReadPrec CustomVocabularyImportSpecification
Int -> ReadS CustomVocabularyImportSpecification
ReadS [CustomVocabularyImportSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomVocabularyImportSpecification]
$creadListPrec :: ReadPrec [CustomVocabularyImportSpecification]
readPrec :: ReadPrec CustomVocabularyImportSpecification
$creadPrec :: ReadPrec CustomVocabularyImportSpecification
readList :: ReadS [CustomVocabularyImportSpecification]
$creadList :: ReadS [CustomVocabularyImportSpecification]
readsPrec :: Int -> ReadS CustomVocabularyImportSpecification
$creadsPrec :: Int -> ReadS CustomVocabularyImportSpecification
Prelude.Read, Int -> CustomVocabularyImportSpecification -> ShowS
[CustomVocabularyImportSpecification] -> ShowS
CustomVocabularyImportSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomVocabularyImportSpecification] -> ShowS
$cshowList :: [CustomVocabularyImportSpecification] -> ShowS
show :: CustomVocabularyImportSpecification -> String
$cshow :: CustomVocabularyImportSpecification -> String
showsPrec :: Int -> CustomVocabularyImportSpecification -> ShowS
$cshowsPrec :: Int -> CustomVocabularyImportSpecification -> ShowS
Prelude.Show, forall x.
Rep CustomVocabularyImportSpecification x
-> CustomVocabularyImportSpecification
forall x.
CustomVocabularyImportSpecification
-> Rep CustomVocabularyImportSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomVocabularyImportSpecification x
-> CustomVocabularyImportSpecification
$cfrom :: forall x.
CustomVocabularyImportSpecification
-> Rep CustomVocabularyImportSpecification x
Prelude.Generic)

-- |
-- Create a value of 'CustomVocabularyImportSpecification' 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:
--
-- 'botId', 'customVocabularyImportSpecification_botId' - The identifier of the bot to import the custom vocabulary to.
--
-- 'botVersion', 'customVocabularyImportSpecification_botVersion' - The version of the bot to import the custom vocabulary to.
--
-- 'localeId', 'customVocabularyImportSpecification_localeId' - The identifier of the local to import the custom vocabulary to. The
-- value must be @en_GB@.
newCustomVocabularyImportSpecification ::
  -- | 'botId'
  Prelude.Text ->
  -- | 'botVersion'
  Prelude.Text ->
  -- | 'localeId'
  Prelude.Text ->
  CustomVocabularyImportSpecification
newCustomVocabularyImportSpecification :: Text -> Text -> Text -> CustomVocabularyImportSpecification
newCustomVocabularyImportSpecification
  Text
pBotId_
  Text
pBotVersion_
  Text
pLocaleId_ =
    CustomVocabularyImportSpecification'
      { $sel:botId:CustomVocabularyImportSpecification' :: Text
botId =
          Text
pBotId_,
        $sel:botVersion:CustomVocabularyImportSpecification' :: Text
botVersion = Text
pBotVersion_,
        $sel:localeId:CustomVocabularyImportSpecification' :: Text
localeId = Text
pLocaleId_
      }

-- | The identifier of the bot to import the custom vocabulary to.
customVocabularyImportSpecification_botId :: Lens.Lens' CustomVocabularyImportSpecification Prelude.Text
customVocabularyImportSpecification_botId :: Lens' CustomVocabularyImportSpecification Text
customVocabularyImportSpecification_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomVocabularyImportSpecification' {Text
botId :: Text
$sel:botId:CustomVocabularyImportSpecification' :: CustomVocabularyImportSpecification -> Text
botId} -> Text
botId) (\s :: CustomVocabularyImportSpecification
s@CustomVocabularyImportSpecification' {} Text
a -> CustomVocabularyImportSpecification
s {$sel:botId:CustomVocabularyImportSpecification' :: Text
botId = Text
a} :: CustomVocabularyImportSpecification)

-- | The version of the bot to import the custom vocabulary to.
customVocabularyImportSpecification_botVersion :: Lens.Lens' CustomVocabularyImportSpecification Prelude.Text
customVocabularyImportSpecification_botVersion :: Lens' CustomVocabularyImportSpecification Text
customVocabularyImportSpecification_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomVocabularyImportSpecification' {Text
botVersion :: Text
$sel:botVersion:CustomVocabularyImportSpecification' :: CustomVocabularyImportSpecification -> Text
botVersion} -> Text
botVersion) (\s :: CustomVocabularyImportSpecification
s@CustomVocabularyImportSpecification' {} Text
a -> CustomVocabularyImportSpecification
s {$sel:botVersion:CustomVocabularyImportSpecification' :: Text
botVersion = Text
a} :: CustomVocabularyImportSpecification)

-- | The identifier of the local to import the custom vocabulary to. The
-- value must be @en_GB@.
customVocabularyImportSpecification_localeId :: Lens.Lens' CustomVocabularyImportSpecification Prelude.Text
customVocabularyImportSpecification_localeId :: Lens' CustomVocabularyImportSpecification Text
customVocabularyImportSpecification_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomVocabularyImportSpecification' {Text
localeId :: Text
$sel:localeId:CustomVocabularyImportSpecification' :: CustomVocabularyImportSpecification -> Text
localeId} -> Text
localeId) (\s :: CustomVocabularyImportSpecification
s@CustomVocabularyImportSpecification' {} Text
a -> CustomVocabularyImportSpecification
s {$sel:localeId:CustomVocabularyImportSpecification' :: Text
localeId = Text
a} :: CustomVocabularyImportSpecification)

instance
  Data.FromJSON
    CustomVocabularyImportSpecification
  where
  parseJSON :: Value -> Parser CustomVocabularyImportSpecification
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CustomVocabularyImportSpecification"
      ( \Object
x ->
          Text -> Text -> Text -> CustomVocabularyImportSpecification
CustomVocabularyImportSpecification'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"botId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"botVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"localeId")
      )

instance
  Prelude.Hashable
    CustomVocabularyImportSpecification
  where
  hashWithSalt :: Int -> CustomVocabularyImportSpecification -> Int
hashWithSalt
    Int
_salt
    CustomVocabularyImportSpecification' {Text
localeId :: Text
botVersion :: Text
botId :: Text
$sel:localeId:CustomVocabularyImportSpecification' :: CustomVocabularyImportSpecification -> Text
$sel:botVersion:CustomVocabularyImportSpecification' :: CustomVocabularyImportSpecification -> Text
$sel:botId:CustomVocabularyImportSpecification' :: CustomVocabularyImportSpecification -> Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botVersion
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
localeId

instance
  Prelude.NFData
    CustomVocabularyImportSpecification
  where
  rnf :: CustomVocabularyImportSpecification -> ()
rnf CustomVocabularyImportSpecification' {Text
localeId :: Text
botVersion :: Text
botId :: Text
$sel:localeId:CustomVocabularyImportSpecification' :: CustomVocabularyImportSpecification -> Text
$sel:botVersion:CustomVocabularyImportSpecification' :: CustomVocabularyImportSpecification -> Text
$sel:botId:CustomVocabularyImportSpecification' :: CustomVocabularyImportSpecification -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
botId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
botVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
localeId

instance
  Data.ToJSON
    CustomVocabularyImportSpecification
  where
  toJSON :: CustomVocabularyImportSpecification -> Value
toJSON CustomVocabularyImportSpecification' {Text
localeId :: Text
botVersion :: Text
botId :: Text
$sel:localeId:CustomVocabularyImportSpecification' :: CustomVocabularyImportSpecification -> Text
$sel:botVersion:CustomVocabularyImportSpecification' :: CustomVocabularyImportSpecification -> Text
$sel:botId:CustomVocabularyImportSpecification' :: CustomVocabularyImportSpecification -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"botId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
botId),
            forall a. a -> Maybe a
Prelude.Just (Key
"botVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
botVersion),
            forall a. a -> Maybe a
Prelude.Just (Key
"localeId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
localeId)
          ]
      )