listActions method

Future<ListActionsResponse> listActions({
  1. String? actionType,
  2. DateTime? createdAfter,
  3. DateTime? createdBefore,
  4. int? maxResults,
  5. String? nextToken,
  6. SortActionsBy? sortBy,
  7. SortOrder? sortOrder,
  8. String? sourceUri,
})

Lists the actions in your account and their properties.

May throw ResourceNotFound.

Parameter actionType : A filter that returns only actions of the specified type.

Parameter createdAfter : A filter that returns only actions created on or after the specified time.

Parameter createdBefore : A filter that returns only actions created on or before the specified time.

Parameter maxResults : The maximum number of actions to return in the response. The default value is 10.

Parameter nextToken : If the previous call to ListActions didn't return the full set of actions, the call returns a token for getting the next set of actions.

Parameter sortBy : The property used to sort results. The default value is CreationTime.

Parameter sortOrder : The sort order. The default value is Descending.

Parameter sourceUri : A filter that returns only actions with the specified source URI.

Implementation

Future<ListActionsResponse> listActions({
  String? actionType,
  DateTime? createdAfter,
  DateTime? createdBefore,
  int? maxResults,
  String? nextToken,
  SortActionsBy? sortBy,
  SortOrder? sortOrder,
  String? sourceUri,
}) async {
  _s.validateStringLength(
    'actionType',
    actionType,
    0,
    256,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    8192,
  );
  _s.validateStringLength(
    'sourceUri',
    sourceUri,
    0,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListActions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (actionType != null) 'ActionType': actionType,
      if (createdAfter != null)
        'CreatedAfter': unixTimestampToJson(createdAfter),
      if (createdBefore != null)
        'CreatedBefore': unixTimestampToJson(createdBefore),
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (sortBy != null) 'SortBy': sortBy.toValue(),
      if (sortOrder != null) 'SortOrder': sortOrder.toValue(),
      if (sourceUri != null) 'SourceUri': sourceUri,
    },
  );

  return ListActionsResponse.fromJson(jsonResponse.body);
}