+# prints the result of an API GET call returning an array
+# and to have the results key of the API call defined.
+sub print_api_list {
+ my ($props_to_print, $data, $returninfo) = @_;
+
+ my $returnprops = $returninfo->{items}->{properties};
+
+ my $formatopts = [];
+ foreach my $prop ( @$props_to_print ) {
+ my $propinfo = $returnprops->{$prop};
+ my $colopts = {
+ key => $prop,
+ title => $propinfo->{title},
+ default => $propinfo->{default},
+ cutoff => $propinfo->{print_width} // $propinfo->{maxLength},
+ };
+ push @$formatopts, $colopts;
+ }
+
+ print_text_table($formatopts, $data);
+}
+