{-# 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.IoTSiteWise.DeleteGateway
-- 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 gateway from IoT SiteWise. When you delete a gateway, some of
-- the gateway\'s files remain in your gateway\'s file system.
module Amazonka.IoTSiteWise.DeleteGateway
  ( -- * Creating a Request
    DeleteGateway (..),
    newDeleteGateway,

    -- * Request Lenses
    deleteGateway_gatewayId,

    -- * Destructuring the Response
    DeleteGatewayResponse (..),
    newDeleteGatewayResponse,
  )
where

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

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

-- |
-- Create a value of 'DeleteGateway' 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:
--
-- 'gatewayId', 'deleteGateway_gatewayId' - The ID of the gateway to delete.
newDeleteGateway ::
  -- | 'gatewayId'
  Prelude.Text ->
  DeleteGateway
newDeleteGateway :: Text -> DeleteGateway
newDeleteGateway Text
pGatewayId_ =
  DeleteGateway' {$sel:gatewayId:DeleteGateway' :: Text
gatewayId = Text
pGatewayId_}

-- | The ID of the gateway to delete.
deleteGateway_gatewayId :: Lens.Lens' DeleteGateway Prelude.Text
deleteGateway_gatewayId :: Lens' DeleteGateway Text
deleteGateway_gatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGateway' {Text
gatewayId :: Text
$sel:gatewayId:DeleteGateway' :: DeleteGateway -> Text
gatewayId} -> Text
gatewayId) (\s :: DeleteGateway
s@DeleteGateway' {} Text
a -> DeleteGateway
s {$sel:gatewayId:DeleteGateway' :: Text
gatewayId = Text
a} :: DeleteGateway)

instance Core.AWSRequest DeleteGateway where
  type
    AWSResponse DeleteGateway =
      DeleteGatewayResponse
  request :: (Service -> Service) -> DeleteGateway -> Request DeleteGateway
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 DeleteGateway
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteGateway)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteGatewayResponse
DeleteGatewayResponse'

instance Prelude.Hashable DeleteGateway where
  hashWithSalt :: Int -> DeleteGateway -> Int
hashWithSalt Int
_salt DeleteGateway' {Text
gatewayId :: Text
$sel:gatewayId:DeleteGateway' :: DeleteGateway -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gatewayId

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

instance Data.ToHeaders DeleteGateway where
  toHeaders :: DeleteGateway -> [Header]
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

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

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

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

-- |
-- Create a value of 'DeleteGatewayResponse' 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.
newDeleteGatewayResponse ::
  DeleteGatewayResponse
newDeleteGatewayResponse :: DeleteGatewayResponse
newDeleteGatewayResponse = DeleteGatewayResponse
DeleteGatewayResponse'

instance Prelude.NFData DeleteGatewayResponse where
  rnf :: DeleteGatewayResponse -> ()
rnf DeleteGatewayResponse
_ = ()