// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Users; namespace osu.Game.Online.API.Requests { public class GetUserRequest : APIRequest { private long? userId; private string userName; /// The user's ID. public GetUserRequest(long? userId = null) { this.userId = userId; } /// The user's username. public GetUserRequest(string userName) { this.userName = userName; } // Prefer ID over name protected override string Target => userId.HasValue ? $@"users/{userId}" : ((!string.IsNullOrEmpty(userName)) ? $@"users/{userName}" : @"me"); } }