batchAssociateProjectAssets method

Future<BatchAssociateProjectAssetsResponse> batchAssociateProjectAssets({
  1. required List<String> assetIds,
  2. required String projectId,
  3. String? clientToken,
})

Associates a group (batch) of assets with an IoT SiteWise Monitor project.

May throw InternalFailureException. May throw InvalidRequestException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter assetIds : The IDs of the assets to be associated to the project.

Parameter projectId : The ID of the project to which to associate the assets.

Parameter clientToken : A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

Implementation

Future<BatchAssociateProjectAssetsResponse> batchAssociateProjectAssets({
  required List<String> assetIds,
  required String projectId,
  String? clientToken,
}) async {
  final $payload = <String, dynamic>{
    'assetIds': assetIds,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/projects/${Uri.encodeComponent(projectId)}/assets/associate',
    exceptionFnMap: _exceptionFns,
  );
  return BatchAssociateProjectAssetsResponse.fromJson(response);
}