{-# 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.MediaPackageVOD.DeletePackagingConfiguration
-- 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 MediaPackage VOD PackagingConfiguration resource.
module Amazonka.MediaPackageVOD.DeletePackagingConfiguration
  ( -- * Creating a Request
    DeletePackagingConfiguration (..),
    newDeletePackagingConfiguration,

    -- * Request Lenses
    deletePackagingConfiguration_id,

    -- * Destructuring the Response
    DeletePackagingConfigurationResponse (..),
    newDeletePackagingConfigurationResponse,

    -- * Response Lenses
    deletePackagingConfigurationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaPackageVOD.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeletePackagingConfiguration' smart constructor.
data DeletePackagingConfiguration = DeletePackagingConfiguration'
  { -- | The ID of the MediaPackage VOD PackagingConfiguration resource to
    -- delete.
    DeletePackagingConfiguration -> Text
id :: Prelude.Text
  }
  deriving (DeletePackagingConfiguration
-> DeletePackagingConfiguration -> Bool
(DeletePackagingConfiguration
 -> DeletePackagingConfiguration -> Bool)
-> (DeletePackagingConfiguration
    -> DeletePackagingConfiguration -> Bool)
-> Eq DeletePackagingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePackagingConfiguration
-> DeletePackagingConfiguration -> Bool
$c/= :: DeletePackagingConfiguration
-> DeletePackagingConfiguration -> Bool
== :: DeletePackagingConfiguration
-> DeletePackagingConfiguration -> Bool
$c== :: DeletePackagingConfiguration
-> DeletePackagingConfiguration -> Bool
Prelude.Eq, ReadPrec [DeletePackagingConfiguration]
ReadPrec DeletePackagingConfiguration
Int -> ReadS DeletePackagingConfiguration
ReadS [DeletePackagingConfiguration]
(Int -> ReadS DeletePackagingConfiguration)
-> ReadS [DeletePackagingConfiguration]
-> ReadPrec DeletePackagingConfiguration
-> ReadPrec [DeletePackagingConfiguration]
-> Read DeletePackagingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletePackagingConfiguration]
$creadListPrec :: ReadPrec [DeletePackagingConfiguration]
readPrec :: ReadPrec DeletePackagingConfiguration
$creadPrec :: ReadPrec DeletePackagingConfiguration
readList :: ReadS [DeletePackagingConfiguration]
$creadList :: ReadS [DeletePackagingConfiguration]
readsPrec :: Int -> ReadS DeletePackagingConfiguration
$creadsPrec :: Int -> ReadS DeletePackagingConfiguration
Prelude.Read, Int -> DeletePackagingConfiguration -> ShowS
[DeletePackagingConfiguration] -> ShowS
DeletePackagingConfiguration -> String
(Int -> DeletePackagingConfiguration -> ShowS)
-> (DeletePackagingConfiguration -> String)
-> ([DeletePackagingConfiguration] -> ShowS)
-> Show DeletePackagingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePackagingConfiguration] -> ShowS
$cshowList :: [DeletePackagingConfiguration] -> ShowS
show :: DeletePackagingConfiguration -> String
$cshow :: DeletePackagingConfiguration -> String
showsPrec :: Int -> DeletePackagingConfiguration -> ShowS
$cshowsPrec :: Int -> DeletePackagingConfiguration -> ShowS
Prelude.Show, (forall x.
 DeletePackagingConfiguration -> Rep DeletePackagingConfiguration x)
-> (forall x.
    Rep DeletePackagingConfiguration x -> DeletePackagingConfiguration)
-> Generic DeletePackagingConfiguration
forall x.
Rep DeletePackagingConfiguration x -> DeletePackagingConfiguration
forall x.
DeletePackagingConfiguration -> Rep DeletePackagingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeletePackagingConfiguration x -> DeletePackagingConfiguration
$cfrom :: forall x.
DeletePackagingConfiguration -> Rep DeletePackagingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeletePackagingConfiguration' 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', 'deletePackagingConfiguration_id' - The ID of the MediaPackage VOD PackagingConfiguration resource to
-- delete.
newDeletePackagingConfiguration ::
  -- | 'id'
  Prelude.Text ->
  DeletePackagingConfiguration
newDeletePackagingConfiguration :: Text -> DeletePackagingConfiguration
newDeletePackagingConfiguration Text
pId_ =
  DeletePackagingConfiguration' :: Text -> DeletePackagingConfiguration
DeletePackagingConfiguration' {$sel:id:DeletePackagingConfiguration' :: Text
id = Text
pId_}

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

instance Core.AWSRequest DeletePackagingConfiguration where
  type
    AWSResponse DeletePackagingConfiguration =
      DeletePackagingConfigurationResponse
  request :: DeletePackagingConfiguration
-> Request DeletePackagingConfiguration
request = Service
-> DeletePackagingConfiguration
-> Request DeletePackagingConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeletePackagingConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeletePackagingConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeletePackagingConfiguration))
-> Logger
-> Service
-> Proxy DeletePackagingConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeletePackagingConfiguration)))
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 -> DeletePackagingConfigurationResponse
DeletePackagingConfigurationResponse'
            (Int -> DeletePackagingConfigurationResponse)
-> Either String Int
-> Either String DeletePackagingConfigurationResponse
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
    DeletePackagingConfiguration

instance Prelude.NFData DeletePackagingConfiguration

instance Core.ToHeaders DeletePackagingConfiguration where
  toHeaders :: DeletePackagingConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeletePackagingConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath DeletePackagingConfiguration where
  toPath :: DeletePackagingConfiguration -> ByteString
toPath DeletePackagingConfiguration' {Text
id :: Text
$sel:id:DeletePackagingConfiguration' :: DeletePackagingConfiguration -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/packaging_configurations/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]

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

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

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

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

instance
  Prelude.NFData
    DeletePackagingConfigurationResponse