import "common_base.proto";
import "common.proto";

message CSteamDeckCompatibility_SetFeedback_Request {
	optional uint32 appid = 1;
	optional int32 feedback = 2 [(.description) = "enum"];
}

message CSteamDeckCompatibility_SetFeedback_Response {
}

message CSteamDeckCompatibility_ShouldPrompt_Request {
	optional uint32 appid = 1;
}

message CSteamDeckCompatibility_ShouldPrompt_Response {
	optional bool prompt = 1;
	optional bool feedback_eligible = 2;
	optional int32 existing_feedback = 3 [(.description) = "enum"];
}

message CStore_GetDiscoveryQueue_Request {
	optional int32 queue_type = 1 [(.description) = "enum"];
	optional string country_code = 2;
	optional bool rebuild_queue = 3;
	optional bool settings_changed = 4;
	optional .CStoreDiscoveryQueueSettings settings = 5;
	optional bool rebuild_queue_if_stale = 6;
	optional bool ignore_user_preferences = 8;
	optional bool no_experimental_results = 9;
	optional uint32 experimental_cohort = 10;
	optional bool debug_get_solr_query = 11;
	optional .CStorePageFilter store_page_filter = 12;
}

message CStore_GetDiscoveryQueue_Response {
	repeated uint32 appids = 1;
	optional string country_code = 2;
	optional .CStoreDiscoveryQueueSettings settings = 3;
	optional int32 skipped = 4;
	optional bool exhausted = 5;
	optional uint32 experimental_cohort = 6;
	optional string debug_solr_query = 7;
}

message CStore_GetDiscoveryQueueSettings_Response {
	optional string country_code = 1;
	optional .CStoreDiscoveryQueueSettings settings = 2;
}

message CStore_GetDiscoveryQueueSkippedApps_Request {
	optional fixed64 steamid = 1;
	optional int32 queue_type = 2 [(.description) = "enum"];
	optional .CStorePageFilter store_page_filter = 3;
}

message CStore_GetDiscoveryQueueSkippedApps_Response {
	repeated uint32 appids = 1;
}

message CStore_GetLocalizedNameForTags_Request {
	optional string language = 1;
	repeated uint32 tagids = 2;
}

message CStore_GetLocalizedNameForTags_Response {
	repeated .CStore_GetLocalizedNameForTags_Response_Tag tags = 1;
}

message CStore_GetLocalizedNameForTags_Response_Tag {
	optional uint32 tagid = 1;
	optional string english_name = 2;
	optional string name = 3;
	optional string normalized_name = 4;
}

message CStore_GetMostPopularTags_Request {
	optional string language = 1;
}

message CStore_GetMostPopularTags_Response {
	repeated .CStore_GetMostPopularTags_Response_Tag tags = 1;
}

message CStore_GetMostPopularTags_Response_Tag {
	optional uint32 tagid = 1;
	optional string name = 2;
}

message CStore_GetStorePreferences_Request {
}

message CStore_GetStorePreferences_Response {
	optional .CStore_UserPreferences preferences = 1;
	optional .CStore_UserTagPreferences tag_preferences = 2;
	optional .CStore_UserContentDescriptorPreferences content_descriptor_preferences = 3;
}

message CStore_GetTrendingAppsAmongFriends_Request {
	optional uint32 num_apps = 1;
	optional uint32 num_top_friends = 2;
}

message CStore_GetTrendingAppsAmongFriends_Response {
	repeated .CStore_GetTrendingAppsAmongFriends_Response_TrendingAppData trending_apps = 1;
}

message CStore_GetTrendingAppsAmongFriends_Response_TrendingAppData {
	optional uint32 appid = 1;
	repeated uint64 steamids_top_friends = 2;
	optional uint32 total_friends = 3;
}

message CStore_GetUserGameInterestState_Response {
	optional bool owned = 1;
	optional bool wishlist = 2;
	optional bool ignored = 3;
	optional bool following = 4;
	repeated int32 in_queues = 5 [(.description) = "enum"];
	repeated int32 queues_with_skip = 6 [(.description) = "enum"];
	repeated int32 queue_items_remaining = 7;
	repeated uint32 queue_items_next_appid = 8;
	optional bool temporarily_owned = 9;
	repeated .CStore_GetUserGameInterestState_Response_InQueue queues = 10;
	optional int32 ignored_reason = 11;
	optional int32 beta_status = 12 [(.description) = "enum"];
}

message CStore_GetUserGameInterestState_Response_InQueue {
	optional int32 type = 1 [(.description) = "enum"];
	optional bool skipped = 2;
	optional int32 items_remaining = 3;
	optional uint32 next_appid = 4;
	optional uint32 experimental_cohort = 5;
}

message CStore_PurchaseReceiptInfo {
	optional uint64 transactionid = 1;
	optional uint32 packageid = 2;
	optional uint32 purchase_status = 3;
	optional uint32 result_detail = 4;
	optional uint32 transaction_time = 5;
	optional uint32 payment_method = 6;
	optional uint64 base_price = 7;
	optional uint64 total_discount = 8;
	optional uint64 tax = 9;
	optional uint64 shipping = 10;
	optional uint32 currency_code = 11;
	optional string country_code = 12;
	optional string error_headline = 13;
	optional string error_string = 14;
	optional string error_link_text = 15;
	optional string error_link_url = 16;
	optional uint32 error_appid = 17;
	repeated .CStore_PurchaseReceiptInfo_LineItem line_items = 18;
}

message CStore_PurchaseReceiptInfo_LineItem {
	optional uint32 packageid = 1;
	optional uint32 appid = 2;
	optional string line_item_description = 3;
}

message CStore_RegisterCDKey_Request {
	optional string activation_code = 1;
	optional int32 purchase_platform = 2;
	optional bool is_request_from_client = 3;
}

message CStore_RegisterCDKey_Response {
	optional int32 purchase_result_details = 1;
	optional .CStore_PurchaseReceiptInfo purchase_receipt_info = 2;
}

message CStore_SkipDiscoveryQueueItem_Request {
	optional int32 queue_type = 1 [(.description) = "enum"];
	optional uint32 appid = 2;
	optional .CStorePageFilter store_page_filter = 3;
}

message CStore_SkipDiscoveryQueueItem_Response {
}

message CStore_StorePreferencesChanged_Notification {
	optional .CStore_UserPreferences preferences = 1;
	optional .CStore_UserTagPreferences tag_preferences = 2;
	optional .CStore_UserContentDescriptorPreferences content_descriptor_preferences = 3;
}

message CStore_UserContentDescriptorPreferences {
	repeated .CStore_UserContentDescriptorPreferences_ContentDescriptor content_descriptors_to_exclude = 1;
}

message CStore_UserContentDescriptorPreferences_ContentDescriptor {
	optional uint32 content_descriptorid = 1;
	optional uint32 timestamp_added = 2;
}

message CStore_UserPreferences {
	optional int32 primary_language = 1;
	//optional uint32 primary_language = 1;
	optional uint32 secondary_languages = 2;
	optional bool platform_windows = 3;
	optional bool platform_mac = 4;
	optional bool platform_linux = 5;
	optional bool hide_adult_content_violence = 6;
	optional bool hide_adult_content_sex = 7;
	optional uint32 timestamp_updated = 8;
	optional bool hide_store_broadcast = 9;
	optional int32 review_score_preference = 10 [(.description) = "enum"];
	optional int32 timestamp_content_descriptor_preferences_updated = 11;
	optional int32 provide_deck_feedback = 12 [(.description) = "enum"];
	optional string additional_languages = 13;
}

message CStore_UserTagPreferences {
	repeated .CStore_UserTagPreferences_Tag tags_to_exclude = 1;
}

message CStore_UserTagPreferences_Tag {
	optional uint32 tagid = 1;
	optional string name = 2;
	optional uint32 timestamp_added = 3;
}

message CStoreDiscoveryQueueSettings {
	optional bool os_win = 4;
	optional bool os_mac = 5;
	optional bool os_linux = 6;
	optional bool full_controller_support = 7;
	optional bool native_steam_controller = 8;
	optional bool include_coming_soon = 9;
	repeated uint32 excluded_tagids = 10;
	optional bool exclude_early_access = 11;
	optional bool exclude_videos = 12;
	optional bool exclude_software = 13;
	optional bool exclude_dlc = 14;
	optional bool exclude_soundtracks = 15;
	repeated uint32 featured_tagids = 16;
}

service Store {
	rpc GetDiscoveryQueue (.CStore_GetDiscoveryQueue_Request) returns (.CStore_GetDiscoveryQueue_Response);
	rpc GetDiscoveryQueueSettings (.NotImplemented) returns (.CStore_GetDiscoveryQueueSettings_Response);
	rpc GetDiscoveryQueueSkippedApps (.CStore_GetDiscoveryQueueSkippedApps_Request) returns (.CStore_GetDiscoveryQueueSkippedApps_Response);
	rpc GetLocalizedNameForTags (.CStore_GetLocalizedNameForTags_Request) returns (.CStore_GetLocalizedNameForTags_Response);
	rpc GetMostPopularTags (.CStore_GetMostPopularTags_Request) returns (.CStore_GetMostPopularTags_Response);
	rpc GetStorePreferences (.CStore_GetStorePreferences_Request) returns (.CStore_GetStorePreferences_Response);
	rpc GetTrendingAppsAmongFriends (.CStore_GetTrendingAppsAmongFriends_Request) returns (.CStore_GetTrendingAppsAmongFriends_Response);
	rpc GetUserGameInterestState (.NotImplemented) returns (.CStore_GetUserGameInterestState_Response);
	rpc RegisterCDKey (.CStore_RegisterCDKey_Request) returns (.CStore_RegisterCDKey_Response);
	rpc SetCompatibilityFeedback (.CSteamDeckCompatibility_SetFeedback_Request) returns (.CSteamDeckCompatibility_SetFeedback_Response);
	rpc ShouldPromptForCompatibilityFeedback (.CSteamDeckCompatibility_ShouldPrompt_Request) returns (.CSteamDeckCompatibility_ShouldPrompt_Response);
	rpc SkipDiscoveryQueueItem (.CStore_SkipDiscoveryQueueItem_Request) returns (.CStore_SkipDiscoveryQueueItem_Response);
}

service StoreClient {
	rpc NotifyStorePreferencesChanged (.CStore_StorePreferencesChanged_Notification) returns (.NoResponse);
}

