getJobsByTypeWithHttpInfo method

Future<Response> getJobsByTypeWithHttpInfo(
  1. String type, {
  2. int? page,
  3. int? perPage,
})

Get the jobs of the given type.

Get a page of jobs of the given type. Use the query parameters to modify the behaviour of this endpoint. Minimum server version: 4.1 ##### Permissions Must have manage_jobs permission.

Note: This method returns the HTTP Response.

Parameters:

  • String type (required): Job type

  • int page: The page to select.

  • int perPage: The number of jobs per page.

Implementation

Future<Response> getJobsByTypeWithHttpInfo(
  String type, {
  int? page,
  int? perPage,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/jobs/type/{type}'.replaceAll('{type}', type);

  // 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));
  }

  const contentTypes = <String>[];

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