{-# 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.ApplicationInsights.UpdateComponentConfiguration
(
UpdateComponentConfiguration (..),
newUpdateComponentConfiguration,
updateComponentConfiguration_componentConfiguration,
updateComponentConfiguration_monitor,
updateComponentConfiguration_tier,
updateComponentConfiguration_resourceGroupName,
updateComponentConfiguration_componentName,
UpdateComponentConfigurationResponse (..),
newUpdateComponentConfigurationResponse,
updateComponentConfigurationResponse_httpStatus,
)
where
import Amazonka.ApplicationInsights.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 UpdateComponentConfiguration = UpdateComponentConfiguration'
{
UpdateComponentConfiguration -> Maybe Text
componentConfiguration :: Prelude.Maybe Prelude.Text,
UpdateComponentConfiguration -> Maybe Bool
monitor :: Prelude.Maybe Prelude.Bool,
UpdateComponentConfiguration -> Maybe Tier
tier :: Prelude.Maybe Tier,
UpdateComponentConfiguration -> Text
resourceGroupName :: Prelude.Text,
UpdateComponentConfiguration -> Text
componentName :: Prelude.Text
}
deriving (UpdateComponentConfiguration
-> UpdateComponentConfiguration -> Bool
(UpdateComponentConfiguration
-> UpdateComponentConfiguration -> Bool)
-> (UpdateComponentConfiguration
-> UpdateComponentConfiguration -> Bool)
-> Eq UpdateComponentConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateComponentConfiguration
-> UpdateComponentConfiguration -> Bool
$c/= :: UpdateComponentConfiguration
-> UpdateComponentConfiguration -> Bool
== :: UpdateComponentConfiguration
-> UpdateComponentConfiguration -> Bool
$c== :: UpdateComponentConfiguration
-> UpdateComponentConfiguration -> Bool
Prelude.Eq, ReadPrec [UpdateComponentConfiguration]
ReadPrec UpdateComponentConfiguration
Int -> ReadS UpdateComponentConfiguration
ReadS [UpdateComponentConfiguration]
(Int -> ReadS UpdateComponentConfiguration)
-> ReadS [UpdateComponentConfiguration]
-> ReadPrec UpdateComponentConfiguration
-> ReadPrec [UpdateComponentConfiguration]
-> Read UpdateComponentConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateComponentConfiguration]
$creadListPrec :: ReadPrec [UpdateComponentConfiguration]
readPrec :: ReadPrec UpdateComponentConfiguration
$creadPrec :: ReadPrec UpdateComponentConfiguration
readList :: ReadS [UpdateComponentConfiguration]
$creadList :: ReadS [UpdateComponentConfiguration]
readsPrec :: Int -> ReadS UpdateComponentConfiguration
$creadsPrec :: Int -> ReadS UpdateComponentConfiguration
Prelude.Read, Int -> UpdateComponentConfiguration -> ShowS
[UpdateComponentConfiguration] -> ShowS
UpdateComponentConfiguration -> String
(Int -> UpdateComponentConfiguration -> ShowS)
-> (UpdateComponentConfiguration -> String)
-> ([UpdateComponentConfiguration] -> ShowS)
-> Show UpdateComponentConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateComponentConfiguration] -> ShowS
$cshowList :: [UpdateComponentConfiguration] -> ShowS
show :: UpdateComponentConfiguration -> String
$cshow :: UpdateComponentConfiguration -> String
showsPrec :: Int -> UpdateComponentConfiguration -> ShowS
$cshowsPrec :: Int -> UpdateComponentConfiguration -> ShowS
Prelude.Show, (forall x.
UpdateComponentConfiguration -> Rep UpdateComponentConfiguration x)
-> (forall x.
Rep UpdateComponentConfiguration x -> UpdateComponentConfiguration)
-> Generic UpdateComponentConfiguration
forall x.
Rep UpdateComponentConfiguration x -> UpdateComponentConfiguration
forall x.
UpdateComponentConfiguration -> Rep UpdateComponentConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateComponentConfiguration x -> UpdateComponentConfiguration
$cfrom :: forall x.
UpdateComponentConfiguration -> Rep UpdateComponentConfiguration x
Prelude.Generic)
newUpdateComponentConfiguration ::
Prelude.Text ->
Prelude.Text ->
UpdateComponentConfiguration
newUpdateComponentConfiguration :: Text -> Text -> UpdateComponentConfiguration
newUpdateComponentConfiguration
Text
pResourceGroupName_
Text
pComponentName_ =
UpdateComponentConfiguration' :: Maybe Text
-> Maybe Bool
-> Maybe Tier
-> Text
-> Text
-> UpdateComponentConfiguration
UpdateComponentConfiguration'
{ $sel:componentConfiguration:UpdateComponentConfiguration' :: Maybe Text
componentConfiguration =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:monitor:UpdateComponentConfiguration' :: Maybe Bool
monitor = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:tier:UpdateComponentConfiguration' :: Maybe Tier
tier = Maybe Tier
forall a. Maybe a
Prelude.Nothing,
$sel:resourceGroupName:UpdateComponentConfiguration' :: Text
resourceGroupName = Text
pResourceGroupName_,
$sel:componentName:UpdateComponentConfiguration' :: Text
componentName = Text
pComponentName_
}
updateComponentConfiguration_componentConfiguration :: Lens.Lens' UpdateComponentConfiguration (Prelude.Maybe Prelude.Text)
updateComponentConfiguration_componentConfiguration :: (Maybe Text -> f (Maybe Text))
-> UpdateComponentConfiguration -> f UpdateComponentConfiguration
updateComponentConfiguration_componentConfiguration = (UpdateComponentConfiguration -> Maybe Text)
-> (UpdateComponentConfiguration
-> Maybe Text -> UpdateComponentConfiguration)
-> Lens
UpdateComponentConfiguration
UpdateComponentConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateComponentConfiguration' {Maybe Text
componentConfiguration :: Maybe Text
$sel:componentConfiguration:UpdateComponentConfiguration' :: UpdateComponentConfiguration -> Maybe Text
componentConfiguration} -> Maybe Text
componentConfiguration) (\s :: UpdateComponentConfiguration
s@UpdateComponentConfiguration' {} Maybe Text
a -> UpdateComponentConfiguration
s {$sel:componentConfiguration:UpdateComponentConfiguration' :: Maybe Text
componentConfiguration = Maybe Text
a} :: UpdateComponentConfiguration)
updateComponentConfiguration_monitor :: Lens.Lens' UpdateComponentConfiguration (Prelude.Maybe Prelude.Bool)
updateComponentConfiguration_monitor :: (Maybe Bool -> f (Maybe Bool))
-> UpdateComponentConfiguration -> f UpdateComponentConfiguration
updateComponentConfiguration_monitor = (UpdateComponentConfiguration -> Maybe Bool)
-> (UpdateComponentConfiguration
-> Maybe Bool -> UpdateComponentConfiguration)
-> Lens
UpdateComponentConfiguration
UpdateComponentConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateComponentConfiguration' {Maybe Bool
monitor :: Maybe Bool
$sel:monitor:UpdateComponentConfiguration' :: UpdateComponentConfiguration -> Maybe Bool
monitor} -> Maybe Bool
monitor) (\s :: UpdateComponentConfiguration
s@UpdateComponentConfiguration' {} Maybe Bool
a -> UpdateComponentConfiguration
s {$sel:monitor:UpdateComponentConfiguration' :: Maybe Bool
monitor = Maybe Bool
a} :: UpdateComponentConfiguration)
updateComponentConfiguration_tier :: Lens.Lens' UpdateComponentConfiguration (Prelude.Maybe Tier)
updateComponentConfiguration_tier :: (Maybe Tier -> f (Maybe Tier))
-> UpdateComponentConfiguration -> f UpdateComponentConfiguration
updateComponentConfiguration_tier = (UpdateComponentConfiguration -> Maybe Tier)
-> (UpdateComponentConfiguration
-> Maybe Tier -> UpdateComponentConfiguration)
-> Lens
UpdateComponentConfiguration
UpdateComponentConfiguration
(Maybe Tier)
(Maybe Tier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateComponentConfiguration' {Maybe Tier
tier :: Maybe Tier
$sel:tier:UpdateComponentConfiguration' :: UpdateComponentConfiguration -> Maybe Tier
tier} -> Maybe Tier
tier) (\s :: UpdateComponentConfiguration
s@UpdateComponentConfiguration' {} Maybe Tier
a -> UpdateComponentConfiguration
s {$sel:tier:UpdateComponentConfiguration' :: Maybe Tier
tier = Maybe Tier
a} :: UpdateComponentConfiguration)
updateComponentConfiguration_resourceGroupName :: Lens.Lens' UpdateComponentConfiguration Prelude.Text
updateComponentConfiguration_resourceGroupName :: (Text -> f Text)
-> UpdateComponentConfiguration -> f UpdateComponentConfiguration
updateComponentConfiguration_resourceGroupName = (UpdateComponentConfiguration -> Text)
-> (UpdateComponentConfiguration
-> Text -> UpdateComponentConfiguration)
-> Lens
UpdateComponentConfiguration UpdateComponentConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateComponentConfiguration' {Text
resourceGroupName :: Text
$sel:resourceGroupName:UpdateComponentConfiguration' :: UpdateComponentConfiguration -> Text
resourceGroupName} -> Text
resourceGroupName) (\s :: UpdateComponentConfiguration
s@UpdateComponentConfiguration' {} Text
a -> UpdateComponentConfiguration
s {$sel:resourceGroupName:UpdateComponentConfiguration' :: Text
resourceGroupName = Text
a} :: UpdateComponentConfiguration)
updateComponentConfiguration_componentName :: Lens.Lens' UpdateComponentConfiguration Prelude.Text
updateComponentConfiguration_componentName :: (Text -> f Text)
-> UpdateComponentConfiguration -> f UpdateComponentConfiguration
updateComponentConfiguration_componentName = (UpdateComponentConfiguration -> Text)
-> (UpdateComponentConfiguration
-> Text -> UpdateComponentConfiguration)
-> Lens
UpdateComponentConfiguration UpdateComponentConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateComponentConfiguration' {Text
componentName :: Text
$sel:componentName:UpdateComponentConfiguration' :: UpdateComponentConfiguration -> Text
componentName} -> Text
componentName) (\s :: UpdateComponentConfiguration
s@UpdateComponentConfiguration' {} Text
a -> UpdateComponentConfiguration
s {$sel:componentName:UpdateComponentConfiguration' :: Text
componentName = Text
a} :: UpdateComponentConfiguration)
instance Core.AWSRequest UpdateComponentConfiguration where
type
AWSResponse UpdateComponentConfiguration =
UpdateComponentConfigurationResponse
request :: UpdateComponentConfiguration
-> Request UpdateComponentConfiguration
request = Service
-> UpdateComponentConfiguration
-> Request UpdateComponentConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateComponentConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateComponentConfiguration)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateComponentConfiguration))
-> Logger
-> Service
-> Proxy UpdateComponentConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateComponentConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateComponentConfigurationResponse
UpdateComponentConfigurationResponse'
(Int -> UpdateComponentConfigurationResponse)
-> Either String Int
-> Either String UpdateComponentConfigurationResponse
forall (f :: * -> *) a b. Functor 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
UpdateComponentConfiguration
instance Prelude.NFData UpdateComponentConfiguration
instance Core.ToHeaders UpdateComponentConfiguration where
toHeaders :: UpdateComponentConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateComponentConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"EC2WindowsBarleyService.UpdateComponentConfiguration" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateComponentConfiguration where
toJSON :: UpdateComponentConfiguration -> Value
toJSON UpdateComponentConfiguration' {Maybe Bool
Maybe Text
Maybe Tier
Text
componentName :: Text
resourceGroupName :: Text
tier :: Maybe Tier
monitor :: Maybe Bool
componentConfiguration :: Maybe Text
$sel:componentName:UpdateComponentConfiguration' :: UpdateComponentConfiguration -> Text
$sel:resourceGroupName:UpdateComponentConfiguration' :: UpdateComponentConfiguration -> Text
$sel:tier:UpdateComponentConfiguration' :: UpdateComponentConfiguration -> Maybe Tier
$sel:monitor:UpdateComponentConfiguration' :: UpdateComponentConfiguration -> Maybe Bool
$sel:componentConfiguration:UpdateComponentConfiguration' :: UpdateComponentConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ComponentConfiguration" 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
componentConfiguration,
(Text
"Monitor" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
monitor,
(Text
"Tier" Text -> Tier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Tier -> Pair) -> Maybe Tier -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Tier
tier,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ResourceGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceGroupName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ComponentName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
componentName)
]
)
instance Core.ToPath UpdateComponentConfiguration where
toPath :: UpdateComponentConfiguration -> ByteString
toPath = ByteString -> UpdateComponentConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateComponentConfiguration where
toQuery :: UpdateComponentConfiguration -> QueryString
toQuery = QueryString -> UpdateComponentConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateComponentConfigurationResponse = UpdateComponentConfigurationResponse'
{
UpdateComponentConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateComponentConfigurationResponse
-> UpdateComponentConfigurationResponse -> Bool
(UpdateComponentConfigurationResponse
-> UpdateComponentConfigurationResponse -> Bool)
-> (UpdateComponentConfigurationResponse
-> UpdateComponentConfigurationResponse -> Bool)
-> Eq UpdateComponentConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateComponentConfigurationResponse
-> UpdateComponentConfigurationResponse -> Bool
$c/= :: UpdateComponentConfigurationResponse
-> UpdateComponentConfigurationResponse -> Bool
== :: UpdateComponentConfigurationResponse
-> UpdateComponentConfigurationResponse -> Bool
$c== :: UpdateComponentConfigurationResponse
-> UpdateComponentConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateComponentConfigurationResponse]
ReadPrec UpdateComponentConfigurationResponse
Int -> ReadS UpdateComponentConfigurationResponse
ReadS [UpdateComponentConfigurationResponse]
(Int -> ReadS UpdateComponentConfigurationResponse)
-> ReadS [UpdateComponentConfigurationResponse]
-> ReadPrec UpdateComponentConfigurationResponse
-> ReadPrec [UpdateComponentConfigurationResponse]
-> Read UpdateComponentConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateComponentConfigurationResponse]
$creadListPrec :: ReadPrec [UpdateComponentConfigurationResponse]
readPrec :: ReadPrec UpdateComponentConfigurationResponse
$creadPrec :: ReadPrec UpdateComponentConfigurationResponse
readList :: ReadS [UpdateComponentConfigurationResponse]
$creadList :: ReadS [UpdateComponentConfigurationResponse]
readsPrec :: Int -> ReadS UpdateComponentConfigurationResponse
$creadsPrec :: Int -> ReadS UpdateComponentConfigurationResponse
Prelude.Read, Int -> UpdateComponentConfigurationResponse -> ShowS
[UpdateComponentConfigurationResponse] -> ShowS
UpdateComponentConfigurationResponse -> String
(Int -> UpdateComponentConfigurationResponse -> ShowS)
-> (UpdateComponentConfigurationResponse -> String)
-> ([UpdateComponentConfigurationResponse] -> ShowS)
-> Show UpdateComponentConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateComponentConfigurationResponse] -> ShowS
$cshowList :: [UpdateComponentConfigurationResponse] -> ShowS
show :: UpdateComponentConfigurationResponse -> String
$cshow :: UpdateComponentConfigurationResponse -> String
showsPrec :: Int -> UpdateComponentConfigurationResponse -> ShowS
$cshowsPrec :: Int -> UpdateComponentConfigurationResponse -> ShowS
Prelude.Show, (forall x.
UpdateComponentConfigurationResponse
-> Rep UpdateComponentConfigurationResponse x)
-> (forall x.
Rep UpdateComponentConfigurationResponse x
-> UpdateComponentConfigurationResponse)
-> Generic UpdateComponentConfigurationResponse
forall x.
Rep UpdateComponentConfigurationResponse x
-> UpdateComponentConfigurationResponse
forall x.
UpdateComponentConfigurationResponse
-> Rep UpdateComponentConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateComponentConfigurationResponse x
-> UpdateComponentConfigurationResponse
$cfrom :: forall x.
UpdateComponentConfigurationResponse
-> Rep UpdateComponentConfigurationResponse x
Prelude.Generic)
newUpdateComponentConfigurationResponse ::
Prelude.Int ->
UpdateComponentConfigurationResponse
newUpdateComponentConfigurationResponse :: Int -> UpdateComponentConfigurationResponse
newUpdateComponentConfigurationResponse Int
pHttpStatus_ =
UpdateComponentConfigurationResponse' :: Int -> UpdateComponentConfigurationResponse
UpdateComponentConfigurationResponse'
{ $sel:httpStatus:UpdateComponentConfigurationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateComponentConfigurationResponse_httpStatus :: Lens.Lens' UpdateComponentConfigurationResponse Prelude.Int
updateComponentConfigurationResponse_httpStatus :: (Int -> f Int)
-> UpdateComponentConfigurationResponse
-> f UpdateComponentConfigurationResponse
updateComponentConfigurationResponse_httpStatus = (UpdateComponentConfigurationResponse -> Int)
-> (UpdateComponentConfigurationResponse
-> Int -> UpdateComponentConfigurationResponse)
-> Lens
UpdateComponentConfigurationResponse
UpdateComponentConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateComponentConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateComponentConfigurationResponse' :: UpdateComponentConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateComponentConfigurationResponse
s@UpdateComponentConfigurationResponse' {} Int
a -> UpdateComponentConfigurationResponse
s {$sel:httpStatus:UpdateComponentConfigurationResponse' :: Int
httpStatus = Int
a} :: UpdateComponentConfigurationResponse)
instance
Prelude.NFData
UpdateComponentConfigurationResponse