{-# 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.SSMIncidents.UpdateDeletionProtection
(
UpdateDeletionProtection (..),
newUpdateDeletionProtection,
updateDeletionProtection_clientToken,
updateDeletionProtection_arn,
updateDeletionProtection_deletionProtected,
UpdateDeletionProtectionResponse (..),
newUpdateDeletionProtectionResponse,
updateDeletionProtectionResponse_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.SSMIncidents.Types
data UpdateDeletionProtection = UpdateDeletionProtection'
{
UpdateDeletionProtection -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
UpdateDeletionProtection -> Text
arn :: Prelude.Text,
UpdateDeletionProtection -> Bool
deletionProtected :: Prelude.Bool
}
deriving (UpdateDeletionProtection -> UpdateDeletionProtection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDeletionProtection -> UpdateDeletionProtection -> Bool
$c/= :: UpdateDeletionProtection -> UpdateDeletionProtection -> Bool
== :: UpdateDeletionProtection -> UpdateDeletionProtection -> Bool
$c== :: UpdateDeletionProtection -> UpdateDeletionProtection -> Bool
Prelude.Eq, ReadPrec [UpdateDeletionProtection]
ReadPrec UpdateDeletionProtection
Int -> ReadS UpdateDeletionProtection
ReadS [UpdateDeletionProtection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDeletionProtection]
$creadListPrec :: ReadPrec [UpdateDeletionProtection]
readPrec :: ReadPrec UpdateDeletionProtection
$creadPrec :: ReadPrec UpdateDeletionProtection
readList :: ReadS [UpdateDeletionProtection]
$creadList :: ReadS [UpdateDeletionProtection]
readsPrec :: Int -> ReadS UpdateDeletionProtection
$creadsPrec :: Int -> ReadS UpdateDeletionProtection
Prelude.Read, Int -> UpdateDeletionProtection -> ShowS
[UpdateDeletionProtection] -> ShowS
UpdateDeletionProtection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDeletionProtection] -> ShowS
$cshowList :: [UpdateDeletionProtection] -> ShowS
show :: UpdateDeletionProtection -> String
$cshow :: UpdateDeletionProtection -> String
showsPrec :: Int -> UpdateDeletionProtection -> ShowS
$cshowsPrec :: Int -> UpdateDeletionProtection -> ShowS
Prelude.Show, forall x.
Rep UpdateDeletionProtection x -> UpdateDeletionProtection
forall x.
UpdateDeletionProtection -> Rep UpdateDeletionProtection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDeletionProtection x -> UpdateDeletionProtection
$cfrom :: forall x.
UpdateDeletionProtection -> Rep UpdateDeletionProtection x
Prelude.Generic)
newUpdateDeletionProtection ::
Prelude.Text ->
Prelude.Bool ->
UpdateDeletionProtection
newUpdateDeletionProtection :: Text -> Bool -> UpdateDeletionProtection
newUpdateDeletionProtection Text
pArn_ Bool
pDeletionProtected_ =
UpdateDeletionProtection'
{ $sel:clientToken:UpdateDeletionProtection' :: Maybe Text
clientToken =
forall a. Maybe a
Prelude.Nothing,
$sel:arn:UpdateDeletionProtection' :: Text
arn = Text
pArn_,
$sel:deletionProtected:UpdateDeletionProtection' :: Bool
deletionProtected = Bool
pDeletionProtected_
}
updateDeletionProtection_clientToken :: Lens.Lens' UpdateDeletionProtection (Prelude.Maybe Prelude.Text)
updateDeletionProtection_clientToken :: Lens' UpdateDeletionProtection (Maybe Text)
updateDeletionProtection_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDeletionProtection' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateDeletionProtection' :: UpdateDeletionProtection -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateDeletionProtection
s@UpdateDeletionProtection' {} Maybe Text
a -> UpdateDeletionProtection
s {$sel:clientToken:UpdateDeletionProtection' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateDeletionProtection)
updateDeletionProtection_arn :: Lens.Lens' UpdateDeletionProtection Prelude.Text
updateDeletionProtection_arn :: Lens' UpdateDeletionProtection Text
updateDeletionProtection_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDeletionProtection' {Text
arn :: Text
$sel:arn:UpdateDeletionProtection' :: UpdateDeletionProtection -> Text
arn} -> Text
arn) (\s :: UpdateDeletionProtection
s@UpdateDeletionProtection' {} Text
a -> UpdateDeletionProtection
s {$sel:arn:UpdateDeletionProtection' :: Text
arn = Text
a} :: UpdateDeletionProtection)
updateDeletionProtection_deletionProtected :: Lens.Lens' UpdateDeletionProtection Prelude.Bool
updateDeletionProtection_deletionProtected :: Lens' UpdateDeletionProtection Bool
updateDeletionProtection_deletionProtected = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDeletionProtection' {Bool
deletionProtected :: Bool
$sel:deletionProtected:UpdateDeletionProtection' :: UpdateDeletionProtection -> Bool
deletionProtected} -> Bool
deletionProtected) (\s :: UpdateDeletionProtection
s@UpdateDeletionProtection' {} Bool
a -> UpdateDeletionProtection
s {$sel:deletionProtected:UpdateDeletionProtection' :: Bool
deletionProtected = Bool
a} :: UpdateDeletionProtection)
instance Core.AWSRequest UpdateDeletionProtection where
type
AWSResponse UpdateDeletionProtection =
UpdateDeletionProtectionResponse
request :: (Service -> Service)
-> UpdateDeletionProtection -> Request UpdateDeletionProtection
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 UpdateDeletionProtection
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDeletionProtection)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateDeletionProtectionResponse
UpdateDeletionProtectionResponse'
forall (f :: * -> *) a b. Functor 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 UpdateDeletionProtection where
hashWithSalt :: Int -> UpdateDeletionProtection -> Int
hashWithSalt Int
_salt UpdateDeletionProtection' {Bool
Maybe Text
Text
deletionProtected :: Bool
arn :: Text
clientToken :: Maybe Text
$sel:deletionProtected:UpdateDeletionProtection' :: UpdateDeletionProtection -> Bool
$sel:arn:UpdateDeletionProtection' :: UpdateDeletionProtection -> Text
$sel:clientToken:UpdateDeletionProtection' :: UpdateDeletionProtection -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
deletionProtected
instance Prelude.NFData UpdateDeletionProtection where
rnf :: UpdateDeletionProtection -> ()
rnf UpdateDeletionProtection' {Bool
Maybe Text
Text
deletionProtected :: Bool
arn :: Text
clientToken :: Maybe Text
$sel:deletionProtected:UpdateDeletionProtection' :: UpdateDeletionProtection -> Bool
$sel:arn:UpdateDeletionProtection' :: UpdateDeletionProtection -> Text
$sel:clientToken:UpdateDeletionProtection' :: UpdateDeletionProtection -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
deletionProtected
instance Data.ToHeaders UpdateDeletionProtection where
toHeaders :: UpdateDeletionProtection -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdateDeletionProtection where
toJSON :: UpdateDeletionProtection -> Value
toJSON UpdateDeletionProtection' {Bool
Maybe Text
Text
deletionProtected :: Bool
arn :: Text
clientToken :: Maybe Text
$sel:deletionProtected:UpdateDeletionProtection' :: UpdateDeletionProtection -> Bool
$sel:arn:UpdateDeletionProtection' :: UpdateDeletionProtection -> Text
$sel:clientToken:UpdateDeletionProtection' :: UpdateDeletionProtection -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
forall a. a -> Maybe a
Prelude.Just (Key
"arn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
arn),
forall a. a -> Maybe a
Prelude.Just
(Key
"deletionProtected" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
deletionProtected)
]
)
instance Data.ToPath UpdateDeletionProtection where
toPath :: UpdateDeletionProtection -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/updateDeletionProtection"
instance Data.ToQuery UpdateDeletionProtection where
toQuery :: UpdateDeletionProtection -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateDeletionProtectionResponse = UpdateDeletionProtectionResponse'
{
UpdateDeletionProtectionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDeletionProtectionResponse
-> UpdateDeletionProtectionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDeletionProtectionResponse
-> UpdateDeletionProtectionResponse -> Bool
$c/= :: UpdateDeletionProtectionResponse
-> UpdateDeletionProtectionResponse -> Bool
== :: UpdateDeletionProtectionResponse
-> UpdateDeletionProtectionResponse -> Bool
$c== :: UpdateDeletionProtectionResponse
-> UpdateDeletionProtectionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDeletionProtectionResponse]
ReadPrec UpdateDeletionProtectionResponse
Int -> ReadS UpdateDeletionProtectionResponse
ReadS [UpdateDeletionProtectionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDeletionProtectionResponse]
$creadListPrec :: ReadPrec [UpdateDeletionProtectionResponse]
readPrec :: ReadPrec UpdateDeletionProtectionResponse
$creadPrec :: ReadPrec UpdateDeletionProtectionResponse
readList :: ReadS [UpdateDeletionProtectionResponse]
$creadList :: ReadS [UpdateDeletionProtectionResponse]
readsPrec :: Int -> ReadS UpdateDeletionProtectionResponse
$creadsPrec :: Int -> ReadS UpdateDeletionProtectionResponse
Prelude.Read, Int -> UpdateDeletionProtectionResponse -> ShowS
[UpdateDeletionProtectionResponse] -> ShowS
UpdateDeletionProtectionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDeletionProtectionResponse] -> ShowS
$cshowList :: [UpdateDeletionProtectionResponse] -> ShowS
show :: UpdateDeletionProtectionResponse -> String
$cshow :: UpdateDeletionProtectionResponse -> String
showsPrec :: Int -> UpdateDeletionProtectionResponse -> ShowS
$cshowsPrec :: Int -> UpdateDeletionProtectionResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateDeletionProtectionResponse x
-> UpdateDeletionProtectionResponse
forall x.
UpdateDeletionProtectionResponse
-> Rep UpdateDeletionProtectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDeletionProtectionResponse x
-> UpdateDeletionProtectionResponse
$cfrom :: forall x.
UpdateDeletionProtectionResponse
-> Rep UpdateDeletionProtectionResponse x
Prelude.Generic)
newUpdateDeletionProtectionResponse ::
Prelude.Int ->
UpdateDeletionProtectionResponse
newUpdateDeletionProtectionResponse :: Int -> UpdateDeletionProtectionResponse
newUpdateDeletionProtectionResponse Int
pHttpStatus_ =
UpdateDeletionProtectionResponse'
{ $sel:httpStatus:UpdateDeletionProtectionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateDeletionProtectionResponse_httpStatus :: Lens.Lens' UpdateDeletionProtectionResponse Prelude.Int
updateDeletionProtectionResponse_httpStatus :: Lens' UpdateDeletionProtectionResponse Int
updateDeletionProtectionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDeletionProtectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDeletionProtectionResponse' :: UpdateDeletionProtectionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDeletionProtectionResponse
s@UpdateDeletionProtectionResponse' {} Int
a -> UpdateDeletionProtectionResponse
s {$sel:httpStatus:UpdateDeletionProtectionResponse' :: Int
httpStatus = Int
a} :: UpdateDeletionProtectionResponse)
instance
Prelude.NFData
UpdateDeletionProtectionResponse
where
rnf :: UpdateDeletionProtectionResponse -> ()
rnf UpdateDeletionProtectionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDeletionProtectionResponse' :: UpdateDeletionProtectionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus