What is a Dropbox API (v2) Union Tag?

白昼怎懂夜的黑 提交于 2019-12-23 03:49:06

问题


While starting to develop a Dropbox app using the Python SDK, I'm tripping conceptually over what the AccessLevel documentation calls a union tag. (The concept extends beyond the AccessLevel class, but this seems like as good an example as any.)

I'm trying to understand why the _tag attribute basically appears to be intended for internal use only. Why, if I want to know if a user has editor, owner, or viewer permission—-and it can only be one of those--I seem to be supposed to call the is_owner(), is_editor(), and is_viewer() methods until I get a True response.

What am I missing? Why wouldn't it be a good idea to just access the _tag attribute and go my merry way?

来源:https://stackoverflow.com/questions/49370075/what-is-a-dropbox-api-v2-union-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!