{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:settingId:UpdateServiceSetting' :: Text
settingId = Text
pSettingId_,
$sel:settingValue:UpdateServiceSetting' :: Text
settingValue = Text
pSettingValue_
}
updateServiceSetting_settingId :: Lens.Lens' UpdateServiceSetting Prelude.Text
updateServiceSetting_settingId :: Lens' UpdateServiceSetting Text
updateServiceSetting_settingId = 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 :: Lens' UpdateServiceSetting Text
updateServiceSetting_settingValue = 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 :: (Service -> Service)
-> UpdateServiceSetting -> Request UpdateServiceSetting
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateServiceSetting
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServiceSetting)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateServiceSettingResponse
UpdateServiceSettingResponse'
forall (f :: * -> *) a b. Functor 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 UpdateServiceSetting where
hashWithSalt :: Int -> UpdateServiceSetting -> Int
hashWithSalt Int
_salt UpdateServiceSetting' {Text
settingValue :: Text
settingId :: Text
$sel:settingValue:UpdateServiceSetting' :: UpdateServiceSetting -> Text
$sel:settingId:UpdateServiceSetting' :: UpdateServiceSetting -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
settingId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
settingValue
instance Prelude.NFData UpdateServiceSetting where
rnf :: UpdateServiceSetting -> ()
rnf UpdateServiceSetting' {Text
settingValue :: Text
settingId :: Text
$sel:settingValue:UpdateServiceSetting' :: UpdateServiceSetting -> Text
$sel:settingId:UpdateServiceSetting' :: UpdateServiceSetting -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
settingId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
settingValue
instance Data.ToHeaders UpdateServiceSetting where
toHeaders :: UpdateServiceSetting -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonSSM.UpdateServiceSetting" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"SettingId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
settingId),
forall a. a -> Maybe a
Prelude.Just (Key
"SettingValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
settingValue)
]
)
instance Data.ToPath UpdateServiceSetting where
toPath :: UpdateServiceSetting -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateServiceSetting where
toQuery :: UpdateServiceSetting -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateServiceSettingResponse = UpdateServiceSettingResponse'
{
UpdateServiceSettingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateServiceSettingResponse
-> UpdateServiceSettingResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:UpdateServiceSettingResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateServiceSettingResponse_httpStatus :: Lens.Lens' UpdateServiceSettingResponse Prelude.Int
updateServiceSettingResponse_httpStatus :: Lens' UpdateServiceSettingResponse Int
updateServiceSettingResponse_httpStatus = 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 where
rnf :: UpdateServiceSettingResponse -> ()
rnf UpdateServiceSettingResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateServiceSettingResponse' :: UpdateServiceSettingResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus