updateManagedThing method

Future<void> updateManagedThing({
  1. required String identifier,
  2. String? brand,
  3. String? capabilities,
  4. CapabilityReport? capabilityReport,
  5. List<CapabilitySchemaItem>? capabilitySchemas,
  6. String? classification,
  7. String? credentialLockerId,
  8. HubNetworkMode? hubNetworkMode,
  9. Map<String, String>? metaData,
  10. String? model,
  11. String? name,
  12. String? owner,
  13. String? serialNumber,
  14. WiFiSimpleSetupConfiguration? wiFiSimpleSetupConfiguration,
})

Update the attributes and capabilities associated with a managed thing.

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

Parameter identifier : The id of the managed thing.

Parameter brand : The brand of the device.

Parameter capabilities : The capabilities of the device such as light bulb.

Parameter capabilityReport : A report of the capabilities for the managed thing.

Parameter capabilitySchemas : The updated capability schemas that define the functionality and features supported by the managed thing.

Parameter classification : The classification of the managed thing such as light bulb or thermostat.

Parameter credentialLockerId : The identifier of the credential for the managed thing.

Parameter hubNetworkMode : The network mode for the hub-connected device.

Parameter metaData : The metadata for the managed thing.

Parameter model : The model of the device.

Parameter name : The name of the managed thing representing the physical device.

Parameter owner : Owner of the device, usually an indication of whom the device belongs to. This value should not contain personal identifiable information.

Parameter serialNumber : The serial number of the device.

Parameter wiFiSimpleSetupConfiguration : The Wi-Fi Simple Setup configuration for the managed thing, which defines provisioning capabilities and timeout settings.

Implementation

Future<void> updateManagedThing({
  required String identifier,
  String? brand,
  String? capabilities,
  CapabilityReport? capabilityReport,
  List<CapabilitySchemaItem>? capabilitySchemas,
  String? classification,
  String? credentialLockerId,
  HubNetworkMode? hubNetworkMode,
  Map<String, String>? metaData,
  String? model,
  String? name,
  String? owner,
  String? serialNumber,
  WiFiSimpleSetupConfiguration? wiFiSimpleSetupConfiguration,
}) async {
  final $payload = <String, dynamic>{
    if (brand != null) 'Brand': brand,
    if (capabilities != null) 'Capabilities': capabilities,
    if (capabilityReport != null) 'CapabilityReport': capabilityReport,
    if (capabilitySchemas != null) 'CapabilitySchemas': capabilitySchemas,
    if (classification != null) 'Classification': classification,
    if (credentialLockerId != null) 'CredentialLockerId': credentialLockerId,
    if (hubNetworkMode != null) 'HubNetworkMode': hubNetworkMode.value,
    if (metaData != null) 'MetaData': metaData,
    if (model != null) 'Model': model,
    if (name != null) 'Name': name,
    if (owner != null) 'Owner': owner,
    if (serialNumber != null) 'SerialNumber': serialNumber,
    if (wiFiSimpleSetupConfiguration != null)
      'WiFiSimpleSetupConfiguration': wiFiSimpleSetupConfiguration,
  };
  await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/managed-things/${Uri.encodeComponent(identifier)}',
    exceptionFnMap: _exceptionFns,
  );
}