{-# 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.IoT.Types.AwsJobAbortCriteria where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types.AwsJobAbortCriteriaAbortAction
import Amazonka.IoT.Types.AwsJobAbortCriteriaFailureType
import qualified Amazonka.Prelude as Prelude
data AwsJobAbortCriteria = AwsJobAbortCriteria'
{
AwsJobAbortCriteria -> AwsJobAbortCriteriaFailureType
failureType :: AwsJobAbortCriteriaFailureType,
AwsJobAbortCriteria -> AwsJobAbortCriteriaAbortAction
action :: AwsJobAbortCriteriaAbortAction,
AwsJobAbortCriteria -> Double
thresholdPercentage :: Prelude.Double,
AwsJobAbortCriteria -> Natural
minNumberOfExecutedThings :: Prelude.Natural
}
deriving (AwsJobAbortCriteria -> AwsJobAbortCriteria -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsJobAbortCriteria -> AwsJobAbortCriteria -> Bool
$c/= :: AwsJobAbortCriteria -> AwsJobAbortCriteria -> Bool
== :: AwsJobAbortCriteria -> AwsJobAbortCriteria -> Bool
$c== :: AwsJobAbortCriteria -> AwsJobAbortCriteria -> Bool
Prelude.Eq, ReadPrec [AwsJobAbortCriteria]
ReadPrec AwsJobAbortCriteria
Int -> ReadS AwsJobAbortCriteria
ReadS [AwsJobAbortCriteria]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsJobAbortCriteria]
$creadListPrec :: ReadPrec [AwsJobAbortCriteria]
readPrec :: ReadPrec AwsJobAbortCriteria
$creadPrec :: ReadPrec AwsJobAbortCriteria
readList :: ReadS [AwsJobAbortCriteria]
$creadList :: ReadS [AwsJobAbortCriteria]
readsPrec :: Int -> ReadS AwsJobAbortCriteria
$creadsPrec :: Int -> ReadS AwsJobAbortCriteria
Prelude.Read, Int -> AwsJobAbortCriteria -> ShowS
[AwsJobAbortCriteria] -> ShowS
AwsJobAbortCriteria -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsJobAbortCriteria] -> ShowS
$cshowList :: [AwsJobAbortCriteria] -> ShowS
show :: AwsJobAbortCriteria -> String
$cshow :: AwsJobAbortCriteria -> String
showsPrec :: Int -> AwsJobAbortCriteria -> ShowS
$cshowsPrec :: Int -> AwsJobAbortCriteria -> ShowS
Prelude.Show, forall x. Rep AwsJobAbortCriteria x -> AwsJobAbortCriteria
forall x. AwsJobAbortCriteria -> Rep AwsJobAbortCriteria x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsJobAbortCriteria x -> AwsJobAbortCriteria
$cfrom :: forall x. AwsJobAbortCriteria -> Rep AwsJobAbortCriteria x
Prelude.Generic)
newAwsJobAbortCriteria ::
AwsJobAbortCriteriaFailureType ->
AwsJobAbortCriteriaAbortAction ->
Prelude.Double ->
Prelude.Natural ->
AwsJobAbortCriteria
newAwsJobAbortCriteria :: AwsJobAbortCriteriaFailureType
-> AwsJobAbortCriteriaAbortAction
-> Double
-> Natural
-> AwsJobAbortCriteria
newAwsJobAbortCriteria
AwsJobAbortCriteriaFailureType
pFailureType_
AwsJobAbortCriteriaAbortAction
pAction_
Double
pThresholdPercentage_
Natural
pMinNumberOfExecutedThings_ =
AwsJobAbortCriteria'
{ $sel:failureType:AwsJobAbortCriteria' :: AwsJobAbortCriteriaFailureType
failureType = AwsJobAbortCriteriaFailureType
pFailureType_,
$sel:action:AwsJobAbortCriteria' :: AwsJobAbortCriteriaAbortAction
action = AwsJobAbortCriteriaAbortAction
pAction_,
$sel:thresholdPercentage:AwsJobAbortCriteria' :: Double
thresholdPercentage = Double
pThresholdPercentage_,
$sel:minNumberOfExecutedThings:AwsJobAbortCriteria' :: Natural
minNumberOfExecutedThings =
Natural
pMinNumberOfExecutedThings_
}
awsJobAbortCriteria_failureType :: Lens.Lens' AwsJobAbortCriteria AwsJobAbortCriteriaFailureType
awsJobAbortCriteria_failureType :: Lens' AwsJobAbortCriteria AwsJobAbortCriteriaFailureType
awsJobAbortCriteria_failureType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsJobAbortCriteria' {AwsJobAbortCriteriaFailureType
failureType :: AwsJobAbortCriteriaFailureType
$sel:failureType:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> AwsJobAbortCriteriaFailureType
failureType} -> AwsJobAbortCriteriaFailureType
failureType) (\s :: AwsJobAbortCriteria
s@AwsJobAbortCriteria' {} AwsJobAbortCriteriaFailureType
a -> AwsJobAbortCriteria
s {$sel:failureType:AwsJobAbortCriteria' :: AwsJobAbortCriteriaFailureType
failureType = AwsJobAbortCriteriaFailureType
a} :: AwsJobAbortCriteria)
awsJobAbortCriteria_action :: Lens.Lens' AwsJobAbortCriteria AwsJobAbortCriteriaAbortAction
awsJobAbortCriteria_action :: Lens' AwsJobAbortCriteria AwsJobAbortCriteriaAbortAction
awsJobAbortCriteria_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsJobAbortCriteria' {AwsJobAbortCriteriaAbortAction
action :: AwsJobAbortCriteriaAbortAction
$sel:action:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> AwsJobAbortCriteriaAbortAction
action} -> AwsJobAbortCriteriaAbortAction
action) (\s :: AwsJobAbortCriteria
s@AwsJobAbortCriteria' {} AwsJobAbortCriteriaAbortAction
a -> AwsJobAbortCriteria
s {$sel:action:AwsJobAbortCriteria' :: AwsJobAbortCriteriaAbortAction
action = AwsJobAbortCriteriaAbortAction
a} :: AwsJobAbortCriteria)
awsJobAbortCriteria_thresholdPercentage :: Lens.Lens' AwsJobAbortCriteria Prelude.Double
awsJobAbortCriteria_thresholdPercentage :: Lens' AwsJobAbortCriteria Double
awsJobAbortCriteria_thresholdPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsJobAbortCriteria' {Double
thresholdPercentage :: Double
$sel:thresholdPercentage:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> Double
thresholdPercentage} -> Double
thresholdPercentage) (\s :: AwsJobAbortCriteria
s@AwsJobAbortCriteria' {} Double
a -> AwsJobAbortCriteria
s {$sel:thresholdPercentage:AwsJobAbortCriteria' :: Double
thresholdPercentage = Double
a} :: AwsJobAbortCriteria)
awsJobAbortCriteria_minNumberOfExecutedThings :: Lens.Lens' AwsJobAbortCriteria Prelude.Natural
awsJobAbortCriteria_minNumberOfExecutedThings :: Lens' AwsJobAbortCriteria Natural
awsJobAbortCriteria_minNumberOfExecutedThings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsJobAbortCriteria' {Natural
minNumberOfExecutedThings :: Natural
$sel:minNumberOfExecutedThings:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> Natural
minNumberOfExecutedThings} -> Natural
minNumberOfExecutedThings) (\s :: AwsJobAbortCriteria
s@AwsJobAbortCriteria' {} Natural
a -> AwsJobAbortCriteria
s {$sel:minNumberOfExecutedThings:AwsJobAbortCriteria' :: Natural
minNumberOfExecutedThings = Natural
a} :: AwsJobAbortCriteria)
instance Prelude.Hashable AwsJobAbortCriteria where
hashWithSalt :: Int -> AwsJobAbortCriteria -> Int
hashWithSalt Int
_salt AwsJobAbortCriteria' {Double
Natural
AwsJobAbortCriteriaAbortAction
AwsJobAbortCriteriaFailureType
minNumberOfExecutedThings :: Natural
thresholdPercentage :: Double
action :: AwsJobAbortCriteriaAbortAction
failureType :: AwsJobAbortCriteriaFailureType
$sel:minNumberOfExecutedThings:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> Natural
$sel:thresholdPercentage:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> Double
$sel:action:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> AwsJobAbortCriteriaAbortAction
$sel:failureType:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> AwsJobAbortCriteriaFailureType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AwsJobAbortCriteriaFailureType
failureType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AwsJobAbortCriteriaAbortAction
action
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
thresholdPercentage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
minNumberOfExecutedThings
instance Prelude.NFData AwsJobAbortCriteria where
rnf :: AwsJobAbortCriteria -> ()
rnf AwsJobAbortCriteria' {Double
Natural
AwsJobAbortCriteriaAbortAction
AwsJobAbortCriteriaFailureType
minNumberOfExecutedThings :: Natural
thresholdPercentage :: Double
action :: AwsJobAbortCriteriaAbortAction
failureType :: AwsJobAbortCriteriaFailureType
$sel:minNumberOfExecutedThings:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> Natural
$sel:thresholdPercentage:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> Double
$sel:action:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> AwsJobAbortCriteriaAbortAction
$sel:failureType:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> AwsJobAbortCriteriaFailureType
..} =
forall a. NFData a => a -> ()
Prelude.rnf AwsJobAbortCriteriaFailureType
failureType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AwsJobAbortCriteriaAbortAction
action
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
thresholdPercentage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
minNumberOfExecutedThings
instance Data.ToJSON AwsJobAbortCriteria where
toJSON :: AwsJobAbortCriteria -> Value
toJSON AwsJobAbortCriteria' {Double
Natural
AwsJobAbortCriteriaAbortAction
AwsJobAbortCriteriaFailureType
minNumberOfExecutedThings :: Natural
thresholdPercentage :: Double
action :: AwsJobAbortCriteriaAbortAction
failureType :: AwsJobAbortCriteriaFailureType
$sel:minNumberOfExecutedThings:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> Natural
$sel:thresholdPercentage:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> Double
$sel:action:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> AwsJobAbortCriteriaAbortAction
$sel:failureType:AwsJobAbortCriteria' :: AwsJobAbortCriteria -> AwsJobAbortCriteriaFailureType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"failureType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AwsJobAbortCriteriaFailureType
failureType),
forall a. a -> Maybe a
Prelude.Just (Key
"action" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AwsJobAbortCriteriaAbortAction
action),
forall a. a -> Maybe a
Prelude.Just
(Key
"thresholdPercentage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Double
thresholdPercentage),
forall a. a -> Maybe a
Prelude.Just
( Key
"minNumberOfExecutedThings"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
minNumberOfExecutedThings
)
]
)