{-# 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.Connect.Types.LexV2Bot
-- 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.Connect.Types.LexV2Bot 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

-- | Configuration information of an Amazon Lex V2 bot.
--
-- /See:/ 'newLexV2Bot' smart constructor.
data LexV2Bot = LexV2Bot'
  { -- | The Amazon Resource Name (ARN) of the Amazon Lex V2 bot.
    LexV2Bot -> Maybe Text
aliasArn :: Prelude.Maybe Prelude.Text
  }
  deriving (LexV2Bot -> LexV2Bot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LexV2Bot -> LexV2Bot -> Bool
$c/= :: LexV2Bot -> LexV2Bot -> Bool
== :: LexV2Bot -> LexV2Bot -> Bool
$c== :: LexV2Bot -> LexV2Bot -> Bool
Prelude.Eq, ReadPrec [LexV2Bot]
ReadPrec LexV2Bot
Int -> ReadS LexV2Bot
ReadS [LexV2Bot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LexV2Bot]
$creadListPrec :: ReadPrec [LexV2Bot]
readPrec :: ReadPrec LexV2Bot
$creadPrec :: ReadPrec LexV2Bot
readList :: ReadS [LexV2Bot]
$creadList :: ReadS [LexV2Bot]
readsPrec :: Int -> ReadS LexV2Bot
$creadsPrec :: Int -> ReadS LexV2Bot
Prelude.Read, Int -> LexV2Bot -> ShowS
[LexV2Bot] -> ShowS
LexV2Bot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LexV2Bot] -> ShowS
$cshowList :: [LexV2Bot] -> ShowS
show :: LexV2Bot -> String
$cshow :: LexV2Bot -> String
showsPrec :: Int -> LexV2Bot -> ShowS
$cshowsPrec :: Int -> LexV2Bot -> ShowS
Prelude.Show, forall x. Rep LexV2Bot x -> LexV2Bot
forall x. LexV2Bot -> Rep LexV2Bot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LexV2Bot x -> LexV2Bot
$cfrom :: forall x. LexV2Bot -> Rep LexV2Bot x
Prelude.Generic)

-- |
-- Create a value of 'LexV2Bot' 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:
--
-- 'aliasArn', 'lexV2Bot_aliasArn' - The Amazon Resource Name (ARN) of the Amazon Lex V2 bot.
newLexV2Bot ::
  LexV2Bot
newLexV2Bot :: LexV2Bot
newLexV2Bot = LexV2Bot' {$sel:aliasArn:LexV2Bot' :: Maybe Text
aliasArn = forall a. Maybe a
Prelude.Nothing}

-- | The Amazon Resource Name (ARN) of the Amazon Lex V2 bot.
lexV2Bot_aliasArn :: Lens.Lens' LexV2Bot (Prelude.Maybe Prelude.Text)
lexV2Bot_aliasArn :: Lens' LexV2Bot (Maybe Text)
lexV2Bot_aliasArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LexV2Bot' {Maybe Text
aliasArn :: Maybe Text
$sel:aliasArn:LexV2Bot' :: LexV2Bot -> Maybe Text
aliasArn} -> Maybe Text
aliasArn) (\s :: LexV2Bot
s@LexV2Bot' {} Maybe Text
a -> LexV2Bot
s {$sel:aliasArn:LexV2Bot' :: Maybe Text
aliasArn = Maybe Text
a} :: LexV2Bot)

instance Data.FromJSON LexV2Bot where
  parseJSON :: Value -> Parser LexV2Bot
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LexV2Bot"
      ( \Object
x ->
          Maybe Text -> LexV2Bot
LexV2Bot' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AliasArn")
      )

instance Prelude.Hashable LexV2Bot where
  hashWithSalt :: Int -> LexV2Bot -> Int
hashWithSalt Int
_salt LexV2Bot' {Maybe Text
aliasArn :: Maybe Text
$sel:aliasArn:LexV2Bot' :: LexV2Bot -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
aliasArn

instance Prelude.NFData LexV2Bot where
  rnf :: LexV2Bot -> ()
rnf LexV2Bot' {Maybe Text
aliasArn :: Maybe Text
$sel:aliasArn:LexV2Bot' :: LexV2Bot -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
aliasArn

instance Data.ToJSON LexV2Bot where
  toJSON :: LexV2Bot -> Value
toJSON LexV2Bot' {Maybe Text
aliasArn :: Maybe Text
$sel:aliasArn:LexV2Bot' :: LexV2Bot -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"AliasArn" 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
aliasArn]
      )