@@ -52,6 +52,14 @@ const (
5252func (u * PathRoot ) UnmarshalJSON (body []byte ) error {
5353 type wrap struct {
5454 dropbox.Tagged
55+ // Root : Paths are relative to the authenticating user's root namespace
56+ // (This results in `PathRootError.invalid_root` if the user's root
57+ // namespace has changed.).
58+ Root string `json:"root,omitempty"`
59+ // NamespaceId : Paths are relative to given namespace id (This results
60+ // in `PathRootError.no_permission` if you don't have access to this
61+ // namespace.).
62+ NamespaceId string `json:"namespace_id,omitempty"`
5563 }
5664 var w wrap
5765 var err error
@@ -61,13 +69,13 @@ func (u *PathRoot) UnmarshalJSON(body []byte) error {
6169 u .Tag = w .Tag
6270 switch u .Tag {
6371 case "root" :
64- err = json . Unmarshal ( body , & u . Root )
72+ u . Root = w . Root
6573
6674 if err != nil {
6775 return err
6876 }
6977 case "namespace_id" :
70- err = json . Unmarshal ( body , & u . NamespaceId )
78+ u . NamespaceId = w . NamespaceId
7179
7280 if err != nil {
7381 return err
@@ -107,7 +115,7 @@ func (u *PathRootError) UnmarshalJSON(body []byte) error {
107115 u .Tag = w .Tag
108116 switch u .Tag {
109117 case "invalid_root" :
110- u .InvalidRoot , err = IsRootInfoFromJSON (body )
118+ u .InvalidRoot , err = IsRootInfoFromJSON (w . InvalidRoot )
111119
112120 if err != nil {
113121 return err
@@ -161,10 +169,6 @@ const (
161169func (u * rootInfoUnion ) UnmarshalJSON (body []byte ) error {
162170 type wrap struct {
163171 dropbox.Tagged
164- // Team : has no documentation (yet)
165- Team json.RawMessage `json:"team,omitempty"`
166- // User : has no documentation (yet)
167- User json.RawMessage `json:"user,omitempty"`
168172 }
169173 var w wrap
170174 var err error
0 commit comments