updateCustomMetric method

Future<UpdateCustomMetricResponse> updateCustomMetric({
  1. required String displayName,
  2. required String metricName,
})

Updates a Device Defender detect custom metric.

May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw InternalFailureException.

Parameter displayName : Field represents a friendly name in the console for the custom metric, it doesn't have to be unique. Don't use this name as the metric identifier in the device metric report. Can be updated.

Parameter metricName : The name of the custom metric. Cannot be updated.

Implementation

Future<UpdateCustomMetricResponse> updateCustomMetric({
  required String displayName,
  required String metricName,
}) async {
  ArgumentError.checkNotNull(displayName, 'displayName');
  _s.validateStringLength(
    'displayName',
    displayName,
    0,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(metricName, 'metricName');
  _s.validateStringLength(
    'metricName',
    metricName,
    1,
    128,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'displayName': displayName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/custom-metric/${Uri.encodeComponent(metricName)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateCustomMetricResponse.fromJson(response);
}