updateApplication method

Future<UpdateApplicationResponse> updateApplication({
  1. required String resourceGroupName,
  2. bool? cWEMonitorEnabled,
  3. bool? opsCenterEnabled,
  4. String? opsItemSNSTopicArn,
  5. bool? removeSNSTopic,
})

Updates the application.

May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter resourceGroupName : The name of the resource group.

Parameter cWEMonitorEnabled : Indicates whether Application Insights can listen to CloudWatch events for the application resources, such as instance terminated, failed deployment, and others.

Parameter opsCenterEnabled : When set to true, creates opsItems for any problems detected on an application.

Parameter opsItemSNSTopicArn : The SNS topic provided to Application Insights that is associated to the created opsItem. Allows you to receive notifications for updates to the opsItem.

Parameter removeSNSTopic : Disassociates the SNS topic from the opsItem created for detected problems.

Implementation

Future<UpdateApplicationResponse> updateApplication({
  required String resourceGroupName,
  bool? cWEMonitorEnabled,
  bool? opsCenterEnabled,
  String? opsItemSNSTopicArn,
  bool? removeSNSTopic,
}) async {
  ArgumentError.checkNotNull(resourceGroupName, 'resourceGroupName');
  _s.validateStringLength(
    'resourceGroupName',
    resourceGroupName,
    1,
    256,
    isRequired: true,
  );
  _s.validateStringLength(
    'opsItemSNSTopicArn',
    opsItemSNSTopicArn,
    20,
    300,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'EC2WindowsBarleyService.UpdateApplication'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceGroupName': resourceGroupName,
      if (cWEMonitorEnabled != null) 'CWEMonitorEnabled': cWEMonitorEnabled,
      if (opsCenterEnabled != null) 'OpsCenterEnabled': opsCenterEnabled,
      if (opsItemSNSTopicArn != null)
        'OpsItemSNSTopicArn': opsItemSNSTopicArn,
      if (removeSNSTopic != null) 'RemoveSNSTopic': removeSNSTopic,
    },
  );

  return UpdateApplicationResponse.fromJson(jsonResponse.body);
}