{-# 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.CreateFlow
(
CreateFlow (..),
newCreateFlow,
createFlow_mediaStreams,
createFlow_sourceFailoverConfig,
createFlow_vpcInterfaces,
createFlow_sources,
createFlow_outputs,
createFlow_availabilityZone,
createFlow_entitlements,
createFlow_source,
createFlow_name,
CreateFlowResponse (..),
newCreateFlowResponse,
createFlowResponse_flow,
createFlowResponse_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 CreateFlow = CreateFlow'
{
CreateFlow -> Maybe [AddMediaStreamRequest]
mediaStreams :: Prelude.Maybe [AddMediaStreamRequest],
CreateFlow -> Maybe FailoverConfig
sourceFailoverConfig :: Prelude.Maybe FailoverConfig,
CreateFlow -> Maybe [VpcInterfaceRequest]
vpcInterfaces :: Prelude.Maybe [VpcInterfaceRequest],
CreateFlow -> Maybe [SetSourceRequest]
sources :: Prelude.Maybe [SetSourceRequest],
CreateFlow -> Maybe [AddOutputRequest]
outputs :: Prelude.Maybe [AddOutputRequest],
CreateFlow -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
CreateFlow -> Maybe [GrantEntitlementRequest]
entitlements :: Prelude.Maybe [GrantEntitlementRequest],
CreateFlow -> Maybe SetSourceRequest
source :: Prelude.Maybe SetSourceRequest,
CreateFlow -> Text
name :: Prelude.Text
}
deriving (CreateFlow -> CreateFlow -> Bool
(CreateFlow -> CreateFlow -> Bool)
-> (CreateFlow -> CreateFlow -> Bool) -> Eq CreateFlow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFlow -> CreateFlow -> Bool
$c/= :: CreateFlow -> CreateFlow -> Bool
== :: CreateFlow -> CreateFlow -> Bool
$c== :: CreateFlow -> CreateFlow -> Bool
Prelude.Eq, ReadPrec [CreateFlow]
ReadPrec CreateFlow
Int -> ReadS CreateFlow
ReadS [CreateFlow]
(Int -> ReadS CreateFlow)
-> ReadS [CreateFlow]
-> ReadPrec CreateFlow
-> ReadPrec [CreateFlow]
-> Read CreateFlow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFlow]
$creadListPrec :: ReadPrec [CreateFlow]
readPrec :: ReadPrec CreateFlow
$creadPrec :: ReadPrec CreateFlow
readList :: ReadS [CreateFlow]
$creadList :: ReadS [CreateFlow]
readsPrec :: Int -> ReadS CreateFlow
$creadsPrec :: Int -> ReadS CreateFlow
Prelude.Read, Int -> CreateFlow -> ShowS
[CreateFlow] -> ShowS
CreateFlow -> String
(Int -> CreateFlow -> ShowS)
-> (CreateFlow -> String)
-> ([CreateFlow] -> ShowS)
-> Show CreateFlow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFlow] -> ShowS
$cshowList :: [CreateFlow] -> ShowS
show :: CreateFlow -> String
$cshow :: CreateFlow -> String
showsPrec :: Int -> CreateFlow -> ShowS
$cshowsPrec :: Int -> CreateFlow -> ShowS
Prelude.Show, (forall x. CreateFlow -> Rep CreateFlow x)
-> (forall x. Rep CreateFlow x -> CreateFlow) -> Generic CreateFlow
forall x. Rep CreateFlow x -> CreateFlow
forall x. CreateFlow -> Rep CreateFlow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateFlow x -> CreateFlow
$cfrom :: forall x. CreateFlow -> Rep CreateFlow x
Prelude.Generic)
newCreateFlow ::
Prelude.Text ->
CreateFlow
newCreateFlow :: Text -> CreateFlow
newCreateFlow Text
pName_ =
CreateFlow' :: Maybe [AddMediaStreamRequest]
-> Maybe FailoverConfig
-> Maybe [VpcInterfaceRequest]
-> Maybe [SetSourceRequest]
-> Maybe [AddOutputRequest]
-> Maybe Text
-> Maybe [GrantEntitlementRequest]
-> Maybe SetSourceRequest
-> Text
-> CreateFlow
CreateFlow'
{ $sel:mediaStreams:CreateFlow' :: Maybe [AddMediaStreamRequest]
mediaStreams = Maybe [AddMediaStreamRequest]
forall a. Maybe a
Prelude.Nothing,
$sel:sourceFailoverConfig:CreateFlow' :: Maybe FailoverConfig
sourceFailoverConfig = Maybe FailoverConfig
forall a. Maybe a
Prelude.Nothing,
$sel:vpcInterfaces:CreateFlow' :: Maybe [VpcInterfaceRequest]
vpcInterfaces = Maybe [VpcInterfaceRequest]
forall a. Maybe a
Prelude.Nothing,
$sel:sources:CreateFlow' :: Maybe [SetSourceRequest]
sources = Maybe [SetSourceRequest]
forall a. Maybe a
Prelude.Nothing,
$sel:outputs:CreateFlow' :: Maybe [AddOutputRequest]
outputs = Maybe [AddOutputRequest]
forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZone:CreateFlow' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:entitlements:CreateFlow' :: Maybe [GrantEntitlementRequest]
entitlements = Maybe [GrantEntitlementRequest]
forall a. Maybe a
Prelude.Nothing,
$sel:source:CreateFlow' :: Maybe SetSourceRequest
source = Maybe SetSourceRequest
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateFlow' :: Text
name = Text
pName_
}
createFlow_mediaStreams :: Lens.Lens' CreateFlow (Prelude.Maybe [AddMediaStreamRequest])
createFlow_mediaStreams :: (Maybe [AddMediaStreamRequest]
-> f (Maybe [AddMediaStreamRequest]))
-> CreateFlow -> f CreateFlow
createFlow_mediaStreams = (CreateFlow -> Maybe [AddMediaStreamRequest])
-> (CreateFlow -> Maybe [AddMediaStreamRequest] -> CreateFlow)
-> Lens
CreateFlow
CreateFlow
(Maybe [AddMediaStreamRequest])
(Maybe [AddMediaStreamRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFlow' {Maybe [AddMediaStreamRequest]
mediaStreams :: Maybe [AddMediaStreamRequest]
$sel:mediaStreams:CreateFlow' :: CreateFlow -> Maybe [AddMediaStreamRequest]
mediaStreams} -> Maybe [AddMediaStreamRequest]
mediaStreams) (\s :: CreateFlow
s@CreateFlow' {} Maybe [AddMediaStreamRequest]
a -> CreateFlow
s {$sel:mediaStreams:CreateFlow' :: Maybe [AddMediaStreamRequest]
mediaStreams = Maybe [AddMediaStreamRequest]
a} :: CreateFlow) ((Maybe [AddMediaStreamRequest]
-> f (Maybe [AddMediaStreamRequest]))
-> CreateFlow -> f CreateFlow)
-> ((Maybe [AddMediaStreamRequest]
-> f (Maybe [AddMediaStreamRequest]))
-> Maybe [AddMediaStreamRequest]
-> f (Maybe [AddMediaStreamRequest]))
-> (Maybe [AddMediaStreamRequest]
-> f (Maybe [AddMediaStreamRequest]))
-> CreateFlow
-> f CreateFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AddMediaStreamRequest]
[AddMediaStreamRequest]
[AddMediaStreamRequest]
[AddMediaStreamRequest]
-> Iso
(Maybe [AddMediaStreamRequest])
(Maybe [AddMediaStreamRequest])
(Maybe [AddMediaStreamRequest])
(Maybe [AddMediaStreamRequest])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[AddMediaStreamRequest]
[AddMediaStreamRequest]
[AddMediaStreamRequest]
[AddMediaStreamRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createFlow_sourceFailoverConfig :: Lens.Lens' CreateFlow (Prelude.Maybe FailoverConfig)
createFlow_sourceFailoverConfig :: (Maybe FailoverConfig -> f (Maybe FailoverConfig))
-> CreateFlow -> f CreateFlow
createFlow_sourceFailoverConfig = (CreateFlow -> Maybe FailoverConfig)
-> (CreateFlow -> Maybe FailoverConfig -> CreateFlow)
-> Lens
CreateFlow CreateFlow (Maybe FailoverConfig) (Maybe FailoverConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFlow' {Maybe FailoverConfig
sourceFailoverConfig :: Maybe FailoverConfig
$sel:sourceFailoverConfig:CreateFlow' :: CreateFlow -> Maybe FailoverConfig
sourceFailoverConfig} -> Maybe FailoverConfig
sourceFailoverConfig) (\s :: CreateFlow
s@CreateFlow' {} Maybe FailoverConfig
a -> CreateFlow
s {$sel:sourceFailoverConfig:CreateFlow' :: Maybe FailoverConfig
sourceFailoverConfig = Maybe FailoverConfig
a} :: CreateFlow)
createFlow_vpcInterfaces :: Lens.Lens' CreateFlow (Prelude.Maybe [VpcInterfaceRequest])
createFlow_vpcInterfaces :: (Maybe [VpcInterfaceRequest] -> f (Maybe [VpcInterfaceRequest]))
-> CreateFlow -> f CreateFlow
createFlow_vpcInterfaces = (CreateFlow -> Maybe [VpcInterfaceRequest])
-> (CreateFlow -> Maybe [VpcInterfaceRequest] -> CreateFlow)
-> Lens
CreateFlow
CreateFlow
(Maybe [VpcInterfaceRequest])
(Maybe [VpcInterfaceRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFlow' {Maybe [VpcInterfaceRequest]
vpcInterfaces :: Maybe [VpcInterfaceRequest]
$sel:vpcInterfaces:CreateFlow' :: CreateFlow -> Maybe [VpcInterfaceRequest]
vpcInterfaces} -> Maybe [VpcInterfaceRequest]
vpcInterfaces) (\s :: CreateFlow
s@CreateFlow' {} Maybe [VpcInterfaceRequest]
a -> CreateFlow
s {$sel:vpcInterfaces:CreateFlow' :: Maybe [VpcInterfaceRequest]
vpcInterfaces = Maybe [VpcInterfaceRequest]
a} :: CreateFlow) ((Maybe [VpcInterfaceRequest] -> f (Maybe [VpcInterfaceRequest]))
-> CreateFlow -> f CreateFlow)
-> ((Maybe [VpcInterfaceRequest]
-> f (Maybe [VpcInterfaceRequest]))
-> Maybe [VpcInterfaceRequest] -> f (Maybe [VpcInterfaceRequest]))
-> (Maybe [VpcInterfaceRequest] -> f (Maybe [VpcInterfaceRequest]))
-> CreateFlow
-> f CreateFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[VpcInterfaceRequest]
[VpcInterfaceRequest]
[VpcInterfaceRequest]
[VpcInterfaceRequest]
-> Iso
(Maybe [VpcInterfaceRequest])
(Maybe [VpcInterfaceRequest])
(Maybe [VpcInterfaceRequest])
(Maybe [VpcInterfaceRequest])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[VpcInterfaceRequest]
[VpcInterfaceRequest]
[VpcInterfaceRequest]
[VpcInterfaceRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createFlow_sources :: Lens.Lens' CreateFlow (Prelude.Maybe [SetSourceRequest])
createFlow_sources :: (Maybe [SetSourceRequest] -> f (Maybe [SetSourceRequest]))
-> CreateFlow -> f CreateFlow
createFlow_sources = (CreateFlow -> Maybe [SetSourceRequest])
-> (CreateFlow -> Maybe [SetSourceRequest] -> CreateFlow)
-> Lens
CreateFlow
CreateFlow
(Maybe [SetSourceRequest])
(Maybe [SetSourceRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFlow' {Maybe [SetSourceRequest]
sources :: Maybe [SetSourceRequest]
$sel:sources:CreateFlow' :: CreateFlow -> Maybe [SetSourceRequest]
sources} -> Maybe [SetSourceRequest]
sources) (\s :: CreateFlow
s@CreateFlow' {} Maybe [SetSourceRequest]
a -> CreateFlow
s {$sel:sources:CreateFlow' :: Maybe [SetSourceRequest]
sources = Maybe [SetSourceRequest]
a} :: CreateFlow) ((Maybe [SetSourceRequest] -> f (Maybe [SetSourceRequest]))
-> CreateFlow -> f CreateFlow)
-> ((Maybe [SetSourceRequest] -> f (Maybe [SetSourceRequest]))
-> Maybe [SetSourceRequest] -> f (Maybe [SetSourceRequest]))
-> (Maybe [SetSourceRequest] -> f (Maybe [SetSourceRequest]))
-> CreateFlow
-> f CreateFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[SetSourceRequest]
[SetSourceRequest]
[SetSourceRequest]
[SetSourceRequest]
-> Iso
(Maybe [SetSourceRequest])
(Maybe [SetSourceRequest])
(Maybe [SetSourceRequest])
(Maybe [SetSourceRequest])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[SetSourceRequest]
[SetSourceRequest]
[SetSourceRequest]
[SetSourceRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createFlow_outputs :: Lens.Lens' CreateFlow (Prelude.Maybe [AddOutputRequest])
createFlow_outputs :: (Maybe [AddOutputRequest] -> f (Maybe [AddOutputRequest]))
-> CreateFlow -> f CreateFlow
createFlow_outputs = (CreateFlow -> Maybe [AddOutputRequest])
-> (CreateFlow -> Maybe [AddOutputRequest] -> CreateFlow)
-> Lens
CreateFlow
CreateFlow
(Maybe [AddOutputRequest])
(Maybe [AddOutputRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFlow' {Maybe [AddOutputRequest]
outputs :: Maybe [AddOutputRequest]
$sel:outputs:CreateFlow' :: CreateFlow -> Maybe [AddOutputRequest]
outputs} -> Maybe [AddOutputRequest]
outputs) (\s :: CreateFlow
s@CreateFlow' {} Maybe [AddOutputRequest]
a -> CreateFlow
s {$sel:outputs:CreateFlow' :: Maybe [AddOutputRequest]
outputs = Maybe [AddOutputRequest]
a} :: CreateFlow) ((Maybe [AddOutputRequest] -> f (Maybe [AddOutputRequest]))
-> CreateFlow -> f CreateFlow)
-> ((Maybe [AddOutputRequest] -> f (Maybe [AddOutputRequest]))
-> Maybe [AddOutputRequest] -> f (Maybe [AddOutputRequest]))
-> (Maybe [AddOutputRequest] -> f (Maybe [AddOutputRequest]))
-> CreateFlow
-> f CreateFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AddOutputRequest]
[AddOutputRequest]
[AddOutputRequest]
[AddOutputRequest]
-> Iso
(Maybe [AddOutputRequest])
(Maybe [AddOutputRequest])
(Maybe [AddOutputRequest])
(Maybe [AddOutputRequest])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[AddOutputRequest]
[AddOutputRequest]
[AddOutputRequest]
[AddOutputRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createFlow_availabilityZone :: Lens.Lens' CreateFlow (Prelude.Maybe Prelude.Text)
createFlow_availabilityZone :: (Maybe Text -> f (Maybe Text)) -> CreateFlow -> f CreateFlow
createFlow_availabilityZone = (CreateFlow -> Maybe Text)
-> (CreateFlow -> Maybe Text -> CreateFlow)
-> Lens CreateFlow CreateFlow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFlow' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:CreateFlow' :: CreateFlow -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: CreateFlow
s@CreateFlow' {} Maybe Text
a -> CreateFlow
s {$sel:availabilityZone:CreateFlow' :: Maybe Text
availabilityZone = Maybe Text
a} :: CreateFlow)
createFlow_entitlements :: Lens.Lens' CreateFlow (Prelude.Maybe [GrantEntitlementRequest])
createFlow_entitlements :: (Maybe [GrantEntitlementRequest]
-> f (Maybe [GrantEntitlementRequest]))
-> CreateFlow -> f CreateFlow
createFlow_entitlements = (CreateFlow -> Maybe [GrantEntitlementRequest])
-> (CreateFlow -> Maybe [GrantEntitlementRequest] -> CreateFlow)
-> Lens
CreateFlow
CreateFlow
(Maybe [GrantEntitlementRequest])
(Maybe [GrantEntitlementRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFlow' {Maybe [GrantEntitlementRequest]
entitlements :: Maybe [GrantEntitlementRequest]
$sel:entitlements:CreateFlow' :: CreateFlow -> Maybe [GrantEntitlementRequest]
entitlements} -> Maybe [GrantEntitlementRequest]
entitlements) (\s :: CreateFlow
s@CreateFlow' {} Maybe [GrantEntitlementRequest]
a -> CreateFlow
s {$sel:entitlements:CreateFlow' :: Maybe [GrantEntitlementRequest]
entitlements = Maybe [GrantEntitlementRequest]
a} :: CreateFlow) ((Maybe [GrantEntitlementRequest]
-> f (Maybe [GrantEntitlementRequest]))
-> CreateFlow -> f CreateFlow)
-> ((Maybe [GrantEntitlementRequest]
-> f (Maybe [GrantEntitlementRequest]))
-> Maybe [GrantEntitlementRequest]
-> f (Maybe [GrantEntitlementRequest]))
-> (Maybe [GrantEntitlementRequest]
-> f (Maybe [GrantEntitlementRequest]))
-> CreateFlow
-> f CreateFlow
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[GrantEntitlementRequest]
[GrantEntitlementRequest]
[GrantEntitlementRequest]
[GrantEntitlementRequest]
-> Iso
(Maybe [GrantEntitlementRequest])
(Maybe [GrantEntitlementRequest])
(Maybe [GrantEntitlementRequest])
(Maybe [GrantEntitlementRequest])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[GrantEntitlementRequest]
[GrantEntitlementRequest]
[GrantEntitlementRequest]
[GrantEntitlementRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createFlow_source :: Lens.Lens' CreateFlow (Prelude.Maybe SetSourceRequest)
createFlow_source :: (Maybe SetSourceRequest -> f (Maybe SetSourceRequest))
-> CreateFlow -> f CreateFlow
createFlow_source = (CreateFlow -> Maybe SetSourceRequest)
-> (CreateFlow -> Maybe SetSourceRequest -> CreateFlow)
-> Lens
CreateFlow
CreateFlow
(Maybe SetSourceRequest)
(Maybe SetSourceRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFlow' {Maybe SetSourceRequest
source :: Maybe SetSourceRequest
$sel:source:CreateFlow' :: CreateFlow -> Maybe SetSourceRequest
source} -> Maybe SetSourceRequest
source) (\s :: CreateFlow
s@CreateFlow' {} Maybe SetSourceRequest
a -> CreateFlow
s {$sel:source:CreateFlow' :: Maybe SetSourceRequest
source = Maybe SetSourceRequest
a} :: CreateFlow)
createFlow_name :: Lens.Lens' CreateFlow Prelude.Text
createFlow_name :: (Text -> f Text) -> CreateFlow -> f CreateFlow
createFlow_name = (CreateFlow -> Text)
-> (CreateFlow -> Text -> CreateFlow)
-> Lens CreateFlow CreateFlow Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFlow' {Text
name :: Text
$sel:name:CreateFlow' :: CreateFlow -> Text
name} -> Text
name) (\s :: CreateFlow
s@CreateFlow' {} Text
a -> CreateFlow
s {$sel:name:CreateFlow' :: Text
name = Text
a} :: CreateFlow)
instance Core.AWSRequest CreateFlow where
type AWSResponse CreateFlow = CreateFlowResponse
request :: CreateFlow -> Request CreateFlow
request = Service -> CreateFlow -> Request CreateFlow
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateFlow
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateFlow)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateFlow))
-> Logger
-> Service
-> Proxy CreateFlow
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateFlow)))
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 Flow -> Int -> CreateFlowResponse
CreateFlowResponse'
(Maybe Flow -> Int -> CreateFlowResponse)
-> Either String (Maybe Flow)
-> Either String (Int -> CreateFlowResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Flow)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"flow")
Either String (Int -> CreateFlowResponse)
-> Either String Int -> Either String CreateFlowResponse
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 CreateFlow
instance Prelude.NFData CreateFlow
instance Core.ToHeaders CreateFlow where
toHeaders :: CreateFlow -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateFlow -> 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.ToJSON CreateFlow where
toJSON :: CreateFlow -> Value
toJSON CreateFlow' {Maybe [GrantEntitlementRequest]
Maybe [SetSourceRequest]
Maybe [AddMediaStreamRequest]
Maybe [AddOutputRequest]
Maybe [VpcInterfaceRequest]
Maybe Text
Maybe SetSourceRequest
Maybe FailoverConfig
Text
name :: Text
source :: Maybe SetSourceRequest
entitlements :: Maybe [GrantEntitlementRequest]
availabilityZone :: Maybe Text
outputs :: Maybe [AddOutputRequest]
sources :: Maybe [SetSourceRequest]
vpcInterfaces :: Maybe [VpcInterfaceRequest]
sourceFailoverConfig :: Maybe FailoverConfig
mediaStreams :: Maybe [AddMediaStreamRequest]
$sel:name:CreateFlow' :: CreateFlow -> Text
$sel:source:CreateFlow' :: CreateFlow -> Maybe SetSourceRequest
$sel:entitlements:CreateFlow' :: CreateFlow -> Maybe [GrantEntitlementRequest]
$sel:availabilityZone:CreateFlow' :: CreateFlow -> Maybe Text
$sel:outputs:CreateFlow' :: CreateFlow -> Maybe [AddOutputRequest]
$sel:sources:CreateFlow' :: CreateFlow -> Maybe [SetSourceRequest]
$sel:vpcInterfaces:CreateFlow' :: CreateFlow -> Maybe [VpcInterfaceRequest]
$sel:sourceFailoverConfig:CreateFlow' :: CreateFlow -> Maybe FailoverConfig
$sel:mediaStreams:CreateFlow' :: CreateFlow -> Maybe [AddMediaStreamRequest]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"mediaStreams" Text -> [AddMediaStreamRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([AddMediaStreamRequest] -> Pair)
-> Maybe [AddMediaStreamRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AddMediaStreamRequest]
mediaStreams,
(Text
"sourceFailoverConfig" Text -> FailoverConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(FailoverConfig -> Pair) -> Maybe FailoverConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FailoverConfig
sourceFailoverConfig,
(Text
"vpcInterfaces" Text -> [VpcInterfaceRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([VpcInterfaceRequest] -> Pair)
-> Maybe [VpcInterfaceRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [VpcInterfaceRequest]
vpcInterfaces,
(Text
"sources" Text -> [SetSourceRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([SetSourceRequest] -> Pair)
-> Maybe [SetSourceRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SetSourceRequest]
sources,
(Text
"outputs" Text -> [AddOutputRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([AddOutputRequest] -> Pair)
-> Maybe [AddOutputRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AddOutputRequest]
outputs,
(Text
"availabilityZone" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
availabilityZone,
(Text
"entitlements" Text -> [GrantEntitlementRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([GrantEntitlementRequest] -> Pair)
-> Maybe [GrantEntitlementRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [GrantEntitlementRequest]
entitlements,
(Text
"source" Text -> SetSourceRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SetSourceRequest -> Pair) -> Maybe SetSourceRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SetSourceRequest
source,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
]
)
instance Core.ToPath CreateFlow where
toPath :: CreateFlow -> ByteString
toPath = ByteString -> CreateFlow -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/flows"
instance Core.ToQuery CreateFlow where
toQuery :: CreateFlow -> QueryString
toQuery = QueryString -> CreateFlow -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateFlowResponse = CreateFlowResponse'
{ CreateFlowResponse -> Maybe Flow
flow :: Prelude.Maybe Flow,
CreateFlowResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateFlowResponse -> CreateFlowResponse -> Bool
(CreateFlowResponse -> CreateFlowResponse -> Bool)
-> (CreateFlowResponse -> CreateFlowResponse -> Bool)
-> Eq CreateFlowResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFlowResponse -> CreateFlowResponse -> Bool
$c/= :: CreateFlowResponse -> CreateFlowResponse -> Bool
== :: CreateFlowResponse -> CreateFlowResponse -> Bool
$c== :: CreateFlowResponse -> CreateFlowResponse -> Bool
Prelude.Eq, ReadPrec [CreateFlowResponse]
ReadPrec CreateFlowResponse
Int -> ReadS CreateFlowResponse
ReadS [CreateFlowResponse]
(Int -> ReadS CreateFlowResponse)
-> ReadS [CreateFlowResponse]
-> ReadPrec CreateFlowResponse
-> ReadPrec [CreateFlowResponse]
-> Read CreateFlowResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFlowResponse]
$creadListPrec :: ReadPrec [CreateFlowResponse]
readPrec :: ReadPrec CreateFlowResponse
$creadPrec :: ReadPrec CreateFlowResponse
readList :: ReadS [CreateFlowResponse]
$creadList :: ReadS [CreateFlowResponse]
readsPrec :: Int -> ReadS CreateFlowResponse
$creadsPrec :: Int -> ReadS CreateFlowResponse
Prelude.Read, Int -> CreateFlowResponse -> ShowS
[CreateFlowResponse] -> ShowS
CreateFlowResponse -> String
(Int -> CreateFlowResponse -> ShowS)
-> (CreateFlowResponse -> String)
-> ([CreateFlowResponse] -> ShowS)
-> Show CreateFlowResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFlowResponse] -> ShowS
$cshowList :: [CreateFlowResponse] -> ShowS
show :: CreateFlowResponse -> String
$cshow :: CreateFlowResponse -> String
showsPrec :: Int -> CreateFlowResponse -> ShowS
$cshowsPrec :: Int -> CreateFlowResponse -> ShowS
Prelude.Show, (forall x. CreateFlowResponse -> Rep CreateFlowResponse x)
-> (forall x. Rep CreateFlowResponse x -> CreateFlowResponse)
-> Generic CreateFlowResponse
forall x. Rep CreateFlowResponse x -> CreateFlowResponse
forall x. CreateFlowResponse -> Rep CreateFlowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateFlowResponse x -> CreateFlowResponse
$cfrom :: forall x. CreateFlowResponse -> Rep CreateFlowResponse x
Prelude.Generic)
newCreateFlowResponse ::
Prelude.Int ->
CreateFlowResponse
newCreateFlowResponse :: Int -> CreateFlowResponse
newCreateFlowResponse Int
pHttpStatus_ =
CreateFlowResponse' :: Maybe Flow -> Int -> CreateFlowResponse
CreateFlowResponse'
{ $sel:flow:CreateFlowResponse' :: Maybe Flow
flow = Maybe Flow
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateFlowResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createFlowResponse_flow :: Lens.Lens' CreateFlowResponse (Prelude.Maybe Flow)
createFlowResponse_flow :: (Maybe Flow -> f (Maybe Flow))
-> CreateFlowResponse -> f CreateFlowResponse
createFlowResponse_flow = (CreateFlowResponse -> Maybe Flow)
-> (CreateFlowResponse -> Maybe Flow -> CreateFlowResponse)
-> Lens
CreateFlowResponse CreateFlowResponse (Maybe Flow) (Maybe Flow)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFlowResponse' {Maybe Flow
flow :: Maybe Flow
$sel:flow:CreateFlowResponse' :: CreateFlowResponse -> Maybe Flow
flow} -> Maybe Flow
flow) (\s :: CreateFlowResponse
s@CreateFlowResponse' {} Maybe Flow
a -> CreateFlowResponse
s {$sel:flow:CreateFlowResponse' :: Maybe Flow
flow = Maybe Flow
a} :: CreateFlowResponse)
createFlowResponse_httpStatus :: Lens.Lens' CreateFlowResponse Prelude.Int
createFlowResponse_httpStatus :: (Int -> f Int) -> CreateFlowResponse -> f CreateFlowResponse
createFlowResponse_httpStatus = (CreateFlowResponse -> Int)
-> (CreateFlowResponse -> Int -> CreateFlowResponse)
-> Lens CreateFlowResponse CreateFlowResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFlowResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateFlowResponse' :: CreateFlowResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateFlowResponse
s@CreateFlowResponse' {} Int
a -> CreateFlowResponse
s {$sel:httpStatus:CreateFlowResponse' :: Int
httpStatus = Int
a} :: CreateFlowResponse)
instance Prelude.NFData CreateFlowResponse