{-# 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.GetServiceSetting
(
GetServiceSetting (..),
newGetServiceSetting,
getServiceSetting_settingId,
GetServiceSettingResponse (..),
newGetServiceSettingResponse,
getServiceSettingResponse_serviceSetting,
getServiceSettingResponse_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 GetServiceSetting = GetServiceSetting'
{
GetServiceSetting -> Text
settingId :: Prelude.Text
}
deriving (GetServiceSetting -> GetServiceSetting -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetServiceSetting -> GetServiceSetting -> Bool
$c/= :: GetServiceSetting -> GetServiceSetting -> Bool
== :: GetServiceSetting -> GetServiceSetting -> Bool
$c== :: GetServiceSetting -> GetServiceSetting -> Bool
Prelude.Eq, ReadPrec [GetServiceSetting]
ReadPrec GetServiceSetting
Int -> ReadS GetServiceSetting
ReadS [GetServiceSetting]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetServiceSetting]
$creadListPrec :: ReadPrec [GetServiceSetting]
readPrec :: ReadPrec GetServiceSetting
$creadPrec :: ReadPrec GetServiceSetting
readList :: ReadS [GetServiceSetting]
$creadList :: ReadS [GetServiceSetting]
readsPrec :: Int -> ReadS GetServiceSetting
$creadsPrec :: Int -> ReadS GetServiceSetting
Prelude.Read, Int -> GetServiceSetting -> ShowS
[GetServiceSetting] -> ShowS
GetServiceSetting -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetServiceSetting] -> ShowS
$cshowList :: [GetServiceSetting] -> ShowS
show :: GetServiceSetting -> String
$cshow :: GetServiceSetting -> String
showsPrec :: Int -> GetServiceSetting -> ShowS
$cshowsPrec :: Int -> GetServiceSetting -> ShowS
Prelude.Show, forall x. Rep GetServiceSetting x -> GetServiceSetting
forall x. GetServiceSetting -> Rep GetServiceSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetServiceSetting x -> GetServiceSetting
$cfrom :: forall x. GetServiceSetting -> Rep GetServiceSetting x
Prelude.Generic)
newGetServiceSetting ::
Prelude.Text ->
GetServiceSetting
newGetServiceSetting :: Text -> GetServiceSetting
newGetServiceSetting Text
pSettingId_ =
GetServiceSetting' {$sel:settingId:GetServiceSetting' :: Text
settingId = Text
pSettingId_}
getServiceSetting_settingId :: Lens.Lens' GetServiceSetting Prelude.Text
getServiceSetting_settingId :: Lens' GetServiceSetting Text
getServiceSetting_settingId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceSetting' {Text
settingId :: Text
$sel:settingId:GetServiceSetting' :: GetServiceSetting -> Text
settingId} -> Text
settingId) (\s :: GetServiceSetting
s@GetServiceSetting' {} Text
a -> GetServiceSetting
s {$sel:settingId:GetServiceSetting' :: Text
settingId = Text
a} :: GetServiceSetting)
instance Core.AWSRequest GetServiceSetting where
type
AWSResponse GetServiceSetting =
GetServiceSettingResponse
request :: (Service -> Service)
-> GetServiceSetting -> Request GetServiceSetting
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 GetServiceSetting
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetServiceSetting)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe ServiceSetting -> Int -> GetServiceSettingResponse
GetServiceSettingResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ServiceSetting")
forall (f :: * -> *) a b. Applicative f => 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 GetServiceSetting where
hashWithSalt :: Int -> GetServiceSetting -> Int
hashWithSalt Int
_salt GetServiceSetting' {Text
settingId :: Text
$sel:settingId:GetServiceSetting' :: GetServiceSetting -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
settingId
instance Prelude.NFData GetServiceSetting where
rnf :: GetServiceSetting -> ()
rnf GetServiceSetting' {Text
settingId :: Text
$sel:settingId:GetServiceSetting' :: GetServiceSetting -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
settingId
instance Data.ToHeaders GetServiceSetting where
toHeaders :: GetServiceSetting -> 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.GetServiceSetting" ::
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 GetServiceSetting where
toJSON :: GetServiceSetting -> Value
toJSON GetServiceSetting' {Text
settingId :: Text
$sel:settingId:GetServiceSetting' :: GetServiceSetting -> 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)]
)
instance Data.ToPath GetServiceSetting where
toPath :: GetServiceSetting -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetServiceSetting where
toQuery :: GetServiceSetting -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetServiceSettingResponse = GetServiceSettingResponse'
{
GetServiceSettingResponse -> Maybe ServiceSetting
serviceSetting :: Prelude.Maybe ServiceSetting,
GetServiceSettingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetServiceSettingResponse -> GetServiceSettingResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetServiceSettingResponse -> GetServiceSettingResponse -> Bool
$c/= :: GetServiceSettingResponse -> GetServiceSettingResponse -> Bool
== :: GetServiceSettingResponse -> GetServiceSettingResponse -> Bool
$c== :: GetServiceSettingResponse -> GetServiceSettingResponse -> Bool
Prelude.Eq, ReadPrec [GetServiceSettingResponse]
ReadPrec GetServiceSettingResponse
Int -> ReadS GetServiceSettingResponse
ReadS [GetServiceSettingResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetServiceSettingResponse]
$creadListPrec :: ReadPrec [GetServiceSettingResponse]
readPrec :: ReadPrec GetServiceSettingResponse
$creadPrec :: ReadPrec GetServiceSettingResponse
readList :: ReadS [GetServiceSettingResponse]
$creadList :: ReadS [GetServiceSettingResponse]
readsPrec :: Int -> ReadS GetServiceSettingResponse
$creadsPrec :: Int -> ReadS GetServiceSettingResponse
Prelude.Read, Int -> GetServiceSettingResponse -> ShowS
[GetServiceSettingResponse] -> ShowS
GetServiceSettingResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetServiceSettingResponse] -> ShowS
$cshowList :: [GetServiceSettingResponse] -> ShowS
show :: GetServiceSettingResponse -> String
$cshow :: GetServiceSettingResponse -> String
showsPrec :: Int -> GetServiceSettingResponse -> ShowS
$cshowsPrec :: Int -> GetServiceSettingResponse -> ShowS
Prelude.Show, forall x.
Rep GetServiceSettingResponse x -> GetServiceSettingResponse
forall x.
GetServiceSettingResponse -> Rep GetServiceSettingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetServiceSettingResponse x -> GetServiceSettingResponse
$cfrom :: forall x.
GetServiceSettingResponse -> Rep GetServiceSettingResponse x
Prelude.Generic)
newGetServiceSettingResponse ::
Prelude.Int ->
GetServiceSettingResponse
newGetServiceSettingResponse :: Int -> GetServiceSettingResponse
newGetServiceSettingResponse Int
pHttpStatus_ =
GetServiceSettingResponse'
{ $sel:serviceSetting:GetServiceSettingResponse' :: Maybe ServiceSetting
serviceSetting =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetServiceSettingResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getServiceSettingResponse_serviceSetting :: Lens.Lens' GetServiceSettingResponse (Prelude.Maybe ServiceSetting)
getServiceSettingResponse_serviceSetting :: Lens' GetServiceSettingResponse (Maybe ServiceSetting)
getServiceSettingResponse_serviceSetting = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceSettingResponse' {Maybe ServiceSetting
serviceSetting :: Maybe ServiceSetting
$sel:serviceSetting:GetServiceSettingResponse' :: GetServiceSettingResponse -> Maybe ServiceSetting
serviceSetting} -> Maybe ServiceSetting
serviceSetting) (\s :: GetServiceSettingResponse
s@GetServiceSettingResponse' {} Maybe ServiceSetting
a -> GetServiceSettingResponse
s {$sel:serviceSetting:GetServiceSettingResponse' :: Maybe ServiceSetting
serviceSetting = Maybe ServiceSetting
a} :: GetServiceSettingResponse)
getServiceSettingResponse_httpStatus :: Lens.Lens' GetServiceSettingResponse Prelude.Int
getServiceSettingResponse_httpStatus :: Lens' GetServiceSettingResponse Int
getServiceSettingResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceSettingResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetServiceSettingResponse' :: GetServiceSettingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetServiceSettingResponse
s@GetServiceSettingResponse' {} Int
a -> GetServiceSettingResponse
s {$sel:httpStatus:GetServiceSettingResponse' :: Int
httpStatus = Int
a} :: GetServiceSettingResponse)
instance Prelude.NFData GetServiceSettingResponse where
rnf :: GetServiceSettingResponse -> ()
rnf GetServiceSettingResponse' {Int
Maybe ServiceSetting
httpStatus :: Int
serviceSetting :: Maybe ServiceSetting
$sel:httpStatus:GetServiceSettingResponse' :: GetServiceSettingResponse -> Int
$sel:serviceSetting:GetServiceSettingResponse' :: GetServiceSettingResponse -> Maybe ServiceSetting
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceSetting
serviceSetting
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus