{-# 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 #-}
module Amazonka.MediaTailor.DeleteVodSource
(
DeleteVodSource (..),
newDeleteVodSource,
deleteVodSource_sourceLocationName,
deleteVodSource_vodSourceName,
DeleteVodSourceResponse (..),
newDeleteVodSourceResponse,
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
data DeleteVodSource = DeleteVodSource'
{
DeleteVodSource -> Text
sourceLocationName :: Prelude.Text,
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)
newDeleteVodSource ::
Prelude.Text ->
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_
}
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)
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
data DeleteVodSourceResponse = DeleteVodSourceResponse'
{
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)
newDeleteVodSourceResponse ::
Prelude.Int ->
DeleteVodSourceResponse
newDeleteVodSourceResponse :: Int -> DeleteVodSourceResponse
newDeleteVodSourceResponse Int
pHttpStatus_ =
DeleteVodSourceResponse' :: Int -> DeleteVodSourceResponse
DeleteVodSourceResponse' {$sel:httpStatus:DeleteVodSourceResponse' :: Int
httpStatus = Int
pHttpStatus_}
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