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