updateLookupTable method

Future<UpdateLookupTableResponse> updateLookupTable({
  1. required String lookupTableArn,
  2. required String tableBody,
  3. String? description,
  4. String? kmsKeyId,
})

Updates an existing lookup table by replacing all of its CSV content. After the update completes, queries that use this table will use the new data.

This is a full replacement operation. All existing content is replaced with the new CSV data.

May throw AccessDeniedException. May throw InvalidParameterException. May throw ResourceNotFoundException. May throw ServiceUnavailableException. May throw ValidationException.

Parameter lookupTableArn : The ARN of the lookup table to update.

Parameter tableBody : The new CSV content to replace the existing data. The first row must be a header row with column names. The content must use UTF-8 encoding and not exceed 10 MB.

Parameter description : An updated description of the lookup table.

Parameter kmsKeyId : The ARN of the KMS key to use to encrypt the lookup table data. You can use this parameter to add, update, or remove the KMS key. To remove the KMS key and use an Amazon Web Services-owned key instead, specify an empty string.

Implementation

Future<UpdateLookupTableResponse> updateLookupTable({
  required String lookupTableArn,
  required String tableBody,
  String? description,
  String? kmsKeyId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Logs_20140328.UpdateLookupTable'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'lookupTableArn': lookupTableArn,
      'tableBody': tableBody,
      if (description != null) 'description': description,
      if (kmsKeyId != null) 'kmsKeyId': kmsKeyId,
    },
  );

  return UpdateLookupTableResponse.fromJson(jsonResponse.body);
}