syntax = "proto2";

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

option cc_generic_services = true;

message CPartnerApps_RequestUploadToken_Request {
  optional string filename = 1;
  optional uint32 appid = 2;
}

message CPartnerApps_RequestUploadToken_Response {
  optional uint64 upload_token = 1;
  optional string location = 2;
  optional uint64 routing_id = 3;
}

message CPartnerApps_FinishUpload_Request {
  optional uint64 upload_token = 1;
  optional uint64 routing_id = 2;
  optional uint32 app_id = 3;
}

message CPartnerApps_FinishUploadKVSign_Response {
  optional string signed_installscript = 1;
}

message CPartnerApps_FinishUploadLegacyDRM_Request {
  optional uint64 upload_token = 1;
  optional uint64 routing_id = 2;
  optional uint32 app_id = 3;
  optional uint32 flags = 4;
  optional string tool_name = 5;
  optional bool use_cloud = 6 [default = false];
}

message CPartnerApps_FinishUploadLegacyDRM_Response {
  optional string file_id = 1;
}

message CPartnerApps_FinishUpload_Response {
}

message CPartnerApps_FinishUploadDepot_Request {
  optional uint64 upload_token = 1;
  optional uint64 routing_id = 2;
  optional uint32 app_id = 3;
  optional uint32 depot_id = 4;
  optional uint32 build_flags = 5;
}

message CPartnerApps_FinishUploadDepot_Response {
  optional uint64 build_routing_id = 1;
}

message CPartnerApps_GetDepotBuildResult_Request {
  optional uint64 upload_token = 1;
  optional uint64 routing_id = 2;
}

message CPartnerApps_GetDepotBuildResult_Response {
  optional uint64 manifest_id = 1;
  optional string error_msg = 2;
}

message CPartnerApps_FindDRMUploads_Request {
  optional int32 app_id = 1;
}

message CPartnerApps_ExistingDRMUpload {
  optional string file_id = 1;
  optional uint32 app_id = 2;
  optional int32 actor_id = 3;
  optional string supplied_name = 5;
  optional uint32 flags = 6;
  optional string mod_type = 7;
  optional fixed32 timestamp = 8;
  optional string orig_file_id = 9;
}

message CPartnerApps_FindDRMUploads_Response {
  repeated CPartnerApps_ExistingDRMUpload uploads = 1;
}

message CPartnerApps_Download_Request {
  optional string file_id = 1;
  optional int32 app_id = 2;
}

message CPartnerApps_Download_Response {
  optional string download_url = 1;
  optional int32 app_id = 2;
}

service PartnerApps {
  rpc RequestKVSignUploadToken (.CPartnerApps_RequestUploadToken_Request) returns (.CPartnerApps_RequestUploadToken_Response);
  rpc RequestDRMUploadToken (.CPartnerApps_RequestUploadToken_Request) returns (.CPartnerApps_RequestUploadToken_Response);
  rpc RequestCEGUploadToken (.CPartnerApps_RequestUploadToken_Request) returns (.CPartnerApps_RequestUploadToken_Response);
  rpc RequestDepotUploadToken (.CPartnerApps_RequestUploadToken_Request) returns (.CPartnerApps_RequestUploadToken_Response);
  rpc FinishUploadKVSign (.CPartnerApps_FinishUpload_Request) returns (.CPartnerApps_FinishUploadKVSign_Response);
  rpc FinishUploadDRMUpload (.CPartnerApps_FinishUploadLegacyDRM_Request) returns (.CPartnerApps_FinishUploadLegacyDRM_Response);
  rpc FinishUploadCEGUpload (.CPartnerApps_FinishUpload_Request) returns (.CPartnerApps_FinishUpload_Response);
  rpc FinishUploadDepotUpload (.CPartnerApps_FinishUploadDepot_Request) returns (.CPartnerApps_FinishUploadDepot_Response);
  rpc GetDepotBuildResult (.CPartnerApps_GetDepotBuildResult_Request) returns (.CPartnerApps_GetDepotBuildResult_Response) {
  }
  rpc FindDRMUploads (.CPartnerApps_FindDRMUploads_Request) returns (.CPartnerApps_FindDRMUploads_Response);
  rpc Download (.CPartnerApps_Download_Request) returns (.CPartnerApps_Download_Response) {
  }
}

