getAllItemsItemsGetWithHttpInfo method

Future<Response> getAllItemsItemsGetWithHttpInfo({
  1. String? name,
  2. int? minLevel,
  3. int? maxLevel,
  4. ItemType? type,
  5. CraftSkill? craftSkill,
  6. String? craftMaterial,
  7. int? page,
  8. int? size,
})

Get All Items

Fetch items details.

Note: This method returns the HTTP Response.

Parameters:

  • String name: Name of the item.

  • int minLevel: Minimum level.

  • int maxLevel: Maximum level.

  • ItemType type: Type of items.

  • CraftSkill craftSkill: Skill to craft items.

  • String craftMaterial: Item code of items used as material for crafting.

  • int page: Page number

  • int size: Page size

Implementation

Future<Response> getAllItemsItemsGetWithHttpInfo({
  String? name,
  int? minLevel,
  int? maxLevel,
  ItemType? type,
  CraftSkill? craftSkill,
  String? craftMaterial,
  int? page,
  int? size,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/items';

  // 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 (type != null) {
    queryParams.addAll(_queryParams('', 'type', type));
  }
  if (craftSkill != null) {
    queryParams.addAll(_queryParams('', 'craft_skill', craftSkill));
  }
  if (craftMaterial != null) {
    queryParams.addAll(_queryParams('', 'craft_material', craftMaterial));
  }
  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,
  );
}