import "steammessages_unified_base.steamclient.proto";
import "enums.proto";

option cc_generic_services = true;

enum EPublishedFileRevision {
	k_EPublishedFileRevision_Default = 0;
	k_EPublishedFileRevision_Latest = 1;
	k_EPublishedFileRevision_ApprovedSnapshot = 2;
	k_EPublishedFileRevision_ApprovedSnapshot_China = 3;
	k_EPublishedFileRevision_RejectedSnapshot = 4;
	k_EPublishedFileRevision_RejectedSnapshot_China = 5;
}

enum EPublishedFileForSaleStatus {
	k_PFFSS_NotForSale = 0;
	k_PFFSS_PendingApproval = 1;
	k_PFFSS_ApprovedForSale = 2;
	k_PFFSS_RejectedForSale = 3;
	k_PFFSS_NoLongerForSale = 4;
	k_PFFSS_TentativeApproval = 5;
}

message CPublishedFile_Subscribe_Request {
	optional uint64 publishedfileid = 1;
	optional uint32 list_type = 2;
	optional int32 appid = 3;
	optional bool notify_client = 4;
}

message CPublishedFile_Subscribe_Response {
}

message CPublishedFile_Unsubscribe_Request {
	optional uint64 publishedfileid = 1;
	optional uint32 list_type = 2;
	optional int32 appid = 3;
	optional bool notify_client = 4;
}

message CPublishedFile_Unsubscribe_Response {
}

message CPublishedFile_CanSubscribe_Request {
	optional uint64 publishedfileid = 1;
}

message CPublishedFile_CanSubscribe_Response {
	optional bool can_subscribe = 1;
}

message CPublishedFile_Publish_Request {
	optional uint32 appid = 1 [(description) = "App Id this file is being published FROM."];
	optional uint32 consumer_appid = 2 [(description) = "App Id this file is being published TO."];
	optional string cloudfilename = 3 [(description) = "Name of the file to publish in the user's cloud."];
	optional string preview_cloudfilename = 4 [(description) = "Name of the file to use as the published file's preview."];
	optional string title = 5 [(description) = "Text title for the published file."];
	optional string file_description = 6 [(description) = "Text description for the published file."];
	optional uint32 file_type = 7 [(description) = "(EWorkshopFileType) Type of Workshop file to publish."];
	optional string consumer_shortcut_name = 8 [(description) = "Shortcut name for the published file."];
	optional string youtube_username = 9 [(description) = "(Optional) User's YouTube account username."];
	optional string youtube_videoid = 10 [(description) = "(Optional) Video Id of a YouTube video for this published file."];
	optional uint32 visibility = 11 [(description) = "(ERemoteStoragePublishedFileVisibility) Visibility of the published file (private, friends, public, etc.)"];
	optional string redirect_uri = 12 [(description) = "(Optional) If supplied, the resulting published file's Id is appended to the URI."];
	repeated string tags = 13 [(description) = "Array of text tags to apply to the published file."];
	optional string collection_type = 14 [(description) = "(Optional) Type of collection the published file represents."];
	optional string game_type = 15 [(description) = "(Optional) Type of game the published file represents."];
	optional string url = 16 [(description) = "(Optional) If this represents a game, this is the URL to that game's page."];
}

message CPublishedFile_Publish_Response {
	optional uint64 publishedfileid = 1;
	optional string redirect_uri = 2;
}

message CPublishedFile_GetDetails_Request {
	repeated fixed64 publishedfileids = 1 [(description) = "Set of published file Ids to retrieve details for."];
	optional bool includetags = 2 [(description) = "If true, return tag information in the returned details."];
	optional bool includeadditionalpreviews = 3 [(description) = "If true, return preview information in the returned details."];
	optional bool includechildren = 4 [(description) = "If true, return children in the returned details."];
	optional bool includekvtags = 5 [(description) = "If true, return key value tags in the returned details."];
	optional bool includevotes = 6 [(description) = "If true, return vote data in the returned details."];
	optional bool short_description = 8 [(description) = "If true, return a short description instead of the full description."];
	optional bool includeforsaledata = 10 [(description) = "If true, return pricing data, if applicable."];
	optional bool includemetadata = 11 [(description) = "If true, populate the metadata field."];
	optional int32 language = 12 [default = 0, (description) = "Specifies the localized text to return. Defaults to English."];
	optional uint32 return_playtime_stats = 13 [(description) = "Return playtime stats for the specified number of days before today."];
	optional uint32 appid = 14;
	optional bool strip_description_bbcode = 15 [(description) = "Strips BBCode from descriptions."];
	optional .EPublishedFileRevision desired_revision = 16 [default = k_EPublishedFileRevision_Default, (description) = "Return the data for the specified revision."];
	optional bool includereactions = 17 [default = false, (description) = "If true, then reactions to items will be returned."];
}

