|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +package gitpod.experimental.v2; |
| 4 | + |
| 5 | +import "google/protobuf/timestamp.proto"; |
| 6 | +import "gitpod/experimental/v2/pagination.proto"; |
| 7 | + |
| 8 | +option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/experimental/v2"; |
| 9 | + |
| 10 | + |
| 11 | +message Organization { |
| 12 | + string id = 1; |
| 13 | + string name = 2; |
| 14 | + google.protobuf.Timestamp creation_time = 3; |
| 15 | +} |
| 16 | + |
| 17 | +message OrganizationMember { |
| 18 | + string user_id = 1; |
| 19 | + OrganizationRole role = 2; |
| 20 | + google.protobuf.Timestamp member_since = 3; |
| 21 | + optional string avatar_url = 4; |
| 22 | + optional string full_name = 5; |
| 23 | + optional string primary_email = 6; |
| 24 | + bool owned_by_organization = 7; |
| 25 | +} |
| 26 | + |
| 27 | +enum OrganizationRole { |
| 28 | + ORGANIZATION_ROLE_UNSPECIFIED = 0; |
| 29 | + ORGANIZATION_ROLE_OWNER = 1; |
| 30 | + ORGANIZATION_ROLE_MEMBER = 2; |
| 31 | +} |
| 32 | + |
| 33 | +message OrganizationSettings { |
| 34 | + bool workspace_sharing_disabled = 1; |
| 35 | + optional string default_workspace_image = 2; |
| 36 | +} |
| 37 | + |
| 38 | +service OrganizationService { |
| 39 | + // CreateOrganization creates a new Organization. |
| 40 | + rpc CreateOrganization(CreateOrganizationRequest) returns (CreateOrganizationResponse) {}; |
| 41 | + |
| 42 | + // GetOrganization retrieves a single Organization. |
| 43 | + rpc GetOrganization(GetOrganizationRequest) returns (GetOrganizationResponse) {} |
| 44 | + |
| 45 | + // UpdateOrganization updates the properties of an Organization. |
| 46 | + rpc UpdateOrganization(UpdateOrganizationRequest) returns (UpdateOrganizationResponse) {}; |
| 47 | + |
| 48 | + // ListOrganizations lists all organization the caller has access to. |
| 49 | + rpc ListOrganizations(ListOrganizationsRequest) returns (ListOrganizationsResponse) {}; |
| 50 | + |
| 51 | + // DeleteOrganization deletes the specified organization. |
| 52 | + rpc DeleteOrganization(DeleteOrganizationRequest) returns (DeleteOrganizationResponse) {}; |
| 53 | + |
| 54 | + // GetOrganizationInvitation retrieves the invitation for a Organization. |
| 55 | + rpc GetOrganizationInvitation(GetOrganizationInvitationRequest) returns (GetOrganizationInvitationResponse) {}; |
| 56 | + |
| 57 | + // JoinOrganization makes the caller a OrganizationMember of the Organization. |
| 58 | + rpc JoinOrganization(JoinOrganizationRequest) returns (JoinOrganizationResponse) {}; |
| 59 | + |
| 60 | + // ResetOrganizationInvitation resets the invitation_id for a Organization. |
| 61 | + rpc ResetOrganizationInvitation(ResetOrganizationInvitationRequest) returns (ResetOrganizationInvitationResponse) {}; |
| 62 | + |
| 63 | + // ListOrganizationMembers lists the members of a Organization. |
| 64 | + rpc ListOrganizationMembers(ListOrganizationMembersRequest) returns (ListOrganizationMembersResponse) {}; |
| 65 | + |
| 66 | + // UpdateOrganizationMember updates organization membership properties. |
| 67 | + rpc UpdateOrganizationMember(UpdateOrganizationMemberRequest) returns (UpdateOrganizationMemberResponse) {}; |
| 68 | + |
| 69 | + // DeleteOrganizationMember removes a OrganizationMember from the Organization. |
| 70 | + rpc DeleteOrganizationMember(DeleteOrganizationMemberRequest) returns (DeleteOrganizationMemberResponse) {}; |
| 71 | + |
| 72 | + // GetOrganizationSettings retrieves the settings of a Organization. |
| 73 | + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (GetOrganizationSettingsResponse) {}; |
| 74 | + |
| 75 | + // UpdateOrganizationSettings updates the settings of a Organization. |
| 76 | + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (UpdateOrganizationSettingsResponse) {}; |
| 77 | +} |
| 78 | + |
| 79 | +message UpdateOrganizationRequest { |
| 80 | + // organization_id is the ID of the organization to update the settings for. |
| 81 | + string organization_id = 1; |
| 82 | + |
| 83 | + // name is the new name of the organization |
| 84 | + string name = 2; |
| 85 | +} |
| 86 | + |
| 87 | +message UpdateOrganizationResponse { |
| 88 | +} |
| 89 | + |
| 90 | +message UpdateOrganizationSettingsRequest { |
| 91 | + // organization_id is the ID of the organization to update the settings for. |
| 92 | + string organization_id = 1; |
| 93 | + |
| 94 | + // settings are the settings to update |
| 95 | + OrganizationSettings settings = 2; |
| 96 | +} |
| 97 | + |
| 98 | +message UpdateOrganizationSettingsResponse { |
| 99 | +} |
| 100 | + |
| 101 | +message GetOrganizationSettingsRequest { |
| 102 | + // organization_id is the ID of the organization to retrieve the settings for. |
| 103 | + string organization_id = 1; |
| 104 | +} |
| 105 | + |
| 106 | +message GetOrganizationSettingsResponse { |
| 107 | + // settings are the settings of the organization |
| 108 | + OrganizationSettings settings = 1; |
| 109 | +} |
| 110 | + |
| 111 | +message CreateOrganizationRequest { |
| 112 | + // name is the organization name |
| 113 | + string name = 1; |
| 114 | +} |
| 115 | + |
| 116 | +message CreateOrganizationResponse { |
| 117 | + Organization organization = 1; |
| 118 | +} |
| 119 | + |
| 120 | +message GetOrganizationRequest { |
| 121 | + // organization_id is the unique identifier of the Organization to retreive. |
| 122 | + string organization_id = 1; |
| 123 | +} |
| 124 | + |
| 125 | +message GetOrganizationResponse { |
| 126 | + Organization organization = 1; |
| 127 | +} |
| 128 | + |
| 129 | +message ListOrganizationsRequest { |
| 130 | + PaginationRequest pagination = 1; |
| 131 | +} |
| 132 | + |
| 133 | +message ListOrganizationsResponse { |
| 134 | + repeated Organization organizations = 1; |
| 135 | + PaginationResponse pagination = 2; |
| 136 | +} |
| 137 | + |
| 138 | +message DeleteOrganizationRequest { |
| 139 | + // organization_id is the ID of the organization to delete |
| 140 | + string organization_id = 1; |
| 141 | +} |
| 142 | + |
| 143 | +message DeleteOrganizationResponse { |
| 144 | +} |
| 145 | + |
| 146 | +message GetOrganizationInvitationRequest { |
| 147 | + string organization_id = 1; |
| 148 | +} |
| 149 | + |
| 150 | +message GetOrganizationInvitationResponse { |
| 151 | + // invitation_id is the invitation ID for an Organization |
| 152 | + string invitation_id = 1; |
| 153 | +} |
| 154 | + |
| 155 | +message JoinOrganizationRequest { |
| 156 | + // invitation_id is the invitation ID for an Organization |
| 157 | + string invitation_id = 1; |
| 158 | +} |
| 159 | + |
| 160 | +message JoinOrganizationResponse { |
| 161 | + // organization_id is the id of the organization the user has just joined |
| 162 | + string organization_id = 1; |
| 163 | +} |
| 164 | + |
| 165 | +message ResetOrganizationInvitationRequest { |
| 166 | + string organization_id = 1; |
| 167 | +} |
| 168 | + |
| 169 | +message ResetOrganizationInvitationResponse { |
| 170 | + // invitation_id is the new invitation id for the organization. |
| 171 | + string invitation_id = 1; |
| 172 | +} |
| 173 | + |
| 174 | +message ListOrganizationMembersRequest { |
| 175 | + // organization_id is the ID of the organization that contains the members to list |
| 176 | + string organization_id = 1; |
| 177 | + PaginationRequest pagination = 2; |
| 178 | +} |
| 179 | + |
| 180 | +message ListOrganizationMembersResponse { |
| 181 | + // members are the organization members of this Organization |
| 182 | + repeated OrganizationMember members = 1; |
| 183 | + PaginationResponse pagination = 2; |
| 184 | +} |
| 185 | + |
| 186 | +message UpdateOrganizationMemberRequest { |
| 187 | + // organization_id is the ID of the organization in which the role is to be updated |
| 188 | + string organization_id = 1; |
| 189 | + |
| 190 | + // user_id is the user for which the membership shall be updated. |
| 191 | + string user_id = 2; |
| 192 | + |
| 193 | + // role is the new role for the user in the organization |
| 194 | + OrganizationRole role = 3; |
| 195 | +} |
| 196 | + |
| 197 | +message UpdateOrganizationMemberResponse { |
| 198 | +} |
| 199 | + |
| 200 | +message DeleteOrganizationMemberRequest { |
| 201 | + // organization_id is the ID of the organization in which a member should be deleted. |
| 202 | + string organization_id = 1; |
| 203 | + |
| 204 | + // user_id is the ID of the user that should be deleted from the organization. |
| 205 | + string user_id = 2; |
| 206 | +} |
| 207 | + |
| 208 | +message DeleteOrganizationMemberResponse {} |
0 commit comments