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