{-# 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.Greengrass.DeleteSubscriptionDefinition
(
DeleteSubscriptionDefinition (..),
newDeleteSubscriptionDefinition,
deleteSubscriptionDefinition_subscriptionDefinitionId,
DeleteSubscriptionDefinitionResponse (..),
newDeleteSubscriptionDefinitionResponse,
deleteSubscriptionDefinitionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Greengrass.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteSubscriptionDefinition = DeleteSubscriptionDefinition'
{
DeleteSubscriptionDefinition -> Text
subscriptionDefinitionId :: Prelude.Text
}
deriving (DeleteSubscriptionDefinition
-> DeleteSubscriptionDefinition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSubscriptionDefinition
-> DeleteSubscriptionDefinition -> Bool
$c/= :: DeleteSubscriptionDefinition
-> DeleteSubscriptionDefinition -> Bool
== :: DeleteSubscriptionDefinition
-> DeleteSubscriptionDefinition -> Bool
$c== :: DeleteSubscriptionDefinition
-> DeleteSubscriptionDefinition -> Bool
Prelude.Eq, ReadPrec [DeleteSubscriptionDefinition]
ReadPrec DeleteSubscriptionDefinition
Int -> ReadS DeleteSubscriptionDefinition
ReadS [DeleteSubscriptionDefinition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSubscriptionDefinition]
$creadListPrec :: ReadPrec [DeleteSubscriptionDefinition]
readPrec :: ReadPrec DeleteSubscriptionDefinition
$creadPrec :: ReadPrec DeleteSubscriptionDefinition
readList :: ReadS [DeleteSubscriptionDefinition]
$creadList :: ReadS [DeleteSubscriptionDefinition]
readsPrec :: Int -> ReadS DeleteSubscriptionDefinition
$creadsPrec :: Int -> ReadS DeleteSubscriptionDefinition
Prelude.Read, Int -> DeleteSubscriptionDefinition -> ShowS
[DeleteSubscriptionDefinition] -> ShowS
DeleteSubscriptionDefinition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSubscriptionDefinition] -> ShowS
$cshowList :: [DeleteSubscriptionDefinition] -> ShowS
show :: DeleteSubscriptionDefinition -> String
$cshow :: DeleteSubscriptionDefinition -> String
showsPrec :: Int -> DeleteSubscriptionDefinition -> ShowS
$cshowsPrec :: Int -> DeleteSubscriptionDefinition -> ShowS
Prelude.Show, forall x.
Rep DeleteSubscriptionDefinition x -> DeleteSubscriptionDefinition
forall x.
DeleteSubscriptionDefinition -> Rep DeleteSubscriptionDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteSubscriptionDefinition x -> DeleteSubscriptionDefinition
$cfrom :: forall x.
DeleteSubscriptionDefinition -> Rep DeleteSubscriptionDefinition x
Prelude.Generic)
newDeleteSubscriptionDefinition ::
Prelude.Text ->
DeleteSubscriptionDefinition
newDeleteSubscriptionDefinition :: Text -> DeleteSubscriptionDefinition
newDeleteSubscriptionDefinition
Text
pSubscriptionDefinitionId_ =
DeleteSubscriptionDefinition'
{ $sel:subscriptionDefinitionId:DeleteSubscriptionDefinition' :: Text
subscriptionDefinitionId =
Text
pSubscriptionDefinitionId_
}
deleteSubscriptionDefinition_subscriptionDefinitionId :: Lens.Lens' DeleteSubscriptionDefinition Prelude.Text
deleteSubscriptionDefinition_subscriptionDefinitionId :: Lens' DeleteSubscriptionDefinition Text
deleteSubscriptionDefinition_subscriptionDefinitionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSubscriptionDefinition' {Text
subscriptionDefinitionId :: Text
$sel:subscriptionDefinitionId:DeleteSubscriptionDefinition' :: DeleteSubscriptionDefinition -> Text
subscriptionDefinitionId} -> Text
subscriptionDefinitionId) (\s :: DeleteSubscriptionDefinition
s@DeleteSubscriptionDefinition' {} Text
a -> DeleteSubscriptionDefinition
s {$sel:subscriptionDefinitionId:DeleteSubscriptionDefinition' :: Text
subscriptionDefinitionId = Text
a} :: DeleteSubscriptionDefinition)
instance Core.AWSRequest DeleteSubscriptionDefinition where
type
AWSResponse DeleteSubscriptionDefinition =
DeleteSubscriptionDefinitionResponse
request :: (Service -> Service)
-> DeleteSubscriptionDefinition
-> Request DeleteSubscriptionDefinition
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteSubscriptionDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteSubscriptionDefinition)))
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 -> DeleteSubscriptionDefinitionResponse
DeleteSubscriptionDefinitionResponse'
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
DeleteSubscriptionDefinition
where
hashWithSalt :: Int -> DeleteSubscriptionDefinition -> Int
hashWithSalt Int
_salt DeleteSubscriptionDefinition' {Text
subscriptionDefinitionId :: Text
$sel:subscriptionDefinitionId:DeleteSubscriptionDefinition' :: DeleteSubscriptionDefinition -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
subscriptionDefinitionId
instance Prelude.NFData DeleteSubscriptionDefinition where
rnf :: DeleteSubscriptionDefinition -> ()
rnf DeleteSubscriptionDefinition' {Text
subscriptionDefinitionId :: Text
$sel:subscriptionDefinitionId:DeleteSubscriptionDefinition' :: DeleteSubscriptionDefinition -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
subscriptionDefinitionId
instance Data.ToHeaders DeleteSubscriptionDefinition where
toHeaders :: DeleteSubscriptionDefinition -> 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.ToPath DeleteSubscriptionDefinition where
toPath :: DeleteSubscriptionDefinition -> ByteString
toPath DeleteSubscriptionDefinition' {Text
subscriptionDefinitionId :: Text
$sel:subscriptionDefinitionId:DeleteSubscriptionDefinition' :: DeleteSubscriptionDefinition -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/greengrass/definition/subscriptions/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
subscriptionDefinitionId
]
instance Data.ToQuery DeleteSubscriptionDefinition where
toQuery :: DeleteSubscriptionDefinition -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteSubscriptionDefinitionResponse = DeleteSubscriptionDefinitionResponse'
{
DeleteSubscriptionDefinitionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteSubscriptionDefinitionResponse
-> DeleteSubscriptionDefinitionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSubscriptionDefinitionResponse
-> DeleteSubscriptionDefinitionResponse -> Bool
$c/= :: DeleteSubscriptionDefinitionResponse
-> DeleteSubscriptionDefinitionResponse -> Bool
== :: DeleteSubscriptionDefinitionResponse
-> DeleteSubscriptionDefinitionResponse -> Bool
$c== :: DeleteSubscriptionDefinitionResponse
-> DeleteSubscriptionDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteSubscriptionDefinitionResponse]
ReadPrec DeleteSubscriptionDefinitionResponse
Int -> ReadS DeleteSubscriptionDefinitionResponse
ReadS [DeleteSubscriptionDefinitionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSubscriptionDefinitionResponse]
$creadListPrec :: ReadPrec [DeleteSubscriptionDefinitionResponse]
readPrec :: ReadPrec DeleteSubscriptionDefinitionResponse
$creadPrec :: ReadPrec DeleteSubscriptionDefinitionResponse
readList :: ReadS [DeleteSubscriptionDefinitionResponse]
$creadList :: ReadS [DeleteSubscriptionDefinitionResponse]
readsPrec :: Int -> ReadS DeleteSubscriptionDefinitionResponse
$creadsPrec :: Int -> ReadS DeleteSubscriptionDefinitionResponse
Prelude.Read, Int -> DeleteSubscriptionDefinitionResponse -> ShowS
[DeleteSubscriptionDefinitionResponse] -> ShowS
DeleteSubscriptionDefinitionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSubscriptionDefinitionResponse] -> ShowS
$cshowList :: [DeleteSubscriptionDefinitionResponse] -> ShowS
show :: DeleteSubscriptionDefinitionResponse -> String
$cshow :: DeleteSubscriptionDefinitionResponse -> String
showsPrec :: Int -> DeleteSubscriptionDefinitionResponse -> ShowS
$cshowsPrec :: Int -> DeleteSubscriptionDefinitionResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteSubscriptionDefinitionResponse x
-> DeleteSubscriptionDefinitionResponse
forall x.
DeleteSubscriptionDefinitionResponse
-> Rep DeleteSubscriptionDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteSubscriptionDefinitionResponse x
-> DeleteSubscriptionDefinitionResponse
$cfrom :: forall x.
DeleteSubscriptionDefinitionResponse
-> Rep DeleteSubscriptionDefinitionResponse x
Prelude.Generic)
newDeleteSubscriptionDefinitionResponse ::
Prelude.Int ->
DeleteSubscriptionDefinitionResponse
newDeleteSubscriptionDefinitionResponse :: Int -> DeleteSubscriptionDefinitionResponse
newDeleteSubscriptionDefinitionResponse Int
pHttpStatus_ =
DeleteSubscriptionDefinitionResponse'
{ $sel:httpStatus:DeleteSubscriptionDefinitionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteSubscriptionDefinitionResponse_httpStatus :: Lens.Lens' DeleteSubscriptionDefinitionResponse Prelude.Int
deleteSubscriptionDefinitionResponse_httpStatus :: Lens' DeleteSubscriptionDefinitionResponse Int
deleteSubscriptionDefinitionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSubscriptionDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteSubscriptionDefinitionResponse' :: DeleteSubscriptionDefinitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteSubscriptionDefinitionResponse
s@DeleteSubscriptionDefinitionResponse' {} Int
a -> DeleteSubscriptionDefinitionResponse
s {$sel:httpStatus:DeleteSubscriptionDefinitionResponse' :: Int
httpStatus = Int
a} :: DeleteSubscriptionDefinitionResponse)
instance
Prelude.NFData
DeleteSubscriptionDefinitionResponse
where
rnf :: DeleteSubscriptionDefinitionResponse -> ()
rnf DeleteSubscriptionDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteSubscriptionDefinitionResponse' :: DeleteSubscriptionDefinitionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus