{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Connect.Types.LexV2Bot where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(LexV2Bot -> LexV2Bot -> Bool)
-> (LexV2Bot -> LexV2Bot -> Bool) -> Eq LexV2Bot
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]
(Int -> ReadS LexV2Bot)
-> ReadS [LexV2Bot]
-> ReadPrec LexV2Bot
-> ReadPrec [LexV2Bot]
-> Read 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
(Int -> LexV2Bot -> ShowS)
-> (LexV2Bot -> String) -> ([LexV2Bot] -> ShowS) -> Show LexV2Bot
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. LexV2Bot -> Rep LexV2Bot x)
-> (forall x. Rep LexV2Bot x -> LexV2Bot) -> Generic LexV2Bot
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' :: Maybe Text -> LexV2Bot
LexV2Bot' {$sel:aliasArn:LexV2Bot' :: Maybe Text
aliasArn = Maybe Text
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 :: (Maybe Text -> f (Maybe Text)) -> LexV2Bot -> f LexV2Bot
lexV2Bot_aliasArn = (LexV2Bot -> Maybe Text)
-> (LexV2Bot -> Maybe Text -> LexV2Bot)
-> Lens LexV2Bot LexV2Bot (Maybe Text) (Maybe Text)
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 Core.FromJSON LexV2Bot where
  parseJSON :: Value -> Parser LexV2Bot
parseJSON =
    String -> (Object -> Parser LexV2Bot) -> Value -> Parser LexV2Bot
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LexV2Bot"
      ( \Object
x ->
          Maybe Text -> LexV2Bot
LexV2Bot' (Maybe Text -> LexV2Bot) -> Parser (Maybe Text) -> Parser LexV2Bot
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AliasArn")
      )

instance Prelude.Hashable LexV2Bot

instance Prelude.NFData LexV2Bot

instance Core.ToJSON LexV2Bot where
  toJSON :: LexV2Bot -> Value
toJSON LexV2Bot' {Maybe Text
aliasArn :: Maybe Text
$sel:aliasArn:LexV2Bot' :: LexV2Bot -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"AliasArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
aliasArn]
      )