updateAction method

Future<UpdateActionResponse> updateAction({
  1. required String actionName,
  2. String? description,
  3. Map<String, String>? properties,
  4. List<String>? propertiesToRemove,
  5. ActionStatus? status,
})

Updates an action.

May throw ConflictException. May throw ResourceNotFound.

Parameter actionName : The name of the action to update.

Parameter description : The new description for the action.

Parameter properties : The new list of properties. Overwrites the current property list.

Parameter propertiesToRemove : A list of properties to remove.

Parameter status : The new status for the action.

Implementation

Future<UpdateActionResponse> updateAction({
  required String actionName,
  String? description,
  Map<String, String>? properties,
  List<String>? propertiesToRemove,
  ActionStatus? status,
}) async {
  ArgumentError.checkNotNull(actionName, 'actionName');
  _s.validateStringLength(
    'actionName',
    actionName,
    1,
    120,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    3072,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.UpdateAction'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ActionName': actionName,
      if (description != null) 'Description': description,
      if (properties != null) 'Properties': properties,
      if (propertiesToRemove != null)
        'PropertiesToRemove': propertiesToRemove,
      if (status != null) 'Status': status.toValue(),
    },
  );

  return UpdateActionResponse.fromJson(jsonResponse.body);
}