|
| 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 | +service OrganizationService { |
| 34 | + // CreateOrganization creates a new Organization. |
| 35 | + rpc CreateOrganization(CreateOrganizationRequest) returns (CreateOrganizationResponse) {}; |
| 36 | + |
| 37 | + // GetOrganization retrieves a single Organization. |
| 38 | + rpc GetOrganization(GetOrganizationRequest) returns (GetOrganizationResponse) {} |
| 39 | + |
| 40 | + // ListOrganizations lists all organization the caller has access to. |
| 41 | + rpc ListOrganizations(ListOrganizationsRequest) returns (ListOrganizationsResponse) {}; |
| 42 | + |
| 43 | + // DeleteOrganization deletes the specified organization. |
| 44 | + rpc DeleteOrganization(DeleteOrganizationRequest) returns (DeleteOrganizationResponse) {}; |
| 45 | + |
| 46 | + // GetOrganizationInvitation retrieves the invitation for a Organization. |
| 47 | + rpc GetOrganizationInvitation(GetOrganizationInvitationRequest) returns (GetOrganizationInvitationResponse) {}; |
| 48 | + |
| 49 | + // JoinOrganization makes the caller a OrganizationMember of the Organization. |
| 50 | + rpc JoinOrganization(JoinOrganizationRequest) returns (JoinOrganizationResponse) {}; |
| 51 | + |
| 52 | + // ResetOrganizationInvitation resets the invitation_id for a Organization. |
| 53 | + rpc ResetOrganizationInvitation(ResetOrganizationInvitationRequest) returns (ResetOrganizationInvitationResponse) {}; |
| 54 | + |
| 55 | + // ListOrganizationMembers lists the members of a Organization. |
| 56 | + rpc ListOrganizationMembers(ListOrganizationMembersRequest) returns (ListOrganizationMembersResponse) {}; |
| 57 | + |
| 58 | + // UpdateOrganizationMember updates organization membership properties. |
| 59 | + rpc UpdateOrganizationMember(UpdateOrganizationMemberRequest) returns (UpdateOrganizationMemberResponse) {}; |
| 60 | + |
| 61 | + // DeleteOrganizationMember removes a OrganizationMember from the Organization. |
| 62 | + rpc DeleteOrganizationMember(DeleteOrganizationMemberRequest) returns (DeleteOrganizationMemberResponse) {}; |
| 63 | +} |
| 64 | + |
| 65 | +message CreateOrganizationRequest { |
| 66 | + // name is the organization name |
| 67 | + string name = 1; |
| 68 | +} |
| 69 | + |
| 70 | +message CreateOrganizationResponse { |
| 71 | + Organization organization = 1; |
| 72 | +} |
| 73 | + |
| 74 | +message GetOrganizationRequest { |
| 75 | + // organization_id is the unique identifier of the Organization to retreive. |
| 76 | + string organization_id = 1; |
| 77 | +} |
| 78 | + |
| 79 | +message GetOrganizationResponse { |
| 80 | + Organization organization = 1; |
| 81 | +} |
| 82 | + |
| 83 | +message ListOrganizationsRequest { |
| 84 | + PaginationRequest pagination = 1; |
| 85 | +} |
| 86 | + |
| 87 | +message ListOrganizationsResponse { |
| 88 | + repeated Organization organizations = 1; |
| 89 | + PaginationResponse pagination = 2; |
| 90 | +} |
| 91 | + |
| 92 | +message DeleteOrganizationRequest { |
| 93 | + // organization_id is the ID of the organization to delete |
| 94 | + string organization_id = 1; |
| 95 | +} |
| 96 | + |
| 97 | +message DeleteOrganizationResponse { |
| 98 | +} |
| 99 | + |
| 100 | +message GetOrganizationInvitationRequest { |
| 101 | + string organization_id = 1; |
| 102 | +} |
| 103 | + |
| 104 | +message GetOrganizationInvitationResponse { |
| 105 | + // invitation_id is the invitation ID for an Organization |
| 106 | + string invitation_id = 1; |
| 107 | +} |
| 108 | + |
| 109 | +message JoinOrganizationRequest { |
| 110 | + // invitation_id is the invitation ID for an Organization |
| 111 | + string invitation_id = 1; |
| 112 | +} |
| 113 | + |
| 114 | +message JoinOrganizationResponse { |
| 115 | + // organization_id is the id of the organization the user has just joined |
| 116 | + string organization_id = 1; |
| 117 | +} |
| 118 | + |
| 119 | +message ResetOrganizationInvitationRequest { |
| 120 | + string organization_id = 1; |
| 121 | +} |
| 122 | + |
| 123 | +message ResetOrganizationInvitationResponse { |
| 124 | + // invitation_id is the new invitation id for the organization. |
| 125 | + string invitation_id = 1; |
| 126 | +} |
| 127 | + |
| 128 | +message ListOrganizationMembersRequest { |
| 129 | + // organization_id is the ID of the organization that contains the members to list |
| 130 | + string organization_id = 1; |
| 131 | + PaginationRequest pagination = 2; |
| 132 | +} |
| 133 | + |
| 134 | +message ListOrganizationMembersResponse { |
| 135 | + // members are the organization members of this Organization |
| 136 | + repeated OrganizationMember members = 1; |
| 137 | + PaginationResponse pagination = 2; |
| 138 | +} |
| 139 | + |
| 140 | +message UpdateOrganizationMemberRequest { |
| 141 | + // organization_id is the ID of the organization in which the role is to be updated |
| 142 | + string organization_id = 1; |
| 143 | + |
| 144 | + // user_id is the user for which the membership shall be updated. |
| 145 | + string user_id = 2; |
| 146 | + |
| 147 | + // role is the new role for the user in the organization |
| 148 | + OrganizationRole role = 3; |
| 149 | +} |
| 150 | + |
| 151 | +message UpdateOrganizationMemberResponse { |
| 152 | +} |
| 153 | + |
| 154 | +message DeleteOrganizationMemberRequest { |
| 155 | + // organization_id is the ID of the organization in which a member should be deleted. |
| 156 | + string organization_id = 1; |
| 157 | + |
| 158 | + // user_id is the ID of the user that should be deleted from the organization. |
| 159 | + string user_id = 2; |
| 160 | +} |
| 161 | + |
| 162 | +message DeleteOrganizationMemberResponse {} |
0 commit comments