{-# 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.ResetServiceSetting
(
ResetServiceSetting (..),
newResetServiceSetting,
resetServiceSetting_settingId,
ResetServiceSettingResponse (..),
newResetServiceSettingResponse,
resetServiceSettingResponse_serviceSetting,
resetServiceSettingResponse_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 ResetServiceSetting = ResetServiceSetting'
{
ResetServiceSetting -> Text
settingId :: Prelude.Text
}
deriving (ResetServiceSetting -> ResetServiceSetting -> Bool
(ResetServiceSetting -> ResetServiceSetting -> Bool)
-> (ResetServiceSetting -> ResetServiceSetting -> Bool)
-> Eq ResetServiceSetting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResetServiceSetting -> ResetServiceSetting -> Bool
$c/= :: ResetServiceSetting -> ResetServiceSetting -> Bool
== :: ResetServiceSetting -> ResetServiceSetting -> Bool
$c== :: ResetServiceSetting -> ResetServiceSetting -> Bool
Prelude.Eq, ReadPrec [ResetServiceSetting]
ReadPrec ResetServiceSetting
Int -> ReadS ResetServiceSetting
ReadS [ResetServiceSetting]
(Int -> ReadS ResetServiceSetting)
-> ReadS [ResetServiceSetting]
-> ReadPrec ResetServiceSetting
-> ReadPrec [ResetServiceSetting]
-> Read ResetServiceSetting
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResetServiceSetting]
$creadListPrec :: ReadPrec [ResetServiceSetting]
readPrec :: ReadPrec ResetServiceSetting
$creadPrec :: ReadPrec ResetServiceSetting
readList :: ReadS [ResetServiceSetting]
$creadList :: ReadS [ResetServiceSetting]
readsPrec :: Int -> ReadS ResetServiceSetting
$creadsPrec :: Int -> ReadS ResetServiceSetting
Prelude.Read, Int -> ResetServiceSetting -> ShowS
[ResetServiceSetting] -> ShowS
ResetServiceSetting -> String
(Int -> ResetServiceSetting -> ShowS)
-> (ResetServiceSetting -> String)
-> ([ResetServiceSetting] -> ShowS)
-> Show ResetServiceSetting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResetServiceSetting] -> ShowS
$cshowList :: [ResetServiceSetting] -> ShowS
show :: ResetServiceSetting -> String
$cshow :: ResetServiceSetting -> String
showsPrec :: Int -> ResetServiceSetting -> ShowS
$cshowsPrec :: Int -> ResetServiceSetting -> ShowS
Prelude.Show, (forall x. ResetServiceSetting -> Rep ResetServiceSetting x)
-> (forall x. Rep ResetServiceSetting x -> ResetServiceSetting)
-> Generic ResetServiceSetting
forall x. Rep ResetServiceSetting x -> ResetServiceSetting
forall x. ResetServiceSetting -> Rep ResetServiceSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResetServiceSetting x -> ResetServiceSetting
$cfrom :: forall x. ResetServiceSetting -> Rep ResetServiceSetting x
Prelude.Generic)
newResetServiceSetting ::
Prelude.Text ->
ResetServiceSetting
newResetServiceSetting :: Text -> ResetServiceSetting
newResetServiceSetting Text
pSettingId_ =
ResetServiceSetting' :: Text -> ResetServiceSetting
ResetServiceSetting' {$sel:settingId:ResetServiceSetting' :: Text
settingId = Text
pSettingId_}
resetServiceSetting_settingId :: Lens.Lens' ResetServiceSetting Prelude.Text
resetServiceSetting_settingId :: (Text -> f Text) -> ResetServiceSetting -> f ResetServiceSetting
resetServiceSetting_settingId = (ResetServiceSetting -> Text)
-> (ResetServiceSetting -> Text -> ResetServiceSetting)
-> Lens ResetServiceSetting ResetServiceSetting Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetServiceSetting' {Text
settingId :: Text
$sel:settingId:ResetServiceSetting' :: ResetServiceSetting -> Text
settingId} -> Text
settingId) (\s :: ResetServiceSetting
s@ResetServiceSetting' {} Text
a -> ResetServiceSetting
s {$sel:settingId:ResetServiceSetting' :: Text
settingId = Text
a} :: ResetServiceSetting)
instance Core.AWSRequest ResetServiceSetting where
type
AWSResponse ResetServiceSetting =
ResetServiceSettingResponse
request :: ResetServiceSetting -> Request ResetServiceSetting
request = Service -> ResetServiceSetting -> Request ResetServiceSetting
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ResetServiceSetting
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ResetServiceSetting)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ResetServiceSetting))
-> Logger
-> Service
-> Proxy ResetServiceSetting
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ResetServiceSetting)))
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 ServiceSetting -> Int -> ResetServiceSettingResponse
ResetServiceSettingResponse'
(Maybe ServiceSetting -> Int -> ResetServiceSettingResponse)
-> Either String (Maybe ServiceSetting)
-> Either String (Int -> ResetServiceSettingResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ServiceSetting)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ServiceSetting")
Either String (Int -> ResetServiceSettingResponse)
-> Either String Int -> Either String ResetServiceSettingResponse
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 ResetServiceSetting
instance Prelude.NFData ResetServiceSetting
instance Core.ToHeaders ResetServiceSetting where
toHeaders :: ResetServiceSetting -> ResponseHeaders
toHeaders =
ResponseHeaders -> ResetServiceSetting -> 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.ResetServiceSetting" ::
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 ResetServiceSetting where
toJSON :: ResetServiceSetting -> Value
toJSON ResetServiceSetting' {Text
settingId :: Text
$sel:settingId:ResetServiceSetting' :: ResetServiceSetting -> 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)]
)
instance Core.ToPath ResetServiceSetting where
toPath :: ResetServiceSetting -> ByteString
toPath = ByteString -> ResetServiceSetting -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ResetServiceSetting where
toQuery :: ResetServiceSetting -> QueryString
toQuery = QueryString -> ResetServiceSetting -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ResetServiceSettingResponse = ResetServiceSettingResponse'
{
ResetServiceSettingResponse -> Maybe ServiceSetting
serviceSetting :: Prelude.Maybe ServiceSetting,
ResetServiceSettingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ResetServiceSettingResponse -> ResetServiceSettingResponse -> Bool
(ResetServiceSettingResponse
-> ResetServiceSettingResponse -> Bool)
-> (ResetServiceSettingResponse
-> ResetServiceSettingResponse -> Bool)
-> Eq ResetServiceSettingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResetServiceSettingResponse -> ResetServiceSettingResponse -> Bool
$c/= :: ResetServiceSettingResponse -> ResetServiceSettingResponse -> Bool
== :: ResetServiceSettingResponse -> ResetServiceSettingResponse -> Bool
$c== :: ResetServiceSettingResponse -> ResetServiceSettingResponse -> Bool
Prelude.Eq, ReadPrec [ResetServiceSettingResponse]
ReadPrec ResetServiceSettingResponse
Int -> ReadS ResetServiceSettingResponse
ReadS [ResetServiceSettingResponse]
(Int -> ReadS ResetServiceSettingResponse)
-> ReadS [ResetServiceSettingResponse]
-> ReadPrec ResetServiceSettingResponse
-> ReadPrec [ResetServiceSettingResponse]
-> Read ResetServiceSettingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResetServiceSettingResponse]
$creadListPrec :: ReadPrec [ResetServiceSettingResponse]
readPrec :: ReadPrec ResetServiceSettingResponse
$creadPrec :: ReadPrec ResetServiceSettingResponse
readList :: ReadS [ResetServiceSettingResponse]
$creadList :: ReadS [ResetServiceSettingResponse]
readsPrec :: Int -> ReadS ResetServiceSettingResponse
$creadsPrec :: Int -> ReadS ResetServiceSettingResponse
Prelude.Read, Int -> ResetServiceSettingResponse -> ShowS
[ResetServiceSettingResponse] -> ShowS
ResetServiceSettingResponse -> String
(Int -> ResetServiceSettingResponse -> ShowS)
-> (ResetServiceSettingResponse -> String)
-> ([ResetServiceSettingResponse] -> ShowS)
-> Show ResetServiceSettingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResetServiceSettingResponse] -> ShowS
$cshowList :: [ResetServiceSettingResponse] -> ShowS
show :: ResetServiceSettingResponse -> String
$cshow :: ResetServiceSettingResponse -> String
showsPrec :: Int -> ResetServiceSettingResponse -> ShowS
$cshowsPrec :: Int -> ResetServiceSettingResponse -> ShowS
Prelude.Show, (forall x.
ResetServiceSettingResponse -> Rep ResetServiceSettingResponse x)
-> (forall x.
Rep ResetServiceSettingResponse x -> ResetServiceSettingResponse)
-> Generic ResetServiceSettingResponse
forall x.
Rep ResetServiceSettingResponse x -> ResetServiceSettingResponse
forall x.
ResetServiceSettingResponse -> Rep ResetServiceSettingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResetServiceSettingResponse x -> ResetServiceSettingResponse
$cfrom :: forall x.
ResetServiceSettingResponse -> Rep ResetServiceSettingResponse x
Prelude.Generic)
newResetServiceSettingResponse ::
Prelude.Int ->
ResetServiceSettingResponse
newResetServiceSettingResponse :: Int -> ResetServiceSettingResponse
newResetServiceSettingResponse Int
pHttpStatus_ =
ResetServiceSettingResponse' :: Maybe ServiceSetting -> Int -> ResetServiceSettingResponse
ResetServiceSettingResponse'
{ $sel:serviceSetting:ResetServiceSettingResponse' :: Maybe ServiceSetting
serviceSetting =
Maybe ServiceSetting
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ResetServiceSettingResponse' :: Int
httpStatus = Int
pHttpStatus_
}
resetServiceSettingResponse_serviceSetting :: Lens.Lens' ResetServiceSettingResponse (Prelude.Maybe ServiceSetting)
resetServiceSettingResponse_serviceSetting :: (Maybe ServiceSetting -> f (Maybe ServiceSetting))
-> ResetServiceSettingResponse -> f ResetServiceSettingResponse
resetServiceSettingResponse_serviceSetting = (ResetServiceSettingResponse -> Maybe ServiceSetting)
-> (ResetServiceSettingResponse
-> Maybe ServiceSetting -> ResetServiceSettingResponse)
-> Lens
ResetServiceSettingResponse
ResetServiceSettingResponse
(Maybe ServiceSetting)
(Maybe ServiceSetting)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetServiceSettingResponse' {Maybe ServiceSetting
serviceSetting :: Maybe ServiceSetting
$sel:serviceSetting:ResetServiceSettingResponse' :: ResetServiceSettingResponse -> Maybe ServiceSetting
serviceSetting} -> Maybe ServiceSetting
serviceSetting) (\s :: ResetServiceSettingResponse
s@ResetServiceSettingResponse' {} Maybe ServiceSetting
a -> ResetServiceSettingResponse
s {$sel:serviceSetting:ResetServiceSettingResponse' :: Maybe ServiceSetting
serviceSetting = Maybe ServiceSetting
a} :: ResetServiceSettingResponse)
resetServiceSettingResponse_httpStatus :: Lens.Lens' ResetServiceSettingResponse Prelude.Int
resetServiceSettingResponse_httpStatus :: (Int -> f Int)
-> ResetServiceSettingResponse -> f ResetServiceSettingResponse
resetServiceSettingResponse_httpStatus = (ResetServiceSettingResponse -> Int)
-> (ResetServiceSettingResponse
-> Int -> ResetServiceSettingResponse)
-> Lens
ResetServiceSettingResponse ResetServiceSettingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetServiceSettingResponse' {Int
httpStatus :: Int
$sel:httpStatus:ResetServiceSettingResponse' :: ResetServiceSettingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ResetServiceSettingResponse
s@ResetServiceSettingResponse' {} Int
a -> ResetServiceSettingResponse
s {$sel:httpStatus:ResetServiceSettingResponse' :: Int
httpStatus = Int
a} :: ResetServiceSettingResponse)
instance Prelude.NFData ResetServiceSettingResponse