{-# 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.DeleteHostedConfigurationVersion
-- 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 version of a configuration from the AppConfig configuration
-- store.
module Amazonka.AppConfig.DeleteHostedConfigurationVersion
  ( -- * Creating a Request
    DeleteHostedConfigurationVersion (..),
    newDeleteHostedConfigurationVersion,

    -- * Request Lenses
    deleteHostedConfigurationVersion_applicationId,
    deleteHostedConfigurationVersion_configurationProfileId,
    deleteHostedConfigurationVersion_versionNumber,

    -- * Destructuring the Response
    DeleteHostedConfigurationVersionResponse (..),
    newDeleteHostedConfigurationVersionResponse,
  )
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:/ 'newDeleteHostedConfigurationVersion' smart constructor.
data DeleteHostedConfigurationVersion = DeleteHostedConfigurationVersion'
  { -- | The application ID.
    DeleteHostedConfigurationVersion -> Text
applicationId :: Prelude.Text,
    -- | The configuration profile ID.
    DeleteHostedConfigurationVersion -> Text
configurationProfileId :: Prelude.Text,
    -- | The versions number to delete.
    DeleteHostedConfigurationVersion -> Int
versionNumber :: Prelude.Int
  }
  deriving (DeleteHostedConfigurationVersion
-> DeleteHostedConfigurationVersion -> Bool
(DeleteHostedConfigurationVersion
 -> DeleteHostedConfigurationVersion -> Bool)
-> (DeleteHostedConfigurationVersion
    -> DeleteHostedConfigurationVersion -> Bool)
-> Eq DeleteHostedConfigurationVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteHostedConfigurationVersion
-> DeleteHostedConfigurationVersion -> Bool
$c/= :: DeleteHostedConfigurationVersion
-> DeleteHostedConfigurationVersion -> Bool
== :: DeleteHostedConfigurationVersion
-> DeleteHostedConfigurationVersion -> Bool
$c== :: DeleteHostedConfigurationVersion
-> DeleteHostedConfigurationVersion -> Bool
Prelude.Eq, ReadPrec [DeleteHostedConfigurationVersion]
ReadPrec DeleteHostedConfigurationVersion
Int -> ReadS DeleteHostedConfigurationVersion
ReadS [DeleteHostedConfigurationVersion]
(Int -> ReadS DeleteHostedConfigurationVersion)
-> ReadS [DeleteHostedConfigurationVersion]
-> ReadPrec DeleteHostedConfigurationVersion
-> ReadPrec [DeleteHostedConfigurationVersion]
-> Read DeleteHostedConfigurationVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteHostedConfigurationVersion]
$creadListPrec :: ReadPrec [DeleteHostedConfigurationVersion]
readPrec :: ReadPrec DeleteHostedConfigurationVersion
$creadPrec :: ReadPrec DeleteHostedConfigurationVersion
readList :: ReadS [DeleteHostedConfigurationVersion]
$creadList :: ReadS [DeleteHostedConfigurationVersion]
readsPrec :: Int -> ReadS DeleteHostedConfigurationVersion
$creadsPrec :: Int -> ReadS DeleteHostedConfigurationVersion
Prelude.Read, Int -> DeleteHostedConfigurationVersion -> ShowS
[DeleteHostedConfigurationVersion] -> ShowS
DeleteHostedConfigurationVersion -> String
(Int -> DeleteHostedConfigurationVersion -> ShowS)
-> (DeleteHostedConfigurationVersion -> String)
-> ([DeleteHostedConfigurationVersion] -> ShowS)
-> Show DeleteHostedConfigurationVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteHostedConfigurationVersion] -> ShowS
$cshowList :: [DeleteHostedConfigurationVersion] -> ShowS
show :: DeleteHostedConfigurationVersion -> String
$cshow :: DeleteHostedConfigurationVersion -> String
showsPrec :: Int -> DeleteHostedConfigurationVersion -> ShowS
$cshowsPrec :: Int -> DeleteHostedConfigurationVersion -> ShowS
Prelude.Show, (forall x.
 DeleteHostedConfigurationVersion
 -> Rep DeleteHostedConfigurationVersion x)
-> (forall x.
    Rep DeleteHostedConfigurationVersion x
    -> DeleteHostedConfigurationVersion)
-> Generic DeleteHostedConfigurationVersion
forall x.
Rep DeleteHostedConfigurationVersion x
-> DeleteHostedConfigurationVersion
forall x.
DeleteHostedConfigurationVersion
-> Rep DeleteHostedConfigurationVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteHostedConfigurationVersion x
-> DeleteHostedConfigurationVersion
$cfrom :: forall x.
DeleteHostedConfigurationVersion
-> Rep DeleteHostedConfigurationVersion x
Prelude.Generic)

-- |
-- Create a value of 'DeleteHostedConfigurationVersion' 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', 'deleteHostedConfigurationVersion_applicationId' - The application ID.
--
-- 'configurationProfileId', 'deleteHostedConfigurationVersion_configurationProfileId' - The configuration profile ID.
--
-- 'versionNumber', 'deleteHostedConfigurationVersion_versionNumber' - The versions number to delete.
newDeleteHostedConfigurationVersion ::
  -- | 'applicationId'
  Prelude.Text ->
  -- | 'configurationProfileId'
  Prelude.Text ->
  -- | 'versionNumber'
  Prelude.Int ->
  DeleteHostedConfigurationVersion
newDeleteHostedConfigurationVersion :: Text -> Text -> Int -> DeleteHostedConfigurationVersion
newDeleteHostedConfigurationVersion
  Text
pApplicationId_
  Text
pConfigurationProfileId_
  Int
pVersionNumber_ =
    DeleteHostedConfigurationVersion' :: Text -> Text -> Int -> DeleteHostedConfigurationVersion
DeleteHostedConfigurationVersion'
      { $sel:applicationId:DeleteHostedConfigurationVersion' :: Text
applicationId =
          Text
pApplicationId_,
        $sel:configurationProfileId:DeleteHostedConfigurationVersion' :: Text
configurationProfileId =
          Text
pConfigurationProfileId_,
        $sel:versionNumber:DeleteHostedConfigurationVersion' :: Int
versionNumber = Int
pVersionNumber_
      }

-- | The application ID.
deleteHostedConfigurationVersion_applicationId :: Lens.Lens' DeleteHostedConfigurationVersion Prelude.Text
deleteHostedConfigurationVersion_applicationId :: (Text -> f Text)
-> DeleteHostedConfigurationVersion
-> f DeleteHostedConfigurationVersion
deleteHostedConfigurationVersion_applicationId = (DeleteHostedConfigurationVersion -> Text)
-> (DeleteHostedConfigurationVersion
    -> Text -> DeleteHostedConfigurationVersion)
-> Lens
     DeleteHostedConfigurationVersion
     DeleteHostedConfigurationVersion
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteHostedConfigurationVersion' {Text
applicationId :: Text
$sel:applicationId:DeleteHostedConfigurationVersion' :: DeleteHostedConfigurationVersion -> Text
applicationId} -> Text
applicationId) (\s :: DeleteHostedConfigurationVersion
s@DeleteHostedConfigurationVersion' {} Text
a -> DeleteHostedConfigurationVersion
s {$sel:applicationId:DeleteHostedConfigurationVersion' :: Text
applicationId = Text
a} :: DeleteHostedConfigurationVersion)

-- | The configuration profile ID.
deleteHostedConfigurationVersion_configurationProfileId :: Lens.Lens' DeleteHostedConfigurationVersion Prelude.Text
deleteHostedConfigurationVersion_configurationProfileId :: (Text -> f Text)
-> DeleteHostedConfigurationVersion
-> f DeleteHostedConfigurationVersion
deleteHostedConfigurationVersion_configurationProfileId = (DeleteHostedConfigurationVersion -> Text)
-> (DeleteHostedConfigurationVersion
    -> Text -> DeleteHostedConfigurationVersion)
-> Lens
     DeleteHostedConfigurationVersion
     DeleteHostedConfigurationVersion
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteHostedConfigurationVersion' {Text
configurationProfileId :: Text
$sel:configurationProfileId:DeleteHostedConfigurationVersion' :: DeleteHostedConfigurationVersion -> Text
configurationProfileId} -> Text
configurationProfileId) (\s :: DeleteHostedConfigurationVersion
s@DeleteHostedConfigurationVersion' {} Text
a -> DeleteHostedConfigurationVersion
s {$sel:configurationProfileId:DeleteHostedConfigurationVersion' :: Text
configurationProfileId = Text
a} :: DeleteHostedConfigurationVersion)

-- | The versions number to delete.
deleteHostedConfigurationVersion_versionNumber :: Lens.Lens' DeleteHostedConfigurationVersion Prelude.Int
deleteHostedConfigurationVersion_versionNumber :: (Int -> f Int)
-> DeleteHostedConfigurationVersion
-> f DeleteHostedConfigurationVersion
deleteHostedConfigurationVersion_versionNumber = (DeleteHostedConfigurationVersion -> Int)
-> (DeleteHostedConfigurationVersion
    -> Int -> DeleteHostedConfigurationVersion)
-> Lens
     DeleteHostedConfigurationVersion
     DeleteHostedConfigurationVersion
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteHostedConfigurationVersion' {Int
versionNumber :: Int
$sel:versionNumber:DeleteHostedConfigurationVersion' :: DeleteHostedConfigurationVersion -> Int
versionNumber} -> Int
versionNumber) (\s :: DeleteHostedConfigurationVersion
s@DeleteHostedConfigurationVersion' {} Int
a -> DeleteHostedConfigurationVersion
s {$sel:versionNumber:DeleteHostedConfigurationVersion' :: Int
versionNumber = Int
a} :: DeleteHostedConfigurationVersion)

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

instance
  Prelude.Hashable
    DeleteHostedConfigurationVersion

instance
  Prelude.NFData
    DeleteHostedConfigurationVersion

instance
  Core.ToHeaders
    DeleteHostedConfigurationVersion
  where
  toHeaders :: DeleteHostedConfigurationVersion -> [Header]
toHeaders =
    [Header] -> DeleteHostedConfigurationVersion -> [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 DeleteHostedConfigurationVersion where
  toPath :: DeleteHostedConfigurationVersion -> ByteString
toPath DeleteHostedConfigurationVersion' {Int
Text
versionNumber :: Int
configurationProfileId :: Text
applicationId :: Text
$sel:versionNumber:DeleteHostedConfigurationVersion' :: DeleteHostedConfigurationVersion -> Int
$sel:configurationProfileId:DeleteHostedConfigurationVersion' :: DeleteHostedConfigurationVersion -> Text
$sel:applicationId:DeleteHostedConfigurationVersion' :: DeleteHostedConfigurationVersion -> 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,
        ByteString
"/hostedconfigurationversions/",
        Int -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Int
versionNumber
      ]

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

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

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

instance
  Prelude.NFData
    DeleteHostedConfigurationVersionResponse