batchAssociateClientDeviceWithCoreDevice method

Future<BatchAssociateClientDeviceWithCoreDeviceResponse> batchAssociateClientDeviceWithCoreDevice({
  1. required String coreDeviceThingName,
  2. List<AssociateClientDeviceWithCoreDeviceEntry>? entries,
})

Associates a list of client devices with a core device. Use this API operation to specify which client devices can discover a core device through cloud discovery. With cloud discovery, client devices connect to IoT Greengrass to retrieve associated core devices' connectivity information and certificates. For more information, see Configure cloud discovery in the IoT Greengrass V2 Developer Guide.

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

Parameter coreDeviceThingName : The name of the core device. This is also the name of the IoT thing.

Parameter entries : The list of client devices to associate.

Implementation

Future<BatchAssociateClientDeviceWithCoreDeviceResponse>
    batchAssociateClientDeviceWithCoreDevice({
  required String coreDeviceThingName,
  List<AssociateClientDeviceWithCoreDeviceEntry>? entries,
}) async {
  final $payload = <String, dynamic>{
    if (entries != null) 'entries': entries,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/greengrass/v2/coreDevices/${Uri.encodeComponent(coreDeviceThingName)}/associateClientDevices',
    exceptionFnMap: _exceptionFns,
  );
  return BatchAssociateClientDeviceWithCoreDeviceResponse.fromJson(response);
}