{-# 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_queryVersion,
createFleetMetric_description,
createFleetMetric_unit,
createFleetMetric_indexName,
createFleetMetric_tags,
createFleetMetric_metricName,
createFleetMetric_queryString,
createFleetMetric_aggregationType,
createFleetMetric_period,
createFleetMetric_aggregationField,
CreateFleetMetricResponse (..),
newCreateFleetMetricResponse,
createFleetMetricResponse_metricName,
createFleetMetricResponse_metricArn,
createFleetMetricResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateFleetMetric = CreateFleetMetric'
{
CreateFleetMetric -> Maybe Text
queryVersion :: Prelude.Maybe Prelude.Text,
CreateFleetMetric -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
CreateFleetMetric -> Maybe FleetMetricUnit
unit :: Prelude.Maybe FleetMetricUnit,
CreateFleetMetric -> Maybe Text
indexName :: Prelude.Maybe Prelude.Text,
CreateFleetMetric -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
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
(CreateFleetMetric -> CreateFleetMetric -> Bool)
-> (CreateFleetMetric -> CreateFleetMetric -> Bool)
-> Eq CreateFleetMetric
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]
(Int -> ReadS CreateFleetMetric)
-> ReadS [CreateFleetMetric]
-> ReadPrec CreateFleetMetric
-> ReadPrec [CreateFleetMetric]
-> Read 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
(Int -> CreateFleetMetric -> ShowS)
-> (CreateFleetMetric -> String)
-> ([CreateFleetMetric] -> ShowS)
-> Show CreateFleetMetric
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. CreateFleetMetric -> Rep CreateFleetMetric x)
-> (forall x. Rep CreateFleetMetric x -> CreateFleetMetric)
-> Generic CreateFleetMetric
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' :: Maybe Text
-> Maybe Text
-> Maybe FleetMetricUnit
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> AggregationType
-> Natural
-> Text
-> CreateFleetMetric
CreateFleetMetric'
{ $sel:queryVersion:CreateFleetMetric' :: Maybe Text
queryVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:CreateFleetMetric' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:unit:CreateFleetMetric' :: Maybe FleetMetricUnit
unit = Maybe FleetMetricUnit
forall a. Maybe a
Prelude.Nothing,
$sel:indexName:CreateFleetMetric' :: Maybe Text
indexName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateFleetMetric' :: Maybe [Tag]
tags = Maybe [Tag]
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_queryVersion :: Lens.Lens' CreateFleetMetric (Prelude.Maybe Prelude.Text)
createFleetMetric_queryVersion :: (Maybe Text -> f (Maybe Text))
-> CreateFleetMetric -> f CreateFleetMetric
createFleetMetric_queryVersion = (CreateFleetMetric -> Maybe Text)
-> (CreateFleetMetric -> Maybe Text -> CreateFleetMetric)
-> Lens
CreateFleetMetric CreateFleetMetric (Maybe Text) (Maybe Text)
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_description :: Lens.Lens' CreateFleetMetric (Prelude.Maybe Prelude.Text)
createFleetMetric_description :: (Maybe Text -> f (Maybe Text))
-> CreateFleetMetric -> f CreateFleetMetric
createFleetMetric_description = (CreateFleetMetric -> Maybe Text)
-> (CreateFleetMetric -> Maybe Text -> CreateFleetMetric)
-> Lens
CreateFleetMetric CreateFleetMetric (Maybe Text) (Maybe Text)
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_unit :: Lens.Lens' CreateFleetMetric (Prelude.Maybe FleetMetricUnit)
createFleetMetric_unit :: (Maybe FleetMetricUnit -> f (Maybe FleetMetricUnit))
-> CreateFleetMetric -> f CreateFleetMetric
createFleetMetric_unit = (CreateFleetMetric -> Maybe FleetMetricUnit)
-> (CreateFleetMetric
-> Maybe FleetMetricUnit -> CreateFleetMetric)
-> Lens
CreateFleetMetric
CreateFleetMetric
(Maybe FleetMetricUnit)
(Maybe FleetMetricUnit)
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_indexName :: Lens.Lens' CreateFleetMetric (Prelude.Maybe Prelude.Text)
createFleetMetric_indexName :: (Maybe Text -> f (Maybe Text))
-> CreateFleetMetric -> f CreateFleetMetric
createFleetMetric_indexName = (CreateFleetMetric -> Maybe Text)
-> (CreateFleetMetric -> Maybe Text -> CreateFleetMetric)
-> Lens
CreateFleetMetric CreateFleetMetric (Maybe Text) (Maybe Text)
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_tags :: Lens.Lens' CreateFleetMetric (Prelude.Maybe [Tag])
createFleetMetric_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateFleetMetric -> f CreateFleetMetric
createFleetMetric_tags = (CreateFleetMetric -> Maybe [Tag])
-> (CreateFleetMetric -> Maybe [Tag] -> CreateFleetMetric)
-> Lens
CreateFleetMetric CreateFleetMetric (Maybe [Tag]) (Maybe [Tag])
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) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateFleetMetric -> f CreateFleetMetric)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateFleetMetric
-> f CreateFleetMetric
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createFleetMetric_metricName :: Lens.Lens' CreateFleetMetric Prelude.Text
createFleetMetric_metricName :: (Text -> f Text) -> CreateFleetMetric -> f CreateFleetMetric
createFleetMetric_metricName = (CreateFleetMetric -> Text)
-> (CreateFleetMetric -> Text -> CreateFleetMetric)
-> Lens CreateFleetMetric CreateFleetMetric Text Text
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 :: (Text -> f Text) -> CreateFleetMetric -> f CreateFleetMetric
createFleetMetric_queryString = (CreateFleetMetric -> Text)
-> (CreateFleetMetric -> Text -> CreateFleetMetric)
-> Lens CreateFleetMetric CreateFleetMetric Text Text
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 :: (AggregationType -> f AggregationType)
-> CreateFleetMetric -> f CreateFleetMetric
createFleetMetric_aggregationType = (CreateFleetMetric -> AggregationType)
-> (CreateFleetMetric -> AggregationType -> CreateFleetMetric)
-> Lens
CreateFleetMetric CreateFleetMetric AggregationType 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 :: (Natural -> f Natural) -> CreateFleetMetric -> f CreateFleetMetric
createFleetMetric_period = (CreateFleetMetric -> Natural)
-> (CreateFleetMetric -> Natural -> CreateFleetMetric)
-> Lens CreateFleetMetric CreateFleetMetric Natural Natural
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 :: (Text -> f Text) -> CreateFleetMetric -> f CreateFleetMetric
createFleetMetric_aggregationField = (CreateFleetMetric -> Text)
-> (CreateFleetMetric -> Text -> CreateFleetMetric)
-> Lens CreateFleetMetric CreateFleetMetric Text Text
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 :: CreateFleetMetric -> Request CreateFleetMetric
request = Service -> CreateFleetMetric -> Request CreateFleetMetric
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateFleetMetric
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateFleetMetric)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateFleetMetric))
-> Logger
-> Service
-> Proxy CreateFleetMetric
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateFleetMetric)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> 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'
(Maybe Text -> Maybe Text -> Int -> CreateFleetMetricResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateFleetMetricResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"metricName")
Either String (Maybe Text -> Int -> CreateFleetMetricResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateFleetMetricResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"metricArn")
Either String (Int -> CreateFleetMetricResponse)
-> Either String Int -> Either String CreateFleetMetricResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateFleetMetric
instance Prelude.NFData CreateFleetMetric
instance Core.ToHeaders CreateFleetMetric where
toHeaders :: CreateFleetMetric -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateFleetMetric -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.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
tags :: Maybe [Tag]
indexName :: Maybe Text
unit :: Maybe FleetMetricUnit
description :: Maybe Text
queryVersion :: 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:tags:CreateFleetMetric' :: CreateFleetMetric -> Maybe [Tag]
$sel:indexName:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
$sel:unit:CreateFleetMetric' :: CreateFleetMetric -> Maybe FleetMetricUnit
$sel:description:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
$sel:queryVersion:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"queryVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
queryVersion,
(Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
(Text
"unit" Text -> FleetMetricUnit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (FleetMetricUnit -> Pair) -> Maybe FleetMetricUnit -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FleetMetricUnit
unit,
(Text
"indexName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
indexName,
(Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"queryString" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
queryString),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"aggregationType" Text -> AggregationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AggregationType
aggregationType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"period" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
period),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"aggregationField" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
aggregationField)
]
)
instance Core.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
tags :: Maybe [Tag]
indexName :: Maybe Text
unit :: Maybe FleetMetricUnit
description :: Maybe Text
queryVersion :: 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:tags:CreateFleetMetric' :: CreateFleetMetric -> Maybe [Tag]
$sel:indexName:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
$sel:unit:CreateFleetMetric' :: CreateFleetMetric -> Maybe FleetMetricUnit
$sel:description:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
$sel:queryVersion:CreateFleetMetric' :: CreateFleetMetric -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/fleet-metric/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
metricName]
instance Core.ToQuery CreateFleetMetric where
toQuery :: CreateFleetMetric -> QueryString
toQuery = QueryString -> CreateFleetMetric -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateFleetMetricResponse = CreateFleetMetricResponse'
{
CreateFleetMetricResponse -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
CreateFleetMetricResponse -> Maybe Text
metricArn :: Prelude.Maybe Prelude.Text,
CreateFleetMetricResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateFleetMetricResponse -> CreateFleetMetricResponse -> Bool
(CreateFleetMetricResponse -> CreateFleetMetricResponse -> Bool)
-> (CreateFleetMetricResponse -> CreateFleetMetricResponse -> Bool)
-> Eq CreateFleetMetricResponse
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]
(Int -> ReadS CreateFleetMetricResponse)
-> ReadS [CreateFleetMetricResponse]
-> ReadPrec CreateFleetMetricResponse
-> ReadPrec [CreateFleetMetricResponse]
-> Read 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
(Int -> CreateFleetMetricResponse -> ShowS)
-> (CreateFleetMetricResponse -> String)
-> ([CreateFleetMetricResponse] -> ShowS)
-> Show CreateFleetMetricResponse
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.
CreateFleetMetricResponse -> Rep CreateFleetMetricResponse x)
-> (forall x.
Rep CreateFleetMetricResponse x -> CreateFleetMetricResponse)
-> Generic CreateFleetMetricResponse
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' :: Maybe Text -> Maybe Text -> Int -> CreateFleetMetricResponse
CreateFleetMetricResponse'
{ $sel:metricName:CreateFleetMetricResponse' :: Maybe Text
metricName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:metricArn:CreateFleetMetricResponse' :: Maybe Text
metricArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateFleetMetricResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createFleetMetricResponse_metricName :: Lens.Lens' CreateFleetMetricResponse (Prelude.Maybe Prelude.Text)
createFleetMetricResponse_metricName :: (Maybe Text -> f (Maybe Text))
-> CreateFleetMetricResponse -> f CreateFleetMetricResponse
createFleetMetricResponse_metricName = (CreateFleetMetricResponse -> Maybe Text)
-> (CreateFleetMetricResponse
-> Maybe Text -> CreateFleetMetricResponse)
-> Lens
CreateFleetMetricResponse
CreateFleetMetricResponse
(Maybe Text)
(Maybe Text)
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_metricArn :: Lens.Lens' CreateFleetMetricResponse (Prelude.Maybe Prelude.Text)
createFleetMetricResponse_metricArn :: (Maybe Text -> f (Maybe Text))
-> CreateFleetMetricResponse -> f CreateFleetMetricResponse
createFleetMetricResponse_metricArn = (CreateFleetMetricResponse -> Maybe Text)
-> (CreateFleetMetricResponse
-> Maybe Text -> CreateFleetMetricResponse)
-> Lens
CreateFleetMetricResponse
CreateFleetMetricResponse
(Maybe Text)
(Maybe Text)
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_httpStatus :: Lens.Lens' CreateFleetMetricResponse Prelude.Int
createFleetMetricResponse_httpStatus :: (Int -> f Int)
-> CreateFleetMetricResponse -> f CreateFleetMetricResponse
createFleetMetricResponse_httpStatus = (CreateFleetMetricResponse -> Int)
-> (CreateFleetMetricResponse -> Int -> CreateFleetMetricResponse)
-> Lens CreateFleetMetricResponse CreateFleetMetricResponse Int Int
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