{-# 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.EC2.DeleteInstanceEventWindow
(
DeleteInstanceEventWindow (..),
newDeleteInstanceEventWindow,
deleteInstanceEventWindow_dryRun,
deleteInstanceEventWindow_forceDelete,
deleteInstanceEventWindow_instanceEventWindowId,
DeleteInstanceEventWindowResponse (..),
newDeleteInstanceEventWindowResponse,
deleteInstanceEventWindowResponse_instanceEventWindowState,
deleteInstanceEventWindowResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteInstanceEventWindow = DeleteInstanceEventWindow'
{
DeleteInstanceEventWindow -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
DeleteInstanceEventWindow -> Maybe Bool
forceDelete :: Prelude.Maybe Prelude.Bool,
DeleteInstanceEventWindow -> Text
instanceEventWindowId :: Prelude.Text
}
deriving (DeleteInstanceEventWindow -> DeleteInstanceEventWindow -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteInstanceEventWindow -> DeleteInstanceEventWindow -> Bool
$c/= :: DeleteInstanceEventWindow -> DeleteInstanceEventWindow -> Bool
== :: DeleteInstanceEventWindow -> DeleteInstanceEventWindow -> Bool
$c== :: DeleteInstanceEventWindow -> DeleteInstanceEventWindow -> Bool
Prelude.Eq, ReadPrec [DeleteInstanceEventWindow]
ReadPrec DeleteInstanceEventWindow
Int -> ReadS DeleteInstanceEventWindow
ReadS [DeleteInstanceEventWindow]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteInstanceEventWindow]
$creadListPrec :: ReadPrec [DeleteInstanceEventWindow]
readPrec :: ReadPrec DeleteInstanceEventWindow
$creadPrec :: ReadPrec DeleteInstanceEventWindow
readList :: ReadS [DeleteInstanceEventWindow]
$creadList :: ReadS [DeleteInstanceEventWindow]
readsPrec :: Int -> ReadS DeleteInstanceEventWindow
$creadsPrec :: Int -> ReadS DeleteInstanceEventWindow
Prelude.Read, Int -> DeleteInstanceEventWindow -> ShowS
[DeleteInstanceEventWindow] -> ShowS
DeleteInstanceEventWindow -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteInstanceEventWindow] -> ShowS
$cshowList :: [DeleteInstanceEventWindow] -> ShowS
show :: DeleteInstanceEventWindow -> String
$cshow :: DeleteInstanceEventWindow -> String
showsPrec :: Int -> DeleteInstanceEventWindow -> ShowS
$cshowsPrec :: Int -> DeleteInstanceEventWindow -> ShowS
Prelude.Show, forall x.
Rep DeleteInstanceEventWindow x -> DeleteInstanceEventWindow
forall x.
DeleteInstanceEventWindow -> Rep DeleteInstanceEventWindow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteInstanceEventWindow x -> DeleteInstanceEventWindow
$cfrom :: forall x.
DeleteInstanceEventWindow -> Rep DeleteInstanceEventWindow x
Prelude.Generic)
newDeleteInstanceEventWindow ::
Prelude.Text ->
DeleteInstanceEventWindow
newDeleteInstanceEventWindow :: Text -> DeleteInstanceEventWindow
newDeleteInstanceEventWindow Text
pInstanceEventWindowId_ =
DeleteInstanceEventWindow'
{ $sel:dryRun:DeleteInstanceEventWindow' :: Maybe Bool
dryRun =
forall a. Maybe a
Prelude.Nothing,
$sel:forceDelete:DeleteInstanceEventWindow' :: Maybe Bool
forceDelete = forall a. Maybe a
Prelude.Nothing,
$sel:instanceEventWindowId:DeleteInstanceEventWindow' :: Text
instanceEventWindowId = Text
pInstanceEventWindowId_
}
deleteInstanceEventWindow_dryRun :: Lens.Lens' DeleteInstanceEventWindow (Prelude.Maybe Prelude.Bool)
deleteInstanceEventWindow_dryRun :: Lens' DeleteInstanceEventWindow (Maybe Bool)
deleteInstanceEventWindow_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInstanceEventWindow' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DeleteInstanceEventWindow' :: DeleteInstanceEventWindow -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DeleteInstanceEventWindow
s@DeleteInstanceEventWindow' {} Maybe Bool
a -> DeleteInstanceEventWindow
s {$sel:dryRun:DeleteInstanceEventWindow' :: Maybe Bool
dryRun = Maybe Bool
a} :: DeleteInstanceEventWindow)
deleteInstanceEventWindow_forceDelete :: Lens.Lens' DeleteInstanceEventWindow (Prelude.Maybe Prelude.Bool)
deleteInstanceEventWindow_forceDelete :: Lens' DeleteInstanceEventWindow (Maybe Bool)
deleteInstanceEventWindow_forceDelete = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInstanceEventWindow' {Maybe Bool
forceDelete :: Maybe Bool
$sel:forceDelete:DeleteInstanceEventWindow' :: DeleteInstanceEventWindow -> Maybe Bool
forceDelete} -> Maybe Bool
forceDelete) (\s :: DeleteInstanceEventWindow
s@DeleteInstanceEventWindow' {} Maybe Bool
a -> DeleteInstanceEventWindow
s {$sel:forceDelete:DeleteInstanceEventWindow' :: Maybe Bool
forceDelete = Maybe Bool
a} :: DeleteInstanceEventWindow)
deleteInstanceEventWindow_instanceEventWindowId :: Lens.Lens' DeleteInstanceEventWindow Prelude.Text
deleteInstanceEventWindow_instanceEventWindowId :: Lens' DeleteInstanceEventWindow Text
deleteInstanceEventWindow_instanceEventWindowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInstanceEventWindow' {Text
instanceEventWindowId :: Text
$sel:instanceEventWindowId:DeleteInstanceEventWindow' :: DeleteInstanceEventWindow -> Text
instanceEventWindowId} -> Text
instanceEventWindowId) (\s :: DeleteInstanceEventWindow
s@DeleteInstanceEventWindow' {} Text
a -> DeleteInstanceEventWindow
s {$sel:instanceEventWindowId:DeleteInstanceEventWindow' :: Text
instanceEventWindowId = Text
a} :: DeleteInstanceEventWindow)
instance Core.AWSRequest DeleteInstanceEventWindow where
type
AWSResponse DeleteInstanceEventWindow =
DeleteInstanceEventWindowResponse
request :: (Service -> Service)
-> DeleteInstanceEventWindow -> Request DeleteInstanceEventWindow
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteInstanceEventWindow
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteInstanceEventWindow)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe InstanceEventWindowStateChange
-> Int -> DeleteInstanceEventWindowResponse
DeleteInstanceEventWindowResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"instanceEventWindowState")
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 DeleteInstanceEventWindow where
hashWithSalt :: Int -> DeleteInstanceEventWindow -> Int
hashWithSalt Int
_salt DeleteInstanceEventWindow' {Maybe Bool
Text
instanceEventWindowId :: Text
forceDelete :: Maybe Bool
dryRun :: Maybe Bool
$sel:instanceEventWindowId:DeleteInstanceEventWindow' :: DeleteInstanceEventWindow -> Text
$sel:forceDelete:DeleteInstanceEventWindow' :: DeleteInstanceEventWindow -> Maybe Bool
$sel:dryRun:DeleteInstanceEventWindow' :: DeleteInstanceEventWindow -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
forceDelete
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceEventWindowId
instance Prelude.NFData DeleteInstanceEventWindow where
rnf :: DeleteInstanceEventWindow -> ()
rnf DeleteInstanceEventWindow' {Maybe Bool
Text
instanceEventWindowId :: Text
forceDelete :: Maybe Bool
dryRun :: Maybe Bool
$sel:instanceEventWindowId:DeleteInstanceEventWindow' :: DeleteInstanceEventWindow -> Text
$sel:forceDelete:DeleteInstanceEventWindow' :: DeleteInstanceEventWindow -> Maybe Bool
$sel:dryRun:DeleteInstanceEventWindow' :: DeleteInstanceEventWindow -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
forceDelete
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceEventWindowId
instance Data.ToHeaders DeleteInstanceEventWindow where
toHeaders :: DeleteInstanceEventWindow -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DeleteInstanceEventWindow where
toPath :: DeleteInstanceEventWindow -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteInstanceEventWindow where
toQuery :: DeleteInstanceEventWindow -> QueryString
toQuery DeleteInstanceEventWindow' {Maybe Bool
Text
instanceEventWindowId :: Text
forceDelete :: Maybe Bool
dryRun :: Maybe Bool
$sel:instanceEventWindowId:DeleteInstanceEventWindow' :: DeleteInstanceEventWindow -> Text
$sel:forceDelete:DeleteInstanceEventWindow' :: DeleteInstanceEventWindow -> Maybe Bool
$sel:dryRun:DeleteInstanceEventWindow' :: DeleteInstanceEventWindow -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DeleteInstanceEventWindow" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
ByteString
"ForceDelete" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
forceDelete,
ByteString
"InstanceEventWindowId"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
instanceEventWindowId
]
data DeleteInstanceEventWindowResponse = DeleteInstanceEventWindowResponse'
{
DeleteInstanceEventWindowResponse
-> Maybe InstanceEventWindowStateChange
instanceEventWindowState :: Prelude.Maybe InstanceEventWindowStateChange,
DeleteInstanceEventWindowResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteInstanceEventWindowResponse
-> DeleteInstanceEventWindowResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteInstanceEventWindowResponse
-> DeleteInstanceEventWindowResponse -> Bool
$c/= :: DeleteInstanceEventWindowResponse
-> DeleteInstanceEventWindowResponse -> Bool
== :: DeleteInstanceEventWindowResponse
-> DeleteInstanceEventWindowResponse -> Bool
$c== :: DeleteInstanceEventWindowResponse
-> DeleteInstanceEventWindowResponse -> Bool
Prelude.Eq, ReadPrec [DeleteInstanceEventWindowResponse]
ReadPrec DeleteInstanceEventWindowResponse
Int -> ReadS DeleteInstanceEventWindowResponse
ReadS [DeleteInstanceEventWindowResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteInstanceEventWindowResponse]
$creadListPrec :: ReadPrec [DeleteInstanceEventWindowResponse]
readPrec :: ReadPrec DeleteInstanceEventWindowResponse
$creadPrec :: ReadPrec DeleteInstanceEventWindowResponse
readList :: ReadS [DeleteInstanceEventWindowResponse]
$creadList :: ReadS [DeleteInstanceEventWindowResponse]
readsPrec :: Int -> ReadS DeleteInstanceEventWindowResponse
$creadsPrec :: Int -> ReadS DeleteInstanceEventWindowResponse
Prelude.Read, Int -> DeleteInstanceEventWindowResponse -> ShowS
[DeleteInstanceEventWindowResponse] -> ShowS
DeleteInstanceEventWindowResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteInstanceEventWindowResponse] -> ShowS
$cshowList :: [DeleteInstanceEventWindowResponse] -> ShowS
show :: DeleteInstanceEventWindowResponse -> String
$cshow :: DeleteInstanceEventWindowResponse -> String
showsPrec :: Int -> DeleteInstanceEventWindowResponse -> ShowS
$cshowsPrec :: Int -> DeleteInstanceEventWindowResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteInstanceEventWindowResponse x
-> DeleteInstanceEventWindowResponse
forall x.
DeleteInstanceEventWindowResponse
-> Rep DeleteInstanceEventWindowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteInstanceEventWindowResponse x
-> DeleteInstanceEventWindowResponse
$cfrom :: forall x.
DeleteInstanceEventWindowResponse
-> Rep DeleteInstanceEventWindowResponse x
Prelude.Generic)
newDeleteInstanceEventWindowResponse ::
Prelude.Int ->
DeleteInstanceEventWindowResponse
newDeleteInstanceEventWindowResponse :: Int -> DeleteInstanceEventWindowResponse
newDeleteInstanceEventWindowResponse Int
pHttpStatus_ =
DeleteInstanceEventWindowResponse'
{ $sel:instanceEventWindowState:DeleteInstanceEventWindowResponse' :: Maybe InstanceEventWindowStateChange
instanceEventWindowState =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteInstanceEventWindowResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteInstanceEventWindowResponse_instanceEventWindowState :: Lens.Lens' DeleteInstanceEventWindowResponse (Prelude.Maybe InstanceEventWindowStateChange)
deleteInstanceEventWindowResponse_instanceEventWindowState :: Lens'
DeleteInstanceEventWindowResponse
(Maybe InstanceEventWindowStateChange)
deleteInstanceEventWindowResponse_instanceEventWindowState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInstanceEventWindowResponse' {Maybe InstanceEventWindowStateChange
instanceEventWindowState :: Maybe InstanceEventWindowStateChange
$sel:instanceEventWindowState:DeleteInstanceEventWindowResponse' :: DeleteInstanceEventWindowResponse
-> Maybe InstanceEventWindowStateChange
instanceEventWindowState} -> Maybe InstanceEventWindowStateChange
instanceEventWindowState) (\s :: DeleteInstanceEventWindowResponse
s@DeleteInstanceEventWindowResponse' {} Maybe InstanceEventWindowStateChange
a -> DeleteInstanceEventWindowResponse
s {$sel:instanceEventWindowState:DeleteInstanceEventWindowResponse' :: Maybe InstanceEventWindowStateChange
instanceEventWindowState = Maybe InstanceEventWindowStateChange
a} :: DeleteInstanceEventWindowResponse)
deleteInstanceEventWindowResponse_httpStatus :: Lens.Lens' DeleteInstanceEventWindowResponse Prelude.Int
deleteInstanceEventWindowResponse_httpStatus :: Lens' DeleteInstanceEventWindowResponse Int
deleteInstanceEventWindowResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteInstanceEventWindowResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteInstanceEventWindowResponse' :: DeleteInstanceEventWindowResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteInstanceEventWindowResponse
s@DeleteInstanceEventWindowResponse' {} Int
a -> DeleteInstanceEventWindowResponse
s {$sel:httpStatus:DeleteInstanceEventWindowResponse' :: Int
httpStatus = Int
a} :: DeleteInstanceEventWindowResponse)
instance
Prelude.NFData
DeleteInstanceEventWindowResponse
where
rnf :: DeleteInstanceEventWindowResponse -> ()
rnf DeleteInstanceEventWindowResponse' {Int
Maybe InstanceEventWindowStateChange
httpStatus :: Int
instanceEventWindowState :: Maybe InstanceEventWindowStateChange
$sel:httpStatus:DeleteInstanceEventWindowResponse' :: DeleteInstanceEventWindowResponse -> Int
$sel:instanceEventWindowState:DeleteInstanceEventWindowResponse' :: DeleteInstanceEventWindowResponse
-> Maybe InstanceEventWindowStateChange
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceEventWindowStateChange
instanceEventWindowState
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus