disassociateVolume method

Future<void> disassociateVolume({
  1. required String volumeId,
  2. required String workspaceInstanceId,
  3. String? device,
  4. DisassociateModeEnum? disassociateMode,
})

Detaches a volume from a WorkSpace Instance.

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

Parameter volumeId : Volume to be detached.

Parameter workspaceInstanceId : WorkSpace Instance to detach volume from.

Parameter device : Device path of volume to detach.

Parameter disassociateMode : Mode for volume detachment.

Implementation

Future<void> disassociateVolume({
  required String volumeId,
  required String workspaceInstanceId,
  String? device,
  DisassociateModeEnum? disassociateMode,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'EUCMIFrontendAPIService.DisassociateVolume'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'VolumeId': volumeId,
      'WorkspaceInstanceId': workspaceInstanceId,
      if (device != null) 'Device': device,
      if (disassociateMode != null)
        'DisassociateMode': disassociateMode.value,
    },
  );
}