createMediaCapturePipeline method

Future<CreateMediaCapturePipelineResponse> createMediaCapturePipeline({
  1. required String sinkArn,
  2. required MediaPipelineSinkType sinkType,
  3. required String sourceArn,
  4. required MediaPipelineSourceType sourceType,
  5. ChimeSdkMeetingConfiguration? chimeSdkMeetingConfiguration,
  6. String? clientRequestToken,
  7. String? sinkIamRoleArn,
  8. SseAwsKeyManagementParams? sseAwsKeyManagementParams,
  9. List<Tag>? tags,
})

Creates a media pipeline.

May throw BadRequestException. May throw ForbiddenException. May throw ResourceLimitExceededException. May throw ServiceFailureException. May throw ServiceUnavailableException. May throw ThrottledClientException. May throw UnauthorizedClientException.

Parameter sinkArn : The ARN of the sink type.

Parameter sinkType : Destination type to which the media artifacts are saved. You must use an S3 bucket.

Parameter sourceArn : ARN of the source from which the media artifacts are captured.

Parameter sourceType : Source type from which the media artifacts are captured. A Chime SDK Meeting is the only supported source.

Parameter chimeSdkMeetingConfiguration : The configuration for a specified media pipeline. SourceType must be ChimeSdkMeeting.

Parameter clientRequestToken : The unique identifier for the client request. The token makes the API request idempotent. Use a unique token for each media pipeline request.

Parameter sinkIamRoleArn : The Amazon Resource Name (ARN) of the sink role to be used with AwsKmsKeyId in SseAwsKeyManagementParams. Can only interact with S3Bucket sink type. The role must belong to the caller’s account and be able to act on behalf of the caller during the API call. All minimum policy permissions requirements for the caller to perform sink-related actions are the same for SinkIamRoleArn.

Additionally, the role must have permission to kms:GenerateDataKey using KMS key supplied as AwsKmsKeyId in SseAwsKeyManagementParams. If media concatenation will be required later, the role must also have permission to kms:Decrypt for the same KMS key.

Parameter sseAwsKeyManagementParams : An object that contains server side encryption parameters to be used by media capture pipeline. The parameters can also be used by media concatenation pipeline taking media capture pipeline as a media source.

Parameter tags : The tag key-value pairs.

Implementation

Future<CreateMediaCapturePipelineResponse> createMediaCapturePipeline({
  required String sinkArn,
  required MediaPipelineSinkType sinkType,
  required String sourceArn,
  required MediaPipelineSourceType sourceType,
  ChimeSdkMeetingConfiguration? chimeSdkMeetingConfiguration,
  String? clientRequestToken,
  String? sinkIamRoleArn,
  SseAwsKeyManagementParams? sseAwsKeyManagementParams,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'SinkArn': sinkArn,
    'SinkType': sinkType.value,
    'SourceArn': sourceArn,
    'SourceType': sourceType.value,
    if (chimeSdkMeetingConfiguration != null)
      'ChimeSdkMeetingConfiguration': chimeSdkMeetingConfiguration,
    'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (sinkIamRoleArn != null) 'SinkIamRoleArn': sinkIamRoleArn,
    if (sseAwsKeyManagementParams != null)
      'SseAwsKeyManagementParams': sseAwsKeyManagementParams,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/sdk-media-capture-pipelines',
    exceptionFnMap: _exceptionFns,
  );
  return CreateMediaCapturePipelineResponse.fromJson(response);
}