updateAdapter method

Future<UpdateAdapterResponse> updateAdapter({
  1. required String adapterId,
  2. String? adapterName,
  3. AutoUpdate? autoUpdate,
  4. String? description,
})

Update the configuration for an adapter. FeatureTypes configurations cannot be updated. At least one new parameter must be specified as an argument.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerError. May throw InvalidParameterException. May throw ProvisionedThroughputExceededException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter adapterId : A string containing a unique ID for the adapter that will be updated.

Parameter adapterName : The new name to be applied to the adapter.

Parameter autoUpdate : The new auto-update status to be applied to the adapter.

Parameter description : The new description to be applied to the adapter.

Implementation

Future<UpdateAdapterResponse> updateAdapter({
  required String adapterId,
  String? adapterName,
  AutoUpdate? autoUpdate,
  String? description,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Textract.UpdateAdapter'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AdapterId': adapterId,
      if (adapterName != null) 'AdapterName': adapterName,
      if (autoUpdate != null) 'AutoUpdate': autoUpdate.value,
      if (description != null) 'Description': description,
    },
  );

  return UpdateAdapterResponse.fromJson(jsonResponse.body);
}