{-# 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.DeleteProgram
(
DeleteProgram (..),
newDeleteProgram,
deleteProgram_channelName,
deleteProgram_programName,
DeleteProgramResponse (..),
newDeleteProgramResponse,
deleteProgramResponse_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
data DeleteProgram = DeleteProgram'
{
DeleteProgram -> Text
channelName :: Prelude.Text,
DeleteProgram -> Text
programName :: Prelude.Text
}
deriving (DeleteProgram -> DeleteProgram -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProgram -> DeleteProgram -> Bool
$c/= :: DeleteProgram -> DeleteProgram -> Bool
== :: DeleteProgram -> DeleteProgram -> Bool
$c== :: DeleteProgram -> DeleteProgram -> Bool
Prelude.Eq, ReadPrec [DeleteProgram]
ReadPrec DeleteProgram
Int -> ReadS DeleteProgram
ReadS [DeleteProgram]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProgram]
$creadListPrec :: ReadPrec [DeleteProgram]
readPrec :: ReadPrec DeleteProgram
$creadPrec :: ReadPrec DeleteProgram
readList :: ReadS [DeleteProgram]
$creadList :: ReadS [DeleteProgram]
readsPrec :: Int -> ReadS DeleteProgram
$creadsPrec :: Int -> ReadS DeleteProgram
Prelude.Read, Int -> DeleteProgram -> ShowS
[DeleteProgram] -> ShowS
DeleteProgram -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProgram] -> ShowS
$cshowList :: [DeleteProgram] -> ShowS
show :: DeleteProgram -> String
$cshow :: DeleteProgram -> String
showsPrec :: Int -> DeleteProgram -> ShowS
$cshowsPrec :: Int -> DeleteProgram -> ShowS
Prelude.Show, forall x. Rep DeleteProgram x -> DeleteProgram
forall x. DeleteProgram -> Rep DeleteProgram x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteProgram x -> DeleteProgram
$cfrom :: forall x. DeleteProgram -> Rep DeleteProgram x
Prelude.Generic)
newDeleteProgram ::
Prelude.Text ->
Prelude.Text ->
DeleteProgram
newDeleteProgram :: Text -> Text -> DeleteProgram
newDeleteProgram Text
pChannelName_ Text
pProgramName_ =
DeleteProgram'
{ $sel:channelName:DeleteProgram' :: Text
channelName = Text
pChannelName_,
$sel:programName:DeleteProgram' :: Text
programName = Text
pProgramName_
}
deleteProgram_channelName :: Lens.Lens' DeleteProgram Prelude.Text
deleteProgram_channelName :: Lens' DeleteProgram Text
deleteProgram_channelName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProgram' {Text
channelName :: Text
$sel:channelName:DeleteProgram' :: DeleteProgram -> Text
channelName} -> Text
channelName) (\s :: DeleteProgram
s@DeleteProgram' {} Text
a -> DeleteProgram
s {$sel:channelName:DeleteProgram' :: Text
channelName = Text
a} :: DeleteProgram)
deleteProgram_programName :: Lens.Lens' DeleteProgram Prelude.Text
deleteProgram_programName :: Lens' DeleteProgram Text
deleteProgram_programName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProgram' {Text
programName :: Text
$sel:programName:DeleteProgram' :: DeleteProgram -> Text
programName} -> Text
programName) (\s :: DeleteProgram
s@DeleteProgram' {} Text
a -> DeleteProgram
s {$sel:programName:DeleteProgram' :: Text
programName = Text
a} :: DeleteProgram)
instance Core.AWSRequest DeleteProgram where
type
AWSResponse DeleteProgram =
DeleteProgramResponse
request :: (Service -> Service) -> DeleteProgram -> Request DeleteProgram
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 DeleteProgram
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteProgram)))
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 -> DeleteProgramResponse
DeleteProgramResponse'
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 DeleteProgram where
hashWithSalt :: Int -> DeleteProgram -> Int
hashWithSalt Int
_salt DeleteProgram' {Text
programName :: Text
channelName :: Text
$sel:programName:DeleteProgram' :: DeleteProgram -> Text
$sel:channelName:DeleteProgram' :: DeleteProgram -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
channelName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
programName
instance Prelude.NFData DeleteProgram where
rnf :: DeleteProgram -> ()
rnf DeleteProgram' {Text
programName :: Text
channelName :: Text
$sel:programName:DeleteProgram' :: DeleteProgram -> Text
$sel:channelName:DeleteProgram' :: DeleteProgram -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
channelName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
programName
instance Data.ToHeaders DeleteProgram where
toHeaders :: DeleteProgram -> 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 DeleteProgram where
toPath :: DeleteProgram -> ByteString
toPath DeleteProgram' {Text
programName :: Text
channelName :: Text
$sel:programName:DeleteProgram' :: DeleteProgram -> Text
$sel:channelName:DeleteProgram' :: DeleteProgram -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/channel/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
channelName,
ByteString
"/program/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
programName
]
instance Data.ToQuery DeleteProgram where
toQuery :: DeleteProgram -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteProgramResponse = DeleteProgramResponse'
{
DeleteProgramResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteProgramResponse -> DeleteProgramResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProgramResponse -> DeleteProgramResponse -> Bool
$c/= :: DeleteProgramResponse -> DeleteProgramResponse -> Bool
== :: DeleteProgramResponse -> DeleteProgramResponse -> Bool
$c== :: DeleteProgramResponse -> DeleteProgramResponse -> Bool
Prelude.Eq, ReadPrec [DeleteProgramResponse]
ReadPrec DeleteProgramResponse
Int -> ReadS DeleteProgramResponse
ReadS [DeleteProgramResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProgramResponse]
$creadListPrec :: ReadPrec [DeleteProgramResponse]
readPrec :: ReadPrec DeleteProgramResponse
$creadPrec :: ReadPrec DeleteProgramResponse
readList :: ReadS [DeleteProgramResponse]
$creadList :: ReadS [DeleteProgramResponse]
readsPrec :: Int -> ReadS DeleteProgramResponse
$creadsPrec :: Int -> ReadS DeleteProgramResponse
Prelude.Read, Int -> DeleteProgramResponse -> ShowS
[DeleteProgramResponse] -> ShowS
DeleteProgramResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProgramResponse] -> ShowS
$cshowList :: [DeleteProgramResponse] -> ShowS
show :: DeleteProgramResponse -> String
$cshow :: DeleteProgramResponse -> String
showsPrec :: Int -> DeleteProgramResponse -> ShowS
$cshowsPrec :: Int -> DeleteProgramResponse -> ShowS
Prelude.Show, forall x. Rep DeleteProgramResponse x -> DeleteProgramResponse
forall x. DeleteProgramResponse -> Rep DeleteProgramResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteProgramResponse x -> DeleteProgramResponse
$cfrom :: forall x. DeleteProgramResponse -> Rep DeleteProgramResponse x
Prelude.Generic)
newDeleteProgramResponse ::
Prelude.Int ->
DeleteProgramResponse
newDeleteProgramResponse :: Int -> DeleteProgramResponse
newDeleteProgramResponse Int
pHttpStatus_ =
DeleteProgramResponse' {$sel:httpStatus:DeleteProgramResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteProgramResponse_httpStatus :: Lens.Lens' DeleteProgramResponse Prelude.Int
deleteProgramResponse_httpStatus :: Lens' DeleteProgramResponse Int
deleteProgramResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProgramResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteProgramResponse' :: DeleteProgramResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteProgramResponse
s@DeleteProgramResponse' {} Int
a -> DeleteProgramResponse
s {$sel:httpStatus:DeleteProgramResponse' :: Int
httpStatus = Int
a} :: DeleteProgramResponse)
instance Prelude.NFData DeleteProgramResponse where
rnf :: DeleteProgramResponse -> ()
rnf DeleteProgramResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteProgramResponse' :: DeleteProgramResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus