{-# 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.DeleteDeviceProfile
-- 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 device profile.
module Amazonka.IoTWireless.DeleteDeviceProfile
  ( -- * Creating a Request
    DeleteDeviceProfile (..),
    newDeleteDeviceProfile,

    -- * Request Lenses
    deleteDeviceProfile_id,

    -- * Destructuring the Response
    DeleteDeviceProfileResponse (..),
    newDeleteDeviceProfileResponse,

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

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

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

instance Core.AWSRequest DeleteDeviceProfile where
  type
    AWSResponse DeleteDeviceProfile =
      DeleteDeviceProfileResponse
  request :: (Service -> Service)
-> DeleteDeviceProfile -> Request DeleteDeviceProfile
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 DeleteDeviceProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteDeviceProfile)))
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 -> DeleteDeviceProfileResponse
DeleteDeviceProfileResponse'
            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 DeleteDeviceProfile where
  hashWithSalt :: Int -> DeleteDeviceProfile -> Int
hashWithSalt Int
_salt DeleteDeviceProfile' {Text
id :: Text
$sel:id:DeleteDeviceProfile' :: DeleteDeviceProfile -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id

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

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

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

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

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

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

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

instance Prelude.NFData DeleteDeviceProfileResponse where
  rnf :: DeleteDeviceProfileResponse -> ()
rnf DeleteDeviceProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDeviceProfileResponse' :: DeleteDeviceProfileResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus