{-# 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 #-}
module Amazonka.LexV2Models.Types.BotImportSpecification where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types.DataPrivacy
import qualified Amazonka.Prelude as Prelude
data BotImportSpecification = BotImportSpecification'
{
BotImportSpecification -> Maybe (HashMap Text Text)
botTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
BotImportSpecification -> Maybe Natural
idleSessionTTLInSeconds :: Prelude.Maybe Prelude.Natural,
BotImportSpecification -> Maybe (HashMap Text Text)
testBotAliasTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
BotImportSpecification -> Text
botName :: Prelude.Text,
BotImportSpecification -> Text
roleArn :: Prelude.Text,
BotImportSpecification -> DataPrivacy
dataPrivacy :: DataPrivacy
}
deriving (BotImportSpecification -> BotImportSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BotImportSpecification -> BotImportSpecification -> Bool
$c/= :: BotImportSpecification -> BotImportSpecification -> Bool
== :: BotImportSpecification -> BotImportSpecification -> Bool
$c== :: BotImportSpecification -> BotImportSpecification -> Bool
Prelude.Eq, ReadPrec [BotImportSpecification]
ReadPrec BotImportSpecification
Int -> ReadS BotImportSpecification
ReadS [BotImportSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BotImportSpecification]
$creadListPrec :: ReadPrec [BotImportSpecification]
readPrec :: ReadPrec BotImportSpecification
$creadPrec :: ReadPrec BotImportSpecification
readList :: ReadS [BotImportSpecification]
$creadList :: ReadS [BotImportSpecification]
readsPrec :: Int -> ReadS BotImportSpecification
$creadsPrec :: Int -> ReadS BotImportSpecification
Prelude.Read, Int -> BotImportSpecification -> ShowS
[BotImportSpecification] -> ShowS
BotImportSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotImportSpecification] -> ShowS
$cshowList :: [BotImportSpecification] -> ShowS
show :: BotImportSpecification -> String
$cshow :: BotImportSpecification -> String
showsPrec :: Int -> BotImportSpecification -> ShowS
$cshowsPrec :: Int -> BotImportSpecification -> ShowS
Prelude.Show, forall x. Rep BotImportSpecification x -> BotImportSpecification
forall x. BotImportSpecification -> Rep BotImportSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BotImportSpecification x -> BotImportSpecification
$cfrom :: forall x. BotImportSpecification -> Rep BotImportSpecification x
Prelude.Generic)
newBotImportSpecification ::
Prelude.Text ->
Prelude.Text ->
DataPrivacy ->
BotImportSpecification
newBotImportSpecification :: Text -> Text -> DataPrivacy -> BotImportSpecification
newBotImportSpecification
Text
pBotName_
Text
pRoleArn_
DataPrivacy
pDataPrivacy_ =
BotImportSpecification'
{ $sel:botTags:BotImportSpecification' :: Maybe (HashMap Text Text)
botTags = forall a. Maybe a
Prelude.Nothing,
$sel:idleSessionTTLInSeconds:BotImportSpecification' :: Maybe Natural
idleSessionTTLInSeconds = forall a. Maybe a
Prelude.Nothing,
$sel:testBotAliasTags:BotImportSpecification' :: Maybe (HashMap Text Text)
testBotAliasTags = forall a. Maybe a
Prelude.Nothing,
$sel:botName:BotImportSpecification' :: Text
botName = Text
pBotName_,
$sel:roleArn:BotImportSpecification' :: Text
roleArn = Text
pRoleArn_,
$sel:dataPrivacy:BotImportSpecification' :: DataPrivacy
dataPrivacy = DataPrivacy
pDataPrivacy_
}
botImportSpecification_botTags :: Lens.Lens' BotImportSpecification (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
botImportSpecification_botTags :: Lens' BotImportSpecification (Maybe (HashMap Text Text))
botImportSpecification_botTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotImportSpecification' {Maybe (HashMap Text Text)
botTags :: Maybe (HashMap Text Text)
$sel:botTags:BotImportSpecification' :: BotImportSpecification -> Maybe (HashMap Text Text)
botTags} -> Maybe (HashMap Text Text)
botTags) (\s :: BotImportSpecification
s@BotImportSpecification' {} Maybe (HashMap Text Text)
a -> BotImportSpecification
s {$sel:botTags:BotImportSpecification' :: Maybe (HashMap Text Text)
botTags = Maybe (HashMap Text Text)
a} :: BotImportSpecification) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
botImportSpecification_idleSessionTTLInSeconds :: Lens.Lens' BotImportSpecification (Prelude.Maybe Prelude.Natural)
botImportSpecification_idleSessionTTLInSeconds :: Lens' BotImportSpecification (Maybe Natural)
botImportSpecification_idleSessionTTLInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotImportSpecification' {Maybe Natural
idleSessionTTLInSeconds :: Maybe Natural
$sel:idleSessionTTLInSeconds:BotImportSpecification' :: BotImportSpecification -> Maybe Natural
idleSessionTTLInSeconds} -> Maybe Natural
idleSessionTTLInSeconds) (\s :: BotImportSpecification
s@BotImportSpecification' {} Maybe Natural
a -> BotImportSpecification
s {$sel:idleSessionTTLInSeconds:BotImportSpecification' :: Maybe Natural
idleSessionTTLInSeconds = Maybe Natural
a} :: BotImportSpecification)
botImportSpecification_testBotAliasTags :: Lens.Lens' BotImportSpecification (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
botImportSpecification_testBotAliasTags :: Lens' BotImportSpecification (Maybe (HashMap Text Text))
botImportSpecification_testBotAliasTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotImportSpecification' {Maybe (HashMap Text Text)
testBotAliasTags :: Maybe (HashMap Text Text)
$sel:testBotAliasTags:BotImportSpecification' :: BotImportSpecification -> Maybe (HashMap Text Text)
testBotAliasTags} -> Maybe (HashMap Text Text)
testBotAliasTags) (\s :: BotImportSpecification
s@BotImportSpecification' {} Maybe (HashMap Text Text)
a -> BotImportSpecification
s {$sel:testBotAliasTags:BotImportSpecification' :: Maybe (HashMap Text Text)
testBotAliasTags = Maybe (HashMap Text Text)
a} :: BotImportSpecification) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
botImportSpecification_botName :: Lens.Lens' BotImportSpecification Prelude.Text
botImportSpecification_botName :: Lens' BotImportSpecification Text
botImportSpecification_botName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotImportSpecification' {Text
botName :: Text
$sel:botName:BotImportSpecification' :: BotImportSpecification -> Text
botName} -> Text
botName) (\s :: BotImportSpecification
s@BotImportSpecification' {} Text
a -> BotImportSpecification
s {$sel:botName:BotImportSpecification' :: Text
botName = Text
a} :: BotImportSpecification)
botImportSpecification_roleArn :: Lens.Lens' BotImportSpecification Prelude.Text
botImportSpecification_roleArn :: Lens' BotImportSpecification Text
botImportSpecification_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotImportSpecification' {Text
roleArn :: Text
$sel:roleArn:BotImportSpecification' :: BotImportSpecification -> Text
roleArn} -> Text
roleArn) (\s :: BotImportSpecification
s@BotImportSpecification' {} Text
a -> BotImportSpecification
s {$sel:roleArn:BotImportSpecification' :: Text
roleArn = Text
a} :: BotImportSpecification)
botImportSpecification_dataPrivacy :: Lens.Lens' BotImportSpecification DataPrivacy
botImportSpecification_dataPrivacy :: Lens' BotImportSpecification DataPrivacy
botImportSpecification_dataPrivacy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotImportSpecification' {DataPrivacy
dataPrivacy :: DataPrivacy
$sel:dataPrivacy:BotImportSpecification' :: BotImportSpecification -> DataPrivacy
dataPrivacy} -> DataPrivacy
dataPrivacy) (\s :: BotImportSpecification
s@BotImportSpecification' {} DataPrivacy
a -> BotImportSpecification
s {$sel:dataPrivacy:BotImportSpecification' :: DataPrivacy
dataPrivacy = DataPrivacy
a} :: BotImportSpecification)
instance Data.FromJSON BotImportSpecification where
parseJSON :: Value -> Parser BotImportSpecification
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BotImportSpecification"
( \Object
x ->
Maybe (HashMap Text Text)
-> Maybe Natural
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> DataPrivacy
-> BotImportSpecification
BotImportSpecification'
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
"botTags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"idleSessionTTLInSeconds")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"testBotAliasTags"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"botName")
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
"roleArn")
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
"dataPrivacy")
)
instance Prelude.Hashable BotImportSpecification where
hashWithSalt :: Int -> BotImportSpecification -> Int
hashWithSalt Int
_salt BotImportSpecification' {Maybe Natural
Maybe (HashMap Text Text)
Text
DataPrivacy
dataPrivacy :: DataPrivacy
roleArn :: Text
botName :: Text
testBotAliasTags :: Maybe (HashMap Text Text)
idleSessionTTLInSeconds :: Maybe Natural
botTags :: Maybe (HashMap Text Text)
$sel:dataPrivacy:BotImportSpecification' :: BotImportSpecification -> DataPrivacy
$sel:roleArn:BotImportSpecification' :: BotImportSpecification -> Text
$sel:botName:BotImportSpecification' :: BotImportSpecification -> Text
$sel:testBotAliasTags:BotImportSpecification' :: BotImportSpecification -> Maybe (HashMap Text Text)
$sel:idleSessionTTLInSeconds:BotImportSpecification' :: BotImportSpecification -> Maybe Natural
$sel:botTags:BotImportSpecification' :: BotImportSpecification -> Maybe (HashMap Text Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
botTags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
idleSessionTTLInSeconds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
testBotAliasTags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
botName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DataPrivacy
dataPrivacy
instance Prelude.NFData BotImportSpecification where
rnf :: BotImportSpecification -> ()
rnf BotImportSpecification' {Maybe Natural
Maybe (HashMap Text Text)
Text
DataPrivacy
dataPrivacy :: DataPrivacy
roleArn :: Text
botName :: Text
testBotAliasTags :: Maybe (HashMap Text Text)
idleSessionTTLInSeconds :: Maybe Natural
botTags :: Maybe (HashMap Text Text)
$sel:dataPrivacy:BotImportSpecification' :: BotImportSpecification -> DataPrivacy
$sel:roleArn:BotImportSpecification' :: BotImportSpecification -> Text
$sel:botName:BotImportSpecification' :: BotImportSpecification -> Text
$sel:testBotAliasTags:BotImportSpecification' :: BotImportSpecification -> Maybe (HashMap Text Text)
$sel:idleSessionTTLInSeconds:BotImportSpecification' :: BotImportSpecification -> Maybe Natural
$sel:botTags:BotImportSpecification' :: BotImportSpecification -> Maybe (HashMap Text Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
botTags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
idleSessionTTLInSeconds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
testBotAliasTags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
botName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DataPrivacy
dataPrivacy
instance Data.ToJSON BotImportSpecification where
toJSON :: BotImportSpecification -> Value
toJSON BotImportSpecification' {Maybe Natural
Maybe (HashMap Text Text)
Text
DataPrivacy
dataPrivacy :: DataPrivacy
roleArn :: Text
botName :: Text
testBotAliasTags :: Maybe (HashMap Text Text)
idleSessionTTLInSeconds :: Maybe Natural
botTags :: Maybe (HashMap Text Text)
$sel:dataPrivacy:BotImportSpecification' :: BotImportSpecification -> DataPrivacy
$sel:roleArn:BotImportSpecification' :: BotImportSpecification -> Text
$sel:botName:BotImportSpecification' :: BotImportSpecification -> Text
$sel:testBotAliasTags:BotImportSpecification' :: BotImportSpecification -> Maybe (HashMap Text Text)
$sel:idleSessionTTLInSeconds:BotImportSpecification' :: BotImportSpecification -> Maybe Natural
$sel:botTags:BotImportSpecification' :: BotImportSpecification -> Maybe (HashMap Text Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"botTags" 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 (HashMap Text Text)
botTags,
(Key
"idleSessionTTLInSeconds" 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 Natural
idleSessionTTLInSeconds,
(Key
"testBotAliasTags" 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 (HashMap Text Text)
testBotAliasTags,
forall a. a -> Maybe a
Prelude.Just (Key
"botName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
botName),
forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn),
forall a. a -> Maybe a
Prelude.Just (Key
"dataPrivacy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DataPrivacy
dataPrivacy)
]
)