{-# 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.AppConfig.DeleteConfigurationProfile
-- 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)
--
-- Delete a configuration profile. Deleting a configuration profile does
-- not delete a configuration from a host.
module Amazonka.AppConfig.DeleteConfigurationProfile
  ( -- * Creating a Request
    DeleteConfigurationProfile (..),
    newDeleteConfigurationProfile,

    -- * Request Lenses
    deleteConfigurationProfile_applicationId,
    deleteConfigurationProfile_configurationProfileId,

    -- * Destructuring the Response
    DeleteConfigurationProfileResponse (..),
    newDeleteConfigurationProfileResponse,
  )
where

import Amazonka.AppConfig.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:/ 'newDeleteConfigurationProfile' smart constructor.
data DeleteConfigurationProfile = DeleteConfigurationProfile'
  { -- | The application ID that includes the configuration profile you want to
    -- delete.
    DeleteConfigurationProfile -> Text
applicationId :: Prelude.Text,
    -- | The ID of the configuration profile you want to delete.
    DeleteConfigurationProfile -> Text
configurationProfileId :: Prelude.Text
  }
  deriving (DeleteConfigurationProfile -> DeleteConfigurationProfile -> Bool
(DeleteConfigurationProfile -> DeleteConfigurationProfile -> Bool)
-> (DeleteConfigurationProfile
    -> DeleteConfigurationProfile -> Bool)
-> Eq DeleteConfigurationProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConfigurationProfile -> DeleteConfigurationProfile -> Bool
$c/= :: DeleteConfigurationProfile -> DeleteConfigurationProfile -> Bool
== :: DeleteConfigurationProfile -> DeleteConfigurationProfile -> Bool
$c== :: DeleteConfigurationProfile -> DeleteConfigurationProfile -> Bool
Prelude.Eq, ReadPrec [DeleteConfigurationProfile]
ReadPrec DeleteConfigurationProfile
Int -> ReadS DeleteConfigurationProfile
ReadS [DeleteConfigurationProfile]
(Int -> ReadS DeleteConfigurationProfile)
-> ReadS [DeleteConfigurationProfile]
-> ReadPrec DeleteConfigurationProfile
-> ReadPrec [DeleteConfigurationProfile]
-> Read DeleteConfigurationProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConfigurationProfile]
$creadListPrec :: ReadPrec [DeleteConfigurationProfile]
readPrec :: ReadPrec DeleteConfigurationProfile
$creadPrec :: ReadPrec DeleteConfigurationProfile
readList :: ReadS [DeleteConfigurationProfile]
$creadList :: ReadS [DeleteConfigurationProfile]
readsPrec :: Int -> ReadS DeleteConfigurationProfile
$creadsPrec :: Int -> ReadS DeleteConfigurationProfile
Prelude.Read, Int -> DeleteConfigurationProfile -> ShowS
[DeleteConfigurationProfile] -> ShowS
DeleteConfigurationProfile -> String
(Int -> DeleteConfigurationProfile -> ShowS)
-> (DeleteConfigurationProfile -> String)
-> ([DeleteConfigurationProfile] -> ShowS)
-> Show DeleteConfigurationProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConfigurationProfile] -> ShowS
$cshowList :: [DeleteConfigurationProfile] -> ShowS
show :: DeleteConfigurationProfile -> String
$cshow :: DeleteConfigurationProfile -> String
showsPrec :: Int -> DeleteConfigurationProfile -> ShowS
$cshowsPrec :: Int -> DeleteConfigurationProfile -> ShowS
Prelude.Show, (forall x.
 DeleteConfigurationProfile -> Rep DeleteConfigurationProfile x)
-> (forall x.
    Rep DeleteConfigurationProfile x -> DeleteConfigurationProfile)
-> Generic DeleteConfigurationProfile
forall x.
Rep DeleteConfigurationProfile x -> DeleteConfigurationProfile
forall x.
DeleteConfigurationProfile -> Rep DeleteConfigurationProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteConfigurationProfile x -> DeleteConfigurationProfile
$cfrom :: forall x.
DeleteConfigurationProfile -> Rep DeleteConfigurationProfile x
Prelude.Generic)

-- |
-- Create a value of 'DeleteConfigurationProfile' 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:
--
-- 'applicationId', 'deleteConfigurationProfile_applicationId' - The application ID that includes the configuration profile you want to
-- delete.
--
-- 'configurationProfileId', 'deleteConfigurationProfile_configurationProfileId' - The ID of the configuration profile you want to delete.
newDeleteConfigurationProfile ::
  -- | 'applicationId'
  Prelude.Text ->
  -- | 'configurationProfileId'
  Prelude.Text ->
  DeleteConfigurationProfile
