{-# 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.WaitAndContinueSpecification 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.ResponseSpecification
import Amazonka.LexV2Models.Types.StillWaitingResponseSpecification
import qualified Amazonka.Prelude as Prelude
data WaitAndContinueSpecification = WaitAndContinueSpecification'
{
WaitAndContinueSpecification -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
WaitAndContinueSpecification
-> Maybe StillWaitingResponseSpecification
stillWaitingResponse :: Prelude.Maybe StillWaitingResponseSpecification,
WaitAndContinueSpecification -> ResponseSpecification
waitingResponse :: ResponseSpecification,
WaitAndContinueSpecification -> ResponseSpecification
continueResponse :: ResponseSpecification
}
deriving (WaitAndContinueSpecification
-> WaitAndContinueSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WaitAndContinueSpecification
-> WaitAndContinueSpecification -> Bool
$c/= :: WaitAndContinueSpecification
-> WaitAndContinueSpecification -> Bool
== :: WaitAndContinueSpecification
-> WaitAndContinueSpecification -> Bool
$c== :: WaitAndContinueSpecification
-> WaitAndContinueSpecification -> Bool
Prelude.Eq, ReadPrec [WaitAndContinueSpecification]
ReadPrec WaitAndContinueSpecification
Int -> ReadS WaitAndContinueSpecification
ReadS [WaitAndContinueSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WaitAndContinueSpecification]
$creadListPrec :: ReadPrec [WaitAndContinueSpecification]
readPrec :: ReadPrec WaitAndContinueSpecification
$creadPrec :: ReadPrec WaitAndContinueSpecification
readList :: ReadS [WaitAndContinueSpecification]
$creadList :: ReadS [WaitAndContinueSpecification]
readsPrec :: Int -> ReadS WaitAndContinueSpecification
$creadsPrec :: Int -> ReadS WaitAndContinueSpecification
Prelude.Read, Int -> WaitAndContinueSpecification -> ShowS
[WaitAndContinueSpecification] -> ShowS
WaitAndContinueSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WaitAndContinueSpecification] -> ShowS
$cshowList :: [WaitAndContinueSpecification] -> ShowS
show :: WaitAndContinueSpecification -> String
$cshow :: WaitAndContinueSpecification -> String
showsPrec :: Int -> WaitAndContinueSpecification -> ShowS
$cshowsPrec :: Int -> WaitAndContinueSpecification -> ShowS
Prelude.Show, forall x.
Rep WaitAndContinueSpecification x -> WaitAndContinueSpecification
forall x.
WaitAndContinueSpecification -> Rep WaitAndContinueSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WaitAndContinueSpecification x -> WaitAndContinueSpecification
$cfrom :: forall x.
WaitAndContinueSpecification -> Rep WaitAndContinueSpecification x
Prelude.Generic)
newWaitAndContinueSpecification ::
ResponseSpecification ->
ResponseSpecification ->
WaitAndContinueSpecification
newWaitAndContinueSpecification :: ResponseSpecification
-> ResponseSpecification -> WaitAndContinueSpecification
newWaitAndContinueSpecification
ResponseSpecification
pWaitingResponse_
ResponseSpecification
pContinueResponse_ =
WaitAndContinueSpecification'
{ $sel:active:WaitAndContinueSpecification' :: Maybe Bool
active =
forall a. Maybe a
Prelude.Nothing,
$sel:stillWaitingResponse:WaitAndContinueSpecification' :: Maybe StillWaitingResponseSpecification
stillWaitingResponse = forall a. Maybe a
Prelude.Nothing,
$sel:waitingResponse:WaitAndContinueSpecification' :: ResponseSpecification
waitingResponse = ResponseSpecification
pWaitingResponse_,
$sel:continueResponse:WaitAndContinueSpecification' :: ResponseSpecification
continueResponse = ResponseSpecification
pContinueResponse_
}
waitAndContinueSpecification_active :: Lens.Lens' WaitAndContinueSpecification (Prelude.Maybe Prelude.Bool)
waitAndContinueSpecification_active :: Lens' WaitAndContinueSpecification (Maybe Bool)
waitAndContinueSpecification_active = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WaitAndContinueSpecification' {Maybe Bool
active :: Maybe Bool
$sel:active:WaitAndContinueSpecification' :: WaitAndContinueSpecification -> Maybe Bool
active} -> Maybe Bool
active) (\s :: WaitAndContinueSpecification
s@WaitAndContinueSpecification' {} Maybe Bool
a -> WaitAndContinueSpecification
s {$sel:active:WaitAndContinueSpecification' :: Maybe Bool
active = Maybe Bool
a} :: WaitAndContinueSpecification)
waitAndContinueSpecification_stillWaitingResponse :: Lens.Lens' WaitAndContinueSpecification (Prelude.Maybe StillWaitingResponseSpecification)
waitAndContinueSpecification_stillWaitingResponse :: Lens'
WaitAndContinueSpecification
(Maybe StillWaitingResponseSpecification)
waitAndContinueSpecification_stillWaitingResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WaitAndContinueSpecification' {Maybe StillWaitingResponseSpecification
stillWaitingResponse :: Maybe StillWaitingResponseSpecification
$sel:stillWaitingResponse:WaitAndContinueSpecification' :: WaitAndContinueSpecification
-> Maybe StillWaitingResponseSpecification
stillWaitingResponse} -> Maybe StillWaitingResponseSpecification
stillWaitingResponse) (\s :: WaitAndContinueSpecification
s@WaitAndContinueSpecification' {} Maybe StillWaitingResponseSpecification
a -> WaitAndContinueSpecification
s {$sel:stillWaitingResponse:WaitAndContinueSpecification' :: Maybe StillWaitingResponseSpecification
stillWaitingResponse = Maybe StillWaitingResponseSpecification
a} :: WaitAndContinueSpecification)
waitAndContinueSpecification_waitingResponse :: Lens.Lens' WaitAndContinueSpecification ResponseSpecification
waitAndContinueSpecification_waitingResponse :: Lens' WaitAndContinueSpecification ResponseSpecification
waitAndContinueSpecification_waitingResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WaitAndContinueSpecification' {ResponseSpecification
waitingResponse :: ResponseSpecification
$sel:waitingResponse:WaitAndContinueSpecification' :: WaitAndContinueSpecification -> ResponseSpecification
waitingResponse} -> ResponseSpecification
waitingResponse) (\s :: WaitAndContinueSpecification
s@WaitAndContinueSpecification' {} ResponseSpecification
a -> WaitAndContinueSpecification
s {$sel:waitingResponse:WaitAndContinueSpecification' :: ResponseSpecification
waitingResponse = ResponseSpecification
a} :: WaitAndContinueSpecification)
waitAndContinueSpecification_continueResponse :: Lens.Lens' WaitAndContinueSpecification ResponseSpecification
waitAndContinueSpecification_continueResponse :: Lens' WaitAndContinueSpecification ResponseSpecification
waitAndContinueSpecification_continueResponse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WaitAndContinueSpecification' {ResponseSpecification
continueResponse :: ResponseSpecification
$sel:continueResponse:WaitAndContinueSpecification' :: WaitAndContinueSpecification -> ResponseSpecification
continueResponse} -> ResponseSpecification
continueResponse) (\s :: WaitAndContinueSpecification
s@WaitAndContinueSpecification' {} ResponseSpecification
a -> WaitAndContinueSpecification
s {$sel:continueResponse:WaitAndContinueSpecification' :: ResponseSpecification
continueResponse = ResponseSpecification
a} :: WaitAndContinueSpecification)
instance Data.FromJSON WaitAndContinueSpecification where
parseJSON :: Value -> Parser WaitAndContinueSpecification
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"WaitAndContinueSpecification"
( \Object
x ->
Maybe Bool
-> Maybe StillWaitingResponseSpecification
-> ResponseSpecification
-> ResponseSpecification
-> WaitAndContinueSpecification
WaitAndContinueSpecification'
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
"active")
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
"stillWaitingResponse")
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
"waitingResponse")
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
"continueResponse")
)
instance
Prelude.Hashable
WaitAndContinueSpecification
where
hashWithSalt :: Int -> WaitAndContinueSpecification -> Int
hashWithSalt Int
_salt WaitAndContinueSpecification' {Maybe Bool
Maybe StillWaitingResponseSpecification
ResponseSpecification
continueResponse :: ResponseSpecification
waitingResponse :: ResponseSpecification
stillWaitingResponse :: Maybe StillWaitingResponseSpecification
active :: Maybe Bool
$sel:continueResponse:WaitAndContinueSpecification' :: WaitAndContinueSpecification -> ResponseSpecification
$sel:waitingResponse:WaitAndContinueSpecification' :: WaitAndContinueSpecification -> ResponseSpecification
$sel:stillWaitingResponse:WaitAndContinueSpecification' :: WaitAndContinueSpecification
-> Maybe StillWaitingResponseSpecification
$sel:active:WaitAndContinueSpecification' :: WaitAndContinueSpecification -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
active
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StillWaitingResponseSpecification
stillWaitingResponse
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResponseSpecification
waitingResponse
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResponseSpecification
continueResponse
instance Prelude.NFData WaitAndContinueSpecification where
rnf :: WaitAndContinueSpecification -> ()
rnf WaitAndContinueSpecification' {Maybe Bool
Maybe StillWaitingResponseSpecification
ResponseSpecification
continueResponse :: ResponseSpecification
waitingResponse :: ResponseSpecification
stillWaitingResponse :: Maybe StillWaitingResponseSpecification
active :: Maybe Bool
$sel:continueResponse:WaitAndContinueSpecification' :: WaitAndContinueSpecification -> ResponseSpecification
$sel:waitingResponse:WaitAndContinueSpecification' :: WaitAndContinueSpecification -> ResponseSpecification
$sel:stillWaitingResponse:WaitAndContinueSpecification' :: WaitAndContinueSpecification
-> Maybe StillWaitingResponseSpecification
$sel:active:WaitAndContinueSpecification' :: WaitAndContinueSpecification -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
active
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StillWaitingResponseSpecification
stillWaitingResponse
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResponseSpecification
waitingResponse
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResponseSpecification
continueResponse
instance Data.ToJSON WaitAndContinueSpecification where
toJSON :: WaitAndContinueSpecification -> Value
toJSON WaitAndContinueSpecification' {Maybe Bool
Maybe StillWaitingResponseSpecification
ResponseSpecification
continueResponse :: ResponseSpecification
waitingResponse :: ResponseSpecification
stillWaitingResponse :: Maybe StillWaitingResponseSpecification
active :: Maybe Bool
$sel:continueResponse:WaitAndContinueSpecification' :: WaitAndContinueSpecification -> ResponseSpecification
$sel:waitingResponse:WaitAndContinueSpecification' :: WaitAndContinueSpecification -> ResponseSpecification
$sel:stillWaitingResponse:WaitAndContinueSpecification' :: WaitAndContinueSpecification
-> Maybe StillWaitingResponseSpecification
$sel:active:WaitAndContinueSpecification' :: WaitAndContinueSpecification -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"active" 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 Bool
active,
(Key
"stillWaitingResponse" 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 StillWaitingResponseSpecification
stillWaitingResponse,
forall a. a -> Maybe a
Prelude.Just
(Key
"waitingResponse" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ResponseSpecification
waitingResponse),
forall a. a -> Maybe a
Prelude.Just
(Key
"continueResponse" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ResponseSpecification
continueResponse)
]
)