notifyApplicationState method

Future<void> notifyApplicationState({
  1. required String applicationId,
  2. required ApplicationStatus status,
  3. bool? dryRun,
  4. DateTime? updateDateTime,
})

Sets the migration state of an application. For a given application identified by the value passed to ApplicationId, its status is set or updated by passing one of three values to Status: NOT_STARTED | IN_PROGRESS | COMPLETED.

May throw AccessDeniedException. May throw ThrottlingException. May throw InternalServerError. May throw ServiceUnavailableException. May throw DryRunOperation. May throw UnauthorizedOperation. May throw InvalidInputException. May throw PolicyErrorException. May throw ResourceNotFoundException. May throw HomeRegionNotSetException.

Parameter applicationId : The configurationId in Application Discovery Service that uniquely identifies the grouped application.

Parameter status : Status of the application - Not Started, In-Progress, Complete.

Parameter dryRun : Optional boolean flag to indicate whether any effect should take place. Used to test if the caller has permission to make the call.

Parameter updateDateTime : The timestamp when the application state changed.

Implementation

Future<void> notifyApplicationState({
  required String applicationId,
  required ApplicationStatus status,
  bool? dryRun,
  DateTime? updateDateTime,
}) async {
  ArgumentError.checkNotNull(applicationId, 'applicationId');
  _s.validateStringLength(
    'applicationId',
    applicationId,
    1,
    1600,
    isRequired: true,
  );
  ArgumentError.checkNotNull(status, 'status');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSMigrationHub.NotifyApplicationState'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ApplicationId': applicationId,
      'Status': status.toValue(),
      if (dryRun != null) 'DryRun': dryRun,
      if (updateDateTime != null)
        'UpdateDateTime': unixTimestampToJson(updateDateTime),
    },
  );
}