addApplicationCloudWatchLoggingOption method

Future<AddApplicationCloudWatchLoggingOptionResponse> addApplicationCloudWatchLoggingOption({
  1. required String applicationName,
  2. required CloudWatchLoggingOption cloudWatchLoggingOption,
  3. required int currentApplicationVersionId,
})

Adds an Amazon CloudWatch log stream to monitor application configuration errors.

May throw ResourceNotFoundException. May throw ResourceInUseException. May throw InvalidArgumentException. May throw ConcurrentModificationException. May throw InvalidRequestException. May throw InvalidApplicationConfigurationException.

Parameter applicationName : The Kinesis Data Analytics application name.

Parameter cloudWatchLoggingOption : Provides the Amazon CloudWatch log stream Amazon Resource Name (ARN).

Parameter currentApplicationVersionId : The version ID of the Kinesis Data Analytics application. You can retrieve the application version ID using DescribeApplication.

Implementation

Future<AddApplicationCloudWatchLoggingOptionResponse>
    addApplicationCloudWatchLoggingOption({
  required String applicationName,
  required CloudWatchLoggingOption cloudWatchLoggingOption,
  required int currentApplicationVersionId,
}) async {
  ArgumentError.checkNotNull(applicationName, 'applicationName');
  _s.validateStringLength(
    'applicationName',
    applicationName,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(
      cloudWatchLoggingOption, 'cloudWatchLoggingOption');
  ArgumentError.checkNotNull(
      currentApplicationVersionId, 'currentApplicationVersionId');
  _s.validateNumRange(
    'currentApplicationVersionId',
    currentApplicationVersionId,
    1,
    999999999,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'KinesisAnalytics_20180523.AddApplicationCloudWatchLoggingOption'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ApplicationName': applicationName,
      'CloudWatchLoggingOption': cloudWatchLoggingOption,
      'CurrentApplicationVersionId': currentApplicationVersionId,
    },
  );

  return AddApplicationCloudWatchLoggingOptionResponse.fromJson(
      jsonResponse.body);
}