{-# 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-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 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 Amazonka.IoTSiteWise.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:/ 'newDeleteGateway' smart constructor.
data DeleteGateway = DeleteGateway'
  { -- | The ID of the gateway to delete.
    DeleteGateway -> Text
gatewayId :: Prelude.Text
  }
  deriving (DeleteGateway -> DeleteGateway -> Bool
(DeleteGateway -> DeleteGateway -> Bool)
-> (DeleteGateway -> DeleteGateway -> Bool) -> Eq DeleteGateway
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]
(Int -> ReadS DeleteGateway)
-> ReadS [DeleteGateway]
-> ReadPrec DeleteGateway
-> ReadPrec [DeleteGateway]
-> Read 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
(Int -> DeleteGateway -> ShowS)
-> (DeleteGateway -> String)
-> ([DeleteGateway] -> ShowS)
-> Show DeleteGateway
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. DeleteGateway -> Rep DeleteGateway x)
-> (forall x. Rep DeleteGateway x -> DeleteGateway)
-> Generic DeleteGateway
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' :: Text -> DeleteGateway
DeleteGateway' {$sel:gatewayId:DeleteGateway' :: Text
gatewayId = Text
pGatewayId_}

-- | The ID of the gateway to delete.
deleteGateway_gatewayId :: Lens.Lens' DeleteGateway Prelude.Text
deleteGateway_gatewayId :: (Text -> f Text) -> DeleteGateway -> f DeleteGateway
deleteGateway_gatewayId = (DeleteGateway -> Text)
-> (DeleteGateway -> Text -> DeleteGateway)
-> Lens DeleteGateway DeleteGateway Text Text
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 :: DeleteGateway -> Request DeleteGateway
request = Service -> DeleteGateway -> Request DeleteGateway
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteGateway
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteGateway)))
response =
    AWSResponse DeleteGateway
-> Logger
-> Service
-> Proxy DeleteGateway
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteGateway)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteGateway
DeleteGatewayResponse
DeleteGatewayResponse'

instance Prelude.Hashable DeleteGateway

instance Prelude.NFData DeleteGateway

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

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

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

-- | /See:/ 'newDeleteGatewayResponse' smart constructor.
data DeleteGatewayResponse = DeleteGatewayResponse'
  {
  }
  deriving (DeleteGatewayResponse -> DeleteGatewayResponse -> Bool
(DeleteGatewayResponse -> DeleteGatewayResponse -> Bool)
-> (DeleteGatewayResponse -> DeleteGatewayResponse -> Bool)
-> Eq DeleteGatewayResponse
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]
(Int -> ReadS DeleteGatewayResponse)
-> ReadS [DeleteGatewayResponse]
-> ReadPrec DeleteGatewayResponse
-> ReadPrec [DeleteGatewayResponse]
-> Read 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
(Int -> DeleteGatewayResponse -> ShowS)
-> (DeleteGatewayResponse -> String)
-> ([DeleteGatewayResponse] -> ShowS)
-> Show DeleteGatewayResponse
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. DeleteGatewayResponse -> Rep DeleteGatewayResponse x)
-> (forall x. Rep DeleteGatewayResponse x -> DeleteGatewayResponse)
-> Generic DeleteGatewayResponse
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