syntax = "proto2";

import "steammessages_base.proto";
import "steammessages_unified_base.steamclient.proto";

option cc_generic_services = true;

enum EValveIndexComponent {
  k_EValveIndexComponentUnknown = 0;
  k_EValveIndexComponentHMD = 1;
  k_EValveIndexComponentLeftKnuckle = 2;
  k_EValveIndexComponentRightKnuckle = 3;
  k_EValveIndexComponentSteamFrameHMD = 4;
  k_EValveIndexComponentSteamFrameLeftController = 5;
  k_EValveIndexComponentSteamFrameRightController = 6;
  k_EValveIndexComponentSteamFrameWirelessAdapter = 7;
}

message CAccountHardware_RegisterSteamController_Request {
  optional string serial_number = 1;
  optional string controller_code = 2;
}

message CAccountHardware_RegisterSteamController_Response {
}

message CAccountHardware_CompleteSteamControllerRegistration_Request {
  optional string serial_number = 1;
  optional string controller_code = 2;
}

message CAccountHardware_CompleteSteamControllerRegistration_Response {
}

message CAccountHardware_QueryAccountsRegisteredToSerial_Request {
  optional string serial_number = 1;
  optional string controller_code = 2;
}

message CAccountHardware_QueryAccountsRegisteredToSerial_Accounts {
  optional uint32 accountid = 1;
  optional bool registration_complete = 2;
}

message CAccountHardware_QueryAccountsRegisteredToSerial_Response {
  repeated CAccountHardware_QueryAccountsRegisteredToSerial_Accounts accounts = 1;
}

message CAccountHardware_UpdateControllerUsageReport_Request {
  message Controller {
    optional string serial_number = 1;
    optional string controller_code = 2;
  }
  repeated CAccountHardware_UpdateControllerUsageReport_Request.Controller controllers = 1;
}

message CAccountHardware_UpdateControllerUsageReport_Response {
}

message CAccountHardware_SteamControllerSetConfig_ControllerConfig {
  optional string appidorname = 1;
  optional uint64 publishedfileid = 2;
  optional string templatename = 3;
}

message CAccountHardware_SteamControllerSetConfig_Request {
  optional string serial_number = 1;
  optional string controller_code = 2;
  optional uint32 accountid = 3;
  repeated CAccountHardware_SteamControllerSetConfig_ControllerConfig configurations = 4;
  optional int32 controller_type = 5 [default = 2];
  optional bool only_for_this_serial = 6 [default = false];
}

message CAccountHardware_SteamControllerSetConfig_Response {
}

message CAccountHardware_SteamControllerGetConfig_Request {
  optional string serial_number = 1;
  optional string controller_code = 2;
  optional uint32 accountid = 3;
  optional string appidorname = 4;
  optional int32 controller_type = 5 [default = 2];
  optional bool only_for_this_serial = 6 [default = false];
}

message CAccountHardware_SteamControllerGetConfig_ControllerConfig {
  optional string appidorname = 1;
  optional uint64 publishedfileid = 2;
  optional string templatename = 3;
  optional string serial_number = 4 [default = ""];
  optional bool autosave = 5 [default = false];
}

message CAccountHardware_SteamControllerGetConfig_Response {
  repeated CAccountHardware_SteamControllerGetConfig_ControllerConfig configurations = 1;
}

message CAccountHardware_DeRegisterSteamController_Request {
  optional string serial_number = 1;
  optional string controller_code = 2;
  optional uint32 accountid = 3;
}

message CAccountHardware_DeRegisterSteamController_Response {
}

message CAccountHardware_SetPersonalizationFile_Request {
  optional string serial_number = 1;
  optional uint64 publishedfileid = 2;
  optional uint32 accountid = 3;
}

message CAccountHardware_SetPersonalizationFile_Response {
}

message CAccountHardware_GetPersonalizationFile_Request {
  optional string serial_number = 1;
  optional uint32 accountid = 2;
}

message CAccountHardware_GetPersonalizationFile_Response {
  optional uint64 publishedfileid = 1;
}

message CAccountHardware_VRCompatibilityCheck_Request {
  message Pair {
    optional string key = 1;
    optional string value = 2;
  }
  optional string product_name = 1;
  repeated CAccountHardware_VRCompatibilityCheck_Request.Pair values = 2;
}

message CAccountHardware_VRCompatibilityCheck_Response {
  message Pair {
    optional string key = 1;
    optional string value = 2;
  }
  message ComponentDisplay {
    optional string name = 1;
    optional string image = 2;
    optional string value = 3;
  }
  repeated CAccountHardware_VRCompatibilityCheck_Response.Pair values = 1;
  repeated CAccountHardware_VRCompatibilityCheck_Response.ComponentDisplay components = 2;
}

