createFlow method

Future<CreateFlowResponse> createFlow({
  1. required String name,
  2. String? availabilityZone,
  3. EncodingConfig? encodingConfig,
  4. List<GrantEntitlementRequest>? entitlements,
  5. FlowSize? flowSize,
  6. Map<String, String>? flowTags,
  7. AddMaintenance? maintenance,
  8. List<AddMediaStreamRequest>? mediaStreams,
  9. NdiConfig? ndiConfig,
  10. List<AddOutputRequest>? outputs,
  11. SetSourceRequest? source,
  12. FailoverConfig? sourceFailoverConfig,
  13. MonitoringConfig? sourceMonitoringConfig,
  14. List<SetSourceRequest>? sources,
  15. List<VpcInterfaceRequest>? vpcInterfaces,
})

Creates a new flow. The request must include one source. The request optionally can include outputs (up to 50) and entitlements (up to 50).

May throw BadRequestException. May throw CreateFlow420Exception. May throw ForbiddenException. May throw InternalServerErrorException. May throw ServiceUnavailableException. May throw TooManyRequestsException.

Parameter name : The name of the flow.

Parameter availabilityZone : The Availability Zone that you want to create the flow in. These options are limited to the Availability Zones within the current Amazon Web Services Region.

Parameter entitlements : The entitlements that you want to grant on a flow.

Parameter flowSize : Determines the processing capacity and feature set of the flow. Set this optional parameter to LARGE if you want to enable NDI sources or outputs on the flow.

Parameter flowTags : The key-value pairs that can be used to tag and organize the flow.

Parameter maintenance : The maintenance settings you want to use for the flow.

Parameter mediaStreams : The media streams that you want to add to the flow. You can associate these media streams with sources and outputs on the flow.

Parameter ndiConfig : Specifies the configuration settings for a flow's NDI source or output. Required when the flow includes an NDI source or output.

Parameter outputs : The outputs that you want to add to this flow.

Parameter source : The settings for the source that you want to use for the new flow.

Parameter sourceFailoverConfig : The settings for source failover.

Parameter sourceMonitoringConfig : The settings for source monitoring.

Parameter sources : The sources that are assigned to the flow.

Parameter vpcInterfaces : The VPC interfaces you want on the flow.

Implementation

Future<CreateFlowResponse> createFlow({
  required String name,
  String? availabilityZone,
  EncodingConfig? encodingConfig,
  List<GrantEntitlementRequest>? entitlements,
  FlowSize? flowSize,
  Map<String, String>? flowTags,
  AddMaintenance? maintenance,
  List<AddMediaStreamRequest>? mediaStreams,
  NdiConfig? ndiConfig,
  List<AddOutputRequest>? outputs,
  SetSourceRequest? source,
  FailoverConfig? sourceFailoverConfig,
  MonitoringConfig? sourceMonitoringConfig,
  List<SetSourceRequest>? sources,
  List<VpcInterfaceRequest>? vpcInterfaces,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    if (availabilityZone != null) 'availabilityZone': availabilityZone,
    if (encodingConfig != null) 'encodingConfig': encodingConfig,
    if (entitlements != null) 'entitlements': entitlements,
    if (flowSize != null) 'flowSize': flowSize.value,
    if (flowTags != null) 'flowTags': flowTags,
    if (maintenance != null) 'maintenance': maintenance,
    if (mediaStreams != null) 'mediaStreams': mediaStreams,
    if (ndiConfig != null) 'ndiConfig': ndiConfig,
    if (outputs != null) 'outputs': outputs,
    if (source != null) 'source': source,
    if (sourceFailoverConfig != null)
      'sourceFailoverConfig': sourceFailoverConfig,
    if (sourceMonitoringConfig != null)
      'sourceMonitoringConfig': sourceMonitoringConfig,
    if (sources != null) 'sources': sources,
    if (vpcInterfaces != null) 'vpcInterfaces': vpcInterfaces,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/flows',
    exceptionFnMap: _exceptionFns,
  );
  return CreateFlowResponse.fromJson(response);
}