{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoTWireless.DeleteWirelessGatewayTaskDefinition
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a wireless gateway task definition. Deleting this task
-- definition does not affect tasks that are currently in progress.
module Amazonka.IoTWireless.DeleteWirelessGatewayTaskDefinition
  ( -- * Creating a Request
    DeleteWirelessGatewayTaskDefinition (..),
    newDeleteWirelessGatewayTaskDefinition,

    -- * Request Lenses
    deleteWirelessGatewayTaskDefinition_id,

    -- * Destructuring the Response
    DeleteWirelessGatewayTaskDefinitionResponse (..),
    newDeleteWirelessGatewayTaskDefinitionResponse,

    -- * Response Lenses
    deleteWirelessGatewayTaskDefinitionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTWireless.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeleteWirelessGatewayTaskDefinition' smart constructor.
data DeleteWirelessGatewayTaskDefinition = DeleteWirelessGatewayTaskDefinition'
  { -- | The ID of the resource to delete.
    DeleteWirelessGatewayTaskDefinition -> Text
id :: Prelude.Text
  }
  deriving (DeleteWirelessGatewayTaskDefinition
-> DeleteWirelessGatewayTaskDefinition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteWirelessGatewayTaskDefinition
-> DeleteWirelessGatewayTaskDefinition -> Bool
$c/= :: DeleteWirelessGatewayTaskDefinition
-> DeleteWirelessGatewayTaskDefinition -> Bool
== :: DeleteWirelessGatewayTaskDefinition
-> DeleteWirelessGatewayTaskDefinition -> Bool
$c== :: DeleteWirelessGatewayTaskDefinition
-> DeleteWirelessGatewayTaskDefinition -> Bool
Prelude.Eq, ReadPrec [DeleteWirelessGatewayTaskDefinition]
ReadPrec DeleteWirelessGatewayTaskDefinition
Int -> ReadS DeleteWirelessGatewayTaskDefinition
ReadS [DeleteWirelessGatewayTaskDefinition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteWirelessGatewayTaskDefinition]
$creadListPrec :: ReadPrec [DeleteWirelessGatewayTaskDefinition]
readPrec :: ReadPrec DeleteWirelessGatewayTaskDefinition
$creadPrec :: ReadPrec DeleteWirelessGatewayTaskDefinition
readList :: ReadS [DeleteWirelessGatewayTaskDefinition]
$creadList :: ReadS [DeleteWirelessGatewayTaskDefinition]
readsPrec :: Int -> ReadS DeleteWirelessGatewayTaskDefinition
$creadsPrec :: Int -> ReadS DeleteWirelessGatewayTaskDefinition
Prelude.Read, Int -> DeleteWirelessGatewayTaskDefinition -> ShowS
[DeleteWirelessGatewayTaskDefinition] -> ShowS
DeleteWirelessGatewayTaskDefinition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteWirelessGatewayTaskDefinition] -> ShowS
$cshowList :: [DeleteWirelessGatewayTaskDefinition] -> ShowS
show :: DeleteWirelessGatewayTaskDefinition -> String
$cshow :: DeleteWirelessGatewayTaskDefinition -> String
showsPrec :: Int -> DeleteWirelessGatewayTaskDefinition -> ShowS
$cshowsPrec :: Int -> DeleteWirelessGatewayTaskDefinition -> ShowS
Prelude.Show, forall x.
Rep DeleteWirelessGatewayTaskDefinition x
-> DeleteWirelessGatewayTaskDefinition
forall x.
DeleteWirelessGatewayTaskDefinition
-> Rep DeleteWirelessGatewayTaskDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteWirelessGatewayTaskDefinition x
-> DeleteWirelessGatewayTaskDefinition
$cfrom :: forall x.
DeleteWirelessGatewayTaskDefinition
-> Rep DeleteWirelessGatewayTaskDefinition x
Prelude.Generic)

-- |
-- Create a value of 'DeleteWirelessGatewayTaskDefinition' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'id', 'deleteWirelessGatewayTaskDefinition_id' - The ID of the resource to delete.
newDeleteWirelessGatewayTaskDefinition ::
  -- | 'id'
  Prelude.Text ->
  DeleteWirelessGatewayTaskDefinition
newDeleteWirelessGatewayTaskDefinition :: Text -> DeleteWirelessGatewayTaskDefinition
newDeleteWirelessGatewayTaskDefinition Text
pId_ =
  DeleteWirelessGatewayTaskDefinition' {$sel:id:DeleteWirelessGatewayTaskDefinition' :: Text
id = Text
pId_}

