createManagedThing method
- required String authenticationMaterial,
- required AuthMaterialType authenticationMaterialType,
- required Role role,
- String? brand,
- String? capabilities,
- CapabilityReport? capabilityReport,
- List<
CapabilitySchemaItem> ? capabilitySchemas, - String? classification,
- String? clientToken,
- String? credentialLockerId,
- Map<
String, String> ? metaData, - String? model,
- String? name,
- String? owner,
- String? serialNumber,
- Map<
String, String> ? tags, - WiFiSimpleSetupConfiguration? wiFiSimpleSetupConfiguration,
Creates a managed thing. A managed thing contains the device identifier, protocol supported, and capabilities of the device in a data model format defined by Managed integrations.
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 authenticationMaterial :
The authentication material defining the device connectivity setup
requests. The authorization materials used are the device bar code.
Parameter authenticationMaterialType :
The type of authentication material used for device connectivity setup
requests.
Parameter role :
The type of device used. This will be the hub controller, cloud device, or
AWS IoT device.
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 capability schemas that define the functionality and features
supported by the managed thing, including device capabilities and their
associated properties.
Parameter classification :
The classification of the managed thing such as light bulb or thermostat.
Parameter clientToken :
An idempotency token. If you retry a request that completed successfully
initially using the same client token and parameters, then the retry
attempt will succeed without performing any further actions.
Parameter credentialLockerId :
The identifier of the credential for the managed thing.
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 tags :
A set of key/value pairs that are used to manage the managed thing.
Parameter wiFiSimpleSetupConfiguration :
The Wi-Fi Simple Setup configuration for the managed thing, which defines
provisioning capabilities and timeout settings.
Implementation
Future<CreateManagedThingResponse> createManagedThing({
required String authenticationMaterial,
required AuthMaterialType authenticationMaterialType,
required Role role,
String? brand,
String? capabilities,
CapabilityReport? capabilityReport,
List<CapabilitySchemaItem>? capabilitySchemas,
String? classification,
String? clientToken,
String? credentialLockerId,
Map<String, String>? metaData,
String? model,
String? name,
String? owner,
String? serialNumber,
Map<String, String>? tags,
WiFiSimpleSetupConfiguration? wiFiSimpleSetupConfiguration,
}) async {
final $payload = <String, dynamic>{
'AuthenticationMaterial': authenticationMaterial,
'AuthenticationMaterialType': authenticationMaterialType.value,
'Role': role.value,
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,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (credentialLockerId != null) 'CredentialLockerId': credentialLockerId,
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 (tags != null) 'Tags': tags,
if (wiFiSimpleSetupConfiguration != null)
'WiFiSimpleSetupConfiguration': wiFiSimpleSetupConfiguration,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/managed-things',
exceptionFnMap: _exceptionFns,
);
return CreateManagedThingResponse.fromJson(response);
}