{-# 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.DeleteCoreDefinition
(
DeleteCoreDefinition (..),
newDeleteCoreDefinition,
deleteCoreDefinition_coreDefinitionId,
DeleteCoreDefinitionResponse (..),
newDeleteCoreDefinitionResponse,
deleteCoreDefinitionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Greengrass.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteCoreDefinition = DeleteCoreDefinition'
{
DeleteCoreDefinition -> Text
coreDefinitionId :: Prelude.Text
}
deriving (DeleteCoreDefinition -> DeleteCoreDefinition -> Bool
(DeleteCoreDefinition -> DeleteCoreDefinition -> Bool)
-> (DeleteCoreDefinition -> DeleteCoreDefinition -> Bool)
-> Eq DeleteCoreDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCoreDefinition -> DeleteCoreDefinition -> Bool
$c/= :: DeleteCoreDefinition -> DeleteCoreDefinition -> Bool
== :: DeleteCoreDefinition -> DeleteCoreDefinition -> Bool
$c== :: DeleteCoreDefinition -> DeleteCoreDefinition -> Bool
Prelude.Eq, ReadPrec [DeleteCoreDefinition]
ReadPrec DeleteCoreDefinition
Int -> ReadS DeleteCoreDefinition
ReadS [DeleteCoreDefinition]
(Int -> ReadS DeleteCoreDefinition)
-> ReadS [DeleteCoreDefinition]
-> ReadPrec DeleteCoreDefinition
-> ReadPrec [DeleteCoreDefinition]
-> Read DeleteCoreDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCoreDefinition]
$creadListPrec :: ReadPrec [DeleteCoreDefinition]
readPrec :: ReadPrec DeleteCoreDefinition
$creadPrec :: ReadPrec DeleteCoreDefinition
readList :: ReadS [DeleteCoreDefinition]
$creadList :: ReadS [DeleteCoreDefinition]
readsPrec :: Int -> ReadS DeleteCoreDefinition
$creadsPrec :: Int -> ReadS DeleteCoreDefinition
Prelude.Read, Int -> DeleteCoreDefinition -> ShowS
[DeleteCoreDefinition] -> ShowS
DeleteCoreDefinition -> String
(Int -> DeleteCoreDefinition -> ShowS)
-> (DeleteCoreDefinition -> String)
-> ([DeleteCoreDefinition] -> ShowS)
-> Show DeleteCoreDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCoreDefinition] -> ShowS
$cshowList :: [DeleteCoreDefinition] -> ShowS
show :: DeleteCoreDefinition -> String
$cshow :: DeleteCoreDefinition -> String
showsPrec :: Int -> DeleteCoreDefinition -> ShowS
$cshowsPrec :: Int -> DeleteCoreDefinition -> ShowS
Prelude.Show, (forall x. DeleteCoreDefinition -> Rep DeleteCoreDefinition x)
-> (forall x. Rep DeleteCoreDefinition x -> DeleteCoreDefinition)
-> Generic DeleteCoreDefinition
forall x. Rep DeleteCoreDefinition x -> DeleteCoreDefinition
forall x. DeleteCoreDefinition -> Rep DeleteCoreDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCoreDefinition x -> DeleteCoreDefinition
$cfrom :: forall x. DeleteCoreDefinition -> Rep DeleteCoreDefinition x
Prelude.Generic)
newDeleteCoreDefinition ::
Prelude.Text ->
DeleteCoreDefinition
newDeleteCoreDefinition :: Text -> DeleteCoreDefinition
newDeleteCoreDefinition Text
pCoreDefinitionId_ =
DeleteCoreDefinition' :: Text -> DeleteCoreDefinition
DeleteCoreDefinition'
{ $sel:coreDefinitionId:DeleteCoreDefinition' :: Text
coreDefinitionId =
Text
pCoreDefinitionId_
}
deleteCoreDefinition_coreDefinitionId :: Lens.Lens' DeleteCoreDefinition Prelude.Text
deleteCoreDefinition_coreDefinitionId :: (Text -> f Text) -> DeleteCoreDefinition -> f DeleteCoreDefinition
deleteCoreDefinition_coreDefinitionId = (DeleteCoreDefinition -> Text)
-> (DeleteCoreDefinition -> Text -> DeleteCoreDefinition)
-> Lens DeleteCoreDefinition DeleteCoreDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCoreDefinition' {Text
coreDefinitionId :: Text
$sel:coreDefinitionId:DeleteCoreDefinition' :: DeleteCoreDefinition -> Text
coreDefinitionId} -> Text
coreDefinitionId) (\s :: DeleteCoreDefinition
s@DeleteCoreDefinition' {} Text
a -> DeleteCoreDefinition
s {$sel:coreDefinitionId:DeleteCoreDefinition' :: Text
coreDefinitionId = Text
a} :: DeleteCoreDefinition)
instance Core.AWSRequest DeleteCoreDefinition where
type
AWSResponse DeleteCoreDefinition =
DeleteCoreDefinitionResponse
request :: DeleteCoreDefinition -> Request DeleteCoreDefinition
request = Service -> DeleteCoreDefinition -> Request DeleteCoreDefinition
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteCoreDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCoreDefinition)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteCoreDefinition))
-> Logger
-> Service
-> Proxy DeleteCoreDefinition
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCoreDefinition)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteCoreDefinitionResponse
DeleteCoreDefinitionResponse'
(Int -> DeleteCoreDefinitionResponse)
-> Either String Int -> Either String DeleteCoreDefinitionResponse
forall (f :: * -> *) a b. Functor 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 DeleteCoreDefinition
instance Prelude.NFData DeleteCoreDefinition
instance Core.ToHeaders DeleteCoreDefinition where
toHeaders :: DeleteCoreDefinition -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteCoreDefinition -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DeleteCoreDefinition where
toPath :: DeleteCoreDefinition -> ByteString
toPath DeleteCoreDefinition' {Text
coreDefinitionId :: Text
$sel:coreDefinitionId:DeleteCoreDefinition' :: DeleteCoreDefinition -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/greengrass/definition/cores/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
coreDefinitionId
]
instance Core.ToQuery DeleteCoreDefinition where
toQuery :: DeleteCoreDefinition -> QueryString
toQuery = QueryString -> DeleteCoreDefinition -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteCoreDefinitionResponse = DeleteCoreDefinitionResponse'
{
DeleteCoreDefinitionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteCoreDefinitionResponse
-> DeleteCoreDefinitionResponse -> Bool
(DeleteCoreDefinitionResponse
-> DeleteCoreDefinitionResponse -> Bool)
-> (DeleteCoreDefinitionResponse
-> DeleteCoreDefinitionResponse -> Bool)
-> Eq DeleteCoreDefinitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCoreDefinitionResponse
-> DeleteCoreDefinitionResponse -> Bool
$c/= :: DeleteCoreDefinitionResponse
-> DeleteCoreDefinitionResponse -> Bool
== :: DeleteCoreDefinitionResponse
-> DeleteCoreDefinitionResponse -> Bool
$c== :: DeleteCoreDefinitionResponse
-> DeleteCoreDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteCoreDefinitionResponse]
ReadPrec DeleteCoreDefinitionResponse
Int -> ReadS DeleteCoreDefinitionResponse
ReadS [DeleteCoreDefinitionResponse]
(Int -> ReadS DeleteCoreDefinitionResponse)
-> ReadS [DeleteCoreDefinitionResponse]
-> ReadPrec DeleteCoreDefinitionResponse
-> ReadPrec [DeleteCoreDefinitionResponse]
-> Read DeleteCoreDefinitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCoreDefinitionResponse]
$creadListPrec :: ReadPrec [DeleteCoreDefinitionResponse]
readPrec :: ReadPrec DeleteCoreDefinitionResponse
$creadPrec :: ReadPrec DeleteCoreDefinitionResponse
readList :: ReadS [DeleteCoreDefinitionResponse]
$creadList :: ReadS [DeleteCoreDefinitionResponse]
readsPrec :: Int -> ReadS DeleteCoreDefinitionResponse
$creadsPrec :: Int -> ReadS DeleteCoreDefinitionResponse
Prelude.Read, Int -> DeleteCoreDefinitionResponse -> ShowS
[DeleteCoreDefinitionResponse] -> ShowS
DeleteCoreDefinitionResponse -> String
(Int -> DeleteCoreDefinitionResponse -> ShowS)
-> (DeleteCoreDefinitionResponse -> String)
-> ([DeleteCoreDefinitionResponse] -> ShowS)
-> Show DeleteCoreDefinitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCoreDefinitionResponse] -> ShowS
$cshowList :: [DeleteCoreDefinitionResponse] -> ShowS
show :: DeleteCoreDefinitionResponse -> String
$cshow :: DeleteCoreDefinitionResponse -> String
showsPrec :: Int -> DeleteCoreDefinitionResponse -> ShowS
$cshowsPrec :: Int -> DeleteCoreDefinitionResponse -> ShowS
Prelude.Show, (forall x.
DeleteCoreDefinitionResponse -> Rep DeleteCoreDefinitionResponse x)
-> (forall x.
Rep DeleteCoreDefinitionResponse x -> DeleteCoreDefinitionResponse)
-> Generic DeleteCoreDefinitionResponse
forall x.
Rep DeleteCoreDefinitionResponse x -> DeleteCoreDefinitionResponse
forall x.
DeleteCoreDefinitionResponse -> Rep DeleteCoreDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCoreDefinitionResponse x -> DeleteCoreDefinitionResponse
$cfrom :: forall x.
DeleteCoreDefinitionResponse -> Rep DeleteCoreDefinitionResponse x
Prelude.Generic)
newDeleteCoreDefinitionResponse ::
Prelude.Int ->
DeleteCoreDefinitionResponse
newDeleteCoreDefinitionResponse :: Int -> DeleteCoreDefinitionResponse
newDeleteCoreDefinitionResponse Int
pHttpStatus_ =
DeleteCoreDefinitionResponse' :: Int -> DeleteCoreDefinitionResponse
DeleteCoreDefinitionResponse'
{ $sel:httpStatus:DeleteCoreDefinitionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteCoreDefinitionResponse_httpStatus :: Lens.Lens' DeleteCoreDefinitionResponse Prelude.Int
deleteCoreDefinitionResponse_httpStatus :: (Int -> f Int)
-> DeleteCoreDefinitionResponse -> f DeleteCoreDefinitionResponse
deleteCoreDefinitionResponse_httpStatus = (DeleteCoreDefinitionResponse -> Int)
-> (DeleteCoreDefinitionResponse
-> Int -> DeleteCoreDefinitionResponse)
-> Lens
DeleteCoreDefinitionResponse DeleteCoreDefinitionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCoreDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteCoreDefinitionResponse' :: DeleteCoreDefinitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteCoreDefinitionResponse
s@DeleteCoreDefinitionResponse' {} Int
a -> DeleteCoreDefinitionResponse
s {$sel:httpStatus:DeleteCoreDefinitionResponse' :: Int
httpStatus = Int
a} :: DeleteCoreDefinitionResponse)
instance Prelude.NFData DeleteCoreDefinitionResponse