示例#1
0
        public Task <SoundCloudList <User> > GetAllAsync(UserQueryBuilder builder)
        {
            builder.Path  = UsersPath;
            builder.Paged = true;

            return(GetPage <User>(builder.BuildUri()));
        }
示例#2
0
        public async Task <User> GetAsync(long userId)
        {
            var builder = new UserQueryBuilder {
                Path = string.Format(UserPath, userId)
            };

            return(await Gateway.SendGetRequestAsync <User>(builder.BuildUri()));
        }
示例#3
0
        public void Test_No_Parameters()
        {
            var builder = new UserQueryBuilder();

            var query = builder.BuildUri();

            Assert.That(query.ToString(), Is.EqualTo("https://api.soundcloud.com/?"));
        }
示例#4
0
        public async Task <IEnumerable <User> > GetAsync(UserQueryBuilder queryBuilder)
        {
            EnsureClientId();

            queryBuilder.Path  = UsersPath;
            queryBuilder.Paged = true;

            return(await GetListAsync <User>(queryBuilder.BuildUri()));
        }
示例#5
0
        public IEnumerable <User> Get(UserQueryBuilder queryBuilder)
        {
            EnsureClientId();

            queryBuilder.Path  = UsersPath;
            queryBuilder.Paged = true;

            return(GetList <User>(queryBuilder.BuildUri()));
        }
示例#6
0
        public Task <SoundCloudList <Playlist> > GetPlaylistsAsync(User user, int limit = SoundCloudQueryBuilder.MaxLimit)
        {
            user.ValidateGet();

            var builder = new UserQueryBuilder {
                Path = string.Format(UserPlaylistsPath, user.Id), Paged = true, Limit = limit
            };

            return(GetPage <Playlist>(builder.BuildUri()));
        }
示例#7
0
        public async Task <User> GetAsync(int userId)
        {
            EnsureClientId();

            var builder = new UserQueryBuilder();

            builder.Path = string.Format(UserPath, userId);

            return(await GetByIdAsync <User>(builder.BuildUri()));
        }
示例#8
0
        public User Get(int userId)
        {
            EnsureClientId();

            var builder = new UserQueryBuilder();

            builder.Path = string.Format(UserPath, userId);

            return(GetById <User>(builder.BuildUri()));
        }
示例#9
0
        public void Test_SearchString()
        {
            var builder = new UserQueryBuilder();

            builder.SearchString = "SearchString";

            var query = builder.BuildUri();

            Assert.That(query.ToString(), Is.EqualTo("https://api.soundcloud.com/?q=SearchString"));
        }
示例#10
0
        public void Test_Paged()
        {
            var builder = new UserQueryBuilder();

            builder.Paged        = true;
            builder.SearchString = "SearchString";

            var query = builder.BuildUri();

            Assert.That(query.ToString(), Is.EqualTo("https://api.soundcloud.com/?limit=200&q=SearchString&linked_partitioning=1"));
        }
示例#11
0
        public async Task <IEnumerable <Comment> > GetCommentsAsync(User user)
        {
            EnsureClientId();
            Validate(user.ValidateGet);

            var builder = new UserQueryBuilder();

            builder.Path  = string.Format(UserCommentsPath, user.id);
            builder.Paged = true;

            return(await GetListAsync <Comment>(builder.BuildUri()));
        }
示例#12
0
        public IEnumerable <WebProfile> GetWebProfiles(User user)
        {
            EnsureClientId();
            Validate(user.ValidateGet);

            var builder = new UserQueryBuilder();

            builder.Path  = string.Format(UserWebProfilesPath, user.id);
            builder.Paged = true;

            return(GetList <WebProfile>(builder.BuildUri()));
        }
示例#13
0
        public IEnumerable <Playlist> GetPlaylists(User user)
        {
            EnsureClientId();
            Validate(user.ValidateGet);

            var builder = new UserQueryBuilder();

            builder.Path  = string.Format(UserPlaylistsPath, user.id);
            builder.Paged = true;

            return(GetList <Playlist>(builder.BuildUri()));
        }