{-# 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.DeleteChannelPolicy
(
DeleteChannelPolicy (..),
newDeleteChannelPolicy,
deleteChannelPolicy_channelName,
DeleteChannelPolicyResponse (..),
newDeleteChannelPolicyResponse,
deleteChannelPolicyResponse_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 DeleteChannelPolicy = DeleteChannelPolicy'
{
DeleteChannelPolicy -> Text
channelName :: Prelude.Text
}
deriving (DeleteChannelPolicy -> DeleteChannelPolicy -> Bool
(DeleteChannelPolicy -> DeleteChannelPolicy -> Bool)
-> (DeleteChannelPolicy -> DeleteChannelPolicy -> Bool)
-> Eq DeleteChannelPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteChannelPolicy -> DeleteChannelPolicy -> Bool
$c/= :: DeleteChannelPolicy -> DeleteChannelPolicy -> Bool
== :: DeleteChannelPolicy -> DeleteChannelPolicy -> Bool
$c== :: DeleteChannelPolicy -> DeleteChannelPolicy -> Bool
Prelude.Eq, ReadPrec [DeleteChannelPolicy]
ReadPrec DeleteChannelPolicy
Int -> ReadS DeleteChannelPolicy
ReadS [DeleteChannelPolicy]
(Int -> ReadS DeleteChannelPolicy)
-> ReadS [DeleteChannelPolicy]
-> ReadPrec DeleteChannelPolicy
-> ReadPrec [DeleteChannelPolicy]
-> Read DeleteChannelPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteChannelPolicy]
$creadListPrec :: ReadPrec [DeleteChannelPolicy]
readPrec :: ReadPrec DeleteChannelPolicy
$creadPrec :: ReadPrec DeleteChannelPolicy
readList :: ReadS [DeleteChannelPolicy]
$creadList :: ReadS [DeleteChannelPolicy]
readsPrec :: Int -> ReadS DeleteChannelPolicy
$creadsPrec :: Int -> ReadS DeleteChannelPolicy
Prelude.Read, Int -> DeleteChannelPolicy -> ShowS
[DeleteChannelPolicy] -> ShowS
DeleteChannelPolicy -> String
(Int -> DeleteChannelPolicy -> ShowS)
-> (DeleteChannelPolicy -> String)
-> ([DeleteChannelPolicy] -> ShowS)
-> Show DeleteChannelPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteChannelPolicy] -> ShowS
$cshowList :: [DeleteChannelPolicy] -> ShowS
show :: DeleteChannelPolicy -> String
$cshow :: DeleteChannelPolicy -> String
showsPrec :: Int -> DeleteChannelPolicy -> ShowS
$cshowsPrec :: Int -> DeleteChannelPolicy -> ShowS
Prelude.Show, (forall x. DeleteChannelPolicy -> Rep DeleteChannelPolicy x)
-> (forall x. Rep DeleteChannelPolicy x -> DeleteChannelPolicy)
-> Generic DeleteChannelPolicy
forall x. Rep DeleteChannelPolicy x -> DeleteChannelPolicy
forall x. DeleteChannelPolicy -> Rep DeleteChannelPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteChannelPolicy x -> DeleteChannelPolicy
$cfrom :: forall x. DeleteChannelPolicy -> Rep DeleteChannelPolicy x
Prelude.Generic)
newDeleteChannelPolicy ::
Prelude.Text ->
DeleteChannelPolicy
newDeleteChannelPolicy :: Text -> DeleteChannelPolicy
newDeleteChannelPolicy Text
pChannelName_ =
DeleteChannelPolicy' :: Text -> DeleteChannelPolicy
DeleteChannelPolicy' {$sel:channelName:DeleteChannelPolicy' :: Text
channelName = Text
pChannelName_}
deleteChannelPolicy_channelName :: Lens.Lens' DeleteChannelPolicy Prelude.Text
deleteChannelPolicy_channelName :: (Text -> f Text) -> DeleteChannelPolicy -> f DeleteChannelPolicy
deleteChannelPolicy_channelName = (DeleteChannelPolicy -> Text)
-> (DeleteChannelPolicy -> Text -> DeleteChannelPolicy)
-> Lens DeleteChannelPolicy DeleteChannelPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChannelPolicy' {Text
channelName :: Text
$sel:channelName:DeleteChannelPolicy' :: DeleteChannelPolicy -> Text
channelName} -> Text
channelName) (\s :: DeleteChannelPolicy
s@DeleteChannelPolicy' {} Text
a -> DeleteChannelPolicy
s {$sel:channelName:DeleteChannelPolicy' :: Text
channelName = Text
a} :: DeleteChannelPolicy)
instance Core.AWSRequest DeleteChannelPolicy where
type
AWSResponse DeleteChannelPolicy =
DeleteChannelPolicyResponse
request :: DeleteChannelPolicy -> Request DeleteChannelPolicy
request = Service -> DeleteChannelPolicy -> Request DeleteChannelPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteChannelPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteChannelPolicy)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteChannelPolicy))
-> Logger
-> Service
-> Proxy DeleteChannelPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteChannelPolicy)))
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 -> DeleteChannelPolicyResponse
DeleteChannelPolicyResponse'
(Int -> DeleteChannelPolicyResponse)
-> Either String Int -> Either String DeleteChannelPolicyResponse
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 DeleteChannelPolicy
instance Prelude.NFData DeleteChannelPolicy
instance Core.ToHeaders DeleteChannelPolicy where
toHeaders :: DeleteChannelPolicy -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteChannelPolicy -> 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 DeleteChannelPolicy where
toPath :: DeleteChannelPolicy -> ByteString
toPath DeleteChannelPolicy' {Text
channelName :: Text
$sel:channelName:DeleteChannelPolicy' :: DeleteChannelPolicy -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/channel/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
channelName, ByteString
"/policy"]
instance Core.ToQuery DeleteChannelPolicy where
toQuery :: DeleteChannelPolicy -> QueryString
toQuery = QueryString -> DeleteChannelPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteChannelPolicyResponse = DeleteChannelPolicyResponse'
{
DeleteChannelPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteChannelPolicyResponse -> DeleteChannelPolicyResponse -> Bool
(DeleteChannelPolicyResponse
-> DeleteChannelPolicyResponse -> Bool)
-> (DeleteChannelPolicyResponse
-> DeleteChannelPolicyResponse -> Bool)
-> Eq DeleteChannelPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteChannelPolicyResponse -> DeleteChannelPolicyResponse -> Bool
$c/= :: DeleteChannelPolicyResponse -> DeleteChannelPolicyResponse -> Bool
== :: DeleteChannelPolicyResponse -> DeleteChannelPolicyResponse -> Bool
$c== :: DeleteChannelPolicyResponse -> DeleteChannelPolicyResponse -> Bool
Prelude.Eq, ReadPrec [DeleteChannelPolicyResponse]
ReadPrec DeleteChannelPolicyResponse
Int -> ReadS DeleteChannelPolicyResponse
ReadS [DeleteChannelPolicyResponse]
(Int -> ReadS DeleteChannelPolicyResponse)
-> ReadS [DeleteChannelPolicyResponse]
-> ReadPrec DeleteChannelPolicyResponse
-> ReadPrec [DeleteChannelPolicyResponse]
-> Read DeleteChannelPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteChannelPolicyResponse]
$creadListPrec :: ReadPrec [DeleteChannelPolicyResponse]
readPrec :: ReadPrec DeleteChannelPolicyResponse
$creadPrec :: ReadPrec DeleteChannelPolicyResponse
readList :: ReadS [DeleteChannelPolicyResponse]
$creadList :: ReadS [DeleteChannelPolicyResponse]
readsPrec :: Int -> ReadS DeleteChannelPolicyResponse
$creadsPrec :: Int -> ReadS DeleteChannelPolicyResponse
Prelude.Read, Int -> DeleteChannelPolicyResponse -> ShowS
[DeleteChannelPolicyResponse] -> ShowS
DeleteChannelPolicyResponse -> String
(Int -> DeleteChannelPolicyResponse -> ShowS)
-> (DeleteChannelPolicyResponse -> String)
-> ([DeleteChannelPolicyResponse] -> ShowS)
-> Show DeleteChannelPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteChannelPolicyResponse] -> ShowS
$cshowList :: [DeleteChannelPolicyResponse] -> ShowS
show :: DeleteChannelPolicyResponse -> String
$cshow :: DeleteChannelPolicyResponse -> String
showsPrec :: Int -> DeleteChannelPolicyResponse -> ShowS
$cshowsPrec :: Int -> DeleteChannelPolicyResponse -> ShowS
Prelude.Show, (forall x.
DeleteChannelPolicyResponse -> Rep DeleteChannelPolicyResponse x)
-> (forall x.
Rep DeleteChannelPolicyResponse x -> DeleteChannelPolicyResponse)
-> Generic DeleteChannelPolicyResponse
forall x.
Rep DeleteChannelPolicyResponse x -> DeleteChannelPolicyResponse
forall x.
DeleteChannelPolicyResponse -> Rep DeleteChannelPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteChannelPolicyResponse x -> DeleteChannelPolicyResponse
$cfrom :: forall x.
DeleteChannelPolicyResponse -> Rep DeleteChannelPolicyResponse x
Prelude.Generic)
newDeleteChannelPolicyResponse ::
Prelude.Int ->
DeleteChannelPolicyResponse
newDeleteChannelPolicyResponse :: Int -> DeleteChannelPolicyResponse
newDeleteChannelPolicyResponse Int
pHttpStatus_ =
DeleteChannelPolicyResponse' :: Int -> DeleteChannelPolicyResponse
DeleteChannelPolicyResponse'
{ $sel:httpStatus:DeleteChannelPolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteChannelPolicyResponse_httpStatus :: Lens.Lens' DeleteChannelPolicyResponse Prelude.Int
deleteChannelPolicyResponse_httpStatus :: (Int -> f Int)
-> DeleteChannelPolicyResponse -> f DeleteChannelPolicyResponse
deleteChannelPolicyResponse_httpStatus = (DeleteChannelPolicyResponse -> Int)
-> (DeleteChannelPolicyResponse
-> Int -> DeleteChannelPolicyResponse)
-> Lens
DeleteChannelPolicyResponse DeleteChannelPolicyResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteChannelPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteChannelPolicyResponse' :: DeleteChannelPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteChannelPolicyResponse
s@DeleteChannelPolicyResponse' {} Int
a -> DeleteChannelPolicyResponse
s {$sel:httpStatus:DeleteChannelPolicyResponse' :: Int
httpStatus = Int
a} :: DeleteChannelPolicyResponse)
instance Prelude.NFData DeleteChannelPolicyResponse