{-# 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-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.
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 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:/ 'newDeleteWirelessGateway' smart constructor.
data DeleteWirelessGateway = DeleteWirelessGateway'
  { -- | The ID of the resource to delete.
    DeleteWirelessGateway -> Text
id :: Prelude.Text
  }
  deriving (DeleteWirelessGateway -> DeleteWirelessGateway -> Bool
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]
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
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. 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' {$sel:id:DeleteWirelessGateway' :: Text
id = Text
pId_}

-- | The ID of the resource to delete.
deleteWirelessGateway_id :: Lens.Lens' DeleteWirelessGateway Prelude.Text
deleteWirelessGateway_id :: Lens' DeleteWirelessGateway Text
deleteWirelessGateway_id = 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 :: (Service -> Service)
-> DeleteWirelessGateway -> Request DeleteWirelessGateway
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 DeleteWirelessGateway
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteWirelessGateway)))
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 -> DeleteWirelessGatewayResponse
DeleteWirelessGatewayResponse'
            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 DeleteWirelessGateway where
  hashWithSalt :: Int -> DeleteWirelessGateway -> Int
hashWithSalt Int
_salt DeleteWirelessGateway' {Text
id :: Text
$sel:id:DeleteWirelessGateway' :: DeleteWirelessGateway -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id

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

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

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

instance Data.ToQuery DeleteWirelessGateway where
  toQuery :: DeleteWirelessGateway -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
    { $sel:httpStatus:DeleteWirelessGatewayResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteWirelessGatewayResponse_httpStatus :: Lens.Lens' DeleteWirelessGatewayResponse Prelude.Int
deleteWirelessGatewayResponse_httpStatus :: Lens' DeleteWirelessGatewayResponse Int
deleteWirelessGatewayResponse_httpStatus = 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 where
  rnf :: DeleteWirelessGatewayResponse -> ()
rnf DeleteWirelessGatewayResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteWirelessGatewayResponse' :: DeleteWirelessGatewayResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus