{-# 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.MediaTailor.DeletePlaybackConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a playback configuration. For information about MediaTailor
-- configurations, see
-- <https://docs.aws.amazon.com/mediatailor/latest/ug/configurations.html Working with configurations in AWS Elemental MediaTailor>.
module Amazonka.MediaTailor.DeletePlaybackConfiguration
  ( -- * Creating a Request
    DeletePlaybackConfiguration (..),
    newDeletePlaybackConfiguration,

    -- * Request Lenses
    deletePlaybackConfiguration_name,

    -- * Destructuring the Response
    DeletePlaybackConfigurationResponse (..),
    newDeletePlaybackConfigurationResponse,

    -- * Response Lenses
    deletePlaybackConfigurationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaTailor.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

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

-- |
-- Create a value of 'DeletePlaybackConfiguration' 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:
--
-- 'name', 'deletePlaybackConfiguration_name' - The name of the playback configuration.
newDeletePlaybackConfiguration ::
  -- | 'name'
  Prelude.Text ->
  DeletePlaybackConfiguration
newDeletePlaybackConfiguration :: Text -> DeletePlaybackConfiguration
newDeletePlaybackConfiguration Text
pName_ =
  DeletePlaybackConfiguration' {$sel:name:DeletePlaybackConfiguration' :: Text
name = Text
pName_}

-- | The name of the playback configuration.
deletePlaybackConfiguration_name :: Lens.Lens' DeletePlaybackConfiguration Prelude.Text
deletePlaybackConfiguration_name :: Lens' DeletePlaybackConfiguration Text
deletePlaybackConfiguration_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePlaybackConfiguration' {Text
name :: Text
$sel:name:DeletePlaybackConfiguration' :: DeletePlaybackConfiguration -> Text
name} -> Text
name) (\s :: DeletePlaybackConfiguration
s@DeletePlaybackConfiguration' {} Text
a -> DeletePlaybackConfiguration
s {$sel:name:DeletePlaybackConfiguration' :: Text
name = Text
a} :: DeletePlaybackConfiguration)

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

instance Prelude.Hashable DeletePlaybackConfiguration where
  hashWithSalt :: Int -> DeletePlaybackConfiguration -> Int
hashWithSalt Int
_salt DeletePlaybackConfiguration' {Text
name :: Text
$sel:name:DeletePlaybackConfiguration' :: DeletePlaybackConfiguration -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData DeletePlaybackConfiguration where
  rnf :: DeletePlaybackConfiguration -> ()
rnf DeletePlaybackConfiguration' {Text
name :: Text
$sel:name:DeletePlaybackConfiguration' :: DeletePlaybackConfiguration -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
name

instance Data.ToHeaders DeletePlaybackConfiguration where
  toHeaders :: DeletePlaybackConfiguration -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath DeletePlaybackConfiguration where
  toPath :: DeletePlaybackConfiguration -> ByteString
toPath DeletePlaybackConfiguration' {Text
name :: Text
$sel:name:DeletePlaybackConfiguration' :: DeletePlaybackConfiguration -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/playbackConfiguration/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
name]

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

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

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

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

instance
  Prelude.NFData
    DeletePlaybackConfigurationResponse
  where
  rnf :: DeletePlaybackConfigurationResponse -> ()
rnf DeletePlaybackConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeletePlaybackConfigurationResponse' :: DeletePlaybackConfigurationResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus