{-# 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.DeletePackagingGroup
-- 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 PackagingGroup resource.
module Amazonka.MediaPackageVOD.DeletePackagingGroup
  ( -- * Creating a Request
    DeletePackagingGroup (..),
    newDeletePackagingGroup,

    -- * Request Lenses
    deletePackagingGroup_id,

    -- * Destructuring the Response
    DeletePackagingGroupResponse (..),
    newDeletePackagingGroupResponse,

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

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

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

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

instance Prelude.NFData DeletePackagingGroup

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

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

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

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

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

instance Prelude.NFData DeletePackagingGroupResponse