batchAssociateAnalyticsDataSet method

Future<BatchAssociateAnalyticsDataSetResponse> batchAssociateAnalyticsDataSet({
  1. required List<String> dataSetIds,
  2. required String instanceId,
  3. String? targetAccountId,
})

Associates a list of analytics datasets for a given Connect Customer instance to a target account. You can associate multiple datasets in a single call.

May throw InternalServiceException. May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter dataSetIds : An array of dataset identifiers to associate.

Parameter instanceId : The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Parameter targetAccountId : The identifier of the target account. Use to associate a dataset to a different account than the one containing the Connect Customer instance. If not specified, by default this value is the Amazon Web Services account that has the Connect Customer instance.

Implementation

Future<BatchAssociateAnalyticsDataSetResponse>
    batchAssociateAnalyticsDataSet({
  required List<String> dataSetIds,
  required String instanceId,
  String? targetAccountId,
}) async {
  final $payload = <String, dynamic>{
    'DataSetIds': dataSetIds,
    if (targetAccountId != null) 'TargetAccountId': targetAccountId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/analytics-data/instance/${Uri.encodeComponent(instanceId)}/associations',
    exceptionFnMap: _exceptionFns,
  );
  return BatchAssociateAnalyticsDataSetResponse.fromJson(response);
}