listChannels method

Future<ListChannelsResponse> listChannels({
  1. String? filterByAdConfigurationArn,
  2. String? filterByName,
  3. String? filterByPlaybackRestrictionPolicyArn,
  4. String? filterByRecordingConfigurationArn,
  5. int? maxResults,
  6. String? nextToken,
})

Gets summary information about all channels in your account, in the Amazon Web Services region where the API request is processed. This list can be filtered to match a specified name or recording-configuration ARN. Filters are mutually exclusive and cannot be used together. If you try to use both filters, you will get an error (409 ConflictException).

May throw AccessDeniedException. May throw ConflictException. May throw ValidationException.

Parameter filterByAdConfigurationArn : Filters the channel list to match the specified ad configuration ARN.

Parameter filterByName : Filters the channel list to match the specified name.

Parameter filterByPlaybackRestrictionPolicyArn : Filters the channel list to match the specified policy.

Parameter filterByRecordingConfigurationArn : Filters the channel list to match the specified recording-configuration ARN.

Parameter maxResults : Maximum number of channels to return. Default: 100.

Parameter nextToken : The first channel to retrieve. This is used for pagination; see the nextToken response field.

Implementation

Future<ListChannelsResponse> listChannels({
  String? filterByAdConfigurationArn,
  String? filterByName,
  String? filterByPlaybackRestrictionPolicyArn,
  String? filterByRecordingConfigurationArn,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    if (filterByAdConfigurationArn != null)
      'filterByAdConfigurationArn': filterByAdConfigurationArn,
    if (filterByName != null) 'filterByName': filterByName,
    if (filterByPlaybackRestrictionPolicyArn != null)
      'filterByPlaybackRestrictionPolicyArn':
          filterByPlaybackRestrictionPolicyArn,
    if (filterByRecordingConfigurationArn != null)
      'filterByRecordingConfigurationArn': filterByRecordingConfigurationArn,
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/ListChannels',
    exceptionFnMap: _exceptionFns,
  );
  return ListChannelsResponse.fromJson(response);
}