-- | The ID of the resource to delete.
deleteWirelessGatewayTaskDefinition_id :: Lens.Lens' DeleteWirelessGatewayTaskDefinition Prelude.Text
deleteWirelessGatewayTaskDefinition_id :: Lens' DeleteWirelessGatewayTaskDefinition Text
deleteWirelessGatewayTaskDefinition_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWirelessGatewayTaskDefinition' {Text
id :: Text
$sel:id:DeleteWirelessGatewayTaskDefinition' :: DeleteWirelessGatewayTaskDefinition -> Text
id} -> Text
id) (\s :: DeleteWirelessGatewayTaskDefinition
s@DeleteWirelessGatewayTaskDefinition' {} Text
a -> DeleteWirelessGatewayTaskDefinition
s {$sel:id:DeleteWirelessGatewayTaskDefinition' :: Text
id = Text
a} :: DeleteWirelessGatewayTaskDefinition)

instance
  Core.AWSRequest
    DeleteWirelessGatewayTaskDefinition
  where
  type
    AWSResponse DeleteWirelessGatewayTaskDefinition =
      DeleteWirelessGatewayTaskDefinitionResponse
  request :: (Service -> Service)
-> DeleteWirelessGatewayTaskDefinition
-> Request DeleteWirelessGatewayTaskDefinition
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 DeleteWirelessGatewayTaskDefinition
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteWirelessGatewayTaskDefinition)))
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 -> DeleteWirelessGatewayTaskDefinitionResponse
DeleteWirelessGatewayTaskDefinitionResponse'
            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
    DeleteWirelessGatewayTaskDefinition
  where
  hashWithSalt :: Int -> DeleteWirelessGatewayTaskDefinition -> Int
hashWithSalt
    Int
_salt
    DeleteWirelessGatewayTaskDefinition' {Text
id :: Text
$sel:id:DeleteWirelessGatewayTaskDefinition' :: DeleteWirelessGatewayTaskDefinition -> Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id

instance
  Prelude.NFData
    DeleteWirelessGatewayTaskDefinition
  where
  rnf :: DeleteWirelessGatewayTaskDefinition -> ()
rnf DeleteWirelessGatewayTaskDefinition' {Text
id :: Text
$sel:id:DeleteWirelessGatewayTaskDefinition' :: DeleteWirelessGatewayTaskDefinition -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
id

instance
  Data.ToHeaders
    DeleteWirelessGatewayTaskDefinition
  where
  toHeaders :: DeleteWirelessGatewayTaskDefinition -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance
  Data.ToPath
    DeleteWirelessGatewayTaskDefinition
  where
  toPath :: DeleteWirelessGatewayTaskDefinition -> ByteString
toPath DeleteWirelessGatewayTaskDefinition' {Text
id :: Text
$sel:id:DeleteWirelessGatewayTaskDefinition' :: DeleteWirelessGatewayTaskDefinition -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/wireless-gateway-task-definitions/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id]

instance
  Data.ToQuery
    DeleteWirelessGatewayTaskDefinition
  where
  toQuery :: DeleteWirelessGatewayTaskDefinition -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDeleteWirelessGatewayTaskDefinitionResponse' smart constructor.
