2021-12-10 16:29:02 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2021-12-30 17:23:16 +00:00
|
|
|
"context"
|
|
|
|
|
2021-12-10 16:29:02 +00:00
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2021-12-22 15:41:33 +00:00
|
|
|
func init() {
|
|
|
|
rootCmd.AddCommand(subAccountsCmd)
|
|
|
|
}
|
|
|
|
|
2021-12-10 16:29:02 +00:00
|
|
|
var subAccountsCmd = &cobra.Command{
|
|
|
|
Use: "subaccounts",
|
|
|
|
Short: "subaccounts",
|
|
|
|
|
|
|
|
// SilenceUsage is an option to silence usage when an error occurs.
|
|
|
|
SilenceUsage: true,
|
|
|
|
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
2021-12-31 18:04:20 +00:00
|
|
|
req := client.AccountService.NewListSubAccountsRequest()
|
|
|
|
subAccounts, err := req.Do(context.Background())
|
2021-12-10 16:29:02 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
logrus.Infof("subAccounts: %+v", subAccounts)
|
|
|
|
return nil
|
|
|
|
},
|
|
|
|
}
|