{-# 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.TermsAggregation 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 TermsAggregation = TermsAggregation'
{
TermsAggregation -> Maybe Natural
maxBuckets :: Prelude.Maybe Prelude.Natural
}
deriving (TermsAggregation -> TermsAggregation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TermsAggregation -> TermsAggregation -> Bool
$c/= :: TermsAggregation -> TermsAggregation -> Bool
== :: TermsAggregation -> TermsAggregation -> Bool
$c== :: TermsAggregation -> TermsAggregation -> Bool
Prelude.Eq, ReadPrec [TermsAggregation]
ReadPrec TermsAggregation
Int -> ReadS TermsAggregation
ReadS [TermsAggregation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TermsAggregation]
$creadListPrec :: ReadPrec [TermsAggregation]
readPrec :: ReadPrec TermsAggregation
$creadPrec :: ReadPrec TermsAggregation
readList :: ReadS [TermsAggregation]
$creadList :: ReadS [TermsAggregation]
readsPrec :: Int -> ReadS TermsAggregation
$creadsPrec :: Int -> ReadS TermsAggregation
Prelude.Read, Int -> TermsAggregation -> ShowS
[TermsAggregation] -> ShowS
TermsAggregation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TermsAggregation] -> ShowS
$cshowList :: [TermsAggregation] -> ShowS
show :: TermsAggregation -> String
$cshow :: TermsAggregation -> String
showsPrec :: Int -> TermsAggregation -> ShowS
$cshowsPrec :: Int -> TermsAggregation -> ShowS
Prelude.Show, forall x. Rep TermsAggregation x -> TermsAggregation
forall x. TermsAggregation -> Rep TermsAggregation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TermsAggregation x -> TermsAggregation
$cfrom :: forall x. TermsAggregation -> Rep TermsAggregation x
Prelude.Generic)
newTermsAggregation ::
TermsAggregation
newTermsAggregation :: TermsAggregation
newTermsAggregation =
TermsAggregation' {$sel:maxBuckets:TermsAggregation' :: Maybe Natural
maxBuckets = forall a. Maybe a
Prelude.Nothing}
termsAggregation_maxBuckets :: Lens.Lens' TermsAggregation (Prelude.Maybe Prelude.Natural)
termsAggregation_maxBuckets :: Lens' TermsAggregation (Maybe Natural)
termsAggregation_maxBuckets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TermsAggregation' {Maybe Natural
maxBuckets :: Maybe Natural
$sel:maxBuckets:TermsAggregation' :: TermsAggregation -> Maybe Natural
maxBuckets} -> Maybe Natural
maxBuckets) (\s :: TermsAggregation
s@TermsAggregation' {} Maybe Natural
a -> TermsAggregation
s {$sel:maxBuckets:TermsAggregation' :: Maybe Natural
maxBuckets = Maybe Natural
a} :: TermsAggregation)
instance Prelude.Hashable TermsAggregation where
hashWithSalt :: Int -> TermsAggregation -> Int
hashWithSalt Int
_salt TermsAggregation' {Maybe Natural
maxBuckets :: Maybe Natural
$sel:maxBuckets:TermsAggregation' :: TermsAggregation -> Maybe Natural
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxBuckets
instance Prelude.NFData TermsAggregation where
rnf :: TermsAggregation -> ()
rnf TermsAggregation' {Maybe Natural
maxBuckets :: Maybe Natural
$sel:maxBuckets:TermsAggregation' :: TermsAggregation -> Maybe Natural
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxBuckets
instance Data.ToJSON TermsAggregation where
toJSON :: TermsAggregation -> Value
toJSON TermsAggregation' {Maybe Natural
maxBuckets :: Maybe Natural
$sel:maxBuckets:TermsAggregation' :: TermsAggregation -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"maxBuckets" 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
maxBuckets]
)