newDeleteConfigurationProfile :: Text -> Text -> DeleteConfigurationProfile
newDeleteConfigurationProfile
  Text
pApplicationId_
  Text
pConfigurationProfileId_ =
    DeleteConfigurationProfile' :: Text -> Text -> DeleteConfigurationProfile
DeleteConfigurationProfile'
      { $sel:applicationId:DeleteConfigurationProfile' :: Text
applicationId =
          Text
pApplicationId_,
        $sel:configurationProfileId:DeleteConfigurationProfile' :: Text
configurationProfileId =
          Text
pConfigurationProfileId_
      }

-- | The application ID that includes the configuration profile you want to
-- delete.
deleteConfigurationProfile_applicationId :: Lens.Lens' DeleteConfigurationProfile Prelude.Text
deleteConfigurationProfile_applicationId :: (Text -> f Text)
-> DeleteConfigurationProfile -> f DeleteConfigurationProfile
deleteConfigurationProfile_applicationId = (DeleteConfigurationProfile -> Text)
-> (DeleteConfigurationProfile
    -> Text -> DeleteConfigurationProfile)
-> Lens
     DeleteConfigurationProfile DeleteConfigurationProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConfigurationProfile' {Text
applicationId :: Text
$sel:applicationId:DeleteConfigurationProfile' :: DeleteConfigurationProfile -> Text
applicationId} -> Text
applicationId) (\s :: DeleteConfigurationProfile
s@DeleteConfigurationProfile' {} Text
a -> DeleteConfigurationProfile
s {$sel:applicationId:DeleteConfigurationProfile' :: Text
applicationId = Text
a} :: DeleteConfigurationProfile)

-- | The ID of the configuration profile you want to delete.
deleteConfigurationProfile_configurationProfileId :: Lens.Lens' DeleteConfigurationProfile Prelude.Text
deleteConfigurationProfile_configurationProfileId :: (Text -> f Text)
-> DeleteConfigurationProfile -> f DeleteConfigurationProfile
deleteConfigurationProfile_configurationProfileId = (DeleteConfigurationProfile -> Text)
-> (DeleteConfigurationProfile
    -> Text -> DeleteConfigurationProfile)
-> Lens
     DeleteConfigurationProfile DeleteConfigurationProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConfigurationProfile' {Text
configurationProfileId :: Text
$sel:configurationProfileId:DeleteConfigurationProfile' :: DeleteConfigurationProfile -> Text
configurationProfileId} -> Text
configurationProfileId) (\s :: DeleteConfigurationProfile
s@DeleteConfigurationProfile' {} Text
a -> DeleteConfigurationProfile
s {$sel:configurationProfileId:DeleteConfigurationProfile' :: Text
configurationProfileId = Text
a} :: DeleteConfigurationProfile)

instance Core.AWSRequest DeleteConfigurationProfile where
  type
    AWSResponse DeleteConfigurationProfile =
      DeleteConfigurationProfileResponse
  request :: DeleteConfigurationProfile -> Request DeleteConfigurationProfile
request = Service
-> DeleteConfigurationProfile -> Request DeleteConfigurationProfile
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteConfigurationProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteConfigurationProfile)))
response =
    AWSResponse DeleteConfigurationProfile
-> Logger
-> Service
-> Proxy DeleteConfigurationProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteConfigurationProfile)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteConfigurationProfile
DeleteConfigurationProfileResponse
DeleteConfigurationProfileResponse'

instance Prelude.Hashable DeleteConfigurationProfile

instance Prelude.NFData DeleteConfigurationProfile

instance Core.ToHeaders DeleteConfigurationProfile where
  toHeaders :: DeleteConfigurationProfile -> [Header]
toHeaders =
    [Header] -> DeleteConfigurationProfile -> [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 DeleteConfigurationProfile where
  toPath :: DeleteConfigurationProfile -> ByteString
toPath DeleteConfigurationProfile' {Text
configurationProfileId :: Text
applicationId :: Text
$sel:configurationProfileId:DeleteConfigurationProfile' :: DeleteConfigurationProfile -> Text
$sel:applicationId:DeleteConfigurationProfile' :: DeleteConfigurationProfile -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/applications/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
applicationId,
        ByteString
"/configurationprofiles/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
configurationProfileId
      ]

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

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

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

instance
  Prelude.NFData
    DeleteConfigurationProfileResponse