{-# 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 Amazonka.IoT.Types.TermsAggregation
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BucketsAggregationType = BucketsAggregationType'
{
BucketsAggregationType -> Maybe TermsAggregation
termsAggregation :: Prelude.Maybe TermsAggregation
}
deriving (BucketsAggregationType -> BucketsAggregationType -> Bool
(BucketsAggregationType -> BucketsAggregationType -> Bool)
-> (BucketsAggregationType -> BucketsAggregationType -> Bool)
-> Eq BucketsAggregationType
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]
(Int -> ReadS BucketsAggregationType)
-> ReadS [BucketsAggregationType]
-> ReadPrec BucketsAggregationType
-> ReadPrec [BucketsAggregationType]
-> Read 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
(Int -> BucketsAggregationType -> ShowS)
-> (BucketsAggregationType -> String)
-> ([BucketsAggregationType] -> ShowS)
-> Show BucketsAggregationType
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. BucketsAggregationType -> Rep BucketsAggregationType x)
-> (forall x.
Rep BucketsAggregationType x -> BucketsAggregationType)
-> Generic BucketsAggregationType
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' :: Maybe TermsAggregation -> BucketsAggregationType
BucketsAggregationType'
{ $sel:termsAggregation:BucketsAggregationType' :: Maybe TermsAggregation
termsAggregation =
Maybe TermsAggregation
forall a. Maybe a
Prelude.Nothing
}
bucketsAggregationType_termsAggregation :: Lens.Lens' BucketsAggregationType (Prelude.Maybe TermsAggregation)
bucketsAggregationType_termsAggregation :: (Maybe TermsAggregation -> f (Maybe TermsAggregation))
-> BucketsAggregationType -> f BucketsAggregationType
bucketsAggregationType_termsAggregation = (BucketsAggregationType -> Maybe TermsAggregation)
-> (BucketsAggregationType
-> Maybe TermsAggregation -> BucketsAggregationType)
-> Lens
BucketsAggregationType
BucketsAggregationType
(Maybe TermsAggregation)
(Maybe 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
instance Prelude.NFData BucketsAggregationType
instance Core.ToJSON BucketsAggregationType where
toJSON :: BucketsAggregationType -> Value
toJSON BucketsAggregationType' {Maybe TermsAggregation
termsAggregation :: Maybe TermsAggregation
$sel:termsAggregation:BucketsAggregationType' :: BucketsAggregationType -> Maybe TermsAggregation
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"termsAggregation" Text -> TermsAggregation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(TermsAggregation -> Pair) -> Maybe TermsAggregation -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TermsAggregation
termsAggregation
]
)