{-# 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.CustomVocabularyExportSpecification
-- 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.CustomVocabularyExportSpecification 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 exporting a custom vocabulary.
--
-- /See:/ 'newCustomVocabularyExportSpecification' smart constructor.
data CustomVocabularyExportSpecification = CustomVocabularyExportSpecification'
  { -- | The identifier of the bot that contains the custom vocabulary to export.
    CustomVocabularyExportSpecification -> Text
botId :: Prelude.Text,
    -- | The version of the bot that contains the custom vocabulary to export.
    CustomVocabularyExportSpecification -> Text
botVersion :: Prelude.Text,
    -- | The locale of the bot that contains the custom vocabulary to export.
    CustomVocabularyExportSpecification -> Text
localeId :: Prelude.Text
  }
  deriving (CustomVocabularyExportSpecification
-> CustomVocabularyExportSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomVocabularyExportSpecification
-> CustomVocabularyExportSpecification -> Bool
$c/= :: CustomVocabularyExportSpecification
-> CustomVocabularyExportSpecification -> Bool
== :: CustomVocabularyExportSpecification
-> CustomVocabularyExportSpecification -> Bool
$c== :: CustomVocabularyExportSpecification
-> CustomVocabularyExportSpecification -> Bool
Prelude.Eq, ReadPrec [CustomVocabularyExportSpecification]
ReadPrec CustomVocabularyExportSpecification
Int -> ReadS CustomVocabularyExportSpecification
ReadS [CustomVocabularyExportSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomVocabularyExportSpecification]
$creadListPrec :: ReadPrec [CustomVocabularyExportSpecification]
readPrec :: ReadPrec CustomVocabularyExportSpecification
$creadPrec :: ReadPrec CustomVocabularyExportSpecification
readList :: ReadS [CustomVocabularyExportSpecification]
$creadList :: ReadS [CustomVocabularyExportSpecification]
readsPrec :: Int -> ReadS CustomVocabularyExportSpecification
$creadsPrec :: Int -> ReadS CustomVocabularyExportSpecification
Prelude.Read, Int -> CustomVocabularyExportSpecification -> ShowS
[CustomVocabularyExportSpecification] -> ShowS
CustomVocabularyExportSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomVocabularyExportSpecification] -> ShowS
$cshowList :: [CustomVocabularyExportSpecification] -> ShowS
show :: CustomVocabularyExportSpecification -> String
$cshow :: CustomVocabularyExportSpecification -> String
showsPrec :: Int -> CustomVocabularyExportSpecification -> ShowS
$cshowsPrec :: Int -> CustomVocabularyExportSpecification -> ShowS
Prelude.Show, forall x.
Rep CustomVocabularyExportSpecification x
-> CustomVocabularyExportSpecification
forall x.
CustomVocabularyExportSpecification
-> Rep CustomVocabularyExportSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomVocabularyExportSpecification x
-> CustomVocabularyExportSpecification
$cfrom :: forall x.
CustomVocabularyExportSpecification
-> Rep CustomVocabularyExportSpecification x
Prelude.Generic)

-- |
-- Create a value of 'CustomVocabularyExportSpecification' 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', 'customVocabularyExportSpecification_botId' - The identifier of the bot that contains the custom vocabulary to export.
--
-- 'botVersion', 'customVocabularyExportSpecification_botVersion' - The version of the bot that contains the custom vocabulary to export.
--
-- 'localeId', 'customVocabularyExportSpecification_localeId' - The locale of the bot that contains the custom vocabulary to export.
newCustomVocabularyExportSpecification ::
  -- | 'botId'
  Prelude.Text ->
  -- | 'botVersion'
  Prelude.Text ->
  -- | 'localeId'
  Prelude.Text ->
  CustomVocabularyExportSpecification
newCustomVocabularyExportSpecification :: Text -> Text -> Text -> CustomVocabularyExportSpecification
newCustomVocabularyExportSpecification
  Text
pBotId_
  Text
pBotVersion_
  Text
pLocaleId_ =
    CustomVocabularyExportSpecification'
      { $sel:botId:CustomVocabularyExportSpecification' :: Text
botId =
          Text
pBotId_,
        $sel:botVersion:CustomVocabularyExportSpecification' :: Text
botVersion = Text
pBotVersion_,
        $sel:localeId:CustomVocabularyExportSpecification' :: Text
localeId = Text
pLocaleId_
      }

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

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

-- | The locale of the bot that contains the custom vocabulary to export.
customVocabularyExportSpecification_localeId :: Lens.Lens' CustomVocabularyExportSpecification Prelude.Text
customVocabularyExportSpecification_localeId :: Lens' CustomVocabularyExportSpecification Text
customVocabularyExportSpecification_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomVocabularyExportSpecification' {Text
localeId :: Text
$sel:localeId:CustomVocabularyExportSpecification' :: CustomVocabularyExportSpecification -> Text
localeId} -> Text
localeId) (\s :: CustomVocabularyExportSpecification
s@CustomVocabularyExportSpecification' {} Text
a -> CustomVocabularyExportSpecification
s {$sel:localeId:CustomVocabularyExportSpecification' :: Text
localeId = Text
a} :: CustomVocabularyExportSpecification)

instance
  Data.FromJSON
    CustomVocabularyExportSpecification
  where
  parseJSON :: Value -> Parser CustomVocabularyExportSpecification
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CustomVocabularyExportSpecification"
      ( \Object
x ->
          Text -> Text -> Text -> CustomVocabularyExportSpecification
CustomVocabularyExportSpecification'
            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
    CustomVocabularyExportSpecification
  where
  hashWithSalt :: Int -> CustomVocabularyExportSpecification -> Int
hashWithSalt
    Int
_salt
    CustomVocabularyExportSpecification' {Text
localeId :: Text
botVersion :: Text
botId :: Text
$sel:localeId:CustomVocabularyExportSpecification' :: CustomVocabularyExportSpecification -> Text
$sel:botVersion:CustomVocabularyExportSpecification' :: CustomVocabularyExportSpecification -> Text
$sel:botId:CustomVocabularyExportSpecification' :: CustomVocabularyExportSpecification -> 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
    CustomVocabularyExportSpecification
  where
  rnf :: CustomVocabularyExportSpecification -> ()
rnf CustomVocabularyExportSpecification' {Text
localeId :: Text
botVersion :: Text
botId :: Text
$sel:localeId:CustomVocabularyExportSpecification' :: CustomVocabularyExportSpecification -> Text
$sel:botVersion:CustomVocabularyExportSpecification' :: CustomVocabularyExportSpecification -> Text
$sel:botId:CustomVocabularyExportSpecification' :: CustomVocabularyExportSpecification -> 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
    CustomVocabularyExportSpecification
  where
  toJSON :: CustomVocabularyExportSpecification -> Value
toJSON CustomVocabularyExportSpecification' {Text
localeId :: Text
botVersion :: Text
botId :: Text
$sel:localeId:CustomVocabularyExportSpecification' :: CustomVocabularyExportSpecification -> Text
$sel:botVersion:CustomVocabularyExportSpecification' :: CustomVocabularyExportSpecification -> Text
$sel:botId:CustomVocabularyExportSpecification' :: CustomVocabularyExportSpecification -> 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)
          ]
      )