{-# 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.AlexaBusiness.DeleteNetworkProfile
-- 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 network profile by the network profile ARN.
module Amazonka.AlexaBusiness.DeleteNetworkProfile
  ( -- * Creating a Request
    DeleteNetworkProfile (..),
    newDeleteNetworkProfile,

    -- * Request Lenses
    deleteNetworkProfile_networkProfileArn,

    -- * Destructuring the Response
    DeleteNetworkProfileResponse (..),
    newDeleteNetworkProfileResponse,

    -- * Response Lenses
    deleteNetworkProfileResponse_httpStatus,
  )
where

import Amazonka.AlexaBusiness.Types
import qualified Amazonka.Core as Core
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:/ 'newDeleteNetworkProfile' smart constructor.
data DeleteNetworkProfile = DeleteNetworkProfile'
  { -- | The ARN of the network profile associated with a device.
    DeleteNetworkProfile -> Text
networkProfileArn :: Prelude.Text
  }
  deriving (DeleteNetworkProfile -> DeleteNetworkProfile -> Bool
(DeleteNetworkProfile -> DeleteNetworkProfile -> Bool)
-> (DeleteNetworkProfile -> DeleteNetworkProfile -> Bool)
-> Eq DeleteNetworkProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteNetworkProfile -> DeleteNetworkProfile -> Bool
$c/= :: DeleteNetworkProfile -> DeleteNetworkProfile -> Bool
== :: DeleteNetworkProfile -> DeleteNetworkProfile -> Bool
$c== :: DeleteNetworkProfile -> DeleteNetworkProfile -> Bool
Prelude.Eq, ReadPrec [DeleteNetworkProfile]
ReadPrec DeleteNetworkProfile
Int -> ReadS DeleteNetworkProfile
ReadS [DeleteNetworkProfile]
(Int -> ReadS DeleteNetworkProfile)
-> ReadS [DeleteNetworkProfile]
-> ReadPrec DeleteNetworkProfile
-> ReadPrec [DeleteNetworkProfile]
-> Read DeleteNetworkProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteNetworkProfile]
$creadListPrec :: ReadPrec [DeleteNetworkProfile]
readPrec :: ReadPrec DeleteNetworkProfile
$creadPrec :: ReadPrec DeleteNetworkProfile
readList :: ReadS [DeleteNetworkProfile]
$creadList :: ReadS [DeleteNetworkProfile]
readsPrec :: Int -> ReadS DeleteNetworkProfile
$creadsPrec :: Int -> ReadS DeleteNetworkProfile
Prelude.Read, Int -> DeleteNetworkProfile -> ShowS
[DeleteNetworkProfile] -> ShowS
DeleteNetworkProfile -> String
(Int -> DeleteNetworkProfile -> ShowS)
-> (DeleteNetworkProfile -> String)
-> ([DeleteNetworkProfile] -> ShowS)
-> Show DeleteNetworkProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteNetworkProfile] -> ShowS
$cshowList :: [DeleteNetworkProfile] -> ShowS
show :: DeleteNetworkProfile -> String
$cshow :: DeleteNetworkProfile -> String
showsPrec :: Int -> DeleteNetworkProfile -> ShowS
$cshowsPrec :: Int -> DeleteNetworkProfile -> ShowS
Prelude.Show, (forall x. DeleteNetworkProfile -> Rep DeleteNetworkProfile x)
-> (forall x. Rep DeleteNetworkProfile x -> DeleteNetworkProfile)
-> Generic DeleteNetworkProfile
forall x. Rep DeleteNetworkProfile x -> DeleteNetworkProfile
forall x. DeleteNetworkProfile -> Rep DeleteNetworkProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteNetworkProfile x -> DeleteNetworkProfile
$cfrom :: forall x. DeleteNetworkProfile -> Rep DeleteNetworkProfile x
Prelude.Generic)

-- |
-- Create a value of 'DeleteNetworkProfile' 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:
--
-- 'networkProfileArn', 'deleteNetworkProfile_networkProfileArn' - The ARN of the network profile associated with a device.
newDeleteNetworkProfile ::
  -- | 'networkProfileArn'
  Prelude.Text ->
  DeleteNetworkProfile
newDeleteNetworkProfile :: Text -> DeleteNetworkProfile
newDeleteNetworkProfile Text
pNetworkProfileArn_ =
  DeleteNetworkProfile' :: Text -> DeleteNetworkProfile
DeleteNetworkProfile'
    { $sel:networkProfileArn:DeleteNetworkProfile' :: Text
networkProfileArn =
        Text
pNetworkProfileArn_
    }

-- | The ARN of the network profile associated with a device.
deleteNetworkProfile_networkProfileArn :: Lens.Lens' DeleteNetworkProfile Prelude.Text
deleteNetworkProfile_networkProfileArn :: (Text -> f Text) -> DeleteNetworkProfile -> f DeleteNetworkProfile
deleteNetworkProfile_networkProfileArn = (DeleteNetworkProfile -> Text)
-> (DeleteNetworkProfile -> Text -> DeleteNetworkProfile)
-> Lens DeleteNetworkProfile DeleteNetworkProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteNetworkProfile' {Text
networkProfileArn :: Text
$sel:networkProfileArn:DeleteNetworkProfile' :: DeleteNetworkProfile -> Text
networkProfileArn} -> Text
networkProfileArn) (\s :: DeleteNetworkProfile
s@DeleteNetworkProfile' {} Text
a -> DeleteNetworkProfile
s {$sel:networkProfileArn:DeleteNetworkProfile' :: Text
networkProfileArn = Text
a} :: DeleteNetworkProfile)

instance Core.AWSRequest DeleteNetworkProfile where
  type
    AWSResponse DeleteNetworkProfile =
      DeleteNetworkProfileResponse
  request :: DeleteNetworkProfile -> Request DeleteNetworkProfile
request = Service -> DeleteNetworkProfile -> Request DeleteNetworkProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteNetworkProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteNetworkProfile)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteNetworkProfile))
-> Logger
-> Service
-> Proxy DeleteNetworkProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteNetworkProfile)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteNetworkProfileResponse
DeleteNetworkProfileResponse'
            (Int -> DeleteNetworkProfileResponse)
-> Either String Int -> Either String DeleteNetworkProfileResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DeleteNetworkProfile

instance Prelude.NFData DeleteNetworkProfile

instance Core.ToHeaders DeleteNetworkProfile where
  toHeaders :: DeleteNetworkProfile -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteNetworkProfile -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AlexaForBusiness.DeleteNetworkProfile" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DeleteNetworkProfile where
  toJSON :: DeleteNetworkProfile -> Value
toJSON DeleteNetworkProfile' {Text
networkProfileArn :: Text
$sel:networkProfileArn:DeleteNetworkProfile' :: DeleteNetworkProfile -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"NetworkProfileArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
networkProfileArn)
          ]
      )

instance Core.ToPath DeleteNetworkProfile where
  toPath :: DeleteNetworkProfile -> ByteString
toPath = ByteString -> DeleteNetworkProfile -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

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

instance Prelude.NFData DeleteNetworkProfileResponse