(record contract.ProviderListResponse)
| 687 | } |
| 688 | |
| 689 | func providerListBundle(record contract.ProviderListResponse) outputBundle { |
| 690 | return outputBundle{ |
| 691 | jsonValue: record, |
| 692 | human: func() (string, error) { |
| 693 | rows := make([][]string, 0, len(record.Providers)) |
| 694 | for _, provider := range record.Providers { |
| 695 | rows = append(rows, []string{ |
| 696 | stringOrDash(provider.Name), |
| 697 | stringOrDash(provider.DisplayName), |
| 698 | stringOrDash(provider.AuthStatus.State), |
| 699 | stringOrDash(provider.AuthStatus.Mode), |
| 700 | }) |
| 701 | } |
| 702 | return renderHumanTable( |
| 703 | "Providers", |
| 704 | []string{providerNameValue, "Display Name", providerStateValue, providerAuthModeValue}, |
| 705 | rows, |
| 706 | ), nil |
| 707 | }, |
| 708 | toon: func() (string, error) { |
| 709 | return renderToonObject( |
| 710 | "providers", |
| 711 | []string{"count"}, |
| 712 | []string{fmt.Sprintf("%d", len(record.Providers))}, |
| 713 | ), nil |
| 714 | }, |
| 715 | } |
| 716 | } |
| 717 | |
| 718 | func providerAuthStatusRows(record providerAuthStatusRecord) []keyValue { |
| 719 | rows := []keyValue{ |
no test coverage detected