getOutgoingWebhooksWithHttpInfo method

Future<Response> getOutgoingWebhooksWithHttpInfo({
  1. int? page,
  2. int? perPage,
  3. String? teamId,
  4. String? channelId,
})

List outgoing webhooks

Get a page of a list of outgoing webhooks. Optionally filter for a specific team or channel using query parameters. ##### Permissions manage_webhooks for the system or manage_webhooks for the specific team/channel.

Note: This method returns the HTTP Response.

Parameters:

  • int page: The page to select.

  • int perPage: The number of hooks per page.

  • String teamId: The ID of the team to get hooks for.

  • String channelId: The ID of the channel to get hooks for.

Implementation

Future<Response> getOutgoingWebhooksWithHttpInfo({
  int? page,
  int? perPage,
  String? teamId,
  String? channelId,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/hooks/outgoing';

  // ignore: prefer_final_locals
  Object? postBody;

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

  if (page != null) {
    queryParams.addAll(_queryParams('', 'page', page));
  }
  if (perPage != null) {
    queryParams.addAll(_queryParams('', 'per_page', perPage));
  }
  if (teamId != null) {
    queryParams.addAll(_queryParams('', 'team_id', teamId));
  }
  if (channelId != null) {
    queryParams.addAll(_queryParams('', 'channel_id', channelId));
  }

  const contentTypes = <String>[];

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