{-# 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.DeleteServiceProfile
-- 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 service profile.
module Amazonka.IoTWireless.DeleteServiceProfile
  ( -- * Creating a Request
    DeleteServiceProfile (..),
    newDeleteServiceProfile,

    -- * Request Lenses
    deleteServiceProfile_id,

    -- * Destructuring the Response
    DeleteServiceProfileResponse (..),
    newDeleteServiceProfileResponse,

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

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

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

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

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

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

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

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

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

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

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

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