{-# 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.FulfillmentUpdateResponseSpecification 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 FulfillmentUpdateResponseSpecification = FulfillmentUpdateResponseSpecification'
{
FulfillmentUpdateResponseSpecification -> Maybe Bool
allowInterrupt :: Prelude.Maybe Prelude.Bool,
FulfillmentUpdateResponseSpecification -> Natural
frequencyInSeconds :: Prelude.Natural,
FulfillmentUpdateResponseSpecification -> NonEmpty MessageGroup
messageGroups :: Prelude.NonEmpty MessageGroup
}
deriving (FulfillmentUpdateResponseSpecification
-> FulfillmentUpdateResponseSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FulfillmentUpdateResponseSpecification
-> FulfillmentUpdateResponseSpecification -> Bool
$c/= :: FulfillmentUpdateResponseSpecification
-> FulfillmentUpdateResponseSpecification -> Bool
== :: FulfillmentUpdateResponseSpecification
-> FulfillmentUpdateResponseSpecification -> Bool
$c== :: FulfillmentUpdateResponseSpecification
-> FulfillmentUpdateResponseSpecification -> Bool
Prelude.Eq, ReadPrec [FulfillmentUpdateResponseSpecification]
ReadPrec FulfillmentUpdateResponseSpecification
Int -> ReadS FulfillmentUpdateResponseSpecification
ReadS [FulfillmentUpdateResponseSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FulfillmentUpdateResponseSpecification]
$creadListPrec :: ReadPrec [FulfillmentUpdateResponseSpecification]
readPrec :: ReadPrec FulfillmentUpdateResponseSpecification
$creadPrec :: ReadPrec FulfillmentUpdateResponseSpecification
readList :: ReadS [FulfillmentUpdateResponseSpecification]
$creadList :: ReadS [FulfillmentUpdateResponseSpecification]
readsPrec :: Int -> ReadS FulfillmentUpdateResponseSpecification
$creadsPrec :: Int -> ReadS FulfillmentUpdateResponseSpecification
Prelude.Read, Int -> FulfillmentUpdateResponseSpecification -> ShowS
[FulfillmentUpdateResponseSpecification] -> ShowS
FulfillmentUpdateResponseSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FulfillmentUpdateResponseSpecification] -> ShowS
$cshowList :: [FulfillmentUpdateResponseSpecification] -> ShowS
show :: FulfillmentUpdateResponseSpecification -> String
$cshow :: FulfillmentUpdateResponseSpecification -> String
showsPrec :: Int -> FulfillmentUpdateResponseSpecification -> ShowS
$cshowsPrec :: Int -> FulfillmentUpdateResponseSpecification -> ShowS
Prelude.Show, forall x.
Rep FulfillmentUpdateResponseSpecification x
-> FulfillmentUpdateResponseSpecification
forall x.
FulfillmentUpdateResponseSpecification
-> Rep FulfillmentUpdateResponseSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FulfillmentUpdateResponseSpecification x
-> FulfillmentUpdateResponseSpecification
$cfrom :: forall x.
FulfillmentUpdateResponseSpecification
-> Rep FulfillmentUpdateResponseSpecification x
Prelude.Generic)
newFulfillmentUpdateResponseSpecification ::
Prelude.Natural ->
Prelude.NonEmpty MessageGroup ->
FulfillmentUpdateResponseSpecification
newFulfillmentUpdateResponseSpecification :: Natural
-> NonEmpty MessageGroup -> FulfillmentUpdateResponseSpecification
newFulfillmentUpdateResponseSpecification
Natural
pFrequencyInSeconds_
NonEmpty MessageGroup
pMessageGroups_ =
FulfillmentUpdateResponseSpecification'
{ $sel:allowInterrupt:FulfillmentUpdateResponseSpecification' :: Maybe Bool
allowInterrupt =
forall a. Maybe a
Prelude.Nothing,
$sel:frequencyInSeconds:FulfillmentUpdateResponseSpecification' :: Natural
frequencyInSeconds =
Natural
pFrequencyInSeconds_,
$sel:messageGroups:FulfillmentUpdateResponseSpecification' :: 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_
}
fulfillmentUpdateResponseSpecification_allowInterrupt :: Lens.Lens' FulfillmentUpdateResponseSpecification (Prelude.Maybe Prelude.Bool)
fulfillmentUpdateResponseSpecification_allowInterrupt :: Lens' FulfillmentUpdateResponseSpecification (Maybe Bool)
fulfillmentUpdateResponseSpecification_allowInterrupt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FulfillmentUpdateResponseSpecification' {Maybe Bool
allowInterrupt :: Maybe Bool
$sel:allowInterrupt:FulfillmentUpdateResponseSpecification' :: FulfillmentUpdateResponseSpecification -> Maybe Bool
allowInterrupt} -> Maybe Bool
allowInterrupt) (\s :: FulfillmentUpdateResponseSpecification
s@FulfillmentUpdateResponseSpecification' {} Maybe Bool
a -> FulfillmentUpdateResponseSpecification
s {$sel:allowInterrupt:FulfillmentUpdateResponseSpecification' :: Maybe Bool
allowInterrupt = Maybe Bool
a} :: FulfillmentUpdateResponseSpecification)
fulfillmentUpdateResponseSpecification_frequencyInSeconds :: Lens.Lens' FulfillmentUpdateResponseSpecification Prelude.Natural
fulfillmentUpdateResponseSpecification_frequencyInSeconds :: Lens' FulfillmentUpdateResponseSpecification Natural
fulfillmentUpdateResponseSpecification_frequencyInSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FulfillmentUpdateResponseSpecification' {Natural
frequencyInSeconds :: Natural
$sel:frequencyInSeconds:FulfillmentUpdateResponseSpecification' :: FulfillmentUpdateResponseSpecification -> Natural
frequencyInSeconds} -> Natural
frequencyInSeconds) (\s :: FulfillmentUpdateResponseSpecification
s@FulfillmentUpdateResponseSpecification' {} Natural
a -> FulfillmentUpdateResponseSpecification
s {$sel:frequencyInSeconds:FulfillmentUpdateResponseSpecification' :: Natural
frequencyInSeconds = Natural
a} :: FulfillmentUpdateResponseSpecification)
fulfillmentUpdateResponseSpecification_messageGroups :: Lens.Lens' FulfillmentUpdateResponseSpecification (Prelude.NonEmpty MessageGroup)
fulfillmentUpdateResponseSpecification_messageGroups :: Lens'
FulfillmentUpdateResponseSpecification (NonEmpty MessageGroup)
fulfillmentUpdateResponseSpecification_messageGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FulfillmentUpdateResponseSpecification' {NonEmpty MessageGroup
messageGroups :: NonEmpty MessageGroup
$sel:messageGroups:FulfillmentUpdateResponseSpecification' :: FulfillmentUpdateResponseSpecification -> NonEmpty MessageGroup
messageGroups} -> NonEmpty MessageGroup
messageGroups) (\s :: FulfillmentUpdateResponseSpecification
s@FulfillmentUpdateResponseSpecification' {} NonEmpty MessageGroup
a -> FulfillmentUpdateResponseSpecification
s {$sel:messageGroups:FulfillmentUpdateResponseSpecification' :: NonEmpty MessageGroup
messageGroups = NonEmpty MessageGroup
a} :: FulfillmentUpdateResponseSpecification) 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
instance
Data.FromJSON
FulfillmentUpdateResponseSpecification
where
parseJSON :: Value -> Parser FulfillmentUpdateResponseSpecification
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FulfillmentUpdateResponseSpecification"
( \Object
x ->
Maybe Bool
-> Natural
-> NonEmpty MessageGroup
-> FulfillmentUpdateResponseSpecification
FulfillmentUpdateResponseSpecification'
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
"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
"messageGroups")
)
instance
Prelude.Hashable
FulfillmentUpdateResponseSpecification
where
hashWithSalt :: Int -> FulfillmentUpdateResponseSpecification -> Int
hashWithSalt
Int
_salt
FulfillmentUpdateResponseSpecification' {Natural
Maybe Bool
NonEmpty MessageGroup
messageGroups :: NonEmpty MessageGroup
frequencyInSeconds :: Natural
allowInterrupt :: Maybe Bool
$sel:messageGroups:FulfillmentUpdateResponseSpecification' :: FulfillmentUpdateResponseSpecification -> NonEmpty MessageGroup
$sel:frequencyInSeconds:FulfillmentUpdateResponseSpecification' :: FulfillmentUpdateResponseSpecification -> Natural
$sel:allowInterrupt:FulfillmentUpdateResponseSpecification' :: FulfillmentUpdateResponseSpecification -> 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` Natural
frequencyInSeconds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty MessageGroup
messageGroups
instance
Prelude.NFData
FulfillmentUpdateResponseSpecification
where
rnf :: FulfillmentUpdateResponseSpecification -> ()
rnf FulfillmentUpdateResponseSpecification' {Natural
Maybe Bool
NonEmpty MessageGroup
messageGroups :: NonEmpty MessageGroup
frequencyInSeconds :: Natural
allowInterrupt :: Maybe Bool
$sel:messageGroups:FulfillmentUpdateResponseSpecification' :: FulfillmentUpdateResponseSpecification -> NonEmpty MessageGroup
$sel:frequencyInSeconds:FulfillmentUpdateResponseSpecification' :: FulfillmentUpdateResponseSpecification -> Natural
$sel:allowInterrupt:FulfillmentUpdateResponseSpecification' :: FulfillmentUpdateResponseSpecification -> 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 Natural
frequencyInSeconds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty MessageGroup
messageGroups
instance
Data.ToJSON
FulfillmentUpdateResponseSpecification
where
toJSON :: FulfillmentUpdateResponseSpecification -> Value
toJSON FulfillmentUpdateResponseSpecification' {Natural
Maybe Bool
NonEmpty MessageGroup
messageGroups :: NonEmpty MessageGroup
frequencyInSeconds :: Natural
allowInterrupt :: Maybe Bool
$sel:messageGroups:FulfillmentUpdateResponseSpecification' :: FulfillmentUpdateResponseSpecification -> NonEmpty MessageGroup
$sel:frequencyInSeconds:FulfillmentUpdateResponseSpecification' :: FulfillmentUpdateResponseSpecification -> Natural
$sel:allowInterrupt:FulfillmentUpdateResponseSpecification' :: FulfillmentUpdateResponseSpecification -> 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
"frequencyInSeconds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
frequencyInSeconds),
forall a. a -> Maybe a
Prelude.Just
(Key
"messageGroups" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty MessageGroup
messageGroups)
]
)