associateAnalyticsDataSet method

Future<AssociateAnalyticsDataSetResponse> associateAnalyticsDataSet({
  1. required String dataSetId,
  2. required String instanceId,
  3. String? targetAccountId,
})

Associates the specified dataset for a Connect Customer instance with the target account. You can associate only one dataset in a single call.

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

Parameter dataSetId : The identifier of the dataset to associate with the target account.

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<AssociateAnalyticsDataSetResponse> associateAnalyticsDataSet({
  required String dataSetId,
  required String instanceId,
  String? targetAccountId,
}) async {
  final $payload = <String, dynamic>{
    'DataSetId': dataSetId,
    if (targetAccountId != null) 'TargetAccountId': targetAccountId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/analytics-data/instance/${Uri.encodeComponent(instanceId)}/association',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateAnalyticsDataSetResponse.fromJson(response);
}