{-# 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-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 the playback configuration for the specified name.
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.Lens as Lens
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 identifier for the playback configuration.
    DeletePlaybackConfiguration -> Text
name :: Prelude.Text
  }
  deriving (DeletePlaybackConfiguration -> DeletePlaybackConfiguration -> Bool
(DeletePlaybackConfiguration
 -> DeletePlaybackConfiguration -> Bool)
-> (DeletePlaybackConfiguration
    -> DeletePlaybackConfiguration -> Bool)
-> Eq DeletePlaybackConfiguration
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]
(Int -> ReadS DeletePlaybackConfiguration)
-> ReadS [DeletePlaybackConfiguration]
-> ReadPrec DeletePlaybackConfiguration
-> ReadPrec [DeletePlaybackConfiguration]
-> Read 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
(Int -> DeletePlaybackConfiguration -> ShowS)
-> (DeletePlaybackConfiguration -> String)
-> ([DeletePlaybackConfiguration] -> ShowS)
-> Show DeletePlaybackConfiguration
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.
 DeletePlaybackConfiguration -> Rep DeletePlaybackConfiguration x)
-> (forall x.
    Rep DeletePlaybackConfiguration x -> DeletePlaybackConfiguration)
-> Generic DeletePlaybackConfiguration
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 identifier for the playback configuration.
newDeletePlaybackConfiguration ::
  -- | 'name'
  Prelude.Text ->
  DeletePlaybackConfiguration
newDeletePlaybackConfiguration :: Text -> DeletePlaybackConfiguration
newDeletePlaybackConfiguration Text
pName_ =
  DeletePlaybackConfiguration' :: Text -> DeletePlaybackConfiguration
DeletePlaybackConfiguration' {$sel:name:DeletePlaybackConfiguration' :: Text
name = Text
pName_}

-- | The identifier for the playback configuration.
deletePlaybackConfiguration_name :: Lens.Lens' DeletePlaybackConfiguration Prelude.Text
deletePlaybackConfiguration_name :: (Text -> f Text)
-> DeletePlaybackConfiguration -> f DeletePlaybackConfiguration
deletePlaybackConfiguration_name = (DeletePlaybackConfiguration -> Text)
-> (DeletePlaybackConfiguration
    -> Text -> DeletePlaybackConfiguration)
-> Lens
     DeletePlaybackConfiguration DeletePlaybackConfiguration Text Text
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 :: DeletePlaybackConfiguration -> Request DeletePlaybackConfiguration
request = Service
-> DeletePlaybackConfiguration
-> Request DeletePlaybackConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeletePlaybackConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeletePlaybackConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeletePlaybackConfiguration))
-> Logger
-> Service
-> Proxy DeletePlaybackConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeletePlaybackConfiguration)))
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 -> DeletePlaybackConfigurationResponse
DeletePlaybackConfigurationResponse'
            (Int -> DeletePlaybackConfigurationResponse)
-> Either String Int
-> Either String DeletePlaybackConfigurationResponse
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 DeletePlaybackConfiguration

instance Prelude.NFData DeletePlaybackConfiguration

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

instance Core.ToQuery DeletePlaybackConfiguration where
  toQuery :: DeletePlaybackConfiguration -> QueryString
toQuery = QueryString -> DeletePlaybackConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DeletePlaybackConfigurationResponse
 -> DeletePlaybackConfigurationResponse -> Bool)
-> (DeletePlaybackConfigurationResponse
    -> DeletePlaybackConfigurationResponse -> Bool)
-> Eq DeletePlaybackConfigurationResponse
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]
(Int -> ReadS DeletePlaybackConfigurationResponse)
-> ReadS [DeletePlaybackConfigurationResponse]
-> ReadPrec DeletePlaybackConfigurationResponse
-> ReadPrec [DeletePlaybackConfigurationResponse]
-> Read 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
(Int -> DeletePlaybackConfigurationResponse -> ShowS)
-> (DeletePlaybackConfigurationResponse -> String)
-> ([DeletePlaybackConfigurationResponse] -> ShowS)
-> Show DeletePlaybackConfigurationResponse
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.
 DeletePlaybackConfigurationResponse
 -> Rep DeletePlaybackConfigurationResponse x)
-> (forall x.
    Rep DeletePlaybackConfigurationResponse x
    -> DeletePlaybackConfigurationResponse)
-> Generic DeletePlaybackConfigurationResponse
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' :: Int -> DeletePlaybackConfigurationResponse
DeletePlaybackConfigurationResponse'
    { $sel:httpStatus:DeletePlaybackConfigurationResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deletePlaybackConfigurationResponse_httpStatus :: Lens.Lens' DeletePlaybackConfigurationResponse Prelude.Int
deletePlaybackConfigurationResponse_httpStatus :: (Int -> f Int)
-> DeletePlaybackConfigurationResponse
-> f DeletePlaybackConfigurationResponse
deletePlaybackConfigurationResponse_httpStatus = (DeletePlaybackConfigurationResponse -> Int)
-> (DeletePlaybackConfigurationResponse
    -> Int -> DeletePlaybackConfigurationResponse)
-> Lens
     DeletePlaybackConfigurationResponse
     DeletePlaybackConfigurationResponse
     Int
     Int
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