addApplicationInputProcessingConfiguration method

Future<AddApplicationInputProcessingConfigurationResponse> addApplicationInputProcessingConfiguration({
  1. required String applicationName,
  2. required int currentApplicationVersionId,
  3. required String inputId,
  4. required InputProcessingConfiguration inputProcessingConfiguration,
})

Adds an InputProcessingConfiguration to a SQL-based Kinesis Data Analytics application. An input processor pre-processes records on the input stream before the application's SQL code executes. Currently, the only input processor available is AWS Lambda.

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

Parameter applicationName : The name of the application to which you want to add the input processing configuration.

Parameter currentApplicationVersionId : The version of the application to which you want to add the input processing configuration. You can use the DescribeApplication operation to get the current application version. If the version specified is not the current version, the ConcurrentModificationException is returned.

Parameter inputId : The ID of the input configuration to add the input processing configuration to. You can get a list of the input IDs for an application using the DescribeApplication operation.

Parameter inputProcessingConfiguration : The InputProcessingConfiguration to add to the application.

Implementation

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

  return AddApplicationInputProcessingConfigurationResponse.fromJson(
      jsonResponse.body);
}