updateAppMonitor method

Future<void> updateAppMonitor({
  1. required String name,
  2. AppMonitorConfiguration? appMonitorConfiguration,
  3. CustomEvents? customEvents,
  4. bool? cwLogEnabled,
  5. DeobfuscationConfiguration? deobfuscationConfiguration,
  6. String? domain,
  7. List<String>? domainList,
})

Updates the configuration of an existing app monitor. When you use this operation, only the parts of the app monitor configuration that you specify in this operation are changed. For any parameters that you omit, the existing values are kept.

You can't use this operation to change the tags of an existing app monitor. To change the tags of an existing app monitor, use TagResource.

To create a new app monitor, use CreateAppMonitor.

After you update an app monitor, sign in to the CloudWatch RUM console to get the updated JavaScript code snippet to add to your web application. For more information, see How do I find a code snippet that I've already generated?

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter name : The name of the app monitor to update.

Parameter appMonitorConfiguration : A structure that contains much of the configuration data for the app monitor. If you are using Amazon Cognito for authorization, you must include this structure in your request, and it must include the ID of the Amazon Cognito identity pool to use for authorization. If you don't include AppMonitorConfiguration, you must set up your own authorization method. For more information, see Authorize your application to send data to Amazon Web Services.

Parameter customEvents : Specifies whether this app monitor allows the web client to define and send custom events. The default is for custom events to be DISABLED.

For more information about custom events, see Send custom events.

Parameter cwLogEnabled : Data collected by RUM is kept by RUM for 30 days and then deleted. This parameter specifies whether RUM sends a copy of this telemetry data to Amazon CloudWatch Logs in your account. This enables you to keep the telemetry data for more than 30 days, but it does incur Amazon CloudWatch Logs charges.

Parameter deobfuscationConfiguration : A structure that contains the configuration for how an app monitor can deobfuscate stack traces.

Parameter domain : The top-level internet domain name for which your application has administrative authority.

Parameter domainList : List the domain names for which your application has administrative authority. The UpdateAppMonitor allows either the domain or the domain list.

Implementation

Future<void> updateAppMonitor({
  required String name,
  AppMonitorConfiguration? appMonitorConfiguration,
  CustomEvents? customEvents,
  bool? cwLogEnabled,
  DeobfuscationConfiguration? deobfuscationConfiguration,
  String? domain,
  List<String>? domainList,
}) async {
  final $payload = <String, dynamic>{
    if (appMonitorConfiguration != null)
      'AppMonitorConfiguration': appMonitorConfiguration,
    if (customEvents != null) 'CustomEvents': customEvents,
    if (cwLogEnabled != null) 'CwLogEnabled': cwLogEnabled,
    if (deobfuscationConfiguration != null)
      'DeobfuscationConfiguration': deobfuscationConfiguration,
    if (domain != null) 'Domain': domain,
    if (domainList != null) 'DomainList': domainList,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/appmonitor/${Uri.encodeComponent(name)}',
    exceptionFnMap: _exceptionFns,
  );
}