{-# 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.SSM.UpdateServiceSetting
(
UpdateServiceSetting (..),
newUpdateServiceSetting,
updateServiceSetting_settingId,
updateServiceSetting_settingValue,
UpdateServiceSettingResponse (..),
newUpdateServiceSettingResponse,
updateServiceSettingResponse_httpStatus,
)
where
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
import Amazonka.SSM.Types
data UpdateServiceSetting = UpdateServiceSetting'
{
UpdateServiceSetting -> Text
settingId :: Prelude.Text,
UpdateServiceSetting -> Text
settingValue :: Prelude.Text
}
deriving (UpdateServiceSetting -> UpdateServiceSetting -> Bool
(UpdateServiceSetting -> UpdateServiceSetting -> Bool)
-> (UpdateServiceSetting -> UpdateServiceSetting -> Bool)
-> Eq UpdateServiceSetting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceSetting -> UpdateServiceSetting -> Bool
$c/= :: UpdateServiceSetting -> UpdateServiceSetting -> Bool
== :: UpdateServiceSetting -> UpdateServiceSetting -> Bool
$c== :: UpdateServiceSetting -> UpdateServiceSetting -> Bool
Prelude.Eq, ReadPrec [UpdateServiceSetting]
ReadPrec UpdateServiceSetting
Int -> ReadS UpdateServiceSetting
ReadS [UpdateServiceSetting]
(Int -> ReadS UpdateServiceSetting)
-> ReadS [UpdateServiceSetting]
-> ReadPrec UpdateServiceSetting
-> ReadPrec [UpdateServiceSetting]
-> Read UpdateServiceSetting
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServiceSetting]
$creadListPrec :: ReadPrec [UpdateServiceSetting]
readPrec :: ReadPrec UpdateServiceSetting
$creadPrec :: ReadPrec UpdateServiceSetting
readList :: ReadS [UpdateServiceSetting]
$creadList :: ReadS [UpdateServiceSetting]
readsPrec :: Int -> ReadS UpdateServiceSetting
$creadsPrec :: Int -> ReadS UpdateServiceSetting
Prelude.Read, Int -> UpdateServiceSetting -> ShowS
[UpdateServiceSetting] -> ShowS
UpdateServiceSetting -> String
(Int -> UpdateServiceSetting -> ShowS)
-> (UpdateServiceSetting -> String)
-> ([UpdateServiceSetting] -> ShowS)
-> Show UpdateServiceSetting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceSetting] -> ShowS
$cshowList :: [UpdateServiceSetting] -> ShowS
show :: UpdateServiceSetting -> String
$cshow :: UpdateServiceSetting -> String
showsPrec :: Int -> UpdateServiceSetting -> ShowS
$cshowsPrec :: Int -> UpdateServiceSetting -> ShowS
Prelude.Show, (forall x. UpdateServiceSetting -> Rep UpdateServiceSetting x)
-> (forall x. Rep UpdateServiceSetting x -> UpdateServiceSetting)
-> Generic UpdateServiceSetting
forall x. Rep UpdateServiceSetting x -> UpdateServiceSetting
forall x. UpdateServiceSetting -> Rep UpdateServiceSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateServiceSetting x -> UpdateServiceSetting
$cfrom :: forall x. UpdateServiceSetting -> Rep UpdateServiceSetting x
Prelude.Generic)
newUpdateServiceSetting ::
Prelude.Text ->
Prelude.Text ->
UpdateServiceSetting
newUpdateServiceSetting :: Text -> Text -> UpdateServiceSetting
newUpdateServiceSetting Text
pSettingId_ Text
pSettingValue_ =
UpdateServiceSetting' :: Text -> Text -> UpdateServiceSetting
UpdateServiceSetting'
{ $sel:settingId:UpdateServiceSetting' :: Text
settingId = Text
pSettingId_,
$sel:settingValue:UpdateServiceSetting' :: Text
settingValue = Text
pSettingValue_
}
updateServiceSetting_settingId :: Lens.Lens' UpdateServiceSetting Prelude.Text
updateServiceSetting_settingId :: (Text -> f Text) -> UpdateServiceSetting -> f UpdateServiceSetting
updateServiceSetting_settingId = (UpdateServiceSetting -> Text)
-> (UpdateServiceSetting -> Text -> UpdateServiceSetting)
-> Lens UpdateServiceSetting UpdateServiceSetting Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSetting' {Text
settingId :: Text
$sel:settingId:UpdateServiceSetting' :: UpdateServiceSetting -> Text
settingId} -> Text
settingId) (\s :: UpdateServiceSetting
s@UpdateServiceSetting' {} Text
a -> UpdateServiceSetting
s {$sel:settingId:UpdateServiceSetting' :: Text
settingId = Text
a} :: UpdateServiceSetting)
updateServiceSetting_settingValue :: Lens.Lens' UpdateServiceSetting Prelude.Text
updateServiceSetting_settingValue :: (Text -> f Text) -> UpdateServiceSetting -> f UpdateServiceSetting
updateServiceSetting_settingValue = (UpdateServiceSetting -> Text)
-> (UpdateServiceSetting -> Text -> UpdateServiceSetting)
-> Lens UpdateServiceSetting UpdateServiceSetting Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSetting' {Text
settingValue :: Text
$sel:settingValue:UpdateServiceSetting' :: UpdateServiceSetting -> Text
settingValue} -> Text
settingValue) (\s :: UpdateServiceSetting
s@UpdateServiceSetting' {} Text
a -> UpdateServiceSetting
s {$sel:settingValue:UpdateServiceSetting' :: Text
settingValue = Text
a} :: UpdateServiceSetting)
instance Core.AWSRequest UpdateServiceSetting where
type
AWSResponse UpdateServiceSetting =
UpdateServiceSettingResponse
request :: UpdateServiceSetting -> Request UpdateServiceSetting
request = Service -> UpdateServiceSetting -> Request UpdateServiceSetting
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateServiceSetting
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServiceSetting)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateServiceSetting))
-> Logger
-> Service
-> Proxy UpdateServiceSetting
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServiceSetting)))
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 -> UpdateServiceSettingResponse
UpdateServiceSettingResponse'
(Int -> UpdateServiceSettingResponse)
-> Either String Int -> Either String UpdateServiceSettingResponse
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 UpdateServiceSetting
instance Prelude.NFData UpdateServiceSetting
instance Core.ToHeaders UpdateServiceSetting where
toHeaders :: UpdateServiceSetting -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateServiceSetting -> 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
"AmazonSSM.UpdateServiceSetting" ::
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 UpdateServiceSetting where
toJSON :: UpdateServiceSetting -> Value
toJSON UpdateServiceSetting' {Text
settingValue :: Text
settingId :: Text
$sel:settingValue:UpdateServiceSetting' :: UpdateServiceSetting -> Text
$sel:settingId:UpdateServiceSetting' :: UpdateServiceSetting -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SettingId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
settingId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SettingValue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
settingValue)
]
)
instance Core.ToPath UpdateServiceSetting where
toPath :: UpdateServiceSetting -> ByteString
toPath = ByteString -> UpdateServiceSetting -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateServiceSetting where
toQuery :: UpdateServiceSetting -> QueryString
toQuery = QueryString -> UpdateServiceSetting -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateServiceSettingResponse = UpdateServiceSettingResponse'
{
UpdateServiceSettingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateServiceSettingResponse
-> UpdateServiceSettingResponse -> Bool
(UpdateServiceSettingResponse
-> UpdateServiceSettingResponse -> Bool)
-> (UpdateServiceSettingResponse
-> UpdateServiceSettingResponse -> Bool)
-> Eq UpdateServiceSettingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceSettingResponse
-> UpdateServiceSettingResponse -> Bool
$c/= :: UpdateServiceSettingResponse
-> UpdateServiceSettingResponse -> Bool
== :: UpdateServiceSettingResponse
-> UpdateServiceSettingResponse -> Bool
$c== :: UpdateServiceSettingResponse
-> UpdateServiceSettingResponse -> Bool
Prelude.Eq, ReadPrec [UpdateServiceSettingResponse]
ReadPrec UpdateServiceSettingResponse
Int -> ReadS UpdateServiceSettingResponse
ReadS [UpdateServiceSettingResponse]
(Int -> ReadS UpdateServiceSettingResponse)
-> ReadS [UpdateServiceSettingResponse]
-> ReadPrec UpdateServiceSettingResponse
-> ReadPrec [UpdateServiceSettingResponse]
-> Read UpdateServiceSettingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServiceSettingResponse]
$creadListPrec :: ReadPrec [UpdateServiceSettingResponse]
readPrec :: ReadPrec UpdateServiceSettingResponse
$creadPrec :: ReadPrec UpdateServiceSettingResponse
readList :: ReadS [UpdateServiceSettingResponse]
$creadList :: ReadS [UpdateServiceSettingResponse]
readsPrec :: Int -> ReadS UpdateServiceSettingResponse
$creadsPrec :: Int -> ReadS UpdateServiceSettingResponse
Prelude.Read, Int -> UpdateServiceSettingResponse -> ShowS
[UpdateServiceSettingResponse] -> ShowS
UpdateServiceSettingResponse -> String
(Int -> UpdateServiceSettingResponse -> ShowS)
-> (UpdateServiceSettingResponse -> String)
-> ([UpdateServiceSettingResponse] -> ShowS)
-> Show UpdateServiceSettingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceSettingResponse] -> ShowS
$cshowList :: [UpdateServiceSettingResponse] -> ShowS
show :: UpdateServiceSettingResponse -> String
$cshow :: UpdateServiceSettingResponse -> String
showsPrec :: Int -> UpdateServiceSettingResponse -> ShowS
$cshowsPrec :: Int -> UpdateServiceSettingResponse -> ShowS
Prelude.Show, (forall x.
UpdateServiceSettingResponse -> Rep UpdateServiceSettingResponse x)
-> (forall x.
Rep UpdateServiceSettingResponse x -> UpdateServiceSettingResponse)
-> Generic UpdateServiceSettingResponse
forall x.
Rep UpdateServiceSettingResponse x -> UpdateServiceSettingResponse
forall x.
UpdateServiceSettingResponse -> Rep UpdateServiceSettingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServiceSettingResponse x -> UpdateServiceSettingResponse
$cfrom :: forall x.
UpdateServiceSettingResponse -> Rep UpdateServiceSettingResponse x
Prelude.Generic)
newUpdateServiceSettingResponse ::
Prelude.Int ->
UpdateServiceSettingResponse
newUpdateServiceSettingResponse :: Int -> UpdateServiceSettingResponse
newUpdateServiceSettingResponse Int
pHttpStatus_ =
UpdateServiceSettingResponse' :: Int -> UpdateServiceSettingResponse
UpdateServiceSettingResponse'
{ $sel:httpStatus:UpdateServiceSettingResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateServiceSettingResponse_httpStatus :: Lens.Lens' UpdateServiceSettingResponse Prelude.Int
updateServiceSettingResponse_httpStatus :: (Int -> f Int)
-> UpdateServiceSettingResponse -> f UpdateServiceSettingResponse
updateServiceSettingResponse_httpStatus = (UpdateServiceSettingResponse -> Int)
-> (UpdateServiceSettingResponse
-> Int -> UpdateServiceSettingResponse)
-> Lens
UpdateServiceSettingResponse UpdateServiceSettingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettingResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateServiceSettingResponse' :: UpdateServiceSettingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateServiceSettingResponse
s@UpdateServiceSettingResponse' {} Int
a -> UpdateServiceSettingResponse
s {$sel:httpStatus:UpdateServiceSettingResponse' :: Int
httpStatus = Int
a} :: UpdateServiceSettingResponse)
instance Prelude.NFData UpdateServiceSettingResponse