updateDevice method

Future<UpdateDeviceResponse> updateDevice({
  1. required String id,
  2. String? desiredSoftwareSetId,
  3. String? name,
  4. SoftwareSetUpdateSchedule? softwareSetUpdateSchedule,
})

Updates a thin client device.

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

Parameter id : The ID of the device to update.

Parameter desiredSoftwareSetId : The ID of the software set to apply.

Parameter name : The name of the device to update.

Parameter softwareSetUpdateSchedule : An option to define if software updates should be applied within a maintenance window.

Implementation

Future<UpdateDeviceResponse> updateDevice({
  required String id,
  String? desiredSoftwareSetId,
  String? name,
  SoftwareSetUpdateSchedule? softwareSetUpdateSchedule,
}) async {
  final $payload = <String, dynamic>{
    if (desiredSoftwareSetId != null)
      'desiredSoftwareSetId': desiredSoftwareSetId,
    if (name != null) 'name': name,
    if (softwareSetUpdateSchedule != null)
      'softwareSetUpdateSchedule': softwareSetUpdateSchedule.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/devices/${Uri.encodeComponent(id)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateDeviceResponse.fromJson(response);
}