{-# 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.DeleteWirelessGateway
-- 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.
module Amazonka.IoTWireless.DeleteWirelessGateway
  ( -- * Creating a Request
    DeleteWirelessGateway (..),
    newDeleteWirelessGateway,

    -- * Request Lenses
    deleteWirelessGateway_id,

    -- * Destructuring the Response
    DeleteWirelessGatewayResponse (..),
    newDeleteWirelessGatewayResponse,

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

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

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

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

instance Prelude.NFData DeleteWirelessGateway

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

instance Core.ToPath DeleteWirelessGateway where
  toPath :: DeleteWirelessGateway -> ByteString
toPath DeleteWirelessGateway' {Text
id :: Text
$sel:id:DeleteWirelessGateway' :: DeleteWirelessGateway -> 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]

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

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

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

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

instance Prelude.NFData DeleteWirelessGatewayResponse