getAllMonstersMonstersGetWithHttpInfo method

Future<Response> getAllMonstersMonstersGetWithHttpInfo({
  1. String? name,
  2. int? minLevel,
  3. int? maxLevel,
  4. String? drop,
  5. int? page,
  6. int? size,
})

Get All Monsters

Fetch monsters details.

Note: This method returns the HTTP Response.

Parameters:

  • String name: Name of the monster.

  • int minLevel: Minimum level.

  • int maxLevel: Maximum level.

  • String drop: Item code of the drop.

  • int page: Page number

  • int size: Page size

Implementation

Future<Response> getAllMonstersMonstersGetWithHttpInfo({
  String? name,
  int? minLevel,
  int? maxLevel,
  String? drop,
  int? page,
  int? size,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/monsters';

  // ignore: prefer_final_locals
  Object? postBody;

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

  if (name != null) {
    queryParams.addAll(_queryParams('', 'name', name));
  }
  if (minLevel != null) {
    queryParams.addAll(_queryParams('', 'min_level', minLevel));
  }
  if (maxLevel != null) {
    queryParams.addAll(_queryParams('', 'max_level', maxLevel));
  }
  if (drop != null) {
    queryParams.addAll(_queryParams('', 'drop', drop));
  }
  if (page != null) {
    queryParams.addAll(_queryParams('', 'page', page));
  }
  if (size != null) {
    queryParams.addAll(_queryParams('', 'size', size));
  }

  const contentTypes = <String>[];

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