syntax = "proto3";

package slash.store;

option go_package = "gen/store";

message UserSetting {
  int32 user_id = 1;

  UserSettingKey key = 2;

  oneof value {
    UserSettingGeneral general = 3;

    UserSettingAccessTokens access_tokens = 4;
  }
}

enum UserSettingKey {
  USER_SETTING_KEY_UNSPECIFIED = 0;
  // General settings for the user.
  GENERAL = 1;
  // Access tokens for the user.
  ACCESS_TOKENS = 2;
}

message UserSettingGeneral {
  string locale = 1;
  string color_theme = 2;
}

message UserSettingAccessTokens {
  message AccessToken {
    // The access token is a JWT token.
    // Including expiration time, issuer, etc.
    string access_token = 1;
    // A description for the access token.
    string description = 2;
  }
  repeated AccessToken access_tokens = 1;
}
