{-# 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.DeleteWirelessGatewayTask
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a wireless gateway task.
module Amazonka.IoTWireless.DeleteWirelessGatewayTask
  ( -- * Creating a Request
    DeleteWirelessGatewayTask (..),
    newDeleteWirelessGatewayTask,

    -- * Request Lenses
    deleteWirelessGatewayTask_id,

    -- * Destructuring the Response
    DeleteWirelessGatewayTaskResponse (..),
    newDeleteWirelessGatewayTaskResponse,

    -- * Response Lenses
    deleteWirelessGatewayTaskResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTWireless.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

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

-- |
-- Create a value of 'DeleteWirelessGatewayTask' 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', 'deleteWirelessGatewayTask_id' - The ID of the resource to delete.
newDeleteWirelessGatewayTask ::
  -- | 'id'
  Prelude.Text ->
  DeleteWirelessGatewayTask
newDeleteWirelessGatewayTask :: Text -> DeleteWirelessGatewayTask
newDeleteWirelessGatewayTask Text
pId_ =
  DeleteWirelessGatewayTask' :: Text -> DeleteWirelessGatewayTask
DeleteWirelessGatewayTask' {$sel:id:DeleteWirelessGatewayTask' :: Text
id = Text
pId_}

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

instance Core.AWSRequest DeleteWirelessGatewayTask where
  type
    AWSResponse DeleteWirelessGatewayTask =
      DeleteWirelessGatewayTaskResponse
  request :: DeleteWirelessGatewayTask -> Request DeleteWirelessGatewayTask
request = Service
-> DeleteWirelessGatewayTask -> Request DeleteWirelessGatewayTask
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteWirelessGatewayTask
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteWirelessGatewayTask)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteWirelessGatewayTask))
-> Logger
-> Service
-> Proxy DeleteWirelessGatewayTask
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteWirelessGatewayTask)))
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 -> DeleteWirelessGatewayTaskResponse
DeleteWirelessGatewayTaskResponse'
            (Int -> DeleteWirelessGatewayTaskResponse)
-> Either String Int
-> Either String DeleteWirelessGatewayTaskResponse
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 DeleteWirelessGatewayTask

instance Prelude.NFData DeleteWirelessGatewayTask

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

instance Core.ToPath DeleteWirelessGatewayTask where
  toPath :: DeleteWirelessGatewayTask -> ByteString
toPath DeleteWirelessGatewayTask' {Text
id :: Text
$sel:id:DeleteWirelessGatewayTask' :: DeleteWirelessGatewayTask -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/wireless-gateways/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id, ByteString
"/tasks"]

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

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

-- |
-- Create a value of 'DeleteWirelessGatewayTaskResponse' 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', 'deleteWirelessGatewayTaskResponse_httpStatus' - The response's http status code.
newDeleteWirelessGatewayTaskResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteWirelessGatewayTaskResponse
newDeleteWirelessGatewayTaskResponse :: Int -> DeleteWirelessGatewayTaskResponse
newDeleteWirelessGatewayTaskResponse Int
pHttpStatus_ =
  DeleteWirelessGatewayTaskResponse' :: Int -> DeleteWirelessGatewayTaskResponse
DeleteWirelessGatewayTaskResponse'
    { $sel:httpStatus:DeleteWirelessGatewayTaskResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    DeleteWirelessGatewayTaskResponse