syntax = "proto3"; package user.v1; import "proto/user/v1/user.proto"; service UserAPI { // Create a User - compares uid against existing users + Authorization header rpc CreateUser(CreateUserRequest) returns (CreateUserResponse) {} // Retrieve a User - based on Authorization header rpc GetUser(GetUserRequest) returns (GetUserResponse) {} // Delete a User - based on Authorization header rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse) {} // Add a push token to users existing push token(s) rpc SavePushToken(SavePushTokenRequest) returns (SavePushTokenResponse) {} // Update user's account type - called by revenue cat lambda rpc UpdateAccountType(UpdateAccountTypeRequest) returns (UpdateAccountTypeResponse) {} } // Input to create a user message CreateUserRequest { string uid = 1; string email = 2; string name = 3; } // Response from creating a user message CreateUserResponse { User user = 1; } // Request details of a user fetch message GetUserRequest { string uid = 1; } // Response details of a user fetch message GetUserResponse { User user = 1; } // Request details of an account delete message DeleteUserRequest { string uid = 1; DeleteReason reason = 2; } // Response details of an account delete request message DeleteUserResponse {} // Request to store new push token message SavePushTokenRequest { string uid = 1; string push_token = 2; } // Response from storing push token message SavePushTokenResponse {} // Request to update users account type message UpdateAccountTypeRequest { string uid = 1; AccountType account_type = 2; } // Response from updating users account type message UpdateAccountTypeResponse {}