{-# 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.AutoScaling.EnableMetricsCollection
(
EnableMetricsCollection (..),
newEnableMetricsCollection,
enableMetricsCollection_metrics,
enableMetricsCollection_autoScalingGroupName,
enableMetricsCollection_granularity,
EnableMetricsCollectionResponse (..),
newEnableMetricsCollectionResponse,
)
where
import Amazonka.AutoScaling.Types
import qualified Amazonka.Core as Core
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 EnableMetricsCollection = EnableMetricsCollection'
{
EnableMetricsCollection -> Maybe [Text]
metrics :: Prelude.Maybe [Prelude.Text],
EnableMetricsCollection -> Text
autoScalingGroupName :: Prelude.Text,
EnableMetricsCollection -> Text
granularity :: Prelude.Text
}
deriving (EnableMetricsCollection -> EnableMetricsCollection -> Bool
(EnableMetricsCollection -> EnableMetricsCollection -> Bool)
-> (EnableMetricsCollection -> EnableMetricsCollection -> Bool)
-> Eq EnableMetricsCollection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableMetricsCollection -> EnableMetricsCollection -> Bool
$c/= :: EnableMetricsCollection -> EnableMetricsCollection -> Bool
== :: EnableMetricsCollection -> EnableMetricsCollection -> Bool
$c== :: EnableMetricsCollection -> EnableMetricsCollection -> Bool
Prelude.Eq, ReadPrec [EnableMetricsCollection]
ReadPrec EnableMetricsCollection
Int -> ReadS EnableMetricsCollection
ReadS [EnableMetricsCollection]
(Int -> ReadS EnableMetricsCollection)
-> ReadS [EnableMetricsCollection]
-> ReadPrec EnableMetricsCollection
-> ReadPrec [EnableMetricsCollection]
-> Read EnableMetricsCollection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableMetricsCollection]
$creadListPrec :: ReadPrec [EnableMetricsCollection]
readPrec :: ReadPrec EnableMetricsCollection
$creadPrec :: ReadPrec EnableMetricsCollection
readList :: ReadS [EnableMetricsCollection]
$creadList :: ReadS [EnableMetricsCollection]
readsPrec :: Int -> ReadS EnableMetricsCollection
$creadsPrec :: Int -> ReadS EnableMetricsCollection
Prelude.Read, Int -> EnableMetricsCollection -> ShowS
[EnableMetricsCollection] -> ShowS
EnableMetricsCollection -> String
(Int -> EnableMetricsCollection -> ShowS)
-> (EnableMetricsCollection -> String)
-> ([EnableMetricsCollection] -> ShowS)
-> Show EnableMetricsCollection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableMetricsCollection] -> ShowS
$cshowList :: [EnableMetricsCollection] -> ShowS
show :: EnableMetricsCollection -> String
$cshow :: EnableMetricsCollection -> String
showsPrec :: Int -> EnableMetricsCollection -> ShowS
$cshowsPrec :: Int -> EnableMetricsCollection -> ShowS
Prelude.Show, (forall x.
EnableMetricsCollection -> Rep EnableMetricsCollection x)
-> (forall x.
Rep EnableMetricsCollection x -> EnableMetricsCollection)
-> Generic EnableMetricsCollection
forall x. Rep EnableMetricsCollection x -> EnableMetricsCollection
forall x. EnableMetricsCollection -> Rep EnableMetricsCollection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnableMetricsCollection x -> EnableMetricsCollection
$cfrom :: forall x. EnableMetricsCollection -> Rep EnableMetricsCollection x
Prelude.Generic)
newEnableMetricsCollection ::
Prelude.Text ->
Prelude.Text ->
EnableMetricsCollection
newEnableMetricsCollection :: Text -> Text -> EnableMetricsCollection
newEnableMetricsCollection
Text
pAutoScalingGroupName_
Text
pGranularity_ =
EnableMetricsCollection' :: Maybe [Text] -> Text -> Text -> EnableMetricsCollection
EnableMetricsCollection'
{ $sel:metrics:EnableMetricsCollection' :: Maybe [Text]
metrics = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:autoScalingGroupName:EnableMetricsCollection' :: Text
autoScalingGroupName = Text
pAutoScalingGroupName_,
$sel:granularity:EnableMetricsCollection' :: Text
granularity = Text
pGranularity_
}
enableMetricsCollection_metrics :: Lens.Lens' EnableMetricsCollection (Prelude.Maybe [Prelude.Text])
enableMetricsCollection_metrics :: (Maybe [Text] -> f (Maybe [Text]))
-> EnableMetricsCollection -> f EnableMetricsCollection
enableMetricsCollection_metrics = (EnableMetricsCollection -> Maybe [Text])
-> (EnableMetricsCollection
-> Maybe [Text] -> EnableMetricsCollection)
-> Lens
EnableMetricsCollection
EnableMetricsCollection
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableMetricsCollection' {Maybe [Text]
metrics :: Maybe [Text]
$sel:metrics:EnableMetricsCollection' :: EnableMetricsCollection -> Maybe [Text]
metrics} -> Maybe [Text]
metrics) (\s :: EnableMetricsCollection
s@EnableMetricsCollection' {} Maybe [Text]
a -> EnableMetricsCollection
s {$sel:metrics:EnableMetricsCollection' :: Maybe [Text]
metrics = Maybe [Text]
a} :: EnableMetricsCollection) ((Maybe [Text] -> f (Maybe [Text]))
-> EnableMetricsCollection -> f EnableMetricsCollection)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> EnableMetricsCollection
-> f EnableMetricsCollection
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
enableMetricsCollection_autoScalingGroupName :: Lens.Lens' EnableMetricsCollection Prelude.Text
enableMetricsCollection_autoScalingGroupName :: (Text -> f Text)
-> EnableMetricsCollection -> f EnableMetricsCollection
enableMetricsCollection_autoScalingGroupName = (EnableMetricsCollection -> Text)
-> (EnableMetricsCollection -> Text -> EnableMetricsCollection)
-> Lens EnableMetricsCollection EnableMetricsCollection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableMetricsCollection' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:EnableMetricsCollection' :: EnableMetricsCollection -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: EnableMetricsCollection
s@EnableMetricsCollection' {} Text
a -> EnableMetricsCollection
s {$sel:autoScalingGroupName:EnableMetricsCollection' :: Text
autoScalingGroupName = Text
a} :: EnableMetricsCollection)
enableMetricsCollection_granularity :: Lens.Lens' EnableMetricsCollection Prelude.Text
enableMetricsCollection_granularity :: (Text -> f Text)
-> EnableMetricsCollection -> f EnableMetricsCollection
enableMetricsCollection_granularity = (EnableMetricsCollection -> Text)
-> (EnableMetricsCollection -> Text -> EnableMetricsCollection)
-> Lens EnableMetricsCollection EnableMetricsCollection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableMetricsCollection' {Text
granularity :: Text
$sel:granularity:EnableMetricsCollection' :: EnableMetricsCollection -> Text
granularity} -> Text
granularity) (\s :: EnableMetricsCollection
s@EnableMetricsCollection' {} Text
a -> EnableMetricsCollection
s {$sel:granularity:EnableMetricsCollection' :: Text
granularity = Text
a} :: EnableMetricsCollection)
instance Core.AWSRequest EnableMetricsCollection where
type
AWSResponse EnableMetricsCollection =
EnableMetricsCollectionResponse
request :: EnableMetricsCollection -> Request EnableMetricsCollection
request = Service
-> EnableMetricsCollection -> Request EnableMetricsCollection
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy EnableMetricsCollection
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EnableMetricsCollection)))
response =
AWSResponse EnableMetricsCollection
-> Logger
-> Service
-> Proxy EnableMetricsCollection
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EnableMetricsCollection)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse EnableMetricsCollection
EnableMetricsCollectionResponse
EnableMetricsCollectionResponse'
instance Prelude.Hashable EnableMetricsCollection
instance Prelude.NFData EnableMetricsCollection
instance Core.ToHeaders EnableMetricsCollection where
toHeaders :: EnableMetricsCollection -> [Header]
toHeaders = [Header] -> EnableMetricsCollection -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath EnableMetricsCollection where
toPath :: EnableMetricsCollection -> ByteString
toPath = ByteString -> EnableMetricsCollection -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery EnableMetricsCollection where
toQuery :: EnableMetricsCollection -> QueryString
toQuery EnableMetricsCollection' {Maybe [Text]
Text
granularity :: Text
autoScalingGroupName :: Text
metrics :: Maybe [Text]
$sel:granularity:EnableMetricsCollection' :: EnableMetricsCollection -> Text
$sel:autoScalingGroupName:EnableMetricsCollection' :: EnableMetricsCollection -> Text
$sel:metrics:EnableMetricsCollection' :: EnableMetricsCollection -> Maybe [Text]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"EnableMetricsCollection" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
ByteString
"Metrics"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
(ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
metrics),
ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName,
ByteString
"Granularity" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
granularity
]
data EnableMetricsCollectionResponse = EnableMetricsCollectionResponse'
{
}
deriving (EnableMetricsCollectionResponse
-> EnableMetricsCollectionResponse -> Bool
(EnableMetricsCollectionResponse
-> EnableMetricsCollectionResponse -> Bool)
-> (EnableMetricsCollectionResponse
-> EnableMetricsCollectionResponse -> Bool)
-> Eq EnableMetricsCollectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableMetricsCollectionResponse
-> EnableMetricsCollectionResponse -> Bool
$c/= :: EnableMetricsCollectionResponse
-> EnableMetricsCollectionResponse -> Bool
== :: EnableMetricsCollectionResponse
-> EnableMetricsCollectionResponse -> Bool
$c== :: EnableMetricsCollectionResponse
-> EnableMetricsCollectionResponse -> Bool
Prelude.Eq, ReadPrec [EnableMetricsCollectionResponse]
ReadPrec EnableMetricsCollectionResponse
Int -> ReadS EnableMetricsCollectionResponse
ReadS [EnableMetricsCollectionResponse]
(Int -> ReadS EnableMetricsCollectionResponse)
-> ReadS [EnableMetricsCollectionResponse]
-> ReadPrec EnableMetricsCollectionResponse
-> ReadPrec [EnableMetricsCollectionResponse]
-> Read EnableMetricsCollectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableMetricsCollectionResponse]
$creadListPrec :: ReadPrec [EnableMetricsCollectionResponse]
readPrec :: ReadPrec EnableMetricsCollectionResponse
$creadPrec :: ReadPrec EnableMetricsCollectionResponse
readList :: ReadS [EnableMetricsCollectionResponse]
$creadList :: ReadS [EnableMetricsCollectionResponse]
readsPrec :: Int -> ReadS EnableMetricsCollectionResponse
$creadsPrec :: Int -> ReadS EnableMetricsCollectionResponse
Prelude.Read, Int -> EnableMetricsCollectionResponse -> ShowS
[EnableMetricsCollectionResponse] -> ShowS
EnableMetricsCollectionResponse -> String
(Int -> EnableMetricsCollectionResponse -> ShowS)
-> (EnableMetricsCollectionResponse -> String)
-> ([EnableMetricsCollectionResponse] -> ShowS)
-> Show EnableMetricsCollectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableMetricsCollectionResponse] -> ShowS
$cshowList :: [EnableMetricsCollectionResponse] -> ShowS
show :: EnableMetricsCollectionResponse -> String
$cshow :: EnableMetricsCollectionResponse -> String
showsPrec :: Int -> EnableMetricsCollectionResponse -> ShowS
$cshowsPrec :: Int -> EnableMetricsCollectionResponse -> ShowS
Prelude.Show, (forall x.
EnableMetricsCollectionResponse
-> Rep EnableMetricsCollectionResponse x)
-> (forall x.
Rep EnableMetricsCollectionResponse x
-> EnableMetricsCollectionResponse)
-> Generic EnableMetricsCollectionResponse
forall x.
Rep EnableMetricsCollectionResponse x
-> EnableMetricsCollectionResponse
forall x.
EnableMetricsCollectionResponse
-> Rep EnableMetricsCollectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnableMetricsCollectionResponse x
-> EnableMetricsCollectionResponse
$cfrom :: forall x.
EnableMetricsCollectionResponse
-> Rep EnableMetricsCollectionResponse x
Prelude.Generic)
newEnableMetricsCollectionResponse ::
EnableMetricsCollectionResponse
newEnableMetricsCollectionResponse :: EnableMetricsCollectionResponse
newEnableMetricsCollectionResponse =
EnableMetricsCollectionResponse
EnableMetricsCollectionResponse'
instance
Prelude.NFData
EnableMetricsCollectionResponse