listVodSources method

Future<ListVodSourcesResponse> listVodSources({
  1. required String sourceLocationName,
  2. int? maxResults,
  3. String? nextToken,
})

Lists the VOD sources contained in a source location. A source represents a piece of content.

Parameter sourceLocationName : The name of the source location associated with this VOD Source list.

Parameter maxResults : The maximum number of VOD sources that you want MediaTailor to return in response to the current request. If there are more than MaxResults VOD sources, use the value of NextToken in the response to get the next page of results.

The default value is 100. MediaTailor uses DynamoDB-based pagination, which means that a response might contain fewer than MaxResults items, including 0 items, even when more results are available. To retrieve all results, you must continue making requests using the NextToken value from each response until the response no longer includes a NextToken value.

Parameter nextToken : Pagination token returned by the list request when results exceed the maximum allowed. Use the token to fetch the next page of results.

For the first ListVodSources request, omit this value. For subsequent requests, get the value of NextToken from the previous response and specify that value for NextToken in the request. Continue making requests until the response no longer includes a NextToken value, which indicates that all results have been retrieved.

Implementation

Future<ListVodSourcesResponse> listVodSources({
  required String sourceLocationName,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/sourceLocation/${Uri.encodeComponent(sourceLocationName)}/vodSources',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListVodSourcesResponse.fromJson(response);
}