{-# 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.GreengrassV2.DeleteCoreDevice
-- 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 Greengrass core device, which is an IoT thing. This operation
-- removes the core device from the list of core devices. This operation
-- doesn\'t delete the IoT thing. For more information about how to delete
-- the IoT thing, see
-- <https://docs.aws.amazon.com/iot/latest/apireference/API_DeleteThing.html DeleteThing>
-- in the /IoT API Reference/.
module Amazonka.GreengrassV2.DeleteCoreDevice
  ( -- * Creating a Request
    DeleteCoreDevice (..),
    newDeleteCoreDevice,

    -- * Request Lenses
    deleteCoreDevice_coreDeviceThingName,

    -- * Destructuring the Response
    DeleteCoreDeviceResponse (..),
    newDeleteCoreDeviceResponse,
  )
where

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

-- | /See:/ 'newDeleteCoreDevice' smart constructor.
data DeleteCoreDevice = DeleteCoreDevice'
  { -- | The name of the core device. This is also the name of the IoT thing.
    DeleteCoreDevice -> Text
coreDeviceThingName :: Prelude.Text
  }
  deriving (DeleteCoreDevice -> DeleteCoreDevice -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCoreDevice -> DeleteCoreDevice -> Bool
$c/= :: DeleteCoreDevice -> DeleteCoreDevice -> Bool
== :: DeleteCoreDevice -> DeleteCoreDevice -> Bool
$c== :: DeleteCoreDevice -> DeleteCoreDevice -> Bool
Prelude.Eq, ReadPrec [DeleteCoreDevice]
ReadPrec DeleteCoreDevice
Int -> ReadS DeleteCoreDevice
ReadS [DeleteCoreDevice]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCoreDevice]
$creadListPrec :: ReadPrec [DeleteCoreDevice]
readPrec :: ReadPrec DeleteCoreDevice
$creadPrec :: ReadPrec DeleteCoreDevice
readList :: ReadS [DeleteCoreDevice]
$creadList :: ReadS [DeleteCoreDevice]
readsPrec :: Int -> ReadS DeleteCoreDevice
$creadsPrec :: Int -> ReadS DeleteCoreDevice
Prelude.Read, Int -> DeleteCoreDevice -> ShowS
[DeleteCoreDevice] -> ShowS
DeleteCoreDevice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCoreDevice] -> ShowS
$cshowList :: [DeleteCoreDevice] -> ShowS
show :: DeleteCoreDevice -> String
$cshow :: DeleteCoreDevice -> String
showsPrec :: Int -> DeleteCoreDevice -> ShowS
$cshowsPrec :: Int -> DeleteCoreDevice -> ShowS
Prelude.Show, forall x. Rep DeleteCoreDevice x -> DeleteCoreDevice
forall x. DeleteCoreDevice -> Rep DeleteCoreDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCoreDevice x -> DeleteCoreDevice
$cfrom :: forall x. DeleteCoreDevice -> Rep DeleteCoreDevice x
Prelude.Generic)

-- |
-- Create a value of 'DeleteCoreDevice' 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:
--
-- 'coreDeviceThingName', 'deleteCoreDevice_coreDeviceThingName' - The name of the core device. This is also the name of the IoT thing.
newDeleteCoreDevice ::
  -- | 'coreDeviceThingName'
  Prelude.Text ->
  DeleteCoreDevice
newDeleteCoreDevice :: Text -> DeleteCoreDevice
newDeleteCoreDevice Text
pCoreDeviceThingName_ =
  DeleteCoreDevice'
    { $sel:coreDeviceThingName:DeleteCoreDevice' :: Text
coreDeviceThingName =
        Text
pCoreDeviceThingName_
    }

-- | The name of the core device. This is also the name of the IoT thing.
deleteCoreDevice_coreDeviceThingName :: Lens.Lens' DeleteCoreDevice Prelude.Text
deleteCoreDevice_coreDeviceThingName :: Lens' DeleteCoreDevice Text
deleteCoreDevice_coreDeviceThingName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCoreDevice' {Text
coreDeviceThingName :: Text
$sel:coreDeviceThingName:DeleteCoreDevice' :: DeleteCoreDevice -> Text
coreDeviceThingName} -> Text
coreDeviceThingName) (\s :: DeleteCoreDevice
s@DeleteCoreDevice' {} Text
a -> DeleteCoreDevice
s {$sel:coreDeviceThingName:DeleteCoreDevice' :: Text
coreDeviceThingName = Text
a} :: DeleteCoreDevice)

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

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

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

instance Data.ToHeaders DeleteCoreDevice where
  toHeaders :: DeleteCoreDevice -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DeleteCoreDevice where
  toPath :: DeleteCoreDevice -> ByteString
toPath DeleteCoreDevice' {Text
coreDeviceThingName :: Text
$sel:coreDeviceThingName:DeleteCoreDevice' :: DeleteCoreDevice -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/v2/coreDevices/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
coreDeviceThingName
      ]

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

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

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

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