generateAccessLogs method

Future<GenerateAccessLogsResult> generateAccessLogs({
  1. required String appId,
  2. required String domainName,
  3. DateTime? endTime,
  4. DateTime? startTime,
})

Returns the website access logs for a specific time range using a presigned URL.

May throw BadRequestException. May throw InternalFailureException. May throw NotFoundException. May throw UnauthorizedException.

Parameter appId : The unique ID for an Amplify app.

Parameter domainName : The name of the domain.

Parameter endTime : The time at which the logs should end. The time range specified is inclusive of the end time.

Parameter startTime : The time at which the logs should start. The time range specified is inclusive of the start time.

Implementation

Future<GenerateAccessLogsResult> generateAccessLogs({
  required String appId,
  required String domainName,
  DateTime? endTime,
  DateTime? startTime,
}) async {
  final $payload = <String, dynamic>{
    'domainName': domainName,
    if (endTime != null) 'endTime': unixTimestampToJson(endTime),
    if (startTime != null) 'startTime': unixTimestampToJson(startTime),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/apps/${Uri.encodeComponent(appId)}/accesslogs',
    exceptionFnMap: _exceptionFns,
  );
  return GenerateAccessLogsResult.fromJson(response);
}