executeQuery method

Future<ExecuteQueryResponse> executeQuery({
  1. required String queryStatement,
  2. required String workspaceId,
  3. int? maxResults,
  4. String? nextToken,
})

Run queries to access information from your knowledge graph of entities within individual workspaces.

May throw AccessDeniedException. May throw InternalServerException. May throw QueryTimeoutException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter queryStatement : The query statement.

Parameter workspaceId : The ID of the workspace.

Parameter maxResults : The maximum number of results to return at one time. The default is 50.

Parameter nextToken : The string that specifies the next page of results.

Implementation

Future<ExecuteQueryResponse> executeQuery({
  required String queryStatement,
  required String workspaceId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    'queryStatement': queryStatement,
    'workspaceId': workspaceId,
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/queries/execution',
    exceptionFnMap: _exceptionFns,
  );
  return ExecuteQueryResponse.fromJson(response);
}