|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +package gitpod.experimental.v1; |
| 4 | + |
| 5 | +option go_package = "github.com/gitpod-io/gitpod/public-api/experimental/v1"; |
| 6 | + |
| 7 | +message Team { |
| 8 | + // id is a UUID of the Team |
| 9 | + string id = 1; |
| 10 | + |
| 11 | + // name is the name of the Team |
| 12 | + string name = 2; |
| 13 | + |
| 14 | + // slug is the short version of the Team name |
| 15 | + string slug = 3; |
| 16 | + |
| 17 | + // members are the team members of this Team |
| 18 | + repeated TeamMember members = 4; |
| 19 | + |
| 20 | + // team_invitation is the team invitation. |
| 21 | + TeamInvitation team_invitation = 5; |
| 22 | +} |
| 23 | + |
| 24 | +message TeamMember { |
| 25 | + // user_id is the identifier of the user |
| 26 | + string user_id = 1; |
| 27 | + |
| 28 | + // role is the role this member is assigned |
| 29 | + TeamRole role = 2; |
| 30 | +} |
| 31 | + |
| 32 | +enum TeamRole { |
| 33 | + // TEAM_ROLE_UNKNOWN is the unkwnon state. |
| 34 | + TEAM_ROLE_UNSPECIFIED = 0; |
| 35 | + |
| 36 | + // TEAM_ROLE_OWNER is the owner of the team. |
| 37 | + // A team can have multiple owners, but there must always be at least one owner. |
| 38 | + TEAM_ROLE_OWNER = 1; |
| 39 | + |
| 40 | + // TEAM_ROLE_MEMBER is a regular member of a team. |
| 41 | + TEAM_ROLE_MEMBER = 2; |
| 42 | +} |
| 43 | + |
| 44 | +message TeamInvitation { |
| 45 | + // id is the invitation ID. |
| 46 | + string id = 1; |
| 47 | +} |
| 48 | + |
| 49 | +service TeamsService { |
| 50 | + |
| 51 | + // CreateTeam creates a new Team. |
| 52 | + rpc CreateTeam(CreateTeamRequest) returns (CreateTeamResponse) {}; |
| 53 | + |
| 54 | + // ListTeams lists the caller has access to. |
| 55 | + rpc ListTeams(ListTeamsRequest) returns (ListTeamsResponse) {}; |
| 56 | + |
| 57 | + // JoinTeam makes the caller a TeamMember of the Team. |
| 58 | + rpc JoinTeam(JoinTeamRequest) returns (JoinTeamResponse) {}; |
| 59 | + |
| 60 | + // ResetTeamInvitation resets the invitation_id for a Team. |
| 61 | + rpc ResetTeamInvitation(ResetTeamInvitationRequest) returns (ResetTeamInvitationResponse) {}; |
| 62 | + |
| 63 | + // UpdateTeamMember updates team membership properties. |
| 64 | + rpc UpdateTeamMember(UpdateTeamMemberRequest) returns (UpdateTeamMemberResponse) {}; |
| 65 | + |
| 66 | + // DeleteTeamMember removes a TeamMember from the Team. |
| 67 | + rpc DeleteTeamMember(DeleteTeamMemberRequest) returns (DeleteTeamMemberResponse) {}; |
| 68 | +} |
| 69 | + |
| 70 | +message CreateTeamRequest { |
| 71 | + // name is the team name |
| 72 | + string name = 1; |
| 73 | +} |
| 74 | + |
| 75 | +message CreateTeamResponse { |
| 76 | + Team team = 1; |
| 77 | +} |
| 78 | + |
| 79 | +message ListTeamsRequest { |
| 80 | + // TODO: pagination options |
| 81 | +} |
| 82 | + |
| 83 | +message ListTeamsResponse { |
| 84 | + repeated Team teams = 1; |
| 85 | +} |
| 86 | + |
| 87 | +message JoinTeamRequest { |
| 88 | + // invitation_id is the invitation ID for a Team |
| 89 | + string invitation_id = 1; |
| 90 | +} |
| 91 | + |
| 92 | +message JoinTeamResponse { |
| 93 | + // team is the team the user has just joined |
| 94 | + Team team = 1; |
| 95 | +} |
| 96 | + |
| 97 | +message ResetTeamInvitationRequest { |
| 98 | + string team_id = 1; |
| 99 | +} |
| 100 | + |
| 101 | +message ResetTeamInvitationResponse { |
| 102 | + // team_invitation is the new invitation for the team. |
| 103 | + TeamInvitation team_invitation = 1; |
| 104 | +} |
| 105 | + |
| 106 | +message UpdateTeamMemberRequest { |
| 107 | + // team_id is the ID of the team in which the role is to be updated |
| 108 | + string team_id = 1; |
| 109 | + |
| 110 | + // team_member is the team member being updated. |
| 111 | + TeamMember team_member = 2; |
| 112 | + |
| 113 | +} |
| 114 | + |
| 115 | +message UpdateTeamMemberResponse { |
| 116 | + TeamMember team_member = 2; |
| 117 | +} |
| 118 | + |
| 119 | +message DeleteTeamMemberRequest { |
| 120 | + // team_id is the ID of the team in which a member should be deleted. |
| 121 | + string team_id = 1; |
| 122 | + |
| 123 | + // team_member_id is the ID of the TeamMember that should be deleted from the team. |
| 124 | + string team_member_id = 2; |
| 125 | +} |
| 126 | + |
| 127 | +message DeleteTeamMemberResponse {} |
0 commit comments