updateDetectorVersionStatus method

Future<void> updateDetectorVersionStatus({
  1. required String detectorId,
  2. required String detectorVersionId,
  3. required DetectorVersionStatus status,
})

Updates the detector version’s status. You can perform the following promotions or demotions using UpdateDetectorVersionStatus: DRAFT to ACTIVE, ACTIVE to INACTIVE, and INACTIVE to ACTIVE.

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

Parameter detectorId : The detector ID.

Parameter detectorVersionId : The detector version ID.

Parameter status : The new status.

Implementation

Future<void> updateDetectorVersionStatus({
  required String detectorId,
  required String detectorVersionId,
  required DetectorVersionStatus status,
}) async {
  ArgumentError.checkNotNull(detectorId, 'detectorId');
  _s.validateStringLength(
    'detectorId',
    detectorId,
    1,
    64,
    isRequired: true,
  );
  ArgumentError.checkNotNull(detectorVersionId, 'detectorVersionId');
  _s.validateStringLength(
    'detectorVersionId',
    detectorVersionId,
    1,
    5,
    isRequired: true,
  );
  ArgumentError.checkNotNull(status, 'status');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSHawksNestServiceFacade.UpdateDetectorVersionStatus'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'detectorId': detectorId,
      'detectorVersionId': detectorVersionId,
      'status': status.toValue(),
    },
  );
}