{-# 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.EC2.Types.DataQuery where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.MetricType
import Amazonka.EC2.Types.PeriodType
import Amazonka.EC2.Types.StatisticType
import qualified Amazonka.Prelude as Prelude
data DataQuery = DataQuery'
{
DataQuery -> Maybe Text
destination :: Prelude.Maybe Prelude.Text,
DataQuery -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
DataQuery -> Maybe MetricType
metric :: Prelude.Maybe MetricType,
DataQuery -> Maybe PeriodType
period :: Prelude.Maybe PeriodType,
DataQuery -> Maybe Text
source :: Prelude.Maybe Prelude.Text,
DataQuery -> Maybe StatisticType
statistic :: Prelude.Maybe StatisticType
}
deriving (DataQuery -> DataQuery -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataQuery -> DataQuery -> Bool
$c/= :: DataQuery -> DataQuery -> Bool
== :: DataQuery -> DataQuery -> Bool
$c== :: DataQuery -> DataQuery -> Bool
Prelude.Eq, ReadPrec [DataQuery]
ReadPrec DataQuery
Int -> ReadS DataQuery
ReadS [DataQuery]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataQuery]
$creadListPrec :: ReadPrec [DataQuery]
readPrec :: ReadPrec DataQuery
$creadPrec :: ReadPrec DataQuery
readList :: ReadS [DataQuery]
$creadList :: ReadS [DataQuery]
readsPrec :: Int -> ReadS DataQuery
$creadsPrec :: Int -> ReadS DataQuery
Prelude.Read, Int -> DataQuery -> ShowS
[DataQuery] -> ShowS
DataQuery -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataQuery] -> ShowS
$cshowList :: [DataQuery] -> ShowS
show :: DataQuery -> String
$cshow :: DataQuery -> String
showsPrec :: Int -> DataQuery -> ShowS
$cshowsPrec :: Int -> DataQuery -> ShowS
Prelude.Show, forall x. Rep DataQuery x -> DataQuery
forall x. DataQuery -> Rep DataQuery x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataQuery x -> DataQuery
$cfrom :: forall x. DataQuery -> Rep DataQuery x
Prelude.Generic)
newDataQuery ::
DataQuery
newDataQuery :: DataQuery
newDataQuery =
DataQuery'
{ $sel:destination:DataQuery' :: Maybe Text
destination = forall a. Maybe a
Prelude.Nothing,
$sel:id:DataQuery' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:metric:DataQuery' :: Maybe MetricType
metric = forall a. Maybe a
Prelude.Nothing,
$sel:period:DataQuery' :: Maybe PeriodType
period = forall a. Maybe a
Prelude.Nothing,
$sel:source:DataQuery' :: Maybe Text
source = forall a. Maybe a
Prelude.Nothing,
$sel:statistic:DataQuery' :: Maybe StatisticType
statistic = forall a. Maybe a
Prelude.Nothing
}
dataQuery_destination :: Lens.Lens' DataQuery (Prelude.Maybe Prelude.Text)
dataQuery_destination :: Lens' DataQuery (Maybe Text)
dataQuery_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQuery' {Maybe Text
destination :: Maybe Text
$sel:destination:DataQuery' :: DataQuery -> Maybe Text
destination} -> Maybe Text
destination) (\s :: DataQuery
s@DataQuery' {} Maybe Text
a -> DataQuery
s {$sel:destination:DataQuery' :: Maybe Text
destination = Maybe Text
a} :: DataQuery)
dataQuery_id :: Lens.Lens' DataQuery (Prelude.Maybe Prelude.Text)
dataQuery_id :: Lens' DataQuery (Maybe Text)
dataQuery_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQuery' {Maybe Text
id :: Maybe Text
$sel:id:DataQuery' :: DataQuery -> Maybe Text
id} -> Maybe Text
id) (\s :: DataQuery
s@DataQuery' {} Maybe Text
a -> DataQuery
s {$sel:id:DataQuery' :: Maybe Text
id = Maybe Text
a} :: DataQuery)
dataQuery_metric :: Lens.Lens' DataQuery (Prelude.Maybe MetricType)
dataQuery_metric :: Lens' DataQuery (Maybe MetricType)
dataQuery_metric = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQuery' {Maybe MetricType
metric :: Maybe MetricType
$sel:metric:DataQuery' :: DataQuery -> Maybe MetricType
metric} -> Maybe MetricType
metric) (\s :: DataQuery
s@DataQuery' {} Maybe MetricType
a -> DataQuery
s {$sel:metric:DataQuery' :: Maybe MetricType
metric = Maybe MetricType
a} :: DataQuery)
dataQuery_period :: Lens.Lens' DataQuery (Prelude.Maybe PeriodType)
dataQuery_period :: Lens' DataQuery (Maybe PeriodType)
dataQuery_period = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQuery' {Maybe PeriodType
period :: Maybe PeriodType
$sel:period:DataQuery' :: DataQuery -> Maybe PeriodType
period} -> Maybe PeriodType
period) (\s :: DataQuery
s@DataQuery' {} Maybe PeriodType
a -> DataQuery
s {$sel:period:DataQuery' :: Maybe PeriodType
period = Maybe PeriodType
a} :: DataQuery)
dataQuery_source :: Lens.Lens' DataQuery (Prelude.Maybe Prelude.Text)
dataQuery_source :: Lens' DataQuery (Maybe Text)
dataQuery_source = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQuery' {Maybe Text
source :: Maybe Text
$sel:source:DataQuery' :: DataQuery -> Maybe Text
source} -> Maybe Text
source) (\s :: DataQuery
s@DataQuery' {} Maybe Text
a -> DataQuery
s {$sel:source:DataQuery' :: Maybe Text
source = Maybe Text
a} :: DataQuery)
dataQuery_statistic :: Lens.Lens' DataQuery (Prelude.Maybe StatisticType)
dataQuery_statistic :: Lens' DataQuery (Maybe StatisticType)
dataQuery_statistic = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataQuery' {Maybe StatisticType
statistic :: Maybe StatisticType
$sel:statistic:DataQuery' :: DataQuery -> Maybe StatisticType
statistic} -> Maybe StatisticType
statistic) (\s :: DataQuery
s@DataQuery' {} Maybe StatisticType
a -> DataQuery
s {$sel:statistic:DataQuery' :: Maybe StatisticType
statistic = Maybe StatisticType
a} :: DataQuery)
instance Prelude.Hashable DataQuery where
hashWithSalt :: Int -> DataQuery -> Int
hashWithSalt Int
_salt DataQuery' {Maybe Text
Maybe MetricType
Maybe PeriodType
Maybe StatisticType
statistic :: Maybe StatisticType
source :: Maybe Text
period :: Maybe PeriodType
metric :: Maybe MetricType
id :: Maybe Text
destination :: Maybe Text
$sel:statistic:DataQuery' :: DataQuery -> Maybe StatisticType
$sel:source:DataQuery' :: DataQuery -> Maybe Text
$sel:period:DataQuery' :: DataQuery -> Maybe PeriodType
$sel:metric:DataQuery' :: DataQuery -> Maybe MetricType
$sel:id:DataQuery' :: DataQuery -> Maybe Text
$sel:destination:DataQuery' :: DataQuery -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destination
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MetricType
metric
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PeriodType
period
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
source
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StatisticType
statistic
instance Prelude.NFData DataQuery where
rnf :: DataQuery -> ()
rnf DataQuery' {Maybe Text
Maybe MetricType
Maybe PeriodType
Maybe StatisticType
statistic :: Maybe StatisticType
source :: Maybe Text
period :: Maybe PeriodType
metric :: Maybe MetricType
id :: Maybe Text
destination :: Maybe Text
$sel:statistic:DataQuery' :: DataQuery -> Maybe StatisticType
$sel:source:DataQuery' :: DataQuery -> Maybe Text
$sel:period:DataQuery' :: DataQuery -> Maybe PeriodType
$sel:metric:DataQuery' :: DataQuery -> Maybe MetricType
$sel:id:DataQuery' :: DataQuery -> Maybe Text
$sel:destination:DataQuery' :: DataQuery -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
destination
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MetricType
metric
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PeriodType
period
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
source
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StatisticType
statistic
instance Data.ToQuery DataQuery where
toQuery :: DataQuery -> QueryString
toQuery DataQuery' {Maybe Text
Maybe MetricType
Maybe PeriodType
Maybe StatisticType
statistic :: Maybe StatisticType
source :: Maybe Text
period :: Maybe PeriodType
metric :: Maybe MetricType
id :: Maybe Text
destination :: Maybe Text
$sel:statistic:DataQuery' :: DataQuery -> Maybe StatisticType
$sel:source:DataQuery' :: DataQuery -> Maybe Text
$sel:period:DataQuery' :: DataQuery -> Maybe PeriodType
$sel:metric:DataQuery' :: DataQuery -> Maybe MetricType
$sel:id:DataQuery' :: DataQuery -> Maybe Text
$sel:destination:DataQuery' :: DataQuery -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Destination" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
destination,
ByteString
"Id" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
id,
ByteString
"Metric" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe MetricType
metric,
ByteString
"Period" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe PeriodType
period,
ByteString
"Source" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
source,
ByteString
"Statistic" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe StatisticType
statistic
]