{-# 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.MediaConnect.RevokeFlowEntitlement
(
RevokeFlowEntitlement (..),
newRevokeFlowEntitlement,
revokeFlowEntitlement_flowArn,
revokeFlowEntitlement_entitlementArn,
RevokeFlowEntitlementResponse (..),
newRevokeFlowEntitlementResponse,
revokeFlowEntitlementResponse_entitlementArn,
revokeFlowEntitlementResponse_flowArn,
revokeFlowEntitlementResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RevokeFlowEntitlement = RevokeFlowEntitlement'
{
RevokeFlowEntitlement -> Text
flowArn :: Prelude.Text,
RevokeFlowEntitlement -> Text
entitlementArn :: Prelude.Text
}
deriving (RevokeFlowEntitlement -> RevokeFlowEntitlement -> Bool
(RevokeFlowEntitlement -> RevokeFlowEntitlement -> Bool)
-> (RevokeFlowEntitlement -> RevokeFlowEntitlement -> Bool)
-> Eq RevokeFlowEntitlement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RevokeFlowEntitlement -> RevokeFlowEntitlement -> Bool
$c/= :: RevokeFlowEntitlement -> RevokeFlowEntitlement -> Bool
== :: RevokeFlowEntitlement -> RevokeFlowEntitlement -> Bool
$c== :: RevokeFlowEntitlement -> RevokeFlowEntitlement -> Bool
Prelude.Eq, ReadPrec [RevokeFlowEntitlement]
ReadPrec RevokeFlowEntitlement
Int -> ReadS RevokeFlowEntitlement
ReadS [RevokeFlowEntitlement]
(Int -> ReadS RevokeFlowEntitlement)
-> ReadS [RevokeFlowEntitlement]
-> ReadPrec RevokeFlowEntitlement
-> ReadPrec [RevokeFlowEntitlement]
-> Read RevokeFlowEntitlement
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RevokeFlowEntitlement]
$creadListPrec :: ReadPrec [RevokeFlowEntitlement]
readPrec :: ReadPrec RevokeFlowEntitlement
$creadPrec :: ReadPrec RevokeFlowEntitlement
readList :: ReadS [RevokeFlowEntitlement]
$creadList :: ReadS [RevokeFlowEntitlement]
readsPrec :: Int -> ReadS RevokeFlowEntitlement
$creadsPrec :: Int -> ReadS RevokeFlowEntitlement
Prelude.Read, Int -> RevokeFlowEntitlement -> ShowS
[RevokeFlowEntitlement] -> ShowS
RevokeFlowEntitlement -> String
(Int -> RevokeFlowEntitlement -> ShowS)
-> (RevokeFlowEntitlement -> String)
-> ([RevokeFlowEntitlement] -> ShowS)
-> Show RevokeFlowEntitlement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RevokeFlowEntitlement] -> ShowS
$cshowList :: [RevokeFlowEntitlement] -> ShowS
show :: RevokeFlowEntitlement -> String
$cshow :: RevokeFlowEntitlement -> String
showsPrec :: Int -> RevokeFlowEntitlement -> ShowS
$cshowsPrec :: Int -> RevokeFlowEntitlement -> ShowS
Prelude.Show, (forall x. RevokeFlowEntitlement -> Rep RevokeFlowEntitlement x)
-> (forall x. Rep RevokeFlowEntitlement x -> RevokeFlowEntitlement)
-> Generic RevokeFlowEntitlement
forall x. Rep RevokeFlowEntitlement x -> RevokeFlowEntitlement
forall x. RevokeFlowEntitlement -> Rep RevokeFlowEntitlement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RevokeFlowEntitlement x -> RevokeFlowEntitlement
$cfrom :: forall x. RevokeFlowEntitlement -> Rep RevokeFlowEntitlement x
Prelude.Generic)
newRevokeFlowEntitlement ::
Prelude.Text ->
Prelude.Text ->
RevokeFlowEntitlement
newRevokeFlowEntitlement :: Text -> Text -> RevokeFlowEntitlement
newRevokeFlowEntitlement Text
pFlowArn_ Text
pEntitlementArn_ =
RevokeFlowEntitlement' :: Text -> Text -> RevokeFlowEntitlement
RevokeFlowEntitlement'
{ $sel:flowArn:RevokeFlowEntitlement' :: Text
flowArn = Text
pFlowArn_,
$sel:entitlementArn:RevokeFlowEntitlement' :: Text
entitlementArn = Text
pEntitlementArn_
}
revokeFlowEntitlement_flowArn :: Lens.Lens' RevokeFlowEntitlement Prelude.Text
revokeFlowEntitlement_flowArn :: (Text -> f Text)
-> RevokeFlowEntitlement -> f RevokeFlowEntitlement
revokeFlowEntitlement_flowArn = (RevokeFlowEntitlement -> Text)
-> (RevokeFlowEntitlement -> Text -> RevokeFlowEntitlement)
-> Lens RevokeFlowEntitlement RevokeFlowEntitlement Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokeFlowEntitlement' {Text
flowArn :: Text
$sel:flowArn:RevokeFlowEntitlement' :: RevokeFlowEntitlement -> Text
flowArn} -> Text
flowArn) (\s :: RevokeFlowEntitlement
s@RevokeFlowEntitlement' {} Text
a -> RevokeFlowEntitlement
s {$sel:flowArn:RevokeFlowEntitlement' :: Text
flowArn = Text
a} :: RevokeFlowEntitlement)
revokeFlowEntitlement_entitlementArn :: Lens.Lens' RevokeFlowEntitlement Prelude.Text
revokeFlowEntitlement_entitlementArn :: (Text -> f Text)
-> RevokeFlowEntitlement -> f RevokeFlowEntitlement
revokeFlowEntitlement_entitlementArn = (RevokeFlowEntitlement -> Text)
-> (RevokeFlowEntitlement -> Text -> RevokeFlowEntitlement)
-> Lens RevokeFlowEntitlement RevokeFlowEntitlement Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokeFlowEntitlement' {Text
entitlementArn :: Text
$sel:entitlementArn:RevokeFlowEntitlement' :: RevokeFlowEntitlement -> Text
entitlementArn} -> Text
entitlementArn) (\s :: RevokeFlowEntitlement
s@RevokeFlowEntitlement' {} Text
a -> RevokeFlowEntitlement
s {$sel:entitlementArn:RevokeFlowEntitlement' :: Text
entitlementArn = Text
a} :: RevokeFlowEntitlement)
instance Core.AWSRequest RevokeFlowEntitlement where
type
AWSResponse RevokeFlowEntitlement =
RevokeFlowEntitlementResponse
request :: RevokeFlowEntitlement -> Request RevokeFlowEntitlement
request = Service -> RevokeFlowEntitlement -> Request RevokeFlowEntitlement
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy RevokeFlowEntitlement
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RevokeFlowEntitlement)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RevokeFlowEntitlement))
-> Logger
-> Service
-> Proxy RevokeFlowEntitlement
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RevokeFlowEntitlement)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Maybe Text -> Int -> RevokeFlowEntitlementResponse
RevokeFlowEntitlementResponse'
(Maybe Text -> Maybe Text -> Int -> RevokeFlowEntitlementResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Int -> RevokeFlowEntitlementResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"entitlementArn")
Either String (Maybe Text -> Int -> RevokeFlowEntitlementResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RevokeFlowEntitlementResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"flowArn")
Either String (Int -> RevokeFlowEntitlementResponse)
-> Either String Int -> Either String RevokeFlowEntitlementResponse
forall (f :: * -> *) a b. Applicative f => 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 RevokeFlowEntitlement
instance Prelude.NFData RevokeFlowEntitlement
instance Core.ToHeaders RevokeFlowEntitlement where
toHeaders :: RevokeFlowEntitlement -> ResponseHeaders
toHeaders =
ResponseHeaders -> RevokeFlowEntitlement -> 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 RevokeFlowEntitlement where
toPath :: RevokeFlowEntitlement -> ByteString
toPath RevokeFlowEntitlement' {Text
entitlementArn :: Text
flowArn :: Text
$sel:entitlementArn:RevokeFlowEntitlement' :: RevokeFlowEntitlement -> Text
$sel:flowArn:RevokeFlowEntitlement' :: RevokeFlowEntitlement -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/flows/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
flowArn,
ByteString
"/entitlements/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
entitlementArn
]
instance Core.ToQuery RevokeFlowEntitlement where
toQuery :: RevokeFlowEntitlement -> QueryString
toQuery = QueryString -> RevokeFlowEntitlement -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RevokeFlowEntitlementResponse = RevokeFlowEntitlementResponse'
{
RevokeFlowEntitlementResponse -> Maybe Text
entitlementArn :: Prelude.Maybe Prelude.Text,
RevokeFlowEntitlementResponse -> Maybe Text
flowArn :: Prelude.Maybe Prelude.Text,
RevokeFlowEntitlementResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RevokeFlowEntitlementResponse
-> RevokeFlowEntitlementResponse -> Bool
(RevokeFlowEntitlementResponse
-> RevokeFlowEntitlementResponse -> Bool)
-> (RevokeFlowEntitlementResponse
-> RevokeFlowEntitlementResponse -> Bool)
-> Eq RevokeFlowEntitlementResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RevokeFlowEntitlementResponse
-> RevokeFlowEntitlementResponse -> Bool
$c/= :: RevokeFlowEntitlementResponse
-> RevokeFlowEntitlementResponse -> Bool
== :: RevokeFlowEntitlementResponse
-> RevokeFlowEntitlementResponse -> Bool
$c== :: RevokeFlowEntitlementResponse
-> RevokeFlowEntitlementResponse -> Bool
Prelude.Eq, ReadPrec [RevokeFlowEntitlementResponse]
ReadPrec RevokeFlowEntitlementResponse
Int -> ReadS RevokeFlowEntitlementResponse
ReadS [RevokeFlowEntitlementResponse]
(Int -> ReadS RevokeFlowEntitlementResponse)
-> ReadS [RevokeFlowEntitlementResponse]
-> ReadPrec RevokeFlowEntitlementResponse
-> ReadPrec [RevokeFlowEntitlementResponse]
-> Read RevokeFlowEntitlementResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RevokeFlowEntitlementResponse]
$creadListPrec :: ReadPrec [RevokeFlowEntitlementResponse]
readPrec :: ReadPrec RevokeFlowEntitlementResponse
$creadPrec :: ReadPrec RevokeFlowEntitlementResponse
readList :: ReadS [RevokeFlowEntitlementResponse]
$creadList :: ReadS [RevokeFlowEntitlementResponse]
readsPrec :: Int -> ReadS RevokeFlowEntitlementResponse
$creadsPrec :: Int -> ReadS RevokeFlowEntitlementResponse
Prelude.Read, Int -> RevokeFlowEntitlementResponse -> ShowS
[RevokeFlowEntitlementResponse] -> ShowS
RevokeFlowEntitlementResponse -> String
(Int -> RevokeFlowEntitlementResponse -> ShowS)
-> (RevokeFlowEntitlementResponse -> String)
-> ([RevokeFlowEntitlementResponse] -> ShowS)
-> Show RevokeFlowEntitlementResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RevokeFlowEntitlementResponse] -> ShowS
$cshowList :: [RevokeFlowEntitlementResponse] -> ShowS
show :: RevokeFlowEntitlementResponse -> String
$cshow :: RevokeFlowEntitlementResponse -> String
showsPrec :: Int -> RevokeFlowEntitlementResponse -> ShowS
$cshowsPrec :: Int -> RevokeFlowEntitlementResponse -> ShowS
Prelude.Show, (forall x.
RevokeFlowEntitlementResponse
-> Rep RevokeFlowEntitlementResponse x)
-> (forall x.
Rep RevokeFlowEntitlementResponse x
-> RevokeFlowEntitlementResponse)
-> Generic RevokeFlowEntitlementResponse
forall x.
Rep RevokeFlowEntitlementResponse x
-> RevokeFlowEntitlementResponse
forall x.
RevokeFlowEntitlementResponse
-> Rep RevokeFlowEntitlementResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RevokeFlowEntitlementResponse x
-> RevokeFlowEntitlementResponse
$cfrom :: forall x.
RevokeFlowEntitlementResponse
-> Rep RevokeFlowEntitlementResponse x
Prelude.Generic)
newRevokeFlowEntitlementResponse ::
Prelude.Int ->
RevokeFlowEntitlementResponse
newRevokeFlowEntitlementResponse :: Int -> RevokeFlowEntitlementResponse
newRevokeFlowEntitlementResponse Int
pHttpStatus_ =
RevokeFlowEntitlementResponse' :: Maybe Text -> Maybe Text -> Int -> RevokeFlowEntitlementResponse
RevokeFlowEntitlementResponse'
{ $sel:entitlementArn:RevokeFlowEntitlementResponse' :: Maybe Text
entitlementArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:flowArn:RevokeFlowEntitlementResponse' :: Maybe Text
flowArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RevokeFlowEntitlementResponse' :: Int
httpStatus = Int
pHttpStatus_
}
revokeFlowEntitlementResponse_entitlementArn :: Lens.Lens' RevokeFlowEntitlementResponse (Prelude.Maybe Prelude.Text)
revokeFlowEntitlementResponse_entitlementArn :: (Maybe Text -> f (Maybe Text))
-> RevokeFlowEntitlementResponse -> f RevokeFlowEntitlementResponse
revokeFlowEntitlementResponse_entitlementArn = (RevokeFlowEntitlementResponse -> Maybe Text)
-> (RevokeFlowEntitlementResponse
-> Maybe Text -> RevokeFlowEntitlementResponse)
-> Lens
RevokeFlowEntitlementResponse
RevokeFlowEntitlementResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokeFlowEntitlementResponse' {Maybe Text
entitlementArn :: Maybe Text
$sel:entitlementArn:RevokeFlowEntitlementResponse' :: RevokeFlowEntitlementResponse -> Maybe Text
entitlementArn} -> Maybe Text
entitlementArn) (\s :: RevokeFlowEntitlementResponse
s@RevokeFlowEntitlementResponse' {} Maybe Text
a -> RevokeFlowEntitlementResponse
s {$sel:entitlementArn:RevokeFlowEntitlementResponse' :: Maybe Text
entitlementArn = Maybe Text
a} :: RevokeFlowEntitlementResponse)
revokeFlowEntitlementResponse_flowArn :: Lens.Lens' RevokeFlowEntitlementResponse (Prelude.Maybe Prelude.Text)
revokeFlowEntitlementResponse_flowArn :: (Maybe Text -> f (Maybe Text))
-> RevokeFlowEntitlementResponse -> f RevokeFlowEntitlementResponse
revokeFlowEntitlementResponse_flowArn = (RevokeFlowEntitlementResponse -> Maybe Text)
-> (RevokeFlowEntitlementResponse
-> Maybe Text -> RevokeFlowEntitlementResponse)
-> Lens
RevokeFlowEntitlementResponse
RevokeFlowEntitlementResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokeFlowEntitlementResponse' {Maybe Text
flowArn :: Maybe Text
$sel:flowArn:RevokeFlowEntitlementResponse' :: RevokeFlowEntitlementResponse -> Maybe Text
flowArn} -> Maybe Text
flowArn) (\s :: RevokeFlowEntitlementResponse
s@RevokeFlowEntitlementResponse' {} Maybe Text
a -> RevokeFlowEntitlementResponse
s {$sel:flowArn:RevokeFlowEntitlementResponse' :: Maybe Text
flowArn = Maybe Text
a} :: RevokeFlowEntitlementResponse)
revokeFlowEntitlementResponse_httpStatus :: Lens.Lens' RevokeFlowEntitlementResponse Prelude.Int
revokeFlowEntitlementResponse_httpStatus :: (Int -> f Int)
-> RevokeFlowEntitlementResponse -> f RevokeFlowEntitlementResponse
revokeFlowEntitlementResponse_httpStatus = (RevokeFlowEntitlementResponse -> Int)
-> (RevokeFlowEntitlementResponse
-> Int -> RevokeFlowEntitlementResponse)
-> Lens
RevokeFlowEntitlementResponse RevokeFlowEntitlementResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokeFlowEntitlementResponse' {Int
httpStatus :: Int
$sel:httpStatus:RevokeFlowEntitlementResponse' :: RevokeFlowEntitlementResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RevokeFlowEntitlementResponse
s@RevokeFlowEntitlementResponse' {} Int
a -> RevokeFlowEntitlementResponse
s {$sel:httpStatus:RevokeFlowEntitlementResponse' :: Int
httpStatus = Int
a} :: RevokeFlowEntitlementResponse)
instance Prelude.NFData RevokeFlowEntitlementResponse