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

option cc_generic_services = true;

enum EMarketingMessageType {
	k_EMarketingMessageInvalid = 0;
	k_EMarketingMessageNowAvailable = 1;
	k_EMarketingMessageWeekendDeal = 2;
	k_EMarketingMessagePrePurchase = 3;
	k_EMarketingMessagePlayNow = 4;
	k_EMarketingMessagePreloadNow = 5;
	k_EMarketingMessageGeneral = 6;
	k_EMarketingMessageDemoQuit = 7;
	k_EMarketingMessageGifting = 8;
	k_EMarketingMessageEJsKorner = 9;
	k_EMarketingMessageUpdate = 10;
	k_EMarketingMessageMidweekDeal = 11;
	k_EMarketingMessageDailyDeal = 12;
	k_EMarketingMessageNewDLC = 13;
	k_EMarketingMessageFreeWeekend = 14;
	k_EMarketingMessageSalePages = 15;
	k_EMarketingMessagePlaytestAvailable = 16;
}

enum EMarketingMessageVisibility {
	k_EMarketingMessageVisibleBeta = 1;
	k_EMarketingMessageVisiblePublic = 2;
	k_EMarketingMessageVisibleApprovedForPublish = 3;
}

enum EMarketingMessageAssociationType {
	k_EMarketingMessageNoAssociation = 0;
	k_EMarketingMessageAppAssociation = 1;
	k_EMarketingMessageSubscriptionAssociation = 2;
	k_EMarketingMessagePublisherAssociation = 3;
	k_EMarketingMessageGenreAssociation = 4;
	k_EMarketingMessageBundleAssociation = 5;
}

enum EMarketingMessageTemplateType {
	k_EMarketingMessageTemplate_Unknown = 0;
	k_EMarketingMessageTemplate_Image = 1;
	k_EMarketingMessageTemplate_Animated = 2;
	k_EMarketingMessageTemplate_Featured_Video = 3;
	k_EMarketingMessageTemplate_DLC_Override = 4;
	k_EMarketingMessageTemplate_Replay = 5;
	k_EMarketingMessageTemplate_Event = 6;
	k_EMarketingMessageTemplate_AutoRender = 7;
	k_EMarketingMessageTemplate_MAX = 8;
}

enum EMarketingMessageClickLocation {
	k_EMarketingMessageClickLocation_Unknown = 0;
	k_EMarketingMessageClickLocation_Image = 1;
	k_EMarketingMessageClickLocation_Button = 2;
	k_EMarketingMessageClickLocation_DlcCapsule = 3;
	k_EMarketingMessageClickLocation_HeaderArea = 4;
	k_EMarketingMessageClickLocation_GameCapsule = 5;
	k_EMarketingMessageClickLocation_PartnerEvent = 6;
}

enum EMarketingMessageLookupType {
	k_EMarketingMessageLookupInvalid = 0;
	k_EMarketingMessageLookupByGID = 1;
	k_EMarketingMessageLookupActive = 2;
	k_EMarketingMessageLookupByTitleWithType = 3;
	k_EMarketingMessageLookupByGIDList = 4;
}

message CMarketingMessages_GetActiveMarketingMessages_Request {
	optional string country = 1;
	optional bool anonymous_user = 2;
}

message CMarketingMessageProto {
	optional fixed64 gid = 1;
	optional string title = 2;
	optional .EMarketingMessageType type = 3 [default = k_EMarketingMessageInvalid];
	optional .EMarketingMessageVisibility visibility = 4 [default = k_EMarketingMessageVisibleBeta];
	optional uint32 priority = 5;
	optional .EMarketingMessageAssociationType association_type = 6 [default = k_EMarketingMessageNoAssociation];
	optional uint32 associated_id = 7;
	optional string associated_name = 8;
	optional uint32 start_date = 9;
	optional uint32 end_date = 10;
	optional string country_allow = 11;
	optional string country_deny = 12;
	optional bool ownership_restrictions_overridden = 13;
	optional uint32 must_own_appid = 14;
	optional uint32 must_not_own_appid = 15;
	optional uint32 must_own_packageid = 16;
	optional uint32 must_not_own_packageid = 17;
	optional uint32 must_have_launched_appid = 18;
	optional string additional_restrictions = 19;
	optional string template_type = 20;
	optional string template_vars = 21;
	optional uint32 flags = 22;
	optional string creator_name = 23;
	optional string template_vars_json = 24;
	optional string additional_restrictions_json = 25;
}

message CMarketingMessages_GetActiveMarketingMessages_Response {
	repeated .CMarketingMessageProto messages = 1;
	optional uint32 time_next_message_age = 2;
}

message CMarketingMessages_GetPastMarketingMessages_Request {
	optional uint32 start_past_days = 1;
	optional uint32 upto_past_days = 2;
}

message CMarketingMessages_GetPastMarketingMessages_Response {
	repeated .CMarketingMessageProto messages = 1;
}

message CMarketingMessages_GetMarketingMessagesForUser_Request {
	optional bool include_seen_messages = 1;
	optional string country_code = 2;
	optional int32 elanguage = 3;
	optional int32 operating_system = 4;
	optional int32 client_package_version = 5;
	optional .StoreBrowseContext context = 6;
	optional .StoreBrowseItemDataRequest data_request = 7;
}

message CDisplayMarketingMessage {
	optional fixed64 gid = 1;
	optional string title = 2;
	optional .EMarketingMessageType type = 3 [default = k_EMarketingMessageInvalid];
	optional .StoreItemID associated_item_id = 4;
	optional .StoreItem associated_item = 5;
	optional string associated_name = 6;
	optional string template_type = 10;
	optional string template_vars_json = 11;
}

message CMarketingMessages_GetMarketingMessagesForUser_Response {
	message MarketingMessageForUser {
		optional bool already_seen = 1;
		optional .CDisplayMarketingMessage message = 2;
	}

	repeated .CMarketingMessages_GetMarketingMessagesForUser_Response.MarketingMessageForUser messages = 1;
}

message CMarketingMessages_DoesUserHavePendingMarketingMessages_Request {
	optional string country_code = 2;
	optional int32 elanguage = 3;
	optional int32 operating_system = 4;
	optional int32 client_package_version = 5;
}

message CMarketingMessages_DoesUserHavePendingMarketingMessages_Response {
	optional bool has_pending_messages = 1;
	optional int32 pending_message_count = 2;
}

message CMarketingMessages_GetDisplayMarketingMessage_Request {
	optional fixed64 gid = 1;
	optional .StoreBrowseContext context = 2;
	optional .StoreBrowseItemDataRequest data_request = 3;
}

message CMarketingMessages_GetDisplayMarketingMessage_Response {
	optional .CDisplayMarketingMessage message = 1;
}

message CMarketingMessages_MarkMessageSeen_Notification {
	optional fixed64 gid = 1;
	optional uint32 display_index = 2 [default = 0];
	optional .EMarketingMessageTemplateType template_type = 3 [default = k_EMarketingMessageTemplate_Unknown];
}

message CMarketingMessages_MarkMessageClicked_Notification {
	optional fixed64 gid = 1;
	optional uint32 display_index = 2 [default = 0];
	optional .EMarketingMessageTemplateType template_type = 3 [default = k_EMarketingMessageTemplate_Unknown];
	optional .EMarketingMessageClickLocation click_location = 4 [default = k_EMarketingMessageClickLocation_Unknown];
}

message CMarketingMessages_GetMarketingMessage_Request {
	optional fixed64 gid = 1;
}

message CMarketingMessages_GetMarketingMessage_Response {
	optional .CMarketingMessageProto message = 1;
}

message CMarketingMessages_CreateMarketingMessage_Request {
	optional .CMarketingMessageProto message = 1;
	optional bool from_json = 2;
}

message CMarketingMessages_CreateMarketingMessage_Response {
	optional fixed64 gid = 1;
}

message CMarketingMessages_UpdateMarketingMessage_Request {
	optional fixed64 gid = 1;
	optional .CMarketingMessageProto message = 2;
	optional bool from_json = 3;
}

message CMarketingMessages_UpdateMarketingMessage_Response {
}

message CMarketingMessages_DeleteMarketingMessage_Request {
	optional fixed64 gid = 1;
}

message CMarketingMessages_DeleteMarketingMessage_Response {
}

message CMarketingMessages_FindMarketingMessages_Request {
	optional .EMarketingMessageLookupType lookup_type = 1 [default = k_EMarketingMessageLookupInvalid];
	optional fixed64 gid = 2;
	optional .EMarketingMessageType message_type = 3 [default = k_EMarketingMessageInvalid];
	repeated fixed64 gidlist = 4;
	optional string title = 5;
}

message CMarketingMessages_FindMarketingMessages_Response {
	repeated .CMarketingMessageProto messages = 1;
}

message CMarketingMessages_GetMarketingMessageViewerStats_Request {
	optional fixed64 gid = 1;
}

message CMarketingMessageHourlyStats {
	optional uint32 rt_time_hour = 1;
	optional uint32 seen_count = 2;
	optional .EMarketingMessageTemplateType template_type = 3 [default = k_EMarketingMessageTemplate_Unknown];
	optional uint32 display_index = 4;
}

message CMarketingMessages_GetMarketingMessageViewerStats_Response {
	repeated .CMarketingMessageHourlyStats stats = 1;
}

message CMarketingMessages_GetMarketingMessagesViewerRangeStats_Request {
	optional uint32 rt_start_time = 1;
	optional uint32 rt_end_time = 2;
}

message CMarketingMessageClickedHourlyStats {
	optional uint32 rt_time_hour = 1;
	optional uint32 clicked_count = 2;
	optional uint32 display_index = 3;
	optional .EMarketingMessageTemplateType template_type = 4 [default = k_EMarketingMessageTemplate_Unknown];
	optional .EMarketingMessageClickLocation click_location = 5 [default = k_EMarketingMessageClickLocation_Unknown];
}

message CMarketingMessages_GetMarketingMessagesViewerRangeStats_Response {
	repeated .CMarketingMessageHourlyStats stats = 1;
	repeated .CMarketingMessageClickedHourlyStats clicked_stats = 2;
}

message CMarketingMessages_GetMarketingMessageClickedStats_Request {
	optional fixed64 gid = 1;
}

message CMarketingMessages_GetMarketingMessageClickedStats_Response {
	repeated .CMarketingMessageClickedHourlyStats stats = 1;
}

message CMarketingMessages_GetPartnerReadyToPublishMessages_Request {
	optional uint32 partnerid = 1;
}

message CMarketingMessages_GetPartnerReadyToPublishMessages_Response {
	repeated .CDisplayMarketingMessage messages = 1;
}

message CMarketingMessages_PartnerPublishMessage_Request {
	optional fixed64 gid = 1;
	optional uint32 partnerid = 2;
}

message CMarketingMessages_PartnerPublishMessage_Response {
}

message CMarketingMessages_GetPartnerMessagePreview_Request {
	optional fixed64 gid = 1;
	optional uint32 partnerid = 2;
}

message CMarketingMessages_GetPartnerMessagePreview_Response {
	optional .CMarketingMessageProto message = 1;
}

message CMarketingMessage_GetMarketingMessagesForPartner_Request {
	optional uint32 partnerid = 1;
}

message CMarketingMessage_GetMarketingMessagesForPartner_Response {
	repeated .CMarketingMessageProto messages = 1;
}

message CMarketingMessage_GetMarketingMessagesForApps_Request {
	repeated uint32 appids = 1;
}

message CMarketingMessage_GetMarketingMessagesForApps_Response {
	repeated .CMarketingMessageProto messages = 1;
}

service MarketingMessages {
	rpc GetActiveMarketingMessages (.CMarketingMessages_GetActiveMarketingMessages_Request) returns (.CMarketingMessages_GetActiveMarketingMessages_Response);
	rpc GetPastMarketingMessages (.CMarketingMessages_GetPastMarketingMessages_Request) returns (.CMarketingMessages_GetPastMarketingMessages_Response);
	rpc GetMarketingMessagesForUser (.CMarketingMessages_GetMarketingMessagesForUser_Request) returns (.CMarketingMessages_GetMarketingMessagesForUser_Response);
	rpc DoesUserHavePendingMarketingMessages (.CMarketingMessages_DoesUserHavePendingMarketingMessages_Request) returns (.CMarketingMessages_DoesUserHavePendingMarketingMessages_Response);
	rpc GetDisplayMarketingMessage (.CMarketingMessages_GetDisplayMarketingMessage_Request) returns (.CMarketingMessages_GetDisplayMarketingMessage_Response);
	rpc GetDisplayMarketingMessageForUser (.CMarketingMessages_GetDisplayMarketingMessage_Request) returns (.CMarketingMessages_GetDisplayMarketingMessage_Response);
	rpc GetDisplayMarketingMessageAdmin (.CMarketingMessages_GetDisplayMarketingMessage_Request) returns (.CMarketingMessages_GetDisplayMarketingMessage_Response);
	rpc MarkMessageSeen (.CMarketingMessages_MarkMessageSeen_Notification) returns (.NoResponse);
	rpc MarkMessageClicked (.CMarketingMessages_MarkMessageClicked_Notification) returns (.NoResponse);
	rpc GetMarketingMessage (.CMarketingMessages_GetMarketingMessage_Request) returns (.CMarketingMessages_GetMarketingMessage_Response);
	rpc CreateMarketingMessage (.CMarketingMessages_CreateMarketingMessage_Request) returns (.CMarketingMessages_CreateMarketingMessage_Response);
	rpc UpdateMarketingMessage (.CMarketingMessages_UpdateMarketingMessage_Request) returns (.CMarketingMessages_UpdateMarketingMessage_Response);
	rpc DeleteMarketingMessage (.CMarketingMessages_DeleteMarketingMessage_Request) returns (.CMarketingMessages_DeleteMarketingMessage_Response);
	rpc FindMarketingMessages (.CMarketingMessages_FindMarketingMessages_Request) returns (.CMarketingMessages_FindMarketingMessages_Response);
	rpc GetMarketingMessageViewerStats (.CMarketingMessages_GetMarketingMessageViewerStats_Request) returns (.CMarketingMessages_GetMarketingMessageViewerStats_Response);
	rpc GetMarketingMessagesViewerRangeStats (.CMarketingMessages_GetMarketingMessagesViewerRangeStats_Request) returns (.CMarketingMessages_GetMarketingMessagesViewerRangeStats_Response);
	rpc GetMarketingMessageClickedStats (.CMarketingMessages_GetMarketingMessageClickedStats_Request) returns (.CMarketingMessages_GetMarketingMessageClickedStats_Response);
	rpc GetPartnerReadyToPublishMessages (.CMarketingMessages_GetPartnerReadyToPublishMessages_Request) returns (.CMarketingMessages_GetPartnerReadyToPublishMessages_Response);
	rpc PublishPartnerMessage (.CMarketingMessages_PartnerPublishMessage_Request) returns (.CMarketingMessages_PartnerPublishMessage_Response);
	rpc GetPartnerMessagePreview (.CMarketingMessages_GetPartnerMessagePreview_Request) returns (.CMarketingMessages_GetPartnerMessagePreview_Response);
	rpc GetMarketingMessagesForPartner (.CMarketingMessage_GetMarketingMessagesForPartner_Request) returns (.CMarketingMessage_GetMarketingMessagesForPartner_Response);
	rpc GetMarketingMessagesForApps (.CMarketingMessage_GetMarketingMessagesForApps_Request) returns (.CMarketingMessage_GetMarketingMessagesForApps_Response);
}
