import "common_base.proto";

message CFamilyGroups_CancelFamilyGroupInvite_Request {
	optional uint64 family_groupid = 1;
	optional fixed64 steamid_to_cancel = 2;
}

message CFamilyGroups_CancelFamilyGroupInvite_Response {
}

message CFamilyGroups_ClearCooldownSkip_Request {
	optional fixed64 steamid = 1;
	optional uint64 invite_id = 2;
}

message CFamilyGroups_ClearCooldownSkip_Response {
}

message CFamilyGroups_ConfirmInviteToFamilyGroup_Request {
	optional uint64 family_groupid = 1;
	optional uint64 invite_id = 2;
	optional uint64 nonce = 3;
}

message CFamilyGroups_ConfirmInviteToFamilyGroup_Response {
}

message CFamilyGroups_ConfirmJoinFamilyGroup_Request {
	optional uint64 family_groupid = 1;
	optional uint64 invite_id = 2;
	optional uint64 nonce = 3;
}

message CFamilyGroups_ConfirmJoinFamilyGroup_Response {
}

message CFamilyGroups_CreateFamilyGroup_Request {
	optional string name = 1;
	optional fixed64 steamid = 2;
}

message CFamilyGroups_CreateFamilyGroup_Response {
	optional uint64 family_groupid = 1;
	optional bool cooldown_skip_granted = 2;
}

message CFamilyGroups_DeleteFamilyGroup_Request {
	optional uint64 family_groupid = 1;
}

message CFamilyGroups_DeleteFamilyGroup_Response {
}

message CFamilyGroups_ForceAcceptInvite_Request {
	optional uint64 family_groupid = 1;
	optional fixed64 steamid = 2;
}

message CFamilyGroups_ForceAcceptInvite_Response {
}

message CFamilyGroups_GetChangeLog_Request {
	optional uint64 family_groupid = 1;
}

message CFamilyGroups_GetChangeLog_Response {
	repeated .CFamilyGroups_GetChangeLog_Response_Change changes = 1;
}

message CFamilyGroups_GetChangeLog_Response_Change {
	optional fixed64 timestamp = 1;
	optional fixed64 actor_steamid = 2;
	optional int32 type = 3 [(.description) = "enum"];
	optional string body = 4;
	optional bool by_support = 5;
}

message CFamilyGroups_GetFamilyGroup_Request {
	optional uint64 family_groupid = 1;
	optional bool send_running_apps = 2;
}

message CFamilyGroups_GetFamilyGroup_Response {
	optional string name = 1;
	repeated .FamilyGroupMember members = 2;
	repeated .FamilyGroupPendingInvite pending_invites = 3;
	optional uint32 free_spots = 4;
	optional string country = 5;
	optional uint32 slot_cooldown_remaining_seconds = 6;
	repeated .FamilyGroupFormerMember former_members = 7;
	optional uint32 slot_cooldown_overrides = 8;
}

message CFamilyGroups_GetFamilyGroupForUser_Request {
	optional uint64 steamid = 1;
	optional bool include_family_group_response = 2;
}

message CFamilyGroups_GetFamilyGroupForUser_Response {
	optional uint64 family_groupid = 1;
	optional bool is_not_member_of_any_group = 2;
	optional uint32 latest_time_joined = 3;
	optional uint64 latest_joined_family_groupid = 4;
	repeated .FamilyGroupPendingInviteForUser pending_group_invites = 5;
	optional uint32 role = 6;
	optional uint32 cooldown_seconds_remaining = 7;
	optional .CFamilyGroups_GetFamilyGroup_Response family_group = 8;
	optional bool can_undelete_last_joined_family = 9;
	repeated .FamilyGroupMembership membership_history = 10;
}

message CFamilyGroups_GetInviteCheckResults_Request {
	optional uint64 family_groupid = 1;
	optional fixed64 steamid = 2;
}

message CFamilyGroups_GetInviteCheckResults_Response {
	optional bool wallet_country_matches = 1;
	optional bool ip_match = 2;
	optional uint32 join_restriction = 3;
}

message CFamilyGroups_GetPlaytimeSummary_Request {
	optional fixed64 family_groupid = 1;
}

message CFamilyGroups_GetPlaytimeSummary_Response {
	repeated .CFamilyGroups_PlaytimeEntry entries = 1;
	repeated .CFamilyGroups_PlaytimeEntry entries_by_owner = 2;
}

message CFamilyGroups_GetPreferredLenders_Request {
	optional uint64 family_groupid = 1;
}

message CFamilyGroups_GetPreferredLenders_Response {
	repeated .CFamilyGroups_GetPreferredLenders_Response_FamilyMember members = 1;
}

