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