createQApp method

Future<CreateQAppOutput> createQApp({
  1. required AppDefinitionInput appDefinition,
  2. required String instanceId,
  3. required String title,
  4. String? description,
  5. Map<String, String>? tags,
})

Creates a new Amazon Q App based on the provided definition. The Q App definition specifies the cards and flow of the Q App. This operation also calculates the dependencies between the cards by inspecting the references in the prompts.

May throw AccessDeniedException. May throw ConflictException. May throw ContentTooLargeException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw UnauthorizedException. May throw ValidationException.

Parameter appDefinition : The definition of the new Q App, specifying the cards and flow.

Parameter instanceId : The unique identifier of the Amazon Q Business application environment instance.

Parameter title : The title of the new Q App.

Parameter description : The description of the new Q App.

Parameter tags : Optional tags to associate with the new Q App.

Implementation

Future<CreateQAppOutput> createQApp({
  required AppDefinitionInput appDefinition,
  required String instanceId,
  required String title,
  String? description,
  Map<String, String>? tags,
}) async {
  final headers = <String, String>{
    'instance-id': instanceId.toString(),
  };
  final $payload = <String, dynamic>{
    'appDefinition': appDefinition,
    'title': title,
    if (description != null) 'description': description,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/apps.create',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return CreateQAppOutput.fromJson(response);
}