message CFamilyGroups_GetPreferredLenders_Response_FamilyMember {
	optional fixed64 steamid = 1;
	repeated uint32 preferred_appids = 2;
}

message CFamilyGroups_GetPurchaseRequests_Request {
	optional uint64 family_groupid = 1;
	repeated uint64 request_ids = 3;
	optional uint32 rt_include_completed_since = 4;
}

message CFamilyGroups_GetPurchaseRequests_Response {
	repeated .PurchaseRequest requests = 1;
}

message CFamilyGroups_GetSharedLibraryApps_Request {
	optional fixed64 family_groupid = 1;
	optional bool include_own = 2;
	optional bool include_excluded = 3;
	optional string language = 5;
	optional uint32 max_apps = 6;
	optional bool include_non_games = 7;
	optional fixed64 steamid = 8;
}

message CFamilyGroups_GetSharedLibraryApps_Response {
	repeated .CFamilyGroups_GetSharedLibraryApps_Response_SharedApp apps = 1;
	optional fixed64 owner_steamid = 2;
}

message CFamilyGroups_GetSharedLibraryApps_Response_SharedApp {
	optional uint32 appid = 1;
	repeated fixed64 owner_steamids = 2;
	optional string name = 6;
	optional string sort_as = 7;
	optional string capsule_filename = 8;
	optional string img_icon_hash = 9;
	optional int32 exclude_reason = 10 [default = 0, (.description) = "enum"];
	optional uint32 rt_time_acquired = 11;
	optional uint32 rt_last_played = 12;
	optional uint32 rt_playtime = 13;
	optional int32 app_type = 14 [default = 1, (.description) = "enum"];
	repeated uint32 content_descriptors = 15;
}

message CFamilyGroups_GetUsersSharingDevice_Request {
	optional uint64 family_groupid = 1;
	optional uint64 client_instance_id = 2;
}

message CFamilyGroups_GetUsersSharingDevice_Response {
	repeated fixed64 users = 1;
}

message CFamilyGroups_InviteToFamilyGroup_Request {
	optional uint64 family_groupid = 1;
	optional fixed64 receiver_steamid = 2;
	optional int32 receiver_role = 3 [(.description) = "enum"];
}

message CFamilyGroups_InviteToFamilyGroup_Response {
	optional uint64 invite_id = 1;
	optional int32 two_factor_method = 2 [(.description) = "enum"];
}

message CFamilyGroups_JoinFamilyGroup_Request {
	optional uint64 family_groupid = 1;
	optional uint64 nonce = 2;
}

message CFamilyGroups_JoinFamilyGroup_Response {
	optional int32 two_factor_method = 2 [(.description) = "enum"];
	optional bool cooldown_skip_granted = 3;
	optional bool invite_already_accepted = 4;
	optional uint32 cooldown_seconds_remaining = 5;
}

message CFamilyGroups_ModifyFamilyGroupDetails_Request {
	optional uint64 family_groupid = 1;
	optional string name = 2;
}

message CFamilyGroups_ModifyFamilyGroupDetails_Response {
}

message CFamilyGroups_PlaytimeEntry {
	optional fixed64 steamid = 1;
	optional uint32 appid = 2;
	optional uint32 first_played = 3;
	optional uint32 latest_played = 4;
	optional uint32 seconds_played = 5;
}

message CFamilyGroups_RemoveFromFamilyGroup_Request {
	optional uint64 family_groupid = 1;
	optional fixed64 steamid_to_remove = 2;
}

message CFamilyGroups_RemoveFromFamilyGroup_Response {
}

message CFamilyGroups_RequestPurchase_Request {
	optional uint64 family_groupid = 1;
	optional uint64 gidshoppingcart = 2;
	optional string store_country_code = 3;
	optional bool use_account_cart = 4;
}

message CFamilyGroups_RequestPurchase_Response {
	optional uint64 gidshoppingcart = 1;
	optional uint64 request_id = 2;
}

message CFamilyGroups_ResendInvitationToFamilyGroup_Request {
	optional uint64 family_groupid = 1;
	optional uint64 steamid = 2;
}

message CFamilyGroups_ResendInvitationToFamilyGroup_Response {
}

message CFamilyGroups_RespondToRequestedPurchase_Request {
	optional uint64 family_groupid = 1;
	optional int32 action = 3 [(.description) = "enum"];
	optional uint64 request_id = 4;
}

message CFamilyGroups_RespondToRequestedPurchase_Response {
}

message CFamilyGroups_RollbackFamilyGroup_Request {
	optional uint64 family_groupid = 1;
	optional uint32 rtime32_target = 2;
}

message CFamilyGroups_RollbackFamilyGroup_Response {
}

message CFamilyGroups_SetFamilyCooldownOverrides_Request {
	optional uint64 family_groupid = 1;
	optional uint32 cooldown_count = 2;
}

message CFamilyGroups_SetFamilyCooldownOverrides_Response {
}

message CFamilyGroups_SetPreferredLender_Request {
	optional uint64 family_groupid = 1;
	optional uint32 appid = 2;
	optional fixed64 lender_steamid = 3;
}

message CFamilyGroups_SetPreferredLender_Response {
}

message CFamilyGroups_UndeleteFamilyGroup_Request {
	optional uint64 family_groupid = 1;
}

message CFamilyGroups_UndeleteFamilyGroup_Response {
}

message CFamilyGroupsClient_GroupChanged_Notification {
	optional uint64 family_groupid = 1;
}

message CFamilyGroupsClient_InviteStatus_Notification {
}

message CFamilyGroupsClient_NotifyRunningApps_Notification {
	optional uint64 family_groupid = 1;
	repeated .CFamilyGroupsClient_NotifyRunningApps_Notification_RunningApp running_apps = 2;
}

message CFamilyGroupsClient_NotifyRunningApps_Notification_PlayingMember {
	optional fixed64 member_steamid = 1;
	optional fixed64 owner_steamid = 2;
}

message CFamilyGroupsClient_NotifyRunningApps_Notification_RunningApp {
	optional uint32 appid = 1;
	repeated .CFamilyGroupsClient_NotifyRunningApps_Notification_PlayingMember playing_members = 3;
}

message FamilyGroupFormerMember {
	optional fixed64 steamid = 1;
}

message FamilyGroupMember {
	optional fixed64 steamid = 1;
	optional int32 role = 2 [(.description) = "enum"];
	optional uint32 time_joined = 3;
	optional uint32 cooldown_seconds_remaining = 4;
}

message FamilyGroupMembership {
	optional uint64 family_groupid = 1;
	optional uint32 rtime_joined = 2;
	optional uint32 rtime_left = 3;
	optional uint32 role = 4;
	optional bool participated = 5;
}

message FamilyGroupPendingInvite {
	optional fixed64 steamid = 1;
	optional int32 role = 2 [(.description) = "enum"];
}

message FamilyGroupPendingInviteForUser {
	optional uint64 family_groupid = 1;
	optional int32 role = 2 [(.description) = "enum"];
	optional fixed64 inviter_steamid = 3;
	optional bool awaiting_2fa = 4;
	optional uint64 invite_id = 5;
}

message PurchaseRequest {
	optional fixed64 requester_steamid = 1;
	optional uint64 gidshoppingcart = 2;
	optional uint32 time_requested = 3;
	optional uint32 time_responded = 4;
	optional fixed64 responder_steamid = 5;
	optional int32 response_action = 6 [(.description) = "enum"];
	optional bool is_completed = 7;
	optional uint64 request_id = 8;
	repeated uint32 requested_packageids = 9;
	repeated uint32 purchased_packageids = 10;
	repeated uint32 requested_bundleids = 11;
	repeated uint32 purchased_bundleids = 12;
}

service FamilyGroups {
	// ePrivilege=1
	rpc CancelFamilyGroupInvite (.CFamilyGroups_CancelFamilyGroupInvite_Request) returns (.CFamilyGroups_CancelFamilyGroupInvite_Response);
	// ePrivilege=5
	rpc ClearCooldownSkip (.CFamilyGroups_ClearCooldownSkip_Request) returns (.CFamilyGroups_ClearCooldownSkip_Response);
	// ePrivilege=1
	rpc ConfirmInviteToFamilyGroup (.CFamilyGroups_ConfirmInviteToFamilyGroup_Request) returns (.CFamilyGroups_ConfirmInviteToFamilyGroup_Response);
	// ePrivilege=1
	rpc ConfirmJoinFamilyGroup (.CFamilyGroups_ConfirmJoinFamilyGroup_Request) returns (.CFamilyGroups_ConfirmJoinFamilyGroup_Response);
	// ePrivilege=1
	rpc CreateFamilyGroup (.CFamilyGroups_CreateFamilyGroup_Request) returns (.CFamilyGroups_CreateFamilyGroup_Response);
	// ePrivilege=1
	rpc DeleteFamilyGroup (.CFamilyGroups_DeleteFamilyGroup_Request) returns (.CFamilyGroups_DeleteFamilyGroup_Response);
	// ePrivilege=5
	rpc ForceAcceptInvite (.CFamilyGroups_ForceAcceptInvite_Request) returns (.CFamilyGroups_ForceAcceptInvite_Response);
	// bConstMethod=true, ePrivilege=1
	rpc GetChangeLog (.CFamilyGroups_GetChangeLog_Request) returns (.CFamilyGroups_GetChangeLog_Response);
	// bConstMethod=true, ePrivilege=1
	rpc GetFamilyGroup (.CFamilyGroups_GetFamilyGroup_Request) returns (.CFamilyGroups_GetFamilyGroup_Response);
	// bConstMethod=true, ePrivilege=1
	rpc GetFamilyGroupForUser (.CFamilyGroups_GetFamilyGroupForUser_Request) returns (.CFamilyGroups_GetFamilyGroupForUser_Response);
	// bConstMethod=true, ePrivilege=5
	rpc GetInviteCheckResults (.CFamilyGroups_GetInviteCheckResults_Request) returns (.CFamilyGroups_GetInviteCheckResults_Response);
	// ePrivilege=1
	rpc GetPlaytimeSummary (.CFamilyGroups_GetPlaytimeSummary_Request) returns (.CFamilyGroups_GetPlaytimeSummary_Response);
	// bConstMethod=true, ePrivilege=1
	rpc GetPreferredLenders (.CFamilyGroups_GetPreferredLenders_Request) returns (.CFamilyGroups_GetPreferredLenders_Response);
	// bConstMethod=true, ePrivilege=1
	rpc GetPurchaseRequests (.CFamilyGroups_GetPurchaseRequests_Request) returns (.CFamilyGroups_GetPurchaseRequests_Response);
	// bConstMethod=true, ePrivilege=1
	rpc GetSharedLibraryApps (.CFamilyGroups_GetSharedLibraryApps_Request) returns (.CFamilyGroups_GetSharedLibraryApps_Response);
	// bConstMethod=true, ePrivilege=1
	rpc GetUsersSharingDevice (.CFamilyGroups_GetUsersSharingDevice_Request) returns (.CFamilyGroups_GetUsersSharingDevice_Response);
	// ePrivilege=1
	rpc InviteToFamilyGroup (.CFamilyGroups_InviteToFamilyGroup_Request) returns (.CFamilyGroups_InviteToFamilyGroup_Response);
	// ePrivilege=1
	rpc JoinFamilyGroup (.CFamilyGroups_JoinFamilyGroup_Request) returns (.CFamilyGroups_JoinFamilyGroup_Response);
	// ePrivilege=1
	rpc ModifyFamilyGroupDetails (.CFamilyGroups_ModifyFamilyGroupDetails_Request) returns (.CFamilyGroups_ModifyFamilyGroupDetails_Response);
	// ePrivilege=1
	rpc RemoveFromFamilyGroup (.CFamilyGroups_RemoveFromFamilyGroup_Request) returns (.CFamilyGroups_RemoveFromFamilyGroup_Response);
	// ePrivilege=1
	rpc RequestPurchase (.CFamilyGroups_RequestPurchase_Request) returns (.CFamilyGroups_RequestPurchase_Response);
	// ePrivilege=1
	rpc ResendInvitationToFamilyGroup (.CFamilyGroups_ResendInvitationToFamilyGroup_Request) returns (.CFamilyGroups_ResendInvitationToFamilyGroup_Response);
	// ePrivilege=1
	rpc RespondToRequestedPurchase (.CFamilyGroups_RespondToRequestedPurchase_Request) returns (.CFamilyGroups_RespondToRequestedPurchase_Response);
	// ePrivilege=5
	rpc RollbackFamilyGroup (.CFamilyGroups_RollbackFamilyGroup_Request) returns (.CFamilyGroups_RollbackFamilyGroup_Response);
	// ePrivilege=1
	rpc SetFamilyCooldownOverrides (.CFamilyGroups_SetFamilyCooldownOverrides_Request) returns (.CFamilyGroups_SetFamilyCooldownOverrides_Response);
	// ePrivilege=1
	rpc SetPreferredLender (.CFamilyGroups_SetPreferredLender_Request) returns (.CFamilyGroups_SetPreferredLender_Response);
	// ePrivilege=1
	rpc UndeleteFamilyGroup (.CFamilyGroups_UndeleteFamilyGroup_Request) returns (.CFamilyGroups_UndeleteFamilyGroup_Response);
}

service FamilyGroupsClient {
	rpc NotifyGroupChanged (.CFamilyGroupsClient_GroupChanged_Notification) returns (.NoResponse);
	rpc NotifyInviteStatus (.CFamilyGroupsClient_InviteStatus_Notification) returns (.NoResponse);
	rpc NotifyRunningApps (.CFamilyGroupsClient_NotifyRunningApps_Notification) returns (.NoResponse);
}

