createAsset method
Creates a new MediaPackage VOD Asset resource.
May throw ForbiddenException.
May throw InternalServerErrorException.
May throw NotFoundException.
May throw ServiceUnavailableException.
May throw TooManyRequestsException.
May throw UnprocessableEntityException.
Parameter id :
The unique identifier for the Asset.
Parameter packagingGroupId :
The ID of the PackagingGroup for the Asset.
Parameter sourceArn :
ARN of the source object in S3.
Parameter sourceRoleArn :
The IAM role ARN used to access the source S3 bucket.
Parameter resourceId :
The resource ID to include in SPEKE key requests.
Implementation
Future<CreateAssetResponse> createAsset({
required String id,
required String packagingGroupId,
required String sourceArn,
required String sourceRoleArn,
String? resourceId,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'id': id,
'packagingGroupId': packagingGroupId,
'sourceArn': sourceArn,
'sourceRoleArn': sourceRoleArn,
if (resourceId != null) 'resourceId': resourceId,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/assets',
exceptionFnMap: _exceptionFns,
);
return CreateAssetResponse.fromJson(response);
}