createDataAccessor method

Future<CreateDataAccessorResponse> createDataAccessor({
  1. required List<ActionConfiguration> actionConfigurations,
  2. required String applicationId,
  3. required String displayName,
  4. required String principal,
  5. DataAccessorAuthenticationDetail? authenticationDetail,
  6. String? clientToken,
  7. List<Tag>? tags,
})

Creates a new data accessor for an ISV to access data from a Amazon Q Business application. The data accessor is an entity that represents the ISV's access to the Amazon Q Business application's data. It includes the IAM role ARN for the ISV, a friendly name, and a set of action configurations that define the specific actions the ISV is allowed to perform and any associated data filters. When the data accessor is created, an IAM Identity Center application is also created to manage the ISV's identity and authentication for accessing the Amazon Q Business application.

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

Parameter actionConfigurations : A list of action configurations specifying the allowed actions and any associated filters.

Parameter applicationId : The unique identifier of the Amazon Q Business application.

Parameter displayName : A friendly name for the data accessor.

Parameter principal : The Amazon Resource Name (ARN) of the IAM role for the ISV that will be accessing the data.

Parameter authenticationDetail : The authentication configuration details for the data accessor. This specifies how the ISV will authenticate when accessing data through this data accessor.

Parameter clientToken : A unique, case-sensitive identifier you provide to ensure idempotency of the request.

Parameter tags : The tags to associate with the data accessor.

Implementation

Future<CreateDataAccessorResponse> createDataAccessor({
  required List<ActionConfiguration> actionConfigurations,
  required String applicationId,
  required String displayName,
  required String principal,
  DataAccessorAuthenticationDetail? authenticationDetail,
  String? clientToken,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'actionConfigurations': actionConfigurations,
    'displayName': displayName,
    'principal': principal,
    if (authenticationDetail != null)
      'authenticationDetail': authenticationDetail,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/applications/${Uri.encodeComponent(applicationId)}/dataaccessors',
    exceptionFnMap: _exceptionFns,
  );
  return CreateDataAccessorResponse.fromJson(response);
}