{-# 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.SESV2.Types.BatchGetMetricDataQuery 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
import Amazonka.SESV2.Types.Metric
import Amazonka.SESV2.Types.MetricDimensionName
import Amazonka.SESV2.Types.MetricNamespace
data BatchGetMetricDataQuery = BatchGetMetricDataQuery'
{
BatchGetMetricDataQuery -> Maybe (HashMap MetricDimensionName Text)
dimensions :: Prelude.Maybe (Prelude.HashMap MetricDimensionName Prelude.Text),
BatchGetMetricDataQuery -> Text
id :: Prelude.Text,
BatchGetMetricDataQuery -> MetricNamespace
namespace :: MetricNamespace,
BatchGetMetricDataQuery -> Metric
metric :: Metric,
BatchGetMetricDataQuery -> POSIX
startDate :: Data.POSIX,
BatchGetMetricDataQuery -> POSIX
endDate :: Data.POSIX
}
deriving (BatchGetMetricDataQuery -> BatchGetMetricDataQuery -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetMetricDataQuery -> BatchGetMetricDataQuery -> Bool
$c/= :: BatchGetMetricDataQuery -> BatchGetMetricDataQuery -> Bool
== :: BatchGetMetricDataQuery -> BatchGetMetricDataQuery -> Bool
$c== :: BatchGetMetricDataQuery -> BatchGetMetricDataQuery -> Bool
Prelude.Eq, ReadPrec [BatchGetMetricDataQuery]
ReadPrec BatchGetMetricDataQuery
Int -> ReadS BatchGetMetricDataQuery
ReadS [BatchGetMetricDataQuery]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetMetricDataQuery]
$creadListPrec :: ReadPrec [BatchGetMetricDataQuery]
readPrec :: ReadPrec BatchGetMetricDataQuery
$creadPrec :: ReadPrec BatchGetMetricDataQuery
readList :: ReadS [BatchGetMetricDataQuery]
$creadList :: ReadS [BatchGetMetricDataQuery]
readsPrec :: Int -> ReadS BatchGetMetricDataQuery
$creadsPrec :: Int -> ReadS BatchGetMetricDataQuery
Prelude.Read, Int -> BatchGetMetricDataQuery -> ShowS
[BatchGetMetricDataQuery] -> ShowS
BatchGetMetricDataQuery -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetMetricDataQuery] -> ShowS
$cshowList :: [BatchGetMetricDataQuery] -> ShowS
show :: BatchGetMetricDataQuery -> String
$cshow :: BatchGetMetricDataQuery -> String
showsPrec :: Int -> BatchGetMetricDataQuery -> ShowS
$cshowsPrec :: Int -> BatchGetMetricDataQuery -> ShowS
Prelude.Show, forall x. Rep BatchGetMetricDataQuery x -> BatchGetMetricDataQuery
forall x. BatchGetMetricDataQuery -> Rep BatchGetMetricDataQuery x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchGetMetricDataQuery x -> BatchGetMetricDataQuery
$cfrom :: forall x. BatchGetMetricDataQuery -> Rep BatchGetMetricDataQuery x
Prelude.Generic)
newBatchGetMetricDataQuery ::
Prelude.Text ->
MetricNamespace ->
Metric ->
Prelude.UTCTime ->
Prelude.UTCTime ->
BatchGetMetricDataQuery
newBatchGetMetricDataQuery :: Text
-> MetricNamespace
-> Metric
-> UTCTime
-> UTCTime
-> BatchGetMetricDataQuery
newBatchGetMetricDataQuery
Text
pId_
MetricNamespace
pNamespace_
Metric
pMetric_
UTCTime
pStartDate_
UTCTime
pEndDate_ =
BatchGetMetricDataQuery'
{ $sel:dimensions:BatchGetMetricDataQuery' :: Maybe (HashMap MetricDimensionName Text)
dimensions =
forall a. Maybe a
Prelude.Nothing,
$sel:id:BatchGetMetricDataQuery' :: Text
id = Text
pId_,
$sel:namespace:BatchGetMetricDataQuery' :: MetricNamespace
namespace = MetricNamespace
pNamespace_,
$sel:metric:BatchGetMetricDataQuery' :: Metric
metric = Metric
pMetric_,
$sel:startDate:BatchGetMetricDataQuery' :: POSIX
startDate = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartDate_,
$sel:endDate:BatchGetMetricDataQuery' :: POSIX
endDate = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndDate_
}
batchGetMetricDataQuery_dimensions :: Lens.Lens' BatchGetMetricDataQuery (Prelude.Maybe (Prelude.HashMap MetricDimensionName Prelude.Text))
batchGetMetricDataQuery_dimensions :: Lens'
BatchGetMetricDataQuery (Maybe (HashMap MetricDimensionName Text))
batchGetMetricDataQuery_dimensions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetMetricDataQuery' {Maybe (HashMap MetricDimensionName Text)
dimensions :: Maybe (HashMap MetricDimensionName Text)
$sel:dimensions:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> Maybe (HashMap MetricDimensionName Text)
dimensions} -> Maybe (HashMap MetricDimensionName Text)
dimensions) (\s :: BatchGetMetricDataQuery
s@BatchGetMetricDataQuery' {} Maybe (HashMap MetricDimensionName Text)
a -> BatchGetMetricDataQuery
s {$sel:dimensions:BatchGetMetricDataQuery' :: Maybe (HashMap MetricDimensionName Text)
dimensions = Maybe (HashMap MetricDimensionName Text)
a} :: BatchGetMetricDataQuery) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchGetMetricDataQuery_id :: Lens.Lens' BatchGetMetricDataQuery Prelude.Text
batchGetMetricDataQuery_id :: Lens' BatchGetMetricDataQuery Text
batchGetMetricDataQuery_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetMetricDataQuery' {Text
id :: Text
$sel:id:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> Text
id} -> Text
id) (\s :: BatchGetMetricDataQuery
s@BatchGetMetricDataQuery' {} Text
a -> BatchGetMetricDataQuery
s {$sel:id:BatchGetMetricDataQuery' :: Text
id = Text
a} :: BatchGetMetricDataQuery)
batchGetMetricDataQuery_namespace :: Lens.Lens' BatchGetMetricDataQuery MetricNamespace
batchGetMetricDataQuery_namespace :: Lens' BatchGetMetricDataQuery MetricNamespace
batchGetMetricDataQuery_namespace = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetMetricDataQuery' {MetricNamespace
namespace :: MetricNamespace
$sel:namespace:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> MetricNamespace
namespace} -> MetricNamespace
namespace) (\s :: BatchGetMetricDataQuery
s@BatchGetMetricDataQuery' {} MetricNamespace
a -> BatchGetMetricDataQuery
s {$sel:namespace:BatchGetMetricDataQuery' :: MetricNamespace
namespace = MetricNamespace
a} :: BatchGetMetricDataQuery)
batchGetMetricDataQuery_metric :: Lens.Lens' BatchGetMetricDataQuery Metric
batchGetMetricDataQuery_metric :: Lens' BatchGetMetricDataQuery Metric
batchGetMetricDataQuery_metric = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetMetricDataQuery' {Metric
metric :: Metric
$sel:metric:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> Metric
metric} -> Metric
metric) (\s :: BatchGetMetricDataQuery
s@BatchGetMetricDataQuery' {} Metric
a -> BatchGetMetricDataQuery
s {$sel:metric:BatchGetMetricDataQuery' :: Metric
metric = Metric
a} :: BatchGetMetricDataQuery)
batchGetMetricDataQuery_startDate :: Lens.Lens' BatchGetMetricDataQuery Prelude.UTCTime
batchGetMetricDataQuery_startDate :: Lens' BatchGetMetricDataQuery UTCTime
batchGetMetricDataQuery_startDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetMetricDataQuery' {POSIX
startDate :: POSIX
$sel:startDate:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> POSIX
startDate} -> POSIX
startDate) (\s :: BatchGetMetricDataQuery
s@BatchGetMetricDataQuery' {} POSIX
a -> BatchGetMetricDataQuery
s {$sel:startDate:BatchGetMetricDataQuery' :: POSIX
startDate = POSIX
a} :: BatchGetMetricDataQuery) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
batchGetMetricDataQuery_endDate :: Lens.Lens' BatchGetMetricDataQuery Prelude.UTCTime
batchGetMetricDataQuery_endDate :: Lens' BatchGetMetricDataQuery UTCTime
batchGetMetricDataQuery_endDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetMetricDataQuery' {POSIX
endDate :: POSIX
$sel:endDate:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> POSIX
endDate} -> POSIX
endDate) (\s :: BatchGetMetricDataQuery
s@BatchGetMetricDataQuery' {} POSIX
a -> BatchGetMetricDataQuery
s {$sel:endDate:BatchGetMetricDataQuery' :: POSIX
endDate = POSIX
a} :: BatchGetMetricDataQuery) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Prelude.Hashable BatchGetMetricDataQuery where
hashWithSalt :: Int -> BatchGetMetricDataQuery -> Int
hashWithSalt Int
_salt BatchGetMetricDataQuery' {Maybe (HashMap MetricDimensionName Text)
Text
POSIX
Metric
MetricNamespace
endDate :: POSIX
startDate :: POSIX
metric :: Metric
namespace :: MetricNamespace
id :: Text
dimensions :: Maybe (HashMap MetricDimensionName Text)
$sel:endDate:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> POSIX
$sel:startDate:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> POSIX
$sel:metric:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> Metric
$sel:namespace:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> MetricNamespace
$sel:id:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> Text
$sel:dimensions:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> Maybe (HashMap MetricDimensionName Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap MetricDimensionName Text)
dimensions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MetricNamespace
namespace
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Metric
metric
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
startDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
endDate
instance Prelude.NFData BatchGetMetricDataQuery where
rnf :: BatchGetMetricDataQuery -> ()
rnf BatchGetMetricDataQuery' {Maybe (HashMap MetricDimensionName Text)
Text
POSIX
Metric
MetricNamespace
endDate :: POSIX
startDate :: POSIX
metric :: Metric
namespace :: MetricNamespace
id :: Text
dimensions :: Maybe (HashMap MetricDimensionName Text)
$sel:endDate:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> POSIX
$sel:startDate:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> POSIX
$sel:metric:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> Metric
$sel:namespace:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> MetricNamespace
$sel:id:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> Text
$sel:dimensions:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> Maybe (HashMap MetricDimensionName Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap MetricDimensionName Text)
dimensions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MetricNamespace
namespace
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Metric
metric
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
startDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
endDate
instance Data.ToJSON BatchGetMetricDataQuery where
toJSON :: BatchGetMetricDataQuery -> Value
toJSON BatchGetMetricDataQuery' {Maybe (HashMap MetricDimensionName Text)
Text
POSIX
Metric
MetricNamespace
endDate :: POSIX
startDate :: POSIX
metric :: Metric
namespace :: MetricNamespace
id :: Text
dimensions :: Maybe (HashMap MetricDimensionName Text)
$sel:endDate:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> POSIX
$sel:startDate:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> POSIX
$sel:metric:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> Metric
$sel:namespace:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> MetricNamespace
$sel:id:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> Text
$sel:dimensions:BatchGetMetricDataQuery' :: BatchGetMetricDataQuery -> Maybe (HashMap MetricDimensionName Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Dimensions" 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 (HashMap MetricDimensionName Text)
dimensions,
forall a. a -> Maybe a
Prelude.Just (Key
"Id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
id),
forall a. a -> Maybe a
Prelude.Just (Key
"Namespace" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= MetricNamespace
namespace),
forall a. a -> Maybe a
Prelude.Just (Key
"Metric" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Metric
metric),
forall a. a -> Maybe a
Prelude.Just (Key
"StartDate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= POSIX
startDate),
forall a. a -> Maybe a
Prelude.Just (Key
"EndDate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= POSIX
endDate)
]
)