data DeleteWirelessGatewayTaskDefinitionResponse = DeleteWirelessGatewayTaskDefinitionResponse'
  { -- | The response's http status code.
    DeleteWirelessGatewayTaskDefinitionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteWirelessGatewayTaskDefinitionResponse
-> DeleteWirelessGatewayTaskDefinitionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteWirelessGatewayTaskDefinitionResponse
-> DeleteWirelessGatewayTaskDefinitionResponse -> Bool
$c/= :: DeleteWirelessGatewayTaskDefinitionResponse
-> DeleteWirelessGatewayTaskDefinitionResponse -> Bool
== :: DeleteWirelessGatewayTaskDefinitionResponse
-> DeleteWirelessGatewayTaskDefinitionResponse -> Bool
$c== :: DeleteWirelessGatewayTaskDefinitionResponse
-> DeleteWirelessGatewayTaskDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteWirelessGatewayTaskDefinitionResponse]
ReadPrec DeleteWirelessGatewayTaskDefinitionResponse
Int -> ReadS DeleteWirelessGatewayTaskDefinitionResponse
ReadS [DeleteWirelessGatewayTaskDefinitionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteWirelessGatewayTaskDefinitionResponse]
$creadListPrec :: ReadPrec [DeleteWirelessGatewayTaskDefinitionResponse]
readPrec :: ReadPrec DeleteWirelessGatewayTaskDefinitionResponse
$creadPrec :: ReadPrec DeleteWirelessGatewayTaskDefinitionResponse
readList :: ReadS [DeleteWirelessGatewayTaskDefinitionResponse]
$creadList :: ReadS [DeleteWirelessGatewayTaskDefinitionResponse]
readsPrec :: Int -> ReadS DeleteWirelessGatewayTaskDefinitionResponse
$creadsPrec :: Int -> ReadS DeleteWirelessGatewayTaskDefinitionResponse
Prelude.Read, Int -> DeleteWirelessGatewayTaskDefinitionResponse -> ShowS
[DeleteWirelessGatewayTaskDefinitionResponse] -> ShowS
DeleteWirelessGatewayTaskDefinitionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteWirelessGatewayTaskDefinitionResponse] -> ShowS
$cshowList :: [DeleteWirelessGatewayTaskDefinitionResponse] -> ShowS
show :: DeleteWirelessGatewayTaskDefinitionResponse -> String
$cshow :: DeleteWirelessGatewayTaskDefinitionResponse -> String
showsPrec :: Int -> DeleteWirelessGatewayTaskDefinitionResponse -> ShowS
$cshowsPrec :: Int -> DeleteWirelessGatewayTaskDefinitionResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteWirelessGatewayTaskDefinitionResponse x
-> DeleteWirelessGatewayTaskDefinitionResponse
forall x.
DeleteWirelessGatewayTaskDefinitionResponse
-> Rep DeleteWirelessGatewayTaskDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteWirelessGatewayTaskDefinitionResponse x
-> DeleteWirelessGatewayTaskDefinitionResponse
$cfrom :: forall x.
DeleteWirelessGatewayTaskDefinitionResponse
-> Rep DeleteWirelessGatewayTaskDefinitionResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteWirelessGatewayTaskDefinitionResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'deleteWirelessGatewayTaskDefinitionResponse_httpStatus' - The response's http status code.
newDeleteWirelessGatewayTaskDefinitionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteWirelessGatewayTaskDefinitionResponse
newDeleteWirelessGatewayTaskDefinitionResponse :: Int -> DeleteWirelessGatewayTaskDefinitionResponse
newDeleteWirelessGatewayTaskDefinitionResponse
  Int
pHttpStatus_ =
    DeleteWirelessGatewayTaskDefinitionResponse'
      { $sel:httpStatus:DeleteWirelessGatewayTaskDefinitionResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The response's http status code.
deleteWirelessGatewayTaskDefinitionResponse_httpStatus :: Lens.Lens' DeleteWirelessGatewayTaskDefinitionResponse Prelude.Int
deleteWirelessGatewayTaskDefinitionResponse_httpStatus :: Lens' DeleteWirelessGatewayTaskDefinitionResponse Int
deleteWirelessGatewayTaskDefinitionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteWirelessGatewayTaskDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteWirelessGatewayTaskDefinitionResponse' :: DeleteWirelessGatewayTaskDefinitionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteWirelessGatewayTaskDefinitionResponse
s@DeleteWirelessGatewayTaskDefinitionResponse' {} Int
a -> DeleteWirelessGatewayTaskDefinitionResponse
s {$sel:httpStatus:DeleteWirelessGatewayTaskDefinitionResponse' :: Int
httpStatus = Int
a} :: DeleteWirelessGatewayTaskDefinitionResponse)

instance
  Prelude.NFData
    DeleteWirelessGatewayTaskDefinitionResponse
  where
  rnf :: DeleteWirelessGatewayTaskDefinitionResponse -> ()
rnf DeleteWirelessGatewayTaskDefinitionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteWirelessGatewayTaskDefinitionResponse' :: DeleteWirelessGatewayTaskDefinitionResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus