createPlugin method

Future<CreatePluginResponse> createPlugin({
  1. required String applicationId,
  2. required PluginAuthConfiguration authConfiguration,
  3. required String displayName,
  4. required PluginType type,
  5. String? clientToken,
  6. CustomPluginConfiguration? customPluginConfiguration,
  7. String? serverUrl,
  8. List<Tag>? tags,
})

Creates an Amazon Q Business plugin.

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

Parameter applicationId : The identifier of the application that will contain the plugin.

Parameter displayName : A the name for your plugin.

Parameter type : The type of plugin you want to create.

Parameter clientToken : A token that you provide to identify the request to create your Amazon Q Business plugin.

Parameter customPluginConfiguration : Contains configuration for a custom plugin.

Parameter serverUrl : The source URL used for plugin configuration.

Parameter tags : A list of key-value pairs that identify or categorize the data source connector. You can also use tags to help control access to the data source connector. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.

Implementation

Future<CreatePluginResponse> createPlugin({
  required String applicationId,
  required PluginAuthConfiguration authConfiguration,
  required String displayName,
  required PluginType type,
  String? clientToken,
  CustomPluginConfiguration? customPluginConfiguration,
  String? serverUrl,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'authConfiguration': authConfiguration,
    'displayName': displayName,
    'type': type.value,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (customPluginConfiguration != null)
      'customPluginConfiguration': customPluginConfiguration,
    if (serverUrl != null) 'serverUrl': serverUrl,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/applications/${Uri.encodeComponent(applicationId)}/plugins',
    exceptionFnMap: _exceptionFns,
  );
  return CreatePluginResponse.fromJson(response);
}