github.com/codefly-dev/core@v0.1.107/resources/testdata/endpoints/basic/proto/api.proto (about)

     1  syntax = "proto3";
     2  package management.organization;
     3  
     4  import "google/api/annotations.proto";
     5  import "google/protobuf/empty.proto";
     6  
     7  message VersionRequest {
     8  }
     9  
    10  message VersionResponse {
    11      string version = 1;
    12  }
    13  
    14  message User {
    15      string id = 1;
    16      string signup_auth_id = 2;
    17      string name = 3;
    18      string email = 4;
    19      string given_name = 5;
    20  }
    21  
    22  message GetUserResponse {
    23      User user = 1;
    24  }
    25  
    26  message Organization {
    27      string id = 1;
    28      string name = 2;
    29      // Domain corresponds vaguely to the organization URL in Github
    30      string domain = 3;
    31  }
    32  
    33  message CreateOrganizationRequest {
    34      string name = 1;
    35      string domain = 2;
    36  }
    37  
    38  message CreateOrganizationResponse {
    39      Organization org = 1;
    40  }
    41  
    42  service OrganizationService {
    43      rpc Version(VersionRequest) returns (VersionResponse) {
    44          option (google.api.http) = {
    45              get: "/version"
    46          };
    47      }
    48  
    49      rpc CreateSelf(google.protobuf.Empty) returns (GetUserResponse) {
    50          option (google.api.http) = {
    51              post: "/user"
    52          };
    53      }
    54  
    55      rpc GetSelf(google.protobuf.Empty) returns (GetUserResponse) {
    56          option (google.api.http) = {
    57              get: "/user"
    58          };
    59      }
    60  
    61      rpc CreateOrganization(CreateOrganizationRequest) returns (CreateOrganizationResponse) {
    62          option (google.api.http) = {
    63              post: "/organization"
    64              body: "*"
    65          };
    66      }
    67  
    68  }