{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.IoT.CreateFleetMetric
(
CreateFleetMetric (..),
newCreateFleetMetric,
createFleetMetric_description,
createFleetMetric_indexName,
createFleetMetric_queryVersion,
createFleetMetric_tags,
createFleetMetric_unit,
createFleetMetric_metricName,
createFleetMetric_queryString,
createFleetMetric_aggregationType,
createFleetMetric_period,
createFleetMetric_aggregationField,
CreateFleetMetricResponse (..),
newCreateFleetMetricResponse,
createFleetMetricResponse_metricArn,
createFleetMetricResponse_metricName,
createFleetMetricResponse_httpStatus,
)
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateFleetMetric = CreateFleetMetric'
{
CreateFleetMetric -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
CreateFleetMetric -> Maybe Text
indexName :: Prelude.Maybe Prelude.Text,
CreateFleetMetric -> Maybe Text
queryVersion :: Prelude.Maybe Prelude.Text,
CreateFleetMetric -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateFleetMetric -> Maybe FleetMetricUnit
unit :: Prelude.Maybe FleetMetricUnit,
CreateFleetMetric -> Text
metricName :: Prelude.Text,
CreateFleetMetric -> Text
queryString :: Prelude.Text,
CreateFleetMetric -> AggregationType
aggregationType :: AggregationType,
CreateFleetMetric -> Natural
period :: Prelude.Natural,
CreateFleetMetric -> Text
aggregationField :: Prelude.Text
}
deriving (CreateFleetMetric -> CreateFleetMetric -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFleetMetric -> CreateFleetMetric -> Bool
$c/= :: CreateFleetMetric -> CreateFleetMetric -> Bool
== :: CreateFleetMetric -> CreateFleetMetric -> Bool
$c== :: CreateFleetMetric -> CreateFleetMetric -> Bool
Prelude.Eq, ReadPrec [CreateFleetMetric]
ReadPrec CreateFleetMetric
Int -> ReadS CreateFleetMetric
ReadS [CreateFleetMetric]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFleetMetric]
$creadListPrec :: ReadPrec [CreateFleetMetric]
readPrec :: ReadPrec CreateFleetMetric
$creadPrec :: ReadPrec CreateFleetMetric
readList :: ReadS [CreateFleetMetric]
$creadList :: ReadS [CreateFleetMetric]
readsPrec :: Int -> ReadS CreateFleetMetric
$creadsPrec :: Int -> ReadS CreateFleetMetric
Prelude.Read, Int -> CreateFleetMetric -> ShowS
[CreateFleetMetric] -> ShowS
CreateFleetMetric -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFleetMetric] -> ShowS
$cshowList :: [CreateFleetMetric] -> ShowS
show :: CreateFleetMetric -> String
$cshow :: CreateFleetMetric -> String
showsPrec :: Int -> CreateFleetMetric -> ShowS
$cshowsPrec :: Int -> CreateFleetMetric -> ShowS
Prelude.Show, forall x. Rep CreateFleetMetric x -> CreateFleetMetric
forall x. CreateFleetMetric -> Rep CreateFleetMetric x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateFleetMetric x -> CreateFleetMetric
$cfrom :: forall x. CreateFleetMetric -> Rep CreateFleetMetric x
Prelude.Generic)
newCreateFleetMetric ::
Prelude.Text ->
Prelude.Text ->
AggregationType ->
Prelude.Natural ->
Prelude.Text ->
CreateFleetMetric
newCreateFleetMetric :: Text
-> Text -> AggregationType -> Natural -> Text -> CreateFleetMetric
newCreateFleetMetric
Text
pMetricName_
Text
pQueryString_
AggregationType
pAggregationType_
Natural
pPeriod_
Text
pAggregationField_ =
CreateFleetMetric'
{ $sel:description:CreateFleetMetric' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:indexName:CreateFleetMetric' :: Maybe Text
indexName = forall a. Maybe a
Prelude.Nothing,
$sel:queryVersion:CreateFleetMetric' :: Maybe Text
queryVersion = forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateFleetMetric' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:unit:CreateFleetMetric' :: Maybe FleetMetricUnit
unit = forall a. Maybe a
Prelude.Nothing,
$sel:metricName:CreateFleetMetric' :: Text
metricName = Text
pMetricName_,
$sel:queryString:CreateFleetMetric' :: Text
queryString = Text
pQueryString_,
$sel:aggregationType:CreateFleetMetric' :: AggregationType
aggregationType = AggregationType
pAggregationType_,
$sel:period:CreateFleetMetric' :: Natural
period = Natural
pPeriod_,
$sel:aggregationField:CreateFleetMetric' :: Text
aggregationField = Text
pAggregationField_
}
createFleetMetric_description :: Lens.Lens' CreateFleetMetric (Prelude.Maybe Prelude.Text)
createFleetMetric_description :: Lens' CreateFleetMetric (Maybe Text)
createFleetMetric_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetric' {Maybe Text
description :: Maybe Text
$sel:description:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateFleetMetric
s@CreateFleetMetric' {} Maybe Text
a -> CreateFleetMetric
s {$sel:description:CreateFleetMetric' :: Maybe Text
description = Maybe Text
a} :: CreateFleetMetric)
createFleetMetric_indexName :: Lens.Lens' CreateFleetMetric (Prelude.Maybe Prelude.Text)
createFleetMetric_indexName :: Lens' CreateFleetMetric (Maybe Text)
createFleetMetric_indexName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetric' {Maybe Text
indexName :: Maybe Text
$sel:indexName:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
indexName} -> Maybe Text
indexName) (\s :: CreateFleetMetric
s@CreateFleetMetric' {} Maybe Text
a -> CreateFleetMetric
s {$sel:indexName:CreateFleetMetric' :: Maybe Text
indexName = Maybe Text
a} :: CreateFleetMetric)
createFleetMetric_queryVersion :: Lens.Lens' CreateFleetMetric (Prelude.Maybe Prelude.Text)
createFleetMetric_queryVersion :: Lens' CreateFleetMetric (Maybe Text)
createFleetMetric_queryVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetric' {Maybe Text
queryVersion :: Maybe Text
$sel:queryVersion:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
queryVersion} -> Maybe Text
queryVersion) (\s :: CreateFleetMetric
s@CreateFleetMetric' {} Maybe Text
a -> CreateFleetMetric
s {$sel:queryVersion:CreateFleetMetric' :: Maybe Text
queryVersion = Maybe Text
a} :: CreateFleetMetric)
createFleetMetric_tags :: Lens.Lens' CreateFleetMetric (Prelude.Maybe [Tag])
createFleetMetric_tags :: Lens' CreateFleetMetric (Maybe [Tag])
createFleetMetric_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetric' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateFleetMetric' :: CreateFleetMetric -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateFleetMetric
s@CreateFleetMetric' {} Maybe [Tag]
a -> CreateFleetMetric
s {$sel:tags:CreateFleetMetric' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateFleetMetric) 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
createFleetMetric_unit :: Lens.Lens' CreateFleetMetric (Prelude.Maybe FleetMetricUnit)
createFleetMetric_unit :: Lens' CreateFleetMetric (Maybe FleetMetricUnit)
createFleetMetric_unit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetric' {Maybe FleetMetricUnit
unit :: Maybe FleetMetricUnit
$sel:unit:CreateFleetMetric' :: CreateFleetMetric -> Maybe FleetMetricUnit
unit} -> Maybe FleetMetricUnit
unit) (\s :: CreateFleetMetric
s@CreateFleetMetric' {} Maybe FleetMetricUnit
a -> CreateFleetMetric
s {$sel:unit:CreateFleetMetric' :: Maybe FleetMetricUnit
unit = Maybe FleetMetricUnit
a} :: CreateFleetMetric)
createFleetMetric_metricName :: Lens.Lens' CreateFleetMetric Prelude.Text
createFleetMetric_metricName :: Lens' CreateFleetMetric Text
createFleetMetric_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetric' {Text
metricName :: Text
$sel:metricName:CreateFleetMetric' :: CreateFleetMetric -> Text
metricName} -> Text
metricName) (\s :: CreateFleetMetric
s@CreateFleetMetric' {} Text
a -> CreateFleetMetric
s {$sel:metricName:CreateFleetMetric' :: Text
metricName = Text
a} :: CreateFleetMetric)
createFleetMetric_queryString :: Lens.Lens' CreateFleetMetric Prelude.Text
createFleetMetric_queryString :: Lens' CreateFleetMetric Text
createFleetMetric_queryString = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetric' {Text
queryString :: Text
$sel:queryString:CreateFleetMetric' :: CreateFleetMetric -> Text
queryString} -> Text
queryString) (\s :: CreateFleetMetric
s@CreateFleetMetric' {} Text
a -> CreateFleetMetric
s {$sel:queryString:CreateFleetMetric' :: Text
queryString = Text
a} :: CreateFleetMetric)
createFleetMetric_aggregationType :: Lens.Lens' CreateFleetMetric AggregationType
createFleetMetric_aggregationType :: Lens' CreateFleetMetric AggregationType
createFleetMetric_aggregationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetric' {AggregationType
aggregationType :: AggregationType
$sel:aggregationType:CreateFleetMetric' :: CreateFleetMetric -> AggregationType
aggregationType} -> AggregationType
aggregationType) (\s :: CreateFleetMetric
s@CreateFleetMetric' {} AggregationType
a -> CreateFleetMetric
s {$sel:aggregationType:CreateFleetMetric' :: AggregationType
aggregationType = AggregationType
a} :: CreateFleetMetric)
createFleetMetric_period :: Lens.Lens' CreateFleetMetric Prelude.Natural
createFleetMetric_period :: Lens' CreateFleetMetric Natural
createFleetMetric_period = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetric' {Natural
period :: Natural
$sel:period:CreateFleetMetric' :: CreateFleetMetric -> Natural
period} -> Natural
period) (\s :: CreateFleetMetric
s@CreateFleetMetric' {} Natural
a -> CreateFleetMetric
s {$sel:period:CreateFleetMetric' :: Natural
period = Natural
a} :: CreateFleetMetric)
createFleetMetric_aggregationField :: Lens.Lens' CreateFleetMetric Prelude.Text
createFleetMetric_aggregationField :: Lens' CreateFleetMetric Text
createFleetMetric_aggregationField = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetric' {Text
aggregationField :: Text
$sel:aggregationField:CreateFleetMetric' :: CreateFleetMetric -> Text
aggregationField} -> Text
aggregationField) (\s :: CreateFleetMetric
s@CreateFleetMetric' {} Text
a -> CreateFleetMetric
s {$sel:aggregationField:CreateFleetMetric' :: Text
aggregationField = Text
a} :: CreateFleetMetric)
instance Core.AWSRequest CreateFleetMetric where
type
AWSResponse CreateFleetMetric =
CreateFleetMetricResponse
request :: (Service -> Service)
-> CreateFleetMetric -> Request CreateFleetMetric
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateFleetMetric
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateFleetMetric)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Maybe Text -> Int -> CreateFleetMetricResponse
CreateFleetMetricResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"metricArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"metricName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateFleetMetric where
hashWithSalt :: Int -> CreateFleetMetric -> Int
hashWithSalt Int
_salt CreateFleetMetric' {Natural
Maybe [Tag]
Maybe Text
Maybe FleetMetricUnit
Text
AggregationType
aggregationField :: Text
period :: Natural
aggregationType :: AggregationType
queryString :: Text
metricName :: Text
unit :: Maybe FleetMetricUnit
tags :: Maybe [Tag]
queryVersion :: Maybe Text
indexName :: Maybe Text
description :: Maybe Text
$sel:aggregationField:CreateFleetMetric' :: CreateFleetMetric -> Text
$sel:period:CreateFleetMetric' :: CreateFleetMetric -> Natural
$sel:aggregationType:CreateFleetMetric' :: CreateFleetMetric -> AggregationType
$sel:queryString:CreateFleetMetric' :: CreateFleetMetric -> Text
$sel:metricName:CreateFleetMetric' :: CreateFleetMetric -> Text
$sel:unit:CreateFleetMetric' :: CreateFleetMetric -> Maybe FleetMetricUnit
$sel:tags:CreateFleetMetric' :: CreateFleetMetric -> Maybe [Tag]
$sel:queryVersion:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
$sel:indexName:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
$sel:description:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
indexName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
queryVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FleetMetricUnit
unit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
metricName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
queryString
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AggregationType
aggregationType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
period
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
aggregationField
instance Prelude.NFData CreateFleetMetric where
rnf :: CreateFleetMetric -> ()
rnf CreateFleetMetric' {Natural
Maybe [Tag]
Maybe Text
Maybe FleetMetricUnit
Text
AggregationType
aggregationField :: Text
period :: Natural
aggregationType :: AggregationType
queryString :: Text
metricName :: Text
unit :: Maybe FleetMetricUnit
tags :: Maybe [Tag]
queryVersion :: Maybe Text
indexName :: Maybe Text
description :: Maybe Text
$sel:aggregationField:CreateFleetMetric' :: CreateFleetMetric -> Text
$sel:period:CreateFleetMetric' :: CreateFleetMetric -> Natural
$sel:aggregationType:CreateFleetMetric' :: CreateFleetMetric -> AggregationType
$sel:queryString:CreateFleetMetric' :: CreateFleetMetric -> Text
$sel:metricName:CreateFleetMetric' :: CreateFleetMetric -> Text
$sel:unit:CreateFleetMetric' :: CreateFleetMetric -> Maybe FleetMetricUnit
$sel:tags:CreateFleetMetric' :: CreateFleetMetric -> Maybe [Tag]
$sel:queryVersion:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
$sel:indexName:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
$sel:description:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
indexName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
queryVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FleetMetricUnit
unit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
metricName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
queryString
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AggregationType
aggregationType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
period
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
aggregationField
instance Data.ToHeaders CreateFleetMetric where
toHeaders :: CreateFleetMetric -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON CreateFleetMetric where
toJSON :: CreateFleetMetric -> Value
toJSON CreateFleetMetric' {Natural
Maybe [Tag]
Maybe Text
Maybe FleetMetricUnit
Text
AggregationType
aggregationField :: Text
period :: Natural
aggregationType :: AggregationType
queryString :: Text
metricName :: Text
unit :: Maybe FleetMetricUnit
tags :: Maybe [Tag]
queryVersion :: Maybe Text
indexName :: Maybe Text
description :: Maybe Text
$sel:aggregationField:CreateFleetMetric' :: CreateFleetMetric -> Text
$sel:period:CreateFleetMetric' :: CreateFleetMetric -> Natural
$sel:aggregationType:CreateFleetMetric' :: CreateFleetMetric -> AggregationType
$sel:queryString:CreateFleetMetric' :: CreateFleetMetric -> Text
$sel:metricName:CreateFleetMetric' :: CreateFleetMetric -> Text
$sel:unit:CreateFleetMetric' :: CreateFleetMetric -> Maybe FleetMetricUnit
$sel:tags:CreateFleetMetric' :: CreateFleetMetric -> Maybe [Tag]
$sel:queryVersion:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
$sel:indexName:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
$sel:description:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"description" 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 Text
description,
(Key
"indexName" 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 Text
indexName,
(Key
"queryVersion" 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 Text
queryVersion,
(Key
"tags" 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 [Tag]
tags,
(Key
"unit" 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 FleetMetricUnit
unit,
forall a. a -> Maybe a
Prelude.Just (Key
"queryString" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
queryString),
forall a. a -> Maybe a
Prelude.Just
(Key
"aggregationType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AggregationType
aggregationType),
forall a. a -> Maybe a
Prelude.Just (Key
"period" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
period),
forall a. a -> Maybe a
Prelude.Just
(Key
"aggregationField" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
aggregationField)
]
)
instance Data.ToPath CreateFleetMetric where
toPath :: CreateFleetMetric -> ByteString
toPath CreateFleetMetric' {Natural
Maybe [Tag]
Maybe Text
Maybe FleetMetricUnit
Text
AggregationType
aggregationField :: Text
period :: Natural
aggregationType :: AggregationType
queryString :: Text
metricName :: Text
unit :: Maybe FleetMetricUnit
tags :: Maybe [Tag]
queryVersion :: Maybe Text
indexName :: Maybe Text
description :: Maybe Text
$sel:aggregationField:CreateFleetMetric' :: CreateFleetMetric -> Text
$sel:period:CreateFleetMetric' :: CreateFleetMetric -> Natural
$sel:aggregationType:CreateFleetMetric' :: CreateFleetMetric -> AggregationType
$sel:queryString:CreateFleetMetric' :: CreateFleetMetric -> Text
$sel:metricName:CreateFleetMetric' :: CreateFleetMetric -> Text
$sel:unit:CreateFleetMetric' :: CreateFleetMetric -> Maybe FleetMetricUnit
$sel:tags:CreateFleetMetric' :: CreateFleetMetric -> Maybe [Tag]
$sel:queryVersion:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
$sel:indexName:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
$sel:description:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/fleet-metric/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
metricName]
instance Data.ToQuery CreateFleetMetric where
toQuery :: CreateFleetMetric -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateFleetMetricResponse = CreateFleetMetricResponse'
{
CreateFleetMetricResponse -> Maybe Text
metricArn :: Prelude.Maybe Prelude.Text,
CreateFleetMetricResponse -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
CreateFleetMetricResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateFleetMetricResponse -> CreateFleetMetricResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFleetMetricResponse -> CreateFleetMetricResponse -> Bool
$c/= :: CreateFleetMetricResponse -> CreateFleetMetricResponse -> Bool
== :: CreateFleetMetricResponse -> CreateFleetMetricResponse -> Bool
$c== :: CreateFleetMetricResponse -> CreateFleetMetricResponse -> Bool
Prelude.Eq, ReadPrec [CreateFleetMetricResponse]
ReadPrec CreateFleetMetricResponse
Int -> ReadS CreateFleetMetricResponse
ReadS [CreateFleetMetricResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFleetMetricResponse]
$creadListPrec :: ReadPrec [CreateFleetMetricResponse]
readPrec :: ReadPrec CreateFleetMetricResponse
$creadPrec :: ReadPrec CreateFleetMetricResponse
readList :: ReadS [CreateFleetMetricResponse]
$creadList :: ReadS [CreateFleetMetricResponse]
readsPrec :: Int -> ReadS CreateFleetMetricResponse
$creadsPrec :: Int -> ReadS CreateFleetMetricResponse
Prelude.Read, Int -> CreateFleetMetricResponse -> ShowS
[CreateFleetMetricResponse] -> ShowS
CreateFleetMetricResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFleetMetricResponse] -> ShowS
$cshowList :: [CreateFleetMetricResponse] -> ShowS
show :: CreateFleetMetricResponse -> String
$cshow :: CreateFleetMetricResponse -> String
showsPrec :: Int -> CreateFleetMetricResponse -> ShowS
$cshowsPrec :: Int -> CreateFleetMetricResponse -> ShowS
Prelude.Show, forall x.
Rep CreateFleetMetricResponse x -> CreateFleetMetricResponse
forall x.
CreateFleetMetricResponse -> Rep CreateFleetMetricResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateFleetMetricResponse x -> CreateFleetMetricResponse
$cfrom :: forall x.
CreateFleetMetricResponse -> Rep CreateFleetMetricResponse x
Prelude.Generic)
newCreateFleetMetricResponse ::
Prelude.Int ->
CreateFleetMetricResponse
newCreateFleetMetricResponse :: Int -> CreateFleetMetricResponse
newCreateFleetMetricResponse Int
pHttpStatus_ =
CreateFleetMetricResponse'
{ $sel:metricArn:CreateFleetMetricResponse' :: Maybe Text
metricArn =
forall a. Maybe a
Prelude.Nothing,
$sel:metricName:CreateFleetMetricResponse' :: Maybe Text
metricName = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateFleetMetricResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createFleetMetricResponse_metricArn :: Lens.Lens' CreateFleetMetricResponse (Prelude.Maybe Prelude.Text)
createFleetMetricResponse_metricArn :: Lens' CreateFleetMetricResponse (Maybe Text)
createFleetMetricResponse_metricArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetricResponse' {Maybe Text
metricArn :: Maybe Text
$sel:metricArn:CreateFleetMetricResponse' :: CreateFleetMetricResponse -> Maybe Text
metricArn} -> Maybe Text
metricArn) (\s :: CreateFleetMetricResponse
s@CreateFleetMetricResponse' {} Maybe Text
a -> CreateFleetMetricResponse
s {$sel:metricArn:CreateFleetMetricResponse' :: Maybe Text
metricArn = Maybe Text
a} :: CreateFleetMetricResponse)
createFleetMetricResponse_metricName :: Lens.Lens' CreateFleetMetricResponse (Prelude.Maybe Prelude.Text)
createFleetMetricResponse_metricName :: Lens' CreateFleetMetricResponse (Maybe Text)
createFleetMetricResponse_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetricResponse' {Maybe Text
metricName :: Maybe Text
$sel:metricName:CreateFleetMetricResponse' :: CreateFleetMetricResponse -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: CreateFleetMetricResponse
s@CreateFleetMetricResponse' {} Maybe Text
a -> CreateFleetMetricResponse
s {$sel:metricName:CreateFleetMetricResponse' :: Maybe Text
metricName = Maybe Text
a} :: CreateFleetMetricResponse)
createFleetMetricResponse_httpStatus :: Lens.Lens' CreateFleetMetricResponse Prelude.Int
createFleetMetricResponse_httpStatus :: Lens' CreateFleetMetricResponse Int
createFleetMetricResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetMetricResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateFleetMetricResponse' :: CreateFleetMetricResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateFleetMetricResponse
s@CreateFleetMetricResponse' {} Int
a -> CreateFleetMetricResponse
s {$sel:httpStatus:CreateFleetMetricResponse' :: Int
httpStatus = Int
a} :: CreateFleetMetricResponse)
instance Prelude.NFData CreateFleetMetricResponse where
rnf :: CreateFleetMetricResponse -> ()
rnf CreateFleetMetricResponse' {Int
Maybe Text
httpStatus :: Int
metricName :: Maybe Text
metricArn :: Maybe Text
$sel:httpStatus:CreateFleetMetricResponse' :: CreateFleetMetricResponse -> Int
$sel:metricName:CreateFleetMetricResponse' :: CreateFleetMetricResponse -> Maybe Text
$sel:metricArn:CreateFleetMetricResponse' :: CreateFleetMetricResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus