getDataEndpoint method
Gets an endpoint for a specified stream for either reading or writing. Use
this endpoint in your application to read from the specified stream (using
the GetMedia
or GetMediaForFragmentList
operations) or write to it (using the PutMedia
operation).
In the request, specify the stream either by StreamName
or
StreamARN
.
May throw InvalidArgumentException. May throw ResourceNotFoundException. May throw ClientLimitExceededException. May throw NotAuthorizedException.
Parameter aPIName
:
The name of the API action for which to get an endpoint.
Parameter streamARN
:
The Amazon Resource Name (ARN) of the stream that you want to get the
endpoint for. You must specify either this parameter or a
StreamName
in the request.
Parameter streamName
:
The name of the stream that you want to get the endpoint for. You must
specify either this parameter or a StreamARN
in the request.
Implementation
Future<GetDataEndpointOutput> getDataEndpoint({
required APIName aPIName,
String? streamARN,
String? streamName,
}) async {
ArgumentError.checkNotNull(aPIName, 'aPIName');
_s.validateStringLength(
'streamARN',
streamARN,
1,
1024,
);
_s.validateStringLength(
'streamName',
streamName,
1,
256,
);
final $payload = <String, dynamic>{
'APIName': aPIName.toValue(),
if (streamARN != null) 'StreamARN': streamARN,
if (streamName != null) 'StreamName': streamName,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/getDataEndpoint',
exceptionFnMap: _exceptionFns,
);
return GetDataEndpointOutput.fromJson(response);
}