describeActivities method

Future<DescribeActivitiesResponse> describeActivities({
  1. String? activityTypes,
  2. String? authenticationToken,
  3. DateTime? endTime,
  4. bool? includeIndirectActivities,
  5. int? limit,
  6. String? marker,
  7. String? organizationId,
  8. String? resourceId,
  9. DateTime? startTime,
  10. String? userId,
})

Describes the user activities in a specified time period.

May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException. May throw InvalidArgumentException. May throw FailedDependencyException. May throw ServiceUnavailableException.

Parameter activityTypes : Specifies which activity types to include in the response. If this field is left empty, all activity types are returned.

Parameter authenticationToken : Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

Parameter endTime : The timestamp that determines the end time of the activities. The response includes the activities performed before the specified timestamp.

Parameter includeIndirectActivities : Includes indirect activities. An indirect activity results from a direct activity performed on a parent resource. For example, sharing a parent folder (the direct activity) shares all of the subfolders and documents within the parent folder (the indirect activity).

Parameter limit : The maximum number of items to return.

Parameter marker : The marker for the next set of results.

Parameter organizationId : The ID of the organization. This is a mandatory parameter when using administrative API (SigV4) requests.

Parameter resourceId : The document or folder ID for which to describe activity types.

Parameter startTime : The timestamp that determines the starting time of the activities. The response includes the activities performed after the specified timestamp.

Parameter userId : The ID of the user who performed the action. The response includes activities pertaining to this user. This is an optional parameter and is only applicable for administrative API (SigV4) requests.

Implementation

Future<DescribeActivitiesResponse> describeActivities({
  String? activityTypes,
  String? authenticationToken,
  DateTime? endTime,
  bool? includeIndirectActivities,
  int? limit,
  String? marker,
  String? organizationId,
  String? resourceId,
  DateTime? startTime,
  String? userId,
}) async {
  _s.validateStringLength(
    'activityTypes',
    activityTypes,
    1,
    1024,
  );
  _s.validateStringLength(
    'authenticationToken',
    authenticationToken,
    1,
    8199,
  );
  _s.validateNumRange(
    'limit',
    limit,
    1,
    999,
  );
  _s.validateStringLength(
    'marker',
    marker,
    1,
    2048,
  );
  _s.validateStringLength(
    'organizationId',
    organizationId,
    1,
    256,
  );
  _s.validateStringLength(
    'resourceId',
    resourceId,
    1,
    256,
  );
  _s.validateStringLength(
    'userId',
    userId,
    1,
    256,
  );
  final headers = <String, String>{
    if (authenticationToken != null)
      'Authentication': authenticationToken.toString(),
  };
  final $query = <String, List<String>>{
    if (activityTypes != null) 'activityTypes': [activityTypes],
    if (endTime != null) 'endTime': [_s.iso8601ToJson(endTime).toString()],
    if (includeIndirectActivities != null)
      'includeIndirectActivities': [includeIndirectActivities.toString()],
    if (limit != null) 'limit': [limit.toString()],
    if (marker != null) 'marker': [marker],
    if (organizationId != null) 'organizationId': [organizationId],
    if (resourceId != null) 'resourceId': [resourceId],
    if (startTime != null)
      'startTime': [_s.iso8601ToJson(startTime).toString()],
    if (userId != null) 'userId': [userId],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/api/v1/activities',
    queryParams: $query,
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return DescribeActivitiesResponse.fromJson(response);
}