{-# 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.DeleteVodSource
-- 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 specific VOD source in a specific source location.
module Amazonka.MediaTailor.DeleteVodSource
  ( -- * Creating a Request
    DeleteVodSource (..),
    newDeleteVodSource,

    -- * Request Lenses
    deleteVodSource_sourceLocationName,
    deleteVodSource_vodSourceName,

    -- * Destructuring the Response
    DeleteVodSourceResponse (..),
    newDeleteVodSourceResponse,

    -- * Response Lenses
    deleteVodSourceResponse_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:/ 'newDeleteVodSource' smart constructor.
data DeleteVodSource = DeleteVodSource'
  { -- | The identifier for the source location you are working on.
    DeleteVodSource -> Text
sourceLocationName :: Prelude.Text,
    -- | The identifier for the VOD source you are working on.
    DeleteVodSource -> Text
vodSourceName :: Prelude.Text
  }
  deriving (DeleteVodSource -> DeleteVodSource -> Bool
(DeleteVodSource -> DeleteVodSource -> Bool)
-> (DeleteVodSource -> DeleteVodSource -> Bool)
-> Eq DeleteVodSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVodSource -> DeleteVodSource -> Bool
$c/= :: DeleteVodSource -> DeleteVodSource -> Bool
== :: DeleteVodSource -> DeleteVodSource -> Bool
$c== :: DeleteVodSource -> DeleteVodSource -> Bool
Prelude.Eq, ReadPrec [DeleteVodSource]
ReadPrec DeleteVodSource
Int -> ReadS DeleteVodSource
ReadS [DeleteVodSource]
(Int -> ReadS DeleteVodSource)
-> ReadS [DeleteVodSource]
-> ReadPrec DeleteVodSource
-> ReadPrec [DeleteVodSource]
-> Read DeleteVodSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVodSource]
$creadListPrec :: ReadPrec [DeleteVodSource]
readPrec :: ReadPrec DeleteVodSource
$creadPrec :: ReadPrec DeleteVodSource
readList :: ReadS [DeleteVodSource]
$creadList :: ReadS [DeleteVodSource]
readsPrec :: Int -> ReadS DeleteVodSource
$creadsPrec :: Int -> ReadS DeleteVodSource
Prelude.Read, Int -> DeleteVodSource -> ShowS
[DeleteVodSource] -> ShowS
DeleteVodSource -> String
(Int -> DeleteVodSource -> ShowS)
-> (DeleteVodSource -> String)
-> ([DeleteVodSource] -> ShowS)
-> Show DeleteVodSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVodSource] -> ShowS
$cshowList :: [DeleteVodSource] -> ShowS
show :: DeleteVodSource -> String
$cshow :: DeleteVodSource -> String
showsPrec :: Int -> DeleteVodSource -> ShowS
$cshowsPrec :: Int -> DeleteVodSource -> ShowS
Prelude.Show, (forall x. DeleteVodSource -> Rep DeleteVodSource x)
-> (forall x. Rep DeleteVodSource x -> DeleteVodSource)
-> Generic DeleteVodSource
forall x. Rep DeleteVodSource x -> DeleteVodSource
forall x. DeleteVodSource -> Rep DeleteVodSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteVodSource x -> DeleteVodSource
$cfrom :: forall x. DeleteVodSource -> Rep DeleteVodSource x
Prelude.Generic)

-- |
-- Create a value of 'DeleteVodSource' 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:
--
-- 'sourceLocationName', 'deleteVodSource_sourceLocationName' - The identifier for the source location you are working on.
--
-- 'vodSourceName', 'deleteVodSource_vodSourceName' - The identifier for the VOD source you are working on.
newDeleteVodSource ::
  -- | 'sourceLocationName'
  Prelude.Text ->
  -- | 'vodSourceName'
  Prelude.Text ->
  DeleteVodSource
newDeleteVodSource :: Text -> Text -> DeleteVodSource
newDeleteVodSource
  Text
pSourceLocationName_
  Text
pVodSourceName_ =
    DeleteVodSource' :: Text -> Text -> DeleteVodSource
DeleteVodSource'
      { $sel:sourceLocationName:DeleteVodSource' :: Text
sourceLocationName =
          Text
pSourceLocationName_,
        $sel:vodSourceName:DeleteVodSource' :: Text
vodSourceName = Text
pVodSourceName_
      }

-- | The identifier for the source location you are working on.
deleteVodSource_sourceLocationName :: Lens.Lens' DeleteVodSource Prelude.Text
deleteVodSource_sourceLocationName :: (Text -> f Text) -> DeleteVodSource -> f DeleteVodSource
deleteVodSource_sourceLocationName = (DeleteVodSource -> Text)
-> (DeleteVodSource -> Text -> DeleteVodSource)
-> Lens DeleteVodSource DeleteVodSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVodSource' {Text
sourceLocationName :: Text
$sel:sourceLocationName:DeleteVodSource' :: DeleteVodSource -> Text
sourceLocationName} -> Text
sourceLocationName) (\s :: DeleteVodSource
s@DeleteVodSource' {} Text
a -> DeleteVodSource
s {$sel:sourceLocationName:DeleteVodSource' :: Text
sourceLocationName = Text
a} :: DeleteVodSource)

-- | The identifier for the VOD source you are working on.
deleteVodSource_vodSourceName :: Lens.Lens' DeleteVodSource Prelude.Text
deleteVodSource_vodSourceName :: (Text -> f Text) -> DeleteVodSource -> f DeleteVodSource
deleteVodSource_vodSourceName = (DeleteVodSource -> Text)
-> (DeleteVodSource -> Text -> DeleteVodSource)
-> Lens DeleteVodSource DeleteVodSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVodSource' {Text
vodSourceName :: Text
$sel:vodSourceName:DeleteVodSource' :: DeleteVodSource -> Text
vodSourceName} -> Text
vodSourceName) (\s :: DeleteVodSource
s@DeleteVodSource' {} Text
a -> DeleteVodSource
s {$sel:vodSourceName:DeleteVodSource' :: Text
vodSourceName = Text
a} :: DeleteVodSource)

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

instance Prelude.NFData DeleteVodSource

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

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

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

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

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

instance Prelude.NFData DeleteVodSourceResponse