Skip to content

Commit 6ee7ae4

Browse files
author
Diwaker Gupta
committed
Update API spec and regerate SDK.
1 parent e7169e8 commit 6ee7ae4

File tree

11 files changed

+61
-19
lines changed

11 files changed

+61
-19
lines changed

dropbox/auth/client.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
// THE SOFTWARE.
2020

21-
// Package auth : has no documentation (yet)
2221
package auth
2322

2423
import (

dropbox/files/client.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
// THE SOFTWARE.
2020

21-
// Package files : This namespace contains endpoints and data types for basic
22-
// file operations.
2321
package files
2422

2523
import (

dropbox/files/types.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ func NewGetMetadataArg(Path string) *GetMetadataArg {
114114
// AlphaGetMetadataArg : has no documentation (yet)
115115
type AlphaGetMetadataArg struct {
116116
GetMetadataArg
117-
// IncludePropertyTemplates : If true, `FileMetadata.property_groups` is set
118-
// for files with custom properties.
117+
// IncludePropertyTemplates : If set to a valid list of template IDs,
118+
// `FileMetadata.property_groups` is set for files with custom properties.
119119
IncludePropertyTemplates []string `json:"include_property_templates,omitempty"`
120120
}
121121

@@ -631,12 +631,21 @@ type FolderSharingInfo struct {
631631
// SharedFolderId : If this folder is a shared folder mount point, the ID of
632632
// the shared folder mounted at this location.
633633
SharedFolderId string `json:"shared_folder_id,omitempty"`
634+
// TraverseOnly : Specifies that the folder can only be traversed and the
635+
// user can only see a limited subset of the contents of this folder because
636+
// they don't have read access to this folder. They do, however, have access
637+
// to some sub folder.
638+
TraverseOnly bool `json:"traverse_only"`
639+
// NoAccess : Specifies that the folder cannot be accessed by the user
640+
NoAccess bool `json:"no_access"`
634641
}
635642

636643
// NewFolderSharingInfo returns a new FolderSharingInfo instance
637644
func NewFolderSharingInfo(ReadOnly bool) *FolderSharingInfo {
638645
s := new(FolderSharingInfo)
639646
s.ReadOnly = ReadOnly
647+
s.TraverseOnly = false
648+
s.NoAccess = false
640649
return s
641650
}
642651

dropbox/sdk.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const (
3434
hostContent = "content"
3535
hostNotify = "notify"
3636
sdkVersion = "1.0.0-beta"
37-
specVersion = "0697bd2"
37+
specVersion = "2fad251"
3838
)
3939

4040
// Version returns the current SDK version and API Spec version
@@ -44,10 +44,14 @@ func Version() (string, string) {
4444

4545
// Config contains parameters for configuring the SDK.
4646
type Config struct {
47-
Token string
48-
Verbose bool
47+
// OAuth2 access token
48+
Token string
49+
// Enable verbose logging in SDK
50+
Verbose bool
51+
// Used with APIs that support operations as another user
4952
AsMemberID string
50-
Domain string
53+
// No need to set -- for testing only
54+
Domain string
5155
}
5256

5357
// Context is the base client context used to implement per-namespace clients.

dropbox/sharing/client.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
// THE SOFTWARE.
2020

21-
// Package sharing : This namespace contains endpoints and data types for
22-
// creating and managing shared links and shared folders.
2321
package sharing
2422

2523
import (

dropbox/sharing/types.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ const (
538538
FileActionUnshare = "unshare"
539539
FileActionRelinquishMembership = "relinquish_membership"
540540
FileActionShareLink = "share_link"
541+
FileActionCreateLink = "create_link"
541542
FileActionOther = "other"
542543
)
543544

@@ -713,15 +714,41 @@ func NewFileLinkMetadata(Url string, Name string, LinkPermissions *LinkPermissio
713714
// FileMemberActionError : has no documentation (yet)
714715
type FileMemberActionError struct {
715716
dropbox.Tagged
717+
// AccessError : Specified file was invalid or user does not have access.
718+
AccessError *SharingFileAccessError `json:"access_error,omitempty"`
716719
}
717720

718721
// Valid tag values for FileMemberActionError
719722
const (
720723
FileMemberActionErrorInvalidMember = "invalid_member"
721724
FileMemberActionErrorNoPermission = "no_permission"
725+
FileMemberActionErrorAccessError = "access_error"
722726
FileMemberActionErrorOther = "other"
723727
)
724728

729+
// UnmarshalJSON deserializes into a FileMemberActionError instance
730+
func (u *FileMemberActionError) UnmarshalJSON(body []byte) error {
731+
type wrap struct {
732+
dropbox.Tagged
733+
// AccessError : Specified file was invalid or user does not have
734+
// access.
735+
AccessError json.RawMessage `json:"access_error,omitempty"`
736+
}
737+
var w wrap
738+
if err := json.Unmarshal(body, &w); err != nil {
739+
return err
740+
}
741+
u.Tag = w.Tag
742+
switch u.Tag {
743+
case "access_error":
744+
if err := json.Unmarshal(w.AccessError, &u.AccessError); err != nil {
745+
return err
746+
}
747+
748+
}
749+
return nil
750+
}
751+
725752
// FileMemberActionIndividualResult : has no documentation (yet)
726753
type FileMemberActionIndividualResult struct {
727754
dropbox.Tagged
@@ -868,6 +895,7 @@ const (
868895
FolderActionUnshare = "unshare"
869896
FolderActionLeaveACopy = "leave_a_copy"
870897
FolderActionShareLink = "share_link"
898+
FolderActionCreateLink = "create_link"
871899
FolderActionOther = "other"
872900
)
873901

@@ -2880,6 +2908,11 @@ type SharedFileMetadata struct {
28802908
Name string `json:"name"`
28812909
// Id : The ID of the file.
28822910
Id string `json:"id"`
2911+
// TimeInvited : Timestamp indicating when the current user was invited to
2912+
// this shared file. If the user was not invited to the shared file, the
2913+
// timestamp will indicate when the user was invited to the parent shared
2914+
// folder. This value may be absent.
2915+
TimeInvited time.Time `json:"time_invited,omitempty"`
28832916
}
28842917

28852918
// NewSharedFileMetadata returns a new SharedFileMetadata instance

dropbox/team/client.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
// THE SOFTWARE.
2020

21-
// Package team : has no documentation (yet)
2221
package team
2322

2423
import (

dropbox/team/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,8 +1423,8 @@ type MemberAddResult struct {
14231423
// limit has been reached.
14241424
FreeTeamMemberLimitReached string `json:"free_team_member_limit_reached,omitempty"`
14251425
// UserAlreadyOnTeam : User is already on this team. The provided email
1426-
// address is associated with a user who is already a member of or invited
1427-
// to the team.
1426+
// address is associated with a user who is already a member of (including
1427+
// in recoverable state) or invited to the team.
14281428
UserAlreadyOnTeam string `json:"user_already_on_team,omitempty"`
14291429
// UserOnAnotherTeam : User is already on another team. The provided email
14301430
// address is associated with a user that is already a member or invited to
@@ -1435,7 +1435,7 @@ type MemberAddResult struct {
14351435
// UserMigrationFailed : User migration has failed.
14361436
UserMigrationFailed string `json:"user_migration_failed,omitempty"`
14371437
// DuplicateExternalMemberId : A user with the given external member ID
1438-
// already exists on the team.
1438+
// already exists on the team (including in recoverable state).
14391439
DuplicateExternalMemberId string `json:"duplicate_external_member_id,omitempty"`
14401440
// UserCreationFailed : User creation has failed.
14411441
UserCreationFailed string `json:"user_creation_failed,omitempty"`

dropbox/users/client.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
// THE SOFTWARE.
2020

21-
// Package users : This namespace contains endpoints and data types for user
22-
// management.
2321
package users
2422

2523
import (

dropbox/users/types.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,19 @@ type Name struct {
266266
// DisplayName : A name that can be used directly to represent the name of a
267267
// user's Dropbox account.
268268
DisplayName string `json:"display_name"`
269+
// AbbreviatedName : An abbreviated form of the person's name. Their
270+
// initials in most locales.
271+
AbbreviatedName string `json:"abbreviated_name"`
269272
}
270273

271274
// NewName returns a new Name instance
272-
func NewName(GivenName string, Surname string, FamiliarName string, DisplayName string) *Name {
275+
func NewName(GivenName string, Surname string, FamiliarName string, DisplayName string, AbbreviatedName string) *Name {
273276
s := new(Name)
274277
s.GivenName = GivenName
275278
s.Surname = Surname
276279
s.FamiliarName = FamiliarName
277280
s.DisplayName = DisplayName
281+
s.AbbreviatedName = AbbreviatedName
278282
return s
279283
}
280284

0 commit comments

Comments
 (0)