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