def generate_parameter_field_number(parameter, used_indexes, field_name_suffix=""):
  """Get unique field number for field corresponding to this parameter in proto file.
     If field number is not stored in metadata of parameter, get the next unused integer value."""
  field_name_key = f"grpc{field_name_suffix}_field_number"
  if field_name_key in parameter:
    field_number = parameter[field_name_key]
  else:
    field_number = next(i for i in range(1, 100) if i not in used_indexes)
  used_indexes.append(field_number)
  return field_number