{-# 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.BotExportSpecification
-- 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.BotExportSpecification 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 identity of a the bot that was exported.
--
-- /See:/ 'newBotExportSpecification' smart constructor.
data BotExportSpecification = BotExportSpecification'
  { -- | The identifier of the bot assigned by Amazon Lex.
    BotExportSpecification -> Text
botId :: Prelude.Text,
    -- | The version of the bot that was exported. This will be either @DRAFT@ or
    -- the version number.
    BotExportSpecification -> Text
botVersion :: Prelude.Text
  }
  deriving (BotExportSpecification -> BotExportSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BotExportSpecification -> BotExportSpecification -> Bool
$c/= :: BotExportSpecification -> BotExportSpecification -> Bool
== :: BotExportSpecification -> BotExportSpecification -> Bool
$c== :: BotExportSpecification -> BotExportSpecification -> Bool
Prelude.Eq, ReadPrec [BotExportSpecification]
ReadPrec BotExportSpecification
Int -> ReadS BotExportSpecification
ReadS [BotExportSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BotExportSpecification]
$creadListPrec :: ReadPrec [BotExportSpecification]
readPrec :: ReadPrec BotExportSpecification
$creadPrec :: ReadPrec BotExportSpecification
readList :: ReadS [BotExportSpecification]
$creadList :: ReadS [BotExportSpecification]
readsPrec :: Int -> ReadS BotExportSpecification
$creadsPrec :: Int -> ReadS BotExportSpecification
Prelude.Read, Int -> BotExportSpecification -> ShowS
[BotExportSpecification] -> ShowS
BotExportSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotExportSpecification] -> ShowS
$cshowList :: [BotExportSpecification] -> ShowS
show :: BotExportSpecification -> String
$cshow :: BotExportSpecification -> String
showsPrec :: Int -> BotExportSpecification -> ShowS
$cshowsPrec :: Int -> BotExportSpecification -> ShowS
Prelude.Show, forall x. Rep BotExportSpecification x -> BotExportSpecification
forall x. BotExportSpecification -> Rep BotExportSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BotExportSpecification x -> BotExportSpecification
$cfrom :: forall x. BotExportSpecification -> Rep BotExportSpecification x
Prelude.Generic)

-- |
-- Create a value of 'BotExportSpecification' 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', 'botExportSpecification_botId' - The identifier of the bot assigned by Amazon Lex.
--
-- 'botVersion', 'botExportSpecification_botVersion' - The version of the bot that was exported. This will be either @DRAFT@ or
-- the version number.
newBotExportSpecification ::
  -- | 'botId'
  Prelude.Text ->
  -- | 'botVersion'
  Prelude.Text ->
  BotExportSpecification
newBotExportSpecification :: Text -> Text -> BotExportSpecification
newBotExportSpecification Text
pBotId_ Text
pBotVersion_ =
  BotExportSpecification'
    { $sel:botId:BotExportSpecification' :: Text
botId = Text
pBotId_,
      $sel:botVersion:BotExportSpecification' :: Text
botVersion = Text
pBotVersion_
    }

-- | The identifier of the bot assigned by Amazon Lex.
botExportSpecification_botId :: Lens.Lens' BotExportSpecification Prelude.Text
botExportSpecification_botId :: Lens' BotExportSpecification Text
botExportSpecification_botId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotExportSpecification' {Text
botId :: Text
$sel:botId:BotExportSpecification' :: BotExportSpecification -> Text
botId} -> Text
botId) (\s :: BotExportSpecification
s@BotExportSpecification' {} Text
a -> BotExportSpecification
s {$sel:botId:BotExportSpecification' :: Text
botId = Text
a} :: BotExportSpecification)

-- | The version of the bot that was exported. This will be either @DRAFT@ or
-- the version number.
botExportSpecification_botVersion :: Lens.Lens' BotExportSpecification Prelude.Text
botExportSpecification_botVersion :: Lens' BotExportSpecification Text
botExportSpecification_botVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotExportSpecification' {Text
botVersion :: Text
$sel:botVersion:BotExportSpecification' :: BotExportSpecification -> Text
botVersion} -> Text
botVersion) (\s :: BotExportSpecification
s@BotExportSpecification' {} Text
a -> BotExportSpecification
s {$sel:botVersion:BotExportSpecification' :: Text
botVersion = Text
a} :: BotExportSpecification)

instance Data.FromJSON BotExportSpecification where
  parseJSON :: Value -> Parser BotExportSpecification
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BotExportSpecification"
      ( \Object
x ->
          Text -> Text -> BotExportSpecification
BotExportSpecification'
            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")
      )

instance Prelude.Hashable BotExportSpecification where
  hashWithSalt :: Int -> BotExportSpecification -> Int
hashWithSalt Int
_salt BotExportSpecification' {Text
botVersion :: Text
botId :: Text
$sel:botVersion:BotExportSpecification' :: BotExportSpecification -> Text
$sel:botId:BotExportSpecification' :: BotExportSpecification -> 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

instance Prelude.NFData BotExportSpecification where
  rnf :: BotExportSpecification -> ()
rnf BotExportSpecification' {Text
botVersion :: Text
botId :: Text
$sel:botVersion:BotExportSpecification' :: BotExportSpecification -> Text
$sel:botId:BotExportSpecification' :: BotExportSpecification -> 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

instance Data.ToJSON BotExportSpecification where
  toJSON :: BotExportSpecification -> Value
toJSON BotExportSpecification' {Text
botVersion :: Text
botId :: Text
$sel:botVersion:BotExportSpecification' :: BotExportSpecification -> Text
$sel:botId:BotExportSpecification' :: BotExportSpecification -> 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)
          ]
      )