{-# 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.DeviceFarm.Types.TrialMinutes where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TrialMinutes = TrialMinutes'
{
TrialMinutes -> Maybe Double
remaining :: Prelude.Maybe Prelude.Double,
TrialMinutes -> Maybe Double
total :: Prelude.Maybe Prelude.Double
}
deriving (TrialMinutes -> TrialMinutes -> Bool
(TrialMinutes -> TrialMinutes -> Bool)
-> (TrialMinutes -> TrialMinutes -> Bool) -> Eq TrialMinutes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrialMinutes -> TrialMinutes -> Bool
$c/= :: TrialMinutes -> TrialMinutes -> Bool
== :: TrialMinutes -> TrialMinutes -> Bool
$c== :: TrialMinutes -> TrialMinutes -> Bool
Prelude.Eq, ReadPrec [TrialMinutes]
ReadPrec TrialMinutes
Int -> ReadS TrialMinutes
ReadS [TrialMinutes]
(Int -> ReadS TrialMinutes)
-> ReadS [TrialMinutes]
-> ReadPrec TrialMinutes
-> ReadPrec [TrialMinutes]
-> Read TrialMinutes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrialMinutes]
$creadListPrec :: ReadPrec [TrialMinutes]
readPrec :: ReadPrec TrialMinutes
$creadPrec :: ReadPrec TrialMinutes
readList :: ReadS [TrialMinutes]
$creadList :: ReadS [TrialMinutes]
readsPrec :: Int -> ReadS TrialMinutes
$creadsPrec :: Int -> ReadS TrialMinutes
Prelude.Read, Int -> TrialMinutes -> ShowS
[TrialMinutes] -> ShowS
TrialMinutes -> String
(Int -> TrialMinutes -> ShowS)
-> (TrialMinutes -> String)
-> ([TrialMinutes] -> ShowS)
-> Show TrialMinutes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrialMinutes] -> ShowS
$cshowList :: [TrialMinutes] -> ShowS
show :: TrialMinutes -> String
$cshow :: TrialMinutes -> String
showsPrec :: Int -> TrialMinutes -> ShowS
$cshowsPrec :: Int -> TrialMinutes -> ShowS
Prelude.Show, (forall x. TrialMinutes -> Rep TrialMinutes x)
-> (forall x. Rep TrialMinutes x -> TrialMinutes)
-> Generic TrialMinutes
forall x. Rep TrialMinutes x -> TrialMinutes
forall x. TrialMinutes -> Rep TrialMinutes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TrialMinutes x -> TrialMinutes
$cfrom :: forall x. TrialMinutes -> Rep TrialMinutes x
Prelude.Generic)
newTrialMinutes ::
TrialMinutes
newTrialMinutes :: TrialMinutes
newTrialMinutes =
TrialMinutes' :: Maybe Double -> Maybe Double -> TrialMinutes
TrialMinutes'
{ $sel:remaining:TrialMinutes' :: Maybe Double
remaining = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:total:TrialMinutes' :: Maybe Double
total = Maybe Double
forall a. Maybe a
Prelude.Nothing
}
trialMinutes_remaining :: Lens.Lens' TrialMinutes (Prelude.Maybe Prelude.Double)
trialMinutes_remaining :: (Maybe Double -> f (Maybe Double))
-> TrialMinutes -> f TrialMinutes
trialMinutes_remaining = (TrialMinutes -> Maybe Double)
-> (TrialMinutes -> Maybe Double -> TrialMinutes)
-> Lens TrialMinutes TrialMinutes (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrialMinutes' {Maybe Double
remaining :: Maybe Double
$sel:remaining:TrialMinutes' :: TrialMinutes -> Maybe Double
remaining} -> Maybe Double
remaining) (\s :: TrialMinutes
s@TrialMinutes' {} Maybe Double
a -> TrialMinutes
s {$sel:remaining:TrialMinutes' :: Maybe Double
remaining = Maybe Double
a} :: TrialMinutes)
trialMinutes_total :: Lens.Lens' TrialMinutes (Prelude.Maybe Prelude.Double)
trialMinutes_total :: (Maybe Double -> f (Maybe Double))
-> TrialMinutes -> f TrialMinutes
trialMinutes_total = (TrialMinutes -> Maybe Double)
-> (TrialMinutes -> Maybe Double -> TrialMinutes)
-> Lens TrialMinutes TrialMinutes (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrialMinutes' {Maybe Double
total :: Maybe Double
$sel:total:TrialMinutes' :: TrialMinutes -> Maybe Double
total} -> Maybe Double
total) (\s :: TrialMinutes
s@TrialMinutes' {} Maybe Double
a -> TrialMinutes
s {$sel:total:TrialMinutes' :: Maybe Double
total = Maybe Double
a} :: TrialMinutes)
instance Core.FromJSON TrialMinutes where
parseJSON :: Value -> Parser TrialMinutes
parseJSON =
String
-> (Object -> Parser TrialMinutes) -> Value -> Parser TrialMinutes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TrialMinutes"
( \Object
x ->
Maybe Double -> Maybe Double -> TrialMinutes
TrialMinutes'
(Maybe Double -> Maybe Double -> TrialMinutes)
-> Parser (Maybe Double) -> Parser (Maybe Double -> TrialMinutes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"remaining")
Parser (Maybe Double -> TrialMinutes)
-> Parser (Maybe Double) -> Parser TrialMinutes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"total")
)
instance Prelude.Hashable TrialMinutes
instance Prelude.NFData TrialMinutes