{-# 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.LookoutEquipment.Types.CountPercent where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data CountPercent = CountPercent'
{
CountPercent -> Int
count :: Prelude.Int,
CountPercent -> Double
percentage :: Prelude.Double
}
deriving (CountPercent -> CountPercent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CountPercent -> CountPercent -> Bool
$c/= :: CountPercent -> CountPercent -> Bool
== :: CountPercent -> CountPercent -> Bool
$c== :: CountPercent -> CountPercent -> Bool
Prelude.Eq, ReadPrec [CountPercent]
ReadPrec CountPercent
Int -> ReadS CountPercent
ReadS [CountPercent]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CountPercent]
$creadListPrec :: ReadPrec [CountPercent]
readPrec :: ReadPrec CountPercent
$creadPrec :: ReadPrec CountPercent
readList :: ReadS [CountPercent]
$creadList :: ReadS [CountPercent]
readsPrec :: Int -> ReadS CountPercent
$creadsPrec :: Int -> ReadS CountPercent
Prelude.Read, Int -> CountPercent -> ShowS
[CountPercent] -> ShowS
CountPercent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CountPercent] -> ShowS
$cshowList :: [CountPercent] -> ShowS
show :: CountPercent -> String
$cshow :: CountPercent -> String
showsPrec :: Int -> CountPercent -> ShowS
$cshowsPrec :: Int -> CountPercent -> ShowS
Prelude.Show, forall x. Rep CountPercent x -> CountPercent
forall x. CountPercent -> Rep CountPercent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CountPercent x -> CountPercent
$cfrom :: forall x. CountPercent -> Rep CountPercent x
Prelude.Generic)
newCountPercent ::
Prelude.Int ->
Prelude.Double ->
CountPercent
newCountPercent :: Int -> Double -> CountPercent
newCountPercent Int
pCount_ Double
pPercentage_ =
CountPercent'
{ $sel:count:CountPercent' :: Int
count = Int
pCount_,
$sel:percentage:CountPercent' :: Double
percentage = Double
pPercentage_
}
countPercent_count :: Lens.Lens' CountPercent Prelude.Int
countPercent_count :: Lens' CountPercent Int
countPercent_count = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CountPercent' {Int
count :: Int
$sel:count:CountPercent' :: CountPercent -> Int
count} -> Int
count) (\s :: CountPercent
s@CountPercent' {} Int
a -> CountPercent
s {$sel:count:CountPercent' :: Int
count = Int
a} :: CountPercent)
countPercent_percentage :: Lens.Lens' CountPercent Prelude.Double
countPercent_percentage :: Lens' CountPercent Double
countPercent_percentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CountPercent' {Double
percentage :: Double
$sel:percentage:CountPercent' :: CountPercent -> Double
percentage} -> Double
percentage) (\s :: CountPercent
s@CountPercent' {} Double
a -> CountPercent
s {$sel:percentage:CountPercent' :: Double
percentage = Double
a} :: CountPercent)
instance Data.FromJSON CountPercent where
parseJSON :: Value -> Parser CountPercent
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CountPercent"
( \Object
x ->
Int -> Double -> CountPercent
CountPercent'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Count")
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
"Percentage")
)
instance Prelude.Hashable CountPercent where
hashWithSalt :: Int -> CountPercent -> Int
hashWithSalt Int
_salt CountPercent' {Double
Int
percentage :: Double
count :: Int
$sel:percentage:CountPercent' :: CountPercent -> Double
$sel:count:CountPercent' :: CountPercent -> Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
count
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
percentage
instance Prelude.NFData CountPercent where
rnf :: CountPercent -> ()
rnf CountPercent' {Double
Int
percentage :: Double
count :: Int
$sel:percentage:CountPercent' :: CountPercent -> Double
$sel:count:CountPercent' :: CountPercent -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
count
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Double
percentage