예제 #1
0
func shareListLinks(cmd *cobra.Command, args []string) (err error) {
	arg := sharing.NewListSharedLinksArg()

	dbx := sharing.New(config)
	res, err := dbx.ListSharedLinks(arg)
	if err != nil {
		return
	}

	printLinks(res.Links)

	for res.HasMore {
		arg = sharing.NewListSharedLinksArg()
		arg.Cursor = res.Cursor

		res, err = dbx.ListSharedLinks(arg)
		if err != nil {
			return
		}

		printLinks(res.Links)
	}

	return
}
예제 #2
0
func shareListFolders(cmd *cobra.Command, args []string) (err error) {
	arg := sharing.NewListFoldersArgs()

	dbx := sharing.New(config)
	res, err := dbx.ListFolders(arg)
	if err != nil {
		return
	}

	printFolders(res.Entries)

	for len(res.Cursor) > 0 {
		continueArg := sharing.NewListFoldersContinueArg(res.Cursor)

		res, err = dbx.ListFoldersContinue(continueArg)
		if err != nil {
			return
		}

		printFolders(res.Entries)
	}

	return
}