listCommandsWithHttpInfo method

Future<Response> listCommandsWithHttpInfo({
  1. String? teamId,
  2. bool? customOnly,
})

List commands for a team

List commands for a team. ##### Permissions manage_slash_commands if need list custom commands.

Note: This method returns the HTTP Response.

Parameters:

  • String teamId: The team id.

  • bool customOnly: To get only the custom commands. If set to false will get the custom if the user have access plus the system commands, otherwise just the system commands.

Implementation

Future<Response> listCommandsWithHttpInfo({
  String? teamId,
  bool? customOnly,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/commands';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <MmQueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (teamId != null) {
    queryParams.addAll(_queryParams('', 'team_id', teamId));
  }
  if (customOnly != null) {
    queryParams.addAll(_queryParams('', 'custom_only', customOnly));
  }

  const contentTypes = <String>[];

  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}