createStreamKey method
Creates a stream key, used to initiate a stream, for the specified channel ARN.
Note that CreateChannel creates a stream key. If you subsequently use CreateStreamKey on the same channel, it will fail because a stream key already exists and there is a limit of 1 stream key per channel. To reset the stream key on a channel, use DeleteStreamKey and then CreateStreamKey.
May throw AccessDeniedException.
May throw PendingVerification.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ValidationException.
Parameter channelArn :
ARN of the channel for which to create the stream key.
Parameter tags :
Array of 1-50 maps, each of the form string:string
(key:value). See Best
practices and strategies in Tagging Amazon Web Services Resources
and Tag Editor for details, including restrictions that apply to tags
and "Tag naming limits and requirements"; Amazon IVS has no
service-specific constraints beyond what is documented there.
Implementation
Future<CreateStreamKeyResponse> createStreamKey({
required String channelArn,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'channelArn': channelArn,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/CreateStreamKey',
exceptionFnMap: _exceptionFns,
);
return CreateStreamKeyResponse.fromJson(response);
}