message CAccountHardware_RegisterValveIndexComponent_Request {
  optional string serial_number = 1;
  optional string manufacturer_serial_number = 2;
  optional string component_code = 3;
  optional EValveIndexComponent component_type = 4;
  optional int32 estimated_time_registered = 5;
}

message CAccountHardware_RegisterValveIndexComponent_Response {
}

message CAccountHardware_GetSteamDeckComponents_Request {
  optional string serial_number = 1;
  optional string controller_code = 2;
}

message CAccountHardware_GetSteamDeckComponents_Response {
  optional string json_components = 1;
}

message CAccountHardware_SaveHardware_Request {
  optional string friendly_name = 1;
  optional UserSystemInformation system_info = 2;
  optional bool backfill_user_reviews = 3;
}

message CAccountHardware_SaveHardware_Response {
  optional uint64 hardware_id = 1;
}

message CAccountHardware_ManageSavedHardware_Request {
  optional uint64 hardware_id = 1;
  optional bool delete_hardware = 2;
  optional string friendly_name_update = 3;
}

message CAccountHardware_ManageSavedHardware_Response {
}

message CAccountHardware_GetSavedHardwareList_Request {
  optional fixed64 steamid = 1;
}

message CAccountHardware_SavedHardware_Details {
  optional uint64 hardware_id = 1;
  optional string friendly_name = 2;
  optional uint32 timestamp_created = 3;
  optional uint64 hardware_cluster_id = 4;
  optional UserSystemInformation system_info = 5;
}

message CAccountHardware_GetSavedHardwareList_Response {
  repeated CAccountHardware_SavedHardware_Details saved_hardware = 1;
}

service AccountHardware {
  rpc RegisterSteamController (.CAccountHardware_RegisterSteamController_Request) returns (.CAccountHardware_RegisterSteamController_Response) {
  }
  rpc CompleteSteamControllerRegistration (.CAccountHardware_CompleteSteamControllerRegistration_Request) returns (.CAccountHardware_CompleteSteamControllerRegistration_Response) {
  }
  rpc QueryAccountsRegisteredToController (.CAccountHardware_QueryAccountsRegisteredToSerial_Request) returns (.CAccountHardware_QueryAccountsRegisteredToSerial_Response) {
  }
  rpc UpdateControllerUsageReport (.CAccountHardware_UpdateControllerUsageReport_Request) returns (.CAccountHardware_UpdateControllerUsageReport_Response) {
  }
  rpc SetDesiredControllerConfigForApp (.CAccountHardware_SteamControllerSetConfig_Request) returns (.CAccountHardware_SteamControllerSetConfig_Response) {
  }
  rpc GetDesiredControllerConfigForApp (.CAccountHardware_SteamControllerGetConfig_Request) returns (.CAccountHardware_SteamControllerGetConfig_Response) {
  }
  rpc DeRegisterSteamController (.CAccountHardware_DeRegisterSteamController_Request) returns (.CAccountHardware_DeRegisterSteamController_Response) {
  }
  rpc SetControllerPersonalizationFile (.CAccountHardware_SetPersonalizationFile_Request) returns (.CAccountHardware_SetPersonalizationFile_Response) {
  }
  rpc GetControllerPersonalizationFile (.CAccountHardware_GetPersonalizationFile_Request) returns (.CAccountHardware_GetPersonalizationFile_Response) {
  }
  rpc VRCompatibilityCheck (.CAccountHardware_VRCompatibilityCheck_Request) returns (.CAccountHardware_VRCompatibilityCheck_Response) {
  }
  rpc RegisterValveIndexComponent (.CAccountHardware_RegisterValveIndexComponent_Request) returns (.CAccountHardware_RegisterValveIndexComponent_Response) {
  }
  rpc GetSteamDeckComponents (.CAccountHardware_GetSteamDeckComponents_Request) returns (.CAccountHardware_GetSteamDeckComponents_Response) {
  }
  rpc SaveHardware (.CAccountHardware_SaveHardware_Request) returns (.CAccountHardware_SaveHardware_Response) {
  }
  rpc ManageSavedHardware (.CAccountHardware_ManageSavedHardware_Request) returns (.CAccountHardware_ManageSavedHardware_Response) {
  }
  rpc GetSavedHardwareList (.CAccountHardware_GetSavedHardwareList_Request) returns (.CAccountHardware_GetSavedHardwareList_Response) {
  }
}