message PublishedFileDetails {
	message Tag {
		optional string tag = 1;
		optional bool adminonly = 2;
		optional string display_name = 3;
	}

	message Preview {
		optional uint64 previewid = 1;
		optional uint32 sortorder = 2;
		optional string url = 3;
		optional uint32 size = 4;
		optional string filename = 5;
		optional string youtubevideoid = 6;
		optional uint32 preview_type = 7;
		optional string external_reference = 8;
	}

	message Child {
		optional uint64 publishedfileid = 1;
		optional uint32 sortorder = 2;
		optional uint32 file_type = 3;
	}

	message KVTag {
		optional string key = 1;
		optional string value = 2;
	}

	message VoteData {
		optional float score = 1;
		optional uint32 votes_up = 2;
		optional uint32 votes_down = 3;
	}

	message ForSaleData {
		optional bool is_for_sale = 1;
		optional uint32 price_category = 2;
		optional .EPublishedFileForSaleStatus estatus = 3 [default = k_PFFSS_NotForSale];
		optional uint32 price_category_floor = 4;
		optional bool price_is_pay_what_you_want = 5;
		optional uint32 discount_percentage = 6;
	}

	message PlaytimeStats {
		optional uint64 playtime_seconds = 1;
		optional uint64 num_sessions = 2;
	}

	message Reaction {
		optional uint32 reactionid = 1;
		optional uint32 count = 2;
	}

	optional uint32 result = 1;
	optional uint64 publishedfileid = 2;
	optional fixed64 creator = 3;
	optional uint32 creator_appid = 4;
	optional uint32 consumer_appid = 5;
	optional uint32 consumer_shortcutid = 6;
	optional string filename = 7;
	optional uint64 file_size = 8;
	optional uint64 preview_file_size = 9;
	optional string file_url = 10;
	optional string preview_url = 11;
	optional string youtubevideoid = 12;
	optional string url = 13;
	optional fixed64 hcontent_file = 14;
	optional fixed64 hcontent_preview = 15;
	optional string title = 16;
	optional string file_description = 17;
	optional string short_description = 18;
	optional uint32 time_created = 19;
	optional uint32 time_updated = 20;
	optional uint32 visibility = 21;
	optional uint32 flags = 22;
	optional bool workshop_file = 23;
	optional bool workshop_accepted = 24;
	optional bool show_subscribe_all = 25;
	optional int32 num_comments_developer = 26;
	optional int32 num_comments_public = 27;
	optional bool banned = 28;
	optional string ban_reason = 29;
	optional fixed64 banner = 30;
	optional bool can_be_deleted = 31;
	optional bool incompatible = 32;
	optional string app_name = 33;
	optional uint32 file_type = 34;
	optional bool can_subscribe = 35;
	optional uint32 subscriptions = 36;
	optional uint32 favorited = 37;
	optional uint32 followers = 38;
	optional uint32 lifetime_subscriptions = 39;
	optional uint32 lifetime_favorited = 40;
	optional uint32 lifetime_followers = 41;
	optional uint64 lifetime_playtime = 62;
	optional uint64 lifetime_playtime_sessions = 63;
	optional uint32 views = 42;
	optional uint32 image_width = 43;
	optional uint32 image_height = 44;
	optional string image_url = 45;
	optional bool spoiler_tag = 46;
	optional uint32 shortcutid = 47;
	optional string shortcutname = 48;
	optional uint32 num_children = 49;
	optional uint32 num_reports = 50;
	repeated .PublishedFileDetails.Preview previews = 51;
	repeated .PublishedFileDetails.Tag tags = 52;
	repeated .PublishedFileDetails.Child children = 53;
	repeated .PublishedFileDetails.KVTag kvtags = 54;
	optional .PublishedFileDetails.VoteData vote_data = 55;
	optional .PublishedFileDetails.PlaytimeStats playtime_stats = 64;
	optional uint32 time_subscribed = 56 [(description) = "Only valid in PublishedFile.GetUserFiles and not normal PublishedFile.GetDetail calls"];
	optional .PublishedFileDetails.ForSaleData for_sale_data = 57 [(description) = "Pricing information, if applicable."];
	optional string metadata = 58 [(description) = "Metadata associated with the item"];
	optional int32 language = 61 [default = 0, (description) = "The language of the title and description."];
	optional bool maybe_inappropriate_sex = 65;
	optional bool maybe_inappropriate_violence = 66;
	optional uint64 revision_change_number = 67 [(description) = "The change number for the specified revision."];
	optional .EPublishedFileRevision revision = 68 [default = k_EPublishedFileRevision_Default, (description) = "The revision of the data returned, usually k_EPublishedFileRevision_Latest, but can be another revision/snapshot depending on the caller."];
	repeated .EPublishedFileRevision available_revisions = 69 [(description) = "Available revisions"];
	repeated .PublishedFileDetails.Reaction reactions = 70 [(description) = "Reactions to this item"];
	optional .EBanContentCheckResult ban_text_check_result = 71 [default = k_EBanContentCheckResult_NotScanned];
}

