{-# 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.ServiceCatalog.DeleteServiceAction
(
DeleteServiceAction (..),
newDeleteServiceAction,
deleteServiceAction_acceptLanguage,
deleteServiceAction_id,
DeleteServiceActionResponse (..),
newDeleteServiceActionResponse,
deleteServiceActionResponse_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.ServiceCatalog.Types
data DeleteServiceAction = DeleteServiceAction'
{
DeleteServiceAction -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
DeleteServiceAction -> Text
id :: Prelude.Text
}
deriving (DeleteServiceAction -> DeleteServiceAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteServiceAction -> DeleteServiceAction -> Bool
$c/= :: DeleteServiceAction -> DeleteServiceAction -> Bool
== :: DeleteServiceAction -> DeleteServiceAction -> Bool
$c== :: DeleteServiceAction -> DeleteServiceAction -> Bool
Prelude.Eq, ReadPrec [DeleteServiceAction]
ReadPrec DeleteServiceAction
Int -> ReadS DeleteServiceAction
ReadS [DeleteServiceAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteServiceAction]
$creadListPrec :: ReadPrec [DeleteServiceAction]
readPrec :: ReadPrec DeleteServiceAction
$creadPrec :: ReadPrec DeleteServiceAction
readList :: ReadS [DeleteServiceAction]
$creadList :: ReadS [DeleteServiceAction]
readsPrec :: Int -> ReadS DeleteServiceAction
$creadsPrec :: Int -> ReadS DeleteServiceAction
Prelude.Read, Int -> DeleteServiceAction -> ShowS
[DeleteServiceAction] -> ShowS
DeleteServiceAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteServiceAction] -> ShowS
$cshowList :: [DeleteServiceAction] -> ShowS
show :: DeleteServiceAction -> String
$cshow :: DeleteServiceAction -> String
showsPrec :: Int -> DeleteServiceAction -> ShowS
$cshowsPrec :: Int -> DeleteServiceAction -> ShowS
Prelude.Show, forall x. Rep DeleteServiceAction x -> DeleteServiceAction
forall x. DeleteServiceAction -> Rep DeleteServiceAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteServiceAction x -> DeleteServiceAction
$cfrom :: forall x. DeleteServiceAction -> Rep DeleteServiceAction x
Prelude.Generic)
newDeleteServiceAction ::
Prelude.Text ->
DeleteServiceAction
newDeleteServiceAction :: Text -> DeleteServiceAction
newDeleteServiceAction Text
pId_ =
DeleteServiceAction'
{ $sel:acceptLanguage:DeleteServiceAction' :: Maybe Text
acceptLanguage =
forall a. Maybe a
Prelude.Nothing,
$sel:id:DeleteServiceAction' :: Text
id = Text
pId_
}
deleteServiceAction_acceptLanguage :: Lens.Lens' DeleteServiceAction (Prelude.Maybe Prelude.Text)
deleteServiceAction_acceptLanguage :: Lens' DeleteServiceAction (Maybe Text)
deleteServiceAction_acceptLanguage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceAction' {Maybe Text
acceptLanguage :: Maybe Text
$sel:acceptLanguage:DeleteServiceAction' :: DeleteServiceAction -> Maybe Text
acceptLanguage} -> Maybe Text
acceptLanguage) (\s :: DeleteServiceAction
s@DeleteServiceAction' {} Maybe Text
a -> DeleteServiceAction
s {$sel:acceptLanguage:DeleteServiceAction' :: Maybe Text
acceptLanguage = Maybe Text
a} :: DeleteServiceAction)
deleteServiceAction_id :: Lens.Lens' DeleteServiceAction Prelude.Text
deleteServiceAction_id :: Lens' DeleteServiceAction Text
deleteServiceAction_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceAction' {Text
id :: Text
$sel:id:DeleteServiceAction' :: DeleteServiceAction -> Text
id} -> Text
id) (\s :: DeleteServiceAction
s@DeleteServiceAction' {} Text
a -> DeleteServiceAction
s {$sel:id:DeleteServiceAction' :: Text
id = Text
a} :: DeleteServiceAction)
instance Core.AWSRequest DeleteServiceAction where
type
AWSResponse DeleteServiceAction =
DeleteServiceActionResponse
request :: (Service -> Service)
-> DeleteServiceAction -> Request DeleteServiceAction
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 DeleteServiceAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteServiceAction)))
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 -> DeleteServiceActionResponse
DeleteServiceActionResponse'
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 DeleteServiceAction where
hashWithSalt :: Int -> DeleteServiceAction -> Int
hashWithSalt Int
_salt DeleteServiceAction' {Maybe Text
Text
id :: Text
acceptLanguage :: Maybe Text
$sel:id:DeleteServiceAction' :: DeleteServiceAction -> Text
$sel:acceptLanguage:DeleteServiceAction' :: DeleteServiceAction -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
acceptLanguage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData DeleteServiceAction where
rnf :: DeleteServiceAction -> ()
rnf DeleteServiceAction' {Maybe Text
Text
id :: Text
acceptLanguage :: Maybe Text
$sel:id:DeleteServiceAction' :: DeleteServiceAction -> Text
$sel:acceptLanguage:DeleteServiceAction' :: DeleteServiceAction -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
acceptLanguage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.ToHeaders DeleteServiceAction where
toHeaders :: DeleteServiceAction -> 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
"AWS242ServiceCatalogService.DeleteServiceAction" ::
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 DeleteServiceAction where
toJSON :: DeleteServiceAction -> Value
toJSON DeleteServiceAction' {Maybe Text
Text
id :: Text
acceptLanguage :: Maybe Text
$sel:id:DeleteServiceAction' :: DeleteServiceAction -> Text
$sel:acceptLanguage:DeleteServiceAction' :: DeleteServiceAction -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AcceptLanguage" 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
acceptLanguage,
forall a. a -> Maybe a
Prelude.Just (Key
"Id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
id)
]
)
instance Data.ToPath DeleteServiceAction where
toPath :: DeleteServiceAction -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteServiceAction where
toQuery :: DeleteServiceAction -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteServiceActionResponse = DeleteServiceActionResponse'
{
DeleteServiceActionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteServiceActionResponse -> DeleteServiceActionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteServiceActionResponse -> DeleteServiceActionResponse -> Bool
$c/= :: DeleteServiceActionResponse -> DeleteServiceActionResponse -> Bool
== :: DeleteServiceActionResponse -> DeleteServiceActionResponse -> Bool
$c== :: DeleteServiceActionResponse -> DeleteServiceActionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteServiceActionResponse]
ReadPrec DeleteServiceActionResponse
Int -> ReadS DeleteServiceActionResponse
ReadS [DeleteServiceActionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteServiceActionResponse]
$creadListPrec :: ReadPrec [DeleteServiceActionResponse]
readPrec :: ReadPrec DeleteServiceActionResponse
$creadPrec :: ReadPrec DeleteServiceActionResponse
readList :: ReadS [DeleteServiceActionResponse]
$creadList :: ReadS [DeleteServiceActionResponse]
readsPrec :: Int -> ReadS DeleteServiceActionResponse
$creadsPrec :: Int -> ReadS DeleteServiceActionResponse
Prelude.Read, Int -> DeleteServiceActionResponse -> ShowS
[DeleteServiceActionResponse] -> ShowS
DeleteServiceActionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteServiceActionResponse] -> ShowS
$cshowList :: [DeleteServiceActionResponse] -> ShowS
show :: DeleteServiceActionResponse -> String
$cshow :: DeleteServiceActionResponse -> String
showsPrec :: Int -> DeleteServiceActionResponse -> ShowS
$cshowsPrec :: Int -> DeleteServiceActionResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteServiceActionResponse x -> DeleteServiceActionResponse
forall x.
DeleteServiceActionResponse -> Rep DeleteServiceActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteServiceActionResponse x -> DeleteServiceActionResponse
$cfrom :: forall x.
DeleteServiceActionResponse -> Rep DeleteServiceActionResponse x
Prelude.Generic)
newDeleteServiceActionResponse ::
Prelude.Int ->
DeleteServiceActionResponse
newDeleteServiceActionResponse :: Int -> DeleteServiceActionResponse
newDeleteServiceActionResponse Int
pHttpStatus_ =
DeleteServiceActionResponse'
{ $sel:httpStatus:DeleteServiceActionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteServiceActionResponse_httpStatus :: Lens.Lens' DeleteServiceActionResponse Prelude.Int
deleteServiceActionResponse_httpStatus :: Lens' DeleteServiceActionResponse Int
deleteServiceActionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceActionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteServiceActionResponse' :: DeleteServiceActionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteServiceActionResponse
s@DeleteServiceActionResponse' {} Int
a -> DeleteServiceActionResponse
s {$sel:httpStatus:DeleteServiceActionResponse' :: Int
httpStatus = Int
a} :: DeleteServiceActionResponse)
instance Prelude.NFData DeleteServiceActionResponse where
rnf :: DeleteServiceActionResponse -> ()
rnf DeleteServiceActionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteServiceActionResponse' :: DeleteServiceActionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus