import "common_base.proto";

message CSteamNotification_GetPreferences_Request {
}

message CSteamNotification_GetPreferences_Response {
	repeated .SteamNotificationPreference preferences = 1;
}

message CSteamNotification_GetSteamNotifications_Request {
	optional bool include_hidden = 1 [default = false];
	optional int32 language = 2 [default = 0];
	optional bool include_confirmation_count = 3 [default = true];
	optional bool include_pinned_counts = 4 [default = false];
	optional bool include_read = 5 [default = true];
	optional bool count_only = 6 [default = false];
}

message CSteamNotification_GetSteamNotifications_Response {
	repeated .SteamNotificationData notifications = 1;
	optional int32 confirmation_count = 2;
	optional uint32 pending_gift_count = 3;
	optional uint32 pending_friend_count = 5;
	optional uint32 unread_count = 6;
	optional uint32 pending_family_invite_count = 7;
}

message CSteamNotification_NotificationsReceived_Notification {
	repeated .SteamNotificationData notifications = 1;
	optional uint32 pending_gift_count = 2;
	optional uint32 pending_friend_count = 3;
	optional uint32 pending_family_invite_count = 4;
}

message CSteamNotification_PreferencesUpdated_Notification {
	repeated .SteamNotificationPreference preferences = 1;
}

message CSteamNotification_SetPreferences_Request {
	repeated .SteamNotificationPreference preferences = 1;
}

message CSteamNotification_SetPreferences_Response {
}

message SteamNotificationData {
	optional uint64 notification_id = 1;
	optional uint32 notification_targets = 2;
	optional int32 notification_type = 3 [(.description) = "enum"];
	optional string body_data = 4;
	optional bool read = 7;
	optional uint32 timestamp = 8;
	optional bool hidden = 9;
	optional uint32 expiry = 10;
	optional uint32 viewed = 11;
}

message SteamNotificationPreference {
	optional int32 notification_type = 1 [(.description) = "enum"];
	optional uint32 notification_targets = 2;
}

service SteamNotification {
	rpc GetPreferences (.CSteamNotification_GetPreferences_Request) returns (.CSteamNotification_GetPreferences_Response);
	rpc GetSteamNotifications (.CSteamNotification_GetSteamNotifications_Request) returns (.CSteamNotification_GetSteamNotifications_Response);
	rpc SetPreferences (.CSteamNotification_SetPreferences_Request) returns (.CSteamNotification_SetPreferences_Response);
}

service SteamNotificationClient {
	rpc NotificationsReceived (.CSteamNotification_NotificationsReceived_Notification) returns (.NoResponse);
	rpc PreferencesUpdated (.CSteamNotification_PreferencesUpdated_Notification) returns (.NoResponse);
}