message CPublishedFile_GetDetails_Response {
	repeated .PublishedFileDetails publishedfiledetails = 1;
}

message CPublishedFile_GetItemInfo_Request {
	message WorkshopItem {
		optional fixed64 published_file_id = 1;
		optional uint32 time_updated = 2;
		optional .EPublishedFileRevision desired_revision = 3 [default = k_EPublishedFileRevision_Default, (description) = "Return the data for the specified revision."];
	}

	optional uint32 appid = 1;
	optional uint32 last_time_updated = 2;
	repeated .CPublishedFile_GetItemInfo_Request.WorkshopItem workshop_items = 3;
}

message CPublishedFile_GetItemInfo_Response {
	message WorkshopItemInfo {
		optional fixed64 published_file_id = 1;
		optional uint32 time_updated = 2;
		optional fixed64 manifest_id = 3;
		optional uint32 flags = 4;
	}

	optional uint32 update_time = 1;
	repeated .CPublishedFile_GetItemInfo_Response.WorkshopItemInfo workshop_items = 2;
	repeated fixed64 private_items = 3;
}

message CPublishedFile_GetUserFiles_Request {
	message KVTag {
		optional string key = 1;
		optional string value = 2;
	}

	message TagGroup {
		repeated string tags = 1;
	}

	optional fixed64 steamid = 1 [(description) = "Steam ID of the user whose files are being requested."];
	optional uint32 appid = 2 [(description) = "App Id of the app that the files were published to."];
	optional uint32 page = 4 [default = 1, (description) = "(Optional) Starting page for results."];
	optional uint32 numperpage = 5 [default = 1, (description) = "(Optional) The number of results, per page to return."];
	optional string type = 6 [default = "myfiles", (description) = "(Optional) Type of files to be returned."];
	optional string sortmethod = 7 [default = "lastupdated", (description) = "(Optional) Sorting method to use on returned values."];
	optional uint32 privacy = 9 [(description) = "(optional) Filter by privacy settings."];
	repeated string requiredtags = 10 [(description) = "(Optional) Tags that must be present on a published file to satisfy the query."];
	repeated string excludedtags = 11 [(description) = "(Optional) Tags that must NOT be present on a published file to satisfy the query."];
	repeated .CPublishedFile_GetUserFiles_Request.KVTag required_kv_tags = 30 [(description) = "Required key-value tags to match on."];
	optional uint32 filetype = 14 [(description) = "(Optional) File type to match files to."];
	optional uint32 creator_appid = 15 [(description) = "App Id of the app that published the files, only matched if specified."];
	optional string match_cloud_filename = 16 [(description) = "Match this cloud filename if specified."];
	optional uint32 cache_max_age_seconds = 27 [default = 0, (description) = "Allow stale data to be returned for the specified number of seconds."];
	optional int32 language = 29 [default = 0, (description) = "Specifies the localized text to return. Defaults to English."];
	repeated .CPublishedFile_GetUserFiles_Request.TagGroup taggroups = 34 [(description) = "(Optional) At least one of the tags must be present on a published file to satisfy the query."];
	optional bool totalonly = 17 [(description) = "(Optional) If true, only return the total number of files that satisfy this query."];
	optional bool ids_only = 18 [(description) = "(Optional) If true, only return the published file ids of files that satisfy this query."];
	optional bool return_vote_data = 19 [default = true, (description) = "Return vote data"];
	optional bool return_tags = 20 [(description) = "Return tags in the file details"];
	optional bool return_kv_tags = 21 [default = true, (description) = "Return key-value tags in the file details"];
	optional bool return_previews = 22 [(description) = "Return preview image and video details in the file details"];
	optional bool return_children = 23 [(description) = "Return child item ids in the file details"];
	optional bool return_short_description = 24 [default = true, (description) = "Populate the short_description field instead of file_description"];
	optional bool return_for_sale_data = 26 [(description) = "Return pricing information, if applicable"];
	optional bool return_metadata = 28 [default = false, (description) = "Populate the metadata field"];
	optional uint32 return_playtime_stats = 31 [(description) = "Return playtime stats for the specified number of days before today."];
	optional bool strip_description_bbcode = 32 [(description) = "Strips BBCode from descriptions."];
	optional bool return_reactions = 35 [default = false, (description) = "If true, then reactions to items will be returned."];
	optional uint32 startindex_override = 25 [(description) = "Backwards compatible for the client."];
	optional .EPublishedFileRevision desired_revision = 33 [default = k_EPublishedFileRevision_Default, (description) = "Return the data for the specified revision."];
}

message CPublishedFile_GetUserFiles_Response {
	message App {
		optional uint32 appid = 1;
		optional string name = 2;
		optional uint32 shortcutid = 3;
		optional bool private = 4;
	}

	optional uint32 total = 1;
	optional uint32 startindex = 2;
	repeated .PublishedFileDetails publishedfiledetails = 3;
	repeated .CPublishedFile_GetUserFiles_Response.App apps = 4;
}

message CPublishedFile_AreFilesInSubscriptionList_Request {
	optional uint32 appid = 1;
	repeated fixed64 publishedfileids = 2;
	optional uint32 listtype = 3 [(description) = "See EUCMListType"];
	optional uint32 filetype = 4 [(description) = "See EPublishedFileInfoMatchingFileType"];
	optional uint32 workshopfiletype = 5 [(description) = "See EWorkshopFileType.  If specified, overrides filetype"];
}

message CPublishedFile_AreFilesInSubscriptionList_Response {
	message InList {
		optional fixed64 publishedfileid = 1;
		optional bool inlist = 2;
	}

	repeated .CPublishedFile_AreFilesInSubscriptionList_Response.InList files = 1;
}

message CPublishedFile_Update_Request {
	optional uint32 appid = 1 [(description) = "App Id this published file belongs to."];
	optional fixed64 publishedfileid = 2 [(description) = "Published file id of the file we'd like update."];
	optional string title = 3 [(description) = "(Optional) Title of the published file."];
	optional string file_description = 4 [(description) = "(Optional) Description of the published file."];
	optional uint32 visibility = 5 [(description) = "(Optional) Visibility of the published file."];
	repeated string tags = 6 [(description) = "(Optional) Set of tags for the published file."];
	optional string filename = 7 [(description) = "(Optional) Filename for the published file."];
	optional string preview_filename = 8 [(description) = "(Optional) Preview filename for the published file."];
	optional uint32 image_width = 15 [(description) = "(Optional) If this is an image file, you can specify the image width."];
	optional uint32 image_height = 16 [(description) = "(Optional) If this is an image file, you can specify the image height."];
}

message CPublishedFile_Update_Response {
}

message CPublishedFile_GetChangeHistoryEntry_Request {
	optional fixed64 publishedfileid = 1 [(description) = "Published file id of the file we'd like to get the change history for."];
	optional uint32 timestamp = 2;
	optional int32 language = 3;
}

message CPublishedFile_GetChangeHistoryEntry_Response {
	optional string change_description = 1;
	optional int32 language = 2;
}

message CPublishedFile_GetChangeHistory_Request {
	optional fixed64 publishedfileid = 1 [(description) = "Published file id of the file we'd like to get the change history for."];
	optional bool total_only = 2 [(description) = "Return the total number of changes only."];
	optional uint32 startindex = 3;
	optional uint32 count = 4;
	optional int32 language = 5 [default = 0, (description) = "Desired language"];
}

message CPublishedFile_GetChangeHistory_Response {
	message ChangeLog {
		optional uint32 timestamp = 1;
		optional string change_description = 2;
		optional int32 language = 3;
	}

	repeated .CPublishedFile_GetChangeHistory_Response.ChangeLog changes = 1;
	optional uint32 total = 2;
}

message CPublishedFile_RefreshVotingQueue_Request {
	optional uint32 appid = 1;
	optional uint32 matching_file_type = 2 [(description) = "EPublishedFileInfoMatchingFileType"];
	repeated string tags = 3 [(description) = "Include files that have all the tags or any of the tags if match_all_tags is set to false."];
	optional bool match_all_tags = 4 [default = true, (description) = "If true, then files must have all the tags specified.  If false, then must have at least one of the tags specified."];
	repeated string excluded_tags = 5 [(description) = "Exclude any files that have any of these tags."];
	optional uint32 desired_queue_size = 6 [(description) = "Desired number of items in the voting queue.  May be clamped by the server"];
	optional .EPublishedFileRevision desired_revision = 8 [default = k_EPublishedFileRevision_Default, (description) = "Filter to items that have data for the specified revision."];
}

message CPublishedFile_RefreshVotingQueue_Response {
}

message CPublishedFile_QueryFiles_Request {
	message KVTag {
		optional string key = 1;
		optional string value = 2;
	}

	message TagGroup {
		repeated string tags = 1;
	}

	message DateRange {
		optional uint32 timestamp_start = 1 [(description) = "(Optional) Include items with the relevant date field after this value."];
		optional uint32 timestamp_end = 2 [(description) = "(Optional) Include items with the relevant date field before this value."];
	}

	optional uint32 query_type = 1 [(description) = "enumeration EPublishedFileQueryType in clientenums.h"];
	optional uint32 page = 2 [(description) = "Current page"];
	optional string cursor = 39 [(description) = "Cursor to paginate through the results (set to '*' for the first request).  Prefer this over using the page parameter, as it will allow you to do deep pagination.  When used, the page parameter will be ignored."];
	optional uint32 numperpage = 3 [default = 1, (description) = "(Optional) The number of results, per page to return."];
	optional uint32 creator_appid = 4 [(description) = "App that created the files"];
	optional uint32 appid = 5 [(description) = "App that consumes the files"];
	repeated string requiredtags = 6 [(description) = "Tags to match on. See match_all_tags parameter below"];
	repeated string excludedtags = 7 [(description) = "(Optional) Tags that must NOT be present on a published file to satisfy the query."];
	optional bool match_all_tags = 8 [default = true, (description) = "If true, then items must have all the tags specified, otherwise they must have at least one of the tags."];
	repeated string required_flags = 9 [(description) = "Required flags that must be set on any returned items"];
	repeated string omitted_flags = 10 [(description) = "Flags that must not be set on any returned items"];
	optional string search_text = 11 [(description) = "Text to match in the item's title or description"];
	optional uint32 filetype = 12 [(description) = "EPublishedFileInfoMatchingFileType"];
	optional fixed64 child_publishedfileid = 13 [(description) = "Find all items that reference the given item."];
	optional uint32 days = 14 [(description) = "If query_type is k_PublishedFileQueryType_RankedByTrend, then this is the number of days to get votes for [1,7]."];
	optional bool include_recent_votes_only = 15 [(description) = "If query_type is k_PublishedFileQueryType_RankedByTrend, then limit result set just to items that have votes within the day range given"];
	optional uint32 cache_max_age_seconds = 31 [default = 0, (description) = "Allow stale data to be returned for the specified number of seconds."];
	optional int32 language = 33 [default = 0, (description) = "Language to search in and also what gets returned. Defaults to English."];
	repeated .CPublishedFile_QueryFiles_Request.KVTag required_kv_tags = 34 [(description) = "Required key-value tags to match on."];
	repeated .CPublishedFile_QueryFiles_Request.TagGroup taggroups = 42 [(description) = "(Optional) At least one of the tags must be present on a published file to satisfy the query."];
	optional .CPublishedFile_QueryFiles_Request.DateRange date_range_created = 44 [(description) = "(Optional) Filter to items created within this range."];
	optional .CPublishedFile_QueryFiles_Request.DateRange date_range_updated = 45 [(description) = "(Optional) Filter to items updated within this range."];
	optional bool totalonly = 16 [(description) = "(Optional) If true, only return the total number of files that satisfy this query."];
	optional bool ids_only = 35 [(description) = "(Optional) If true, only return the published file ids of files that satisfy this query."];
	optional bool return_vote_data = 17 [(description) = "Return vote data"];
	optional bool return_tags = 18 [(description) = "Return tags in the file details"];
	optional bool return_kv_tags = 19 [(description) = "Return key-value tags in the file details"];
	optional bool return_previews = 20 [(description) = "Return preview image and video details in the file details"];
	optional bool return_children = 21 [(description) = "Return child item ids in the file details"];
	optional bool return_short_description = 22 [(description) = "Populate the short_description field instead of file_description"];
	optional bool return_for_sale_data = 30 [(description) = "Return pricing information, if applicable"];
	optional bool return_metadata = 32 [default = false, (description) = "Populate the metadata"];
	optional uint32 return_playtime_stats = 36 [(description) = "Return playtime stats for the specified number of days before today."];
	optional bool return_details = 37 [(description) = "By default, if none of the other 'return_*' fields are set, only some voting details are returned. Set this to true to return the default set of details."];
	optional bool strip_description_bbcode = 38 [(description) = "Strips BBCode from descriptions."];
	optional .EPublishedFileRevision desired_revision = 40 [default = k_EPublishedFileRevision_Default, (description) = "Return the data for the specified revision."];
	optional bool return_reactions = 43 [default = false, (description) = "If true, then reactions to items will be returned."];
}

message CPublishedFile_QueryFiles_Response {
	optional uint32 total = 1 [(description) = "Number of matches found, not necessarily number of items returned"];
	repeated .PublishedFileDetails publishedfiledetails = 2 [(description) = "Each file details will be populated, depending on what return values were requested."];
	optional string next_cursor = 3 [(description) = "If a paging cursor was used, then this will be the next cursor to use for paging through results"];
}

message CPublishedFile_AddAppRelationship_Request {
	optional uint64 publishedfileid = 1;
	optional uint32 appid = 2;
	optional uint32 relationship = 3;
}

message CPublishedFile_AddAppRelationship_Response {
}

message CPublishedFile_RemoveAppRelationship_Request {
	optional uint64 publishedfileid = 1;
	optional uint32 appid = 2;
	optional uint32 relationship = 3;
}

message CPublishedFile_RemoveAppRelationship_Response {
}

message CPublishedFile_GetAppRelationships_Request {
	optional uint64 publishedfileid = 1;
}

message CPublishedFile_GetAppRelationships_Response {
	message AppRelationship {
		optional uint32 appid = 1;
		optional uint32 relationship = 2;
	}

	repeated .CPublishedFile_GetAppRelationships_Response.AppRelationship app_relationships = 3;
}

message CPublishedFile_StartPlaytimeTracking_Request {
	optional uint32 appid = 1;
	repeated uint64 publishedfileids = 2;
}

message CPublishedFile_StartPlaytimeTracking_Response {
}

message CPublishedFile_StopPlaytimeTracking_Request {
	optional uint32 appid = 1;
	repeated uint64 publishedfileids = 2;
}

message CPublishedFile_StopPlaytimeTracking_Response {
}

message CPublishedFile_StopPlaytimeTrackingForAllAppItems_Request {
	optional uint32 appid = 1;
}

message CPublishedFile_StopPlaytimeTrackingForAllAppItems_Response {
}

message CPublishedFile_SetPlaytimeForControllerConfigs_Request {
	message ControllerConfigUsage {
		optional uint64 publishedfileid = 1;
		optional float seconds_active = 2;
	}

	optional uint32 appid = 1;
	repeated .CPublishedFile_SetPlaytimeForControllerConfigs_Request.ControllerConfigUsage controller_config_usage = 2;
}

message CPublishedFile_SetPlaytimeForControllerConfigs_Response {
}

message CPublishedFile_AddChild_Request {
	optional uint64 publishedfileid = 1;
	optional uint64 child_publishedfileid = 2;
}

message CPublishedFile_AddChild_Response {
}

message CPublishedFile_RemoveChild_Request {
	optional uint64 publishedfileid = 1;
	optional uint64 child_publishedfileid = 2;
}

message CPublishedFile_RemoveChild_Response {
}

message CPublishedFile_GetUserVoteSummary_Request {
	repeated fixed64 publishedfileids = 1;
}

message CPublishedFile_GetUserVoteSummary_Response {
	message VoteSummary {
		optional fixed64 publishedfileid = 1;
		optional bool vote_for = 2;
		optional bool vote_against = 3;
		optional bool reported = 4;
	}

	repeated .CPublishedFile_GetUserVoteSummary_Response.VoteSummary summaries = 1;
}

message CPublishedFile_GetItemChanges_Request {
	optional uint32 appid = 1;
	optional uint32 last_time_updated = 2;
	optional uint32 num_items_max = 3;
}

message CPublishedFile_GetItemChanges_Response {
	message WorkshopItemInfo {
		optional fixed64 published_file_id = 1;
		optional uint32 time_updated = 2;
		optional fixed64 manifest_id = 3;
	}

	optional uint32 update_time = 1;
	repeated .CPublishedFile_GetItemChanges_Response.WorkshopItemInfo workshop_items = 2;
}

message CPublishedFile_FileSubscribed_Notification {
	message RevisionData {
		optional .EPublishedFileRevision revision = 1 [default = k_EPublishedFileRevision_Default];
		optional fixed64 file_hcontent = 2 [(description) = "Manifest GID"];
		optional uint32 rtime_updated = 3 [(description) = "Last time content updated"];
	}

	optional fixed64 published_file_id = 1 [(description) = "PublishedFileID_t for the content"];
	optional uint32 app_id = 2;
	optional fixed64 file_hcontent = 3 [(description) = "UGC file handle or manifest GID"];
	optional uint32 file_size = 4;
	optional uint32 rtime_subscribed = 5;
	optional bool is_depot_content = 6 [(description) = "True if workshop item is delivered via Steampipe"];
	optional uint32 rtime_updated = 7 [(description) = "Last time content updated"];
	repeated .CPublishedFile_FileSubscribed_Notification.RevisionData revisions = 8 [(description) = "Data for each of the revisions that this item has"];
}

message CPublishedFile_FileUnsubscribed_Notification {
	optional fixed64 published_file_id = 1 [(description) = "PublishedFileID_t for the content"];
	optional uint32 app_id = 2;
}

message CPublishedFile_FileDeleted_Client_Notification {
	optional fixed64 published_file_id = 1 [(description) = "PublishedFileID_t for the content"];
	optional uint32 app_id = 2;
}

service PublishedFile {
	option (service_description) = "A service to access published file data";

	rpc Subscribe (.CPublishedFile_Subscribe_Request) returns (.CPublishedFile_Subscribe_Response) {
		option (method_description) = "Subscribes the user to the published file";
	}

	rpc Unsubscribe (.CPublishedFile_Unsubscribe_Request) returns (.CPublishedFile_Unsubscribe_Response) {
		option (method_description) = "Unsubscribes the user from the published file";
	}

	rpc CanSubscribe (.CPublishedFile_CanSubscribe_Request) returns (.CPublishedFile_CanSubscribe_Response) {
		option (method_description) = "Check if the user can subscribe to the published file";
	}

	rpc Publish (.CPublishedFile_Publish_Request) returns (.CPublishedFile_Publish_Response) {
		option (method_description) = "Publishes a clouded user file to the Workshop.";
	}

	rpc GetDetails (.CPublishedFile_GetDetails_Request) returns (.CPublishedFile_GetDetails_Response) {
		option (method_description) = "Retrieves information about a set of published files.";
	}

	rpc GetItemInfo (.CPublishedFile_GetItemInfo_Request) returns (.CPublishedFile_GetItemInfo_Response) {
		option (method_description) = "Retrieves information about a set of published files.";
	}

	rpc GetUserFiles (.CPublishedFile_GetUserFiles_Request) returns (.CPublishedFile_GetUserFiles_Response) {
		option (method_description) = "Retrieves files published by a user.";
	}

	rpc AreFilesInSubscriptionList (.CPublishedFile_AreFilesInSubscriptionList_Request) returns (.CPublishedFile_AreFilesInSubscriptionList_Response) {
		option (method_description) = "Determines which files in the given list are in a user's subscription list";
	}

	rpc Update (.CPublishedFile_Update_Request) returns (.CPublishedFile_Update_Response) {
		option (method_description) = "Updates information about a published file.";
	}

	rpc GetChangeHistoryEntry (.CPublishedFile_GetChangeHistoryEntry_Request) returns (.CPublishedFile_GetChangeHistoryEntry_Response) {
		option (method_description) = "Returns data on a specific change history entry for a published file";
	}

	rpc GetChangeHistory (.CPublishedFile_GetChangeHistory_Request) returns (.CPublishedFile_GetChangeHistory_Response) {
		option (method_description) = "Returns data on the change history for a published file";
	}

	rpc RefreshVotingQueue (.CPublishedFile_RefreshVotingQueue_Request) returns (.CPublishedFile_RefreshVotingQueue_Response) {
		option (method_description) = "Refresh the voting queue for the user";
	}

	rpc QueryFiles (.CPublishedFile_QueryFiles_Request) returns (.CPublishedFile_QueryFiles_Response) {
		option (method_description) = "Performs a search query for published files";
	}

	rpc AddAppRelationship (.CPublishedFile_AddAppRelationship_Request) returns (.CPublishedFile_AddAppRelationship_Response) {
		option (method_description) = "Adds a relationship between the published file and the given app";
	}

	rpc RemoveAppRelationship (.CPublishedFile_RemoveAppRelationship_Request) returns (.CPublishedFile_RemoveAppRelationship_Response) {
		option (method_description) = "Remove a relationship between the published file and the given app";
	}

	rpc GetAppRelationships (.CPublishedFile_GetAppRelationships_Request) returns (.CPublishedFile_GetAppRelationships_Response) {
		option (method_description) = "Returns the list of app relationships for this published file";
	}

	rpc StartPlaytimeTracking (.CPublishedFile_StartPlaytimeTracking_Request) returns (.CPublishedFile_StartPlaytimeTracking_Response) {
		option (method_description) = "Start usage tracking for a given set of published files";
	}

	rpc StopPlaytimeTracking (.CPublishedFile_StopPlaytimeTracking_Request) returns (.CPublishedFile_StopPlaytimeTracking_Response) {
		option (method_description) = "Stops usage tracking for a given set of published files";
	}

	rpc StopPlaytimeTrackingForAllAppItems (.CPublishedFile_StopPlaytimeTrackingForAllAppItems_Request) returns (.CPublishedFile_StopPlaytimeTrackingForAllAppItems_Response) {
		option (method_description) = "Stops usage tracking for all items currently tracked for the specified app";
	}

	rpc SetPlaytimeForControllerConfigs (.CPublishedFile_SetPlaytimeForControllerConfigs_Request) returns (.CPublishedFile_SetPlaytimeForControllerConfigs_Response) {
		option (method_description) = "Stops usage tracking all controller configs for the given app and set the usage time for the for the given controller configs";
	}

	rpc AddChild (.CPublishedFile_AddChild_Request) returns (.CPublishedFile_AddChild_Response) {
		option (method_description) = "Adds a parent->child relationship between the given items.";
	}

	rpc RemoveChild (.CPublishedFile_RemoveChild_Request) returns (.CPublishedFile_RemoveChild_Response) {
		option (method_description) = "Removes parent->child relationship between the given items.";
	}

	rpc GetUserVoteSummary (.CPublishedFile_GetUserVoteSummary_Request) returns (.CPublishedFile_GetUserVoteSummary_Response) {
		option (method_description) = "Get user vote summary";
	}

	rpc GetItemChanges (.CPublishedFile_GetItemChanges_Request) returns (.CPublishedFile_GetItemChanges_Response) {
		option (method_description) = "Get list of updated items since given date";
	}
}

service PublishedFileClient {
	option (service_description) = "Published file client notifications";
	option (service_execution_site) = k_EProtoExecutionSiteSteamClient;

	rpc NotifyFileSubscribed (.CPublishedFile_FileSubscribed_Notification) returns (.NoResponse) {
		option (method_description) = "Notification from the server when a user subscribes to a file";
	}

	rpc NotifyFileUnsubscribed (.CPublishedFile_FileUnsubscribed_Notification) returns (.NoResponse) {
		option (method_description) = "Notification from the server when a user unsubscribes from a file";
	}

	rpc NotifyFileDeleted (.CPublishedFile_FileDeleted_Client_Notification) returns (.NoResponse) {
		option (method_description) = "Notification from the server when a published file is deleted";
	}
}
