syntax = "proto2";
import "steammessages_base.proto";
import "steammessages_unified_base.proto";
import "contenthubs.proto";
import "enums.proto";

option py_generic_services = true;

enum EStoreDiscoveryQueueType {
	k_EStoreDiscoveryQueueTypeNew = 0;
	k_EStoreDiscoveryQueueTypeComingSoon = 1;
	k_EStoreDiscoveryQueueTypeRecommended = 2;
	k_EStoreDiscoveryQueueTypeEveryNewRelease = 3;
	k_EStoreDiscoveryQueueTypeMLRecommender = 5;
	k_EStoreDiscoveryQueueTypeWishlistOnSale = 6;
	k_EStoreDiscoveryQueueTypeDLC = 7;
	k_EStoreDiscoveryQueueTypeDLCOnSale = 8;
	k_EStoreDiscoveryQueueTypeRecommendedComingSoon = 9;
	k_EStoreDiscoveryQueueTypeRecommendedFree = 10;
	k_EStoreDiscoveryQueueTypeRecommendedOnSale = 11;
	k_EStoreDiscoveryQueueTypeRecommendedDemos = 12;
	k_EStoreDiscoveryQueueTypeDLCNewReleases = 13;
	k_EStoreDiscoveryQueueTypeDLCTopSellers = 14;
	k_EStoreDiscoveryQueueTypeMAX = 15;
}

enum EPlaytestStatus {
	k_ETesterStatusNone = 0;
	k_ETesterStatusPending = 1;
	k_ETesterStatusInvited = 2;
	k_ETesterStatusGranted = 3;
}

enum EAppReportType {
	k_EAppReportType_Invalid = 0;
	k_EAppReportType_Scam = 1;
	k_EAppReportType_Malware = 2;
	k_EAppReportType_HateSpeech = 3;
	k_EAppReportType_Pornography = 4;
	k_EAppReportType_NonLabeledAdultContent = 5;
	k_EAppReportType_Libelous = 6;
	k_EAppReportType_Offensive = 7;
	k_EAppReportType_ExploitsChildren = 8;
	k_EAppReportType_MtxWithNonSteamWalletPaymentMethods = 9;
	k_EAppReportType_CopyrightViolation = 10;
	k_EAppReportType_ViolatesLaws = 11;
	k_EAppReportType_Other = 12;
	k_EAppReportType_Broken = 13;
	k_EAppReportType_AIContentReport = 14;
}

enum EUserReviewScorePreference {
	k_EUserReviewScorePreference_Unset = 0;
	k_EUserReviewScorePreference_IncludeAll = 1;
	k_EUserReviewScorePreference_ExcludeBombs = 2;
}

enum EPartnerLinkTrackingBackfillSource {
	k_EPartnerLinkTrackingBackfillSource_None = 0;
	k_EPartnerLinkTrackingBackfillSource_Web = 1;
	k_EPartnerLinkTrackingBackfillSource_Mobile = 2;
	k_EPartnerLinkTrackingBackfillSource_Desktop = 3;
}

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

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

	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_RegisterCDKey_Response {
	optional int32 purchase_result_details = 1;
	optional .CStore_PurchaseReceiptInfo purchase_receipt_info = 2;
}

message CStore_GetMostPopularTags_Request {
	optional string language = 1;
}

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

	repeated .CStore_GetMostPopularTags_Response.Tag tags = 1;
}

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

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

	repeated .CStore_GetLocalizedNameForTags_Response.Tag tags = 1;
}

message CStore_GetTagList_Request {
	optional string language = 1;
	optional string have_version_hash = 2;
}

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

	optional string version_hash = 1;
	repeated .CStore_GetTagList_Response.Tag tags = 2;
}

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;
}

message CStore_GetDiscoveryQueue_Request {
	optional .EStoreDiscoveryQueueType queue_type = 1 [default = k_EStoreDiscoveryQueueTypeNew];
	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_Request {
	optional .EStoreDiscoveryQueueType queue_type = 1 [default = k_EStoreDiscoveryQueueTypeNew];
	optional .CStorePageFilter store_page_filter = 2;
}

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

message CStore_SkipDiscoveryQueueItem_Request {
	optional .EStoreDiscoveryQueueType queue_type = 1 [default = k_EStoreDiscoveryQueueTypeNew];
	optional uint32 appid = 2;
	optional .CStorePageFilter store_page_filter = 3;
}

message CStore_SkipDiscoveryQueueItem_Response {
}

message CStore_GetUserGameInterestState_Request {
	optional uint32 appid = 1;
	optional uint32 store_appid = 2;
	optional uint32 beta_appid = 3;
}

message CStore_GetUserGameInterestState_Response {
	message InQueue {
		optional .EStoreDiscoveryQueueType type = 1 [default = k_EStoreDiscoveryQueueTypeNew];
		optional bool skipped = 2;
		optional int32 items_remaining = 3;
		optional uint32 next_appid = 4;
		optional uint32 experimental_cohort = 5;
	}

	optional bool owned = 1;
	optional bool wishlist = 2;
	optional bool ignored = 3;
	optional bool following = 4;
	repeated .EStoreDiscoveryQueueType in_queues = 5;
	repeated .EStoreDiscoveryQueueType queues_with_skip = 6;
	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 .EPlaytestStatus beta_status = 12 [default = k_ETesterStatusNone];
}

message CStore_GetDiscoveryQueueSkippedApps_Request {
	optional fixed64 steamid = 1;
	optional .EStoreDiscoveryQueueType queue_type = 2 [default = k_EStoreDiscoveryQueueTypeNew];
	optional .CStorePageFilter store_page_filter = 3;
}

message CStore_GetDiscoveryQueueSkippedApps_Response {
	repeated uint32 appids = 1;
}

message CStore_ReportApp_Request {
	optional uint32 appid = 1;
	optional .EAppReportType report_type = 2 [default = k_EAppReportType_Invalid];
	optional string report = 3;
}

message CStore_ReportApp_Response {
}

message CStore_GetStorePreferences_Request {
}

message CStore_UserPreferences {
	optional int32 primary_language = 1;
	optional uint32 secondary_languages = 2;
	optional bool platform_windows = 3;
	optional bool platform_mac = 4;
	optional bool platform_linux = 5;
	optional uint32 timestamp_updated = 8;
	optional bool hide_store_broadcast = 9;
	optional .EUserReviewScorePreference review_score_preference = 10 [default = k_EUserReviewScorePreference_Unset];
	optional int32 timestamp_content_descriptor_preferences_updated = 11;
	optional .EProvideDeckFeedbackPreference provide_deck_feedback = 12 [default = k_EProvideDeckFeedbackPreference_Unset];
	optional string additional_languages = 13;
}

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

	repeated .CStore_UserTagPreferences.Tag tags_to_exclude = 1;
}

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

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

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

	repeated .CStore_GetTrendingAppsAmongFriends_Response.TrendingAppData trending_apps = 1;
}

message CStore_MigratePartnerLinkTracking_Notification {
	optional uint32 accountid = 1;
	optional uint64 browserid = 2;
	optional .EPartnerLinkTrackingBackfillSource backfill_source = 3 [default = k_EPartnerLinkTrackingBackfillSource_None];
}

message CStore_UpdatePackageReservations_Request {
	repeated uint32 packages_to_reserve = 1;
	repeated uint32 packages_to_unreserve = 2;
	optional string country_code = 3;
}

message CStore_UpdatePackageReservations_Response {
	repeated .CPackageReservationStatus reservation_status = 1;
}

message CStore_GetWishlistDemoEmailStatus_Request {
	optional uint32 appid = 1;
	optional uint32 demo_appid = 2;
	optional bool allow_late_firing = 3;
}

message CStore_GetWishlistDemoEmailStatus_Response {
	optional bool can_fire = 1 [default = false];
	optional uint32 time_staged = 2;
	optional uint32 demo_release_date = 3;
}

message CStore_QueueWishlistDemoEmailToFire_Request {
	optional uint32 appid = 1;
	optional uint32 demo_appid = 2;
	optional bool allow_late_firing = 3;
}

message CStore_QueueWishlistDemoEmailToFire_Response {
}

message CReservationPositionMessage {
	optional uint32 edistributor = 1;
	optional string product_identifier = 2;
	optional uint32 start_queue_position = 3;
	optional uint32 rtime_estimated_notification = 4;
	optional string localization_token = 5;
	optional uint32 accountid = 6;
	optional uint32 rtime_created = 7;
}

message CStore_SetReservationPositionMessage_Request {
	repeated .CReservationPositionMessage settings = 1;
}

message CStore_SetReservationPositionMessage_Response {
}

message CStore_DeleteReservationPositionMessage_Request {
	optional uint32 edistributor = 1;
	optional string product_identifier = 2;
	optional uint32 start_queue_position = 3;
}

message CStore_DeleteReservationPositionMessage_Response {
}

message CStore_GetAllReservationPositionMessages_Request {
}

message CStore_GetAllReservationPositionMessages_Response {
	repeated .CReservationPositionMessage settings = 1;
}

message CStore_ReloadAllReservationPositionMessages_Notification {
}

message CSteamDeckCompatibility_SetFeedback_Request {
	optional uint32 appid = 1;
	optional .ESteamDeckCompatibilityFeedback feedback = 2 [default = k_ESteamDeckCompatibilityFeedback_Unset];
}

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 .ESteamDeckCompatibilityFeedback existing_feedback = 3 [default = k_ESteamDeckCompatibilityFeedback_Unset];
}

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

service Store {
	rpc RegisterCDKey (.CStore_RegisterCDKey_Request) returns (.CStore_RegisterCDKey_Response);
	rpc GetMostPopularTags (.CStore_GetMostPopularTags_Request) returns (.CStore_GetMostPopularTags_Response);
	rpc GetLocalizedNameForTags (.CStore_GetLocalizedNameForTags_Request) returns (.CStore_GetLocalizedNameForTags_Response);
	rpc GetTagList (.CStore_GetTagList_Request) returns (.CStore_GetTagList_Response);
	rpc GetDiscoveryQueue (.CStore_GetDiscoveryQueue_Request) returns (.CStore_GetDiscoveryQueue_Response);
	rpc GetDiscoveryQueueSettings (.CStore_GetDiscoveryQueueSettings_Request) returns (.CStore_GetDiscoveryQueueSettings_Response);
	rpc SkipDiscoveryQueueItem (.CStore_SkipDiscoveryQueueItem_Request) returns (.CStore_SkipDiscoveryQueueItem_Response);
	rpc GetUserGameInterestState (.CStore_GetUserGameInterestState_Request) returns (.CStore_GetUserGameInterestState_Response);
	rpc GetDiscoveryQueueSkippedApps (.CStore_GetDiscoveryQueueSkippedApps_Request) returns (.CStore_GetDiscoveryQueueSkippedApps_Response);
	rpc ReportApp (.CStore_ReportApp_Request) returns (.CStore_ReportApp_Response);
	rpc GetStorePreferences (.CStore_GetStorePreferences_Request) returns (.CStore_GetStorePreferences_Response);
	rpc GetTrendingAppsAmongFriends (.CStore_GetTrendingAppsAmongFriends_Request) returns (.CStore_GetTrendingAppsAmongFriends_Response);
	rpc MigratePartnerLinkTracking (.CStore_MigratePartnerLinkTracking_Notification) returns (.NoResponse);
	rpc UpdatePackageReservations (.CStore_UpdatePackageReservations_Request) returns (.CStore_UpdatePackageReservations_Response);
	rpc GetWishlistDemoEmailStatus (.CStore_GetWishlistDemoEmailStatus_Request) returns (.CStore_GetWishlistDemoEmailStatus_Response);
	rpc QueueWishlistDemoEmailToFire (.CStore_QueueWishlistDemoEmailToFire_Request) returns (.CStore_QueueWishlistDemoEmailToFire_Response);
	rpc SetReservationPositionMessage (.CStore_SetReservationPositionMessage_Request) returns (.CStore_SetReservationPositionMessage_Response);
	rpc DeleteReservationPositionMessage (.CStore_DeleteReservationPositionMessage_Request) returns (.CStore_DeleteReservationPositionMessage_Response);
	rpc GetAllReservationPositionMessages (.CStore_GetAllReservationPositionMessages_Request) returns (.CStore_GetAllReservationPositionMessages_Response);
	rpc ReloadAllReservationPositionMessages (.CStore_ReloadAllReservationPositionMessages_Notification) returns (.NoResponse);
	rpc SetCompatibilityFeedback (.CSteamDeckCompatibility_SetFeedback_Request) returns (.CSteamDeckCompatibility_SetFeedback_Response);
	rpc ShouldPromptForCompatibilityFeedback (.CSteamDeckCompatibility_ShouldPrompt_Request) returns (.CSteamDeckCompatibility_ShouldPrompt_Response);
}

service StoreClient {
	option (service_execution_site) = k_EProtoExecutionSiteSteamClient;

	rpc NotifyStorePreferencesChanged (.CStore_StorePreferencesChanged_Notification) returns (.NoResponse);
}
