@@ -84,6 +84,10 @@ type APIInterface interface {
84
84
TrackEvent (ctx context.Context , event * RemoteTrackMessage ) (err error )
85
85
GetSupportedWorkspaceClasses (ctx context.Context ) (res []* SupportedWorkspaceClass , err error )
86
86
87
+ CreateTeam (ctx context.Context , params string ) (* Team , error )
88
+ GetTeamMembers (ctx context.Context , params string ) ([]* TeamMemberInfo , error )
89
+ JoinTeam (ctx context.Context , params string ) (* Team , error )
90
+
87
91
InstanceUpdates (ctx context.Context , instanceID string ) (<- chan * WorkspaceInstance , error )
88
92
}
89
93
@@ -1382,6 +1386,36 @@ func (gp *APIoverJSONRPC) GetSupportedWorkspaceClasses(ctx context.Context) (res
1382
1386
return
1383
1387
}
1384
1388
1389
+ func (gp * APIoverJSONRPC ) CreateTeam (ctx context.Context , teamName string ) (res * Team , err error ) {
1390
+ if gp == nil {
1391
+ err = errNotConnected
1392
+ return
1393
+ }
1394
+ _params := []interface {}{teamName }
1395
+ err = gp .C .Call (ctx , "createTeam" , _params , & res )
1396
+ return
1397
+ }
1398
+
1399
+ func (gp * APIoverJSONRPC ) GetTeamMembers (ctx context.Context , teamID string ) (res []* TeamMemberInfo , err error ) {
1400
+ if gp == nil {
1401
+ err = errNotConnected
1402
+ return
1403
+ }
1404
+ _params := []interface {}{teamID }
1405
+ err = gp .C .Call (ctx , "getTeamMembers" , _params , & res )
1406
+ return
1407
+ }
1408
+
1409
+ func (gp * APIoverJSONRPC ) JoinTeam (ctx context.Context , inviteID string ) (res * Team , err error ) {
1410
+ if gp == nil {
1411
+ err = errNotConnected
1412
+ return
1413
+ }
1414
+ _params := []interface {}{inviteID }
1415
+ err = gp .C .Call (ctx , "joinTeam" , _params , & res )
1416
+ return
1417
+ }
1418
+
1385
1419
// PermissionName is the name of a permission
1386
1420
type PermissionName string
1387
1421
@@ -2074,3 +2108,26 @@ type UserMessage struct {
2074
2108
Title string `json:"title,omitempty"`
2075
2109
URL string `json:"url,omitempty"`
2076
2110
}
2111
+
2112
+ type Team struct {
2113
+ ID string `json:"id,omitempty"`
2114
+ Name string `json:"name,omitempty"`
2115
+ Slug string `json:"slug,omitempty"`
2116
+ CreationTime string `json:"creationTime,omitempty"`
2117
+ }
2118
+
2119
+ type TeamMemberRole string
2120
+
2121
+ const (
2122
+ TeamMember_Owner TeamMemberRole = "owner"
2123
+ TeamMember_Member TeamMemberRole = "member"
2124
+ )
2125
+
2126
+ type TeamMemberInfo struct {
2127
+ UserId string `json:"userId,omitempty"`
2128
+ FullName string `json:"fullName,omitempty"`
2129
+ PrimaryEmail string `json:"primaryEmail,omitempty"`
2130
+ AvatarUrl string `json:"avatarUrl,omitempty"`
2131
+ Role TeamMemberRole `json:"role,omitempty"`
2132
+ MemberSince string `json:"memberSince,omitempty"`
2133
+ }
0 commit comments