{-# 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.StillWaitingResponseSpecification 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.MessageGroup
import qualified Amazonka.Prelude as Prelude
data StillWaitingResponseSpecification = StillWaitingResponseSpecification'
{
StillWaitingResponseSpecification -> Maybe Bool
allowInterrupt :: Prelude.Maybe Prelude.Bool,
StillWaitingResponseSpecification -> NonEmpty MessageGroup
messageGroups :: Prelude.NonEmpty MessageGroup,
StillWaitingResponseSpecification -> Natural
frequencyInSeconds :: Prelude.Natural,
StillWaitingResponseSpecification -> Natural
timeoutInSeconds :: Prelude.Natural
}
deriving (StillWaitingResponseSpecification
-> StillWaitingResponseSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StillWaitingResponseSpecification
-> StillWaitingResponseSpecification -> Bool
$c/= :: StillWaitingResponseSpecification
-> StillWaitingResponseSpecification -> Bool
== :: StillWaitingResponseSpecification
-> StillWaitingResponseSpecification -> Bool
$c== :: StillWaitingResponseSpecification
-> StillWaitingResponseSpecification -> Bool
Prelude.Eq, ReadPrec [StillWaitingResponseSpecification]
ReadPrec StillWaitingResponseSpecification
Int -> ReadS StillWaitingResponseSpecification
ReadS [StillWaitingResponseSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StillWaitingResponseSpecification]
$creadListPrec :: ReadPrec [StillWaitingResponseSpecification]
readPrec :: ReadPrec StillWaitingResponseSpecification
$creadPrec :: ReadPrec StillWaitingResponseSpecification
readList :: ReadS [StillWaitingResponseSpecification]
$creadList :: ReadS [StillWaitingResponseSpecification]
readsPrec :: Int -> ReadS StillWaitingResponseSpecification
$creadsPrec :: Int -> ReadS StillWaitingResponseSpecification
Prelude.Read, Int -> StillWaitingResponseSpecification -> ShowS
[StillWaitingResponseSpecification] -> ShowS
StillWaitingResponseSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StillWaitingResponseSpecification] -> ShowS
$cshowList :: [StillWaitingResponseSpecification] -> ShowS
show :: StillWaitingResponseSpecification -> String
$cshow :: StillWaitingResponseSpecification -> String
showsPrec :: Int -> StillWaitingResponseSpecification -> ShowS
$cshowsPrec :: Int -> StillWaitingResponseSpecification -> ShowS
Prelude.Show, forall x.
Rep StillWaitingResponseSpecification x
-> StillWaitingResponseSpecification
forall x.
StillWaitingResponseSpecification
-> Rep StillWaitingResponseSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StillWaitingResponseSpecification x
-> StillWaitingResponseSpecification
$cfrom :: forall x.
StillWaitingResponseSpecification
-> Rep StillWaitingResponseSpecification x
Prelude.Generic)
newStillWaitingResponseSpecification ::
Prelude.NonEmpty MessageGroup ->
Prelude.Natural ->
Prelude.Natural ->
StillWaitingResponseSpecification
newStillWaitingResponseSpecification :: NonEmpty MessageGroup
-> Natural -> Natural -> StillWaitingResponseSpecification
newStillWaitingResponseSpecification
NonEmpty MessageGroup
pMessageGroups_
Natural
pFrequencyInSeconds_
Natural
pTimeoutInSeconds_ =
StillWaitingResponseSpecification'
{ $sel:allowInterrupt:StillWaitingResponseSpecification' :: Maybe Bool
allowInterrupt =
forall a. Maybe a
Prelude.Nothing,
$sel:messageGroups:StillWaitingResponseSpecification' :: NonEmpty MessageGroup
messageGroups =
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty MessageGroup
pMessageGroups_,
$sel:frequencyInSeconds:StillWaitingResponseSpecification' :: Natural
frequencyInSeconds =
Natural
pFrequencyInSeconds_,
$sel:timeoutInSeconds:StillWaitingResponseSpecification' :: Natural
timeoutInSeconds = Natural
pTimeoutInSeconds_
}
stillWaitingResponseSpecification_allowInterrupt :: Lens.Lens' StillWaitingResponseSpecification (Prelude.Maybe Prelude.Bool)
stillWaitingResponseSpecification_allowInterrupt :: Lens' StillWaitingResponseSpecification (Maybe Bool)
stillWaitingResponseSpecification_allowInterrupt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StillWaitingResponseSpecification' {Maybe Bool
allowInterrupt :: Maybe Bool
$sel:allowInterrupt:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> Maybe Bool
allowInterrupt} -> Maybe Bool
allowInterrupt) (\s :: StillWaitingResponseSpecification
s@StillWaitingResponseSpecification' {} Maybe Bool
a -> StillWaitingResponseSpecification
s {$sel:allowInterrupt:StillWaitingResponseSpecification' :: Maybe Bool
allowInterrupt = Maybe Bool
a} :: StillWaitingResponseSpecification)
stillWaitingResponseSpecification_messageGroups :: Lens.Lens' StillWaitingResponseSpecification (Prelude.NonEmpty MessageGroup)
stillWaitingResponseSpecification_messageGroups :: Lens' StillWaitingResponseSpecification (NonEmpty MessageGroup)
stillWaitingResponseSpecification_messageGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StillWaitingResponseSpecification' {NonEmpty MessageGroup
messageGroups :: NonEmpty MessageGroup
$sel:messageGroups:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> NonEmpty MessageGroup
messageGroups} -> NonEmpty MessageGroup
messageGroups) (\s :: StillWaitingResponseSpecification
s@StillWaitingResponseSpecification' {} NonEmpty MessageGroup
a -> StillWaitingResponseSpecification
s {$sel:messageGroups:StillWaitingResponseSpecification' :: NonEmpty MessageGroup
messageGroups = NonEmpty MessageGroup
a} :: StillWaitingResponseSpecification) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
stillWaitingResponseSpecification_frequencyInSeconds :: Lens.Lens' StillWaitingResponseSpecification Prelude.Natural
stillWaitingResponseSpecification_frequencyInSeconds :: Lens' StillWaitingResponseSpecification Natural
stillWaitingResponseSpecification_frequencyInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StillWaitingResponseSpecification' {Natural
frequencyInSeconds :: Natural
$sel:frequencyInSeconds:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> Natural
frequencyInSeconds} -> Natural
frequencyInSeconds) (\s :: StillWaitingResponseSpecification
s@StillWaitingResponseSpecification' {} Natural
a -> StillWaitingResponseSpecification
s {$sel:frequencyInSeconds:StillWaitingResponseSpecification' :: Natural
frequencyInSeconds = Natural
a} :: StillWaitingResponseSpecification)
stillWaitingResponseSpecification_timeoutInSeconds :: Lens.Lens' StillWaitingResponseSpecification Prelude.Natural
stillWaitingResponseSpecification_timeoutInSeconds :: Lens' StillWaitingResponseSpecification Natural
stillWaitingResponseSpecification_timeoutInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StillWaitingResponseSpecification' {Natural
timeoutInSeconds :: Natural
$sel:timeoutInSeconds:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> Natural
timeoutInSeconds} -> Natural
timeoutInSeconds) (\s :: StillWaitingResponseSpecification
s@StillWaitingResponseSpecification' {} Natural
a -> StillWaitingResponseSpecification
s {$sel:timeoutInSeconds:StillWaitingResponseSpecification' :: Natural
timeoutInSeconds = Natural
a} :: StillWaitingResponseSpecification)
instance
Data.FromJSON
StillWaitingResponseSpecification
where
parseJSON :: Value -> Parser StillWaitingResponseSpecification
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StillWaitingResponseSpecification"
( \Object
x ->
Maybe Bool
-> NonEmpty MessageGroup
-> Natural
-> Natural
-> StillWaitingResponseSpecification
StillWaitingResponseSpecification'
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
"allowInterrupt")
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
"messageGroups")
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
"frequencyInSeconds")
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
"timeoutInSeconds")
)
instance
Prelude.Hashable
StillWaitingResponseSpecification
where
hashWithSalt :: Int -> StillWaitingResponseSpecification -> Int
hashWithSalt
Int
_salt
StillWaitingResponseSpecification' {Natural
Maybe Bool
NonEmpty MessageGroup
timeoutInSeconds :: Natural
frequencyInSeconds :: Natural
messageGroups :: NonEmpty MessageGroup
allowInterrupt :: Maybe Bool
$sel:timeoutInSeconds:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> Natural
$sel:frequencyInSeconds:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> Natural
$sel:messageGroups:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> NonEmpty MessageGroup
$sel:allowInterrupt:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
allowInterrupt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty MessageGroup
messageGroups
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
frequencyInSeconds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
timeoutInSeconds
instance
Prelude.NFData
StillWaitingResponseSpecification
where
rnf :: StillWaitingResponseSpecification -> ()
rnf StillWaitingResponseSpecification' {Natural
Maybe Bool
NonEmpty MessageGroup
timeoutInSeconds :: Natural
frequencyInSeconds :: Natural
messageGroups :: NonEmpty MessageGroup
allowInterrupt :: Maybe Bool
$sel:timeoutInSeconds:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> Natural
$sel:frequencyInSeconds:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> Natural
$sel:messageGroups:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> NonEmpty MessageGroup
$sel:allowInterrupt:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
allowInterrupt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty MessageGroup
messageGroups
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
frequencyInSeconds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
timeoutInSeconds
instance
Data.ToJSON
StillWaitingResponseSpecification
where
toJSON :: StillWaitingResponseSpecification -> Value
toJSON StillWaitingResponseSpecification' {Natural
Maybe Bool
NonEmpty MessageGroup
timeoutInSeconds :: Natural
frequencyInSeconds :: Natural
messageGroups :: NonEmpty MessageGroup
allowInterrupt :: Maybe Bool
$sel:timeoutInSeconds:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> Natural
$sel:frequencyInSeconds:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> Natural
$sel:messageGroups:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> NonEmpty MessageGroup
$sel:allowInterrupt:StillWaitingResponseSpecification' :: StillWaitingResponseSpecification -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"allowInterrupt" 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
allowInterrupt,
forall a. a -> Maybe a
Prelude.Just (Key
"messageGroups" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty MessageGroup
messageGroups),
forall a. a -> Maybe a
Prelude.Just
(Key
"frequencyInSeconds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
frequencyInSeconds),
forall a. a -> Maybe a
Prelude.Just
(Key
"timeoutInSeconds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
timeoutInSeconds)
]
)