{-# 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.QuickSight.Types.BinWidthOptions 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 BinWidthOptions = BinWidthOptions'
{
BinWidthOptions -> Maybe Natural
binCountLimit :: Prelude.Maybe Prelude.Natural,
BinWidthOptions -> Maybe Double
value :: Prelude.Maybe Prelude.Double
}
deriving (BinWidthOptions -> BinWidthOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BinWidthOptions -> BinWidthOptions -> Bool
$c/= :: BinWidthOptions -> BinWidthOptions -> Bool
== :: BinWidthOptions -> BinWidthOptions -> Bool
$c== :: BinWidthOptions -> BinWidthOptions -> Bool
Prelude.Eq, ReadPrec [BinWidthOptions]
ReadPrec BinWidthOptions
Int -> ReadS BinWidthOptions
ReadS [BinWidthOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BinWidthOptions]
$creadListPrec :: ReadPrec [BinWidthOptions]
readPrec :: ReadPrec BinWidthOptions
$creadPrec :: ReadPrec BinWidthOptions
readList :: ReadS [BinWidthOptions]
$creadList :: ReadS [BinWidthOptions]
readsPrec :: Int -> ReadS BinWidthOptions
$creadsPrec :: Int -> ReadS BinWidthOptions
Prelude.Read, Int -> BinWidthOptions -> ShowS
[BinWidthOptions] -> ShowS
BinWidthOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BinWidthOptions] -> ShowS
$cshowList :: [BinWidthOptions] -> ShowS
show :: BinWidthOptions -> String
$cshow :: BinWidthOptions -> String
showsPrec :: Int -> BinWidthOptions -> ShowS
$cshowsPrec :: Int -> BinWidthOptions -> ShowS
Prelude.Show, forall x. Rep BinWidthOptions x -> BinWidthOptions
forall x. BinWidthOptions -> Rep BinWidthOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BinWidthOptions x -> BinWidthOptions
$cfrom :: forall x. BinWidthOptions -> Rep BinWidthOptions x
Prelude.Generic)
newBinWidthOptions ::
BinWidthOptions
newBinWidthOptions :: BinWidthOptions
newBinWidthOptions =
BinWidthOptions'
{ $sel:binCountLimit:BinWidthOptions' :: Maybe Natural
binCountLimit = forall a. Maybe a
Prelude.Nothing,
$sel:value:BinWidthOptions' :: Maybe Double
value = forall a. Maybe a
Prelude.Nothing
}
binWidthOptions_binCountLimit :: Lens.Lens' BinWidthOptions (Prelude.Maybe Prelude.Natural)
binWidthOptions_binCountLimit :: Lens' BinWidthOptions (Maybe Natural)
binWidthOptions_binCountLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BinWidthOptions' {Maybe Natural
binCountLimit :: Maybe Natural
$sel:binCountLimit:BinWidthOptions' :: BinWidthOptions -> Maybe Natural
binCountLimit} -> Maybe Natural
binCountLimit) (\s :: BinWidthOptions
s@BinWidthOptions' {} Maybe Natural
a -> BinWidthOptions
s {$sel:binCountLimit:BinWidthOptions' :: Maybe Natural
binCountLimit = Maybe Natural
a} :: BinWidthOptions)
binWidthOptions_value :: Lens.Lens' BinWidthOptions (Prelude.Maybe Prelude.Double)
binWidthOptions_value :: Lens' BinWidthOptions (Maybe Double)
binWidthOptions_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BinWidthOptions' {Maybe Double
value :: Maybe Double
$sel:value:BinWidthOptions' :: BinWidthOptions -> Maybe Double
value} -> Maybe Double
value) (\s :: BinWidthOptions
s@BinWidthOptions' {} Maybe Double
a -> BinWidthOptions
s {$sel:value:BinWidthOptions' :: Maybe Double
value = Maybe Double
a} :: BinWidthOptions)
instance Data.FromJSON BinWidthOptions where
parseJSON :: Value -> Parser BinWidthOptions
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BinWidthOptions"
( \Object
x ->
Maybe Natural -> Maybe Double -> BinWidthOptions
BinWidthOptions'
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
"BinCountLimit")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Value")
)
instance Prelude.Hashable BinWidthOptions where
hashWithSalt :: Int -> BinWidthOptions -> Int
hashWithSalt Int
_salt BinWidthOptions' {Maybe Double
Maybe Natural
value :: Maybe Double
binCountLimit :: Maybe Natural
$sel:value:BinWidthOptions' :: BinWidthOptions -> Maybe Double
$sel:binCountLimit:BinWidthOptions' :: BinWidthOptions -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
binCountLimit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
value
instance Prelude.NFData BinWidthOptions where
rnf :: BinWidthOptions -> ()
rnf BinWidthOptions' {Maybe Double
Maybe Natural
value :: Maybe Double
binCountLimit :: Maybe Natural
$sel:value:BinWidthOptions' :: BinWidthOptions -> Maybe Double
$sel:binCountLimit:BinWidthOptions' :: BinWidthOptions -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
binCountLimit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
value
instance Data.ToJSON BinWidthOptions where
toJSON :: BinWidthOptions -> Value
toJSON BinWidthOptions' {Maybe Double
Maybe Natural
value :: Maybe Double
binCountLimit :: Maybe Natural
$sel:value:BinWidthOptions' :: BinWidthOptions -> Maybe Double
$sel:binCountLimit:BinWidthOptions' :: BinWidthOptions -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"BinCountLimit" 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 Natural
binCountLimit,
(Key
"Value" 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 Double
value
]
)