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