refactor(api module): enforce typed definitions (#2238)

This commit is contained in:
Damian Debkowski authored and GitHub committed 2022-07-21 15:21:31 -07:00
1 parent d6c1402223
commit c2bfcc0664
79 files changed
+906 -551

No files matched your search

+2 -4
View File
@@ -277,8 +277,7 @@ func (c *Command) PrintCliError(err error) {
}
// PrintJsonItem prints the given item to the UI in JSON format
func (c *Command) PrintJsonItem(result api.GenericResult, opt ...Option) bool {
resp := result.GetResponse()
func (c *Command) PrintJsonItem(resp *api.Response, opt ...Option) bool {
if resp == nil {
c.PrintCliError(errors.New("Error formatting as JSON: no response given to item formatter"))
return false
@@ -309,8 +308,7 @@ func (c *Command) PrintJson(input json.RawMessage, opt ...Option) bool {
}
// PrintJsonItems prints the given items to the UI in JSON format
func (c *Command) PrintJsonItems(result api.GenericListResult) bool {
resp := result.GetResponse()
func (c *Command) PrintJsonItems(resp *api.Response) bool {
if resp == nil {
c.PrintCliError(errors.New("Error formatting as JSON: no response given to items formatter"))
return false