示例#1
0
 internal User(int userId, ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     _soundCloudApi   = soundCloudApi;
     Request.Resource = string.Format(Uri.Users + "{{{0}}}", UrlParameter.Id);
     Request.AddParameter(UrlParameter.Id, userId, ParameterType.UrlSegment);
 }
 internal Contribution(RestRequest request, int contributionId, ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + string.Format(Uri.Contributions + "{{{0}}}", UrlParameter.Id);
     Request.AddParameter(UrlParameter.Id, contributionId, ParameterType.UrlSegment);
 }
示例#3
0
 internal Following(RestRequest request, int followingId, ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + string.Format(Uri.Followings + "{{{0}}}", UrlParameter.followingId);
     Request.AddParameter(UrlParameter.followingId, followingId, ParameterType.UrlSegment);
 }
示例#4
0
 internal Group(int groupId, ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     _soundCloudApi   = soundCloudApi;
     Request.Resource = Request.Resource + string.Format(Uri.Groups + "{{{0}}}", UrlParameter.Id);
     Request.AddParameter(UrlParameter.Id, groupId, ParameterType.UrlSegment);
 }
 public PendingTrack(RestRequest request, int trackId, ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = string.Format(Uri.PendingTracks + "{{{0}}}", UrlParameter.Id);
     Request.AddParameter(UrlParameter.Id, trackId, ParameterType.UrlSegment);
 }
示例#6
0
 internal WebProfile(RestRequest request, int webProfileId, ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + string.Format(Uri.WebProfiles + "{{{0}}}", UrlParameter.Id);
     Request.AddParameter(UrlParameter.Id, webProfileId, ParameterType.UrlSegment);
 }
示例#7
0
        internal OAuth2Token(OAuth2 oAuth2, ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
        {
            Request.Resource = "/oauth2/token";
            Request.Method   = Method.POST;
            Request.AddParameter(FormParameter.ClientId, oAuth2.ClientId);
            Request.AddParameter(FormParameter.ClientSecret, oAuth2.ClientSecret);
            Request.AddParameter(FormParameter.GrantType, oAuth2.GrantType.ToString());

            switch (oAuth2.GrantType)
            {
            case GrantType.password:
                AddPasswordParameters(oAuth2);
                break;

            case GrantType.authorization_code:
                AddAuthorizationCodeParameters(oAuth2);
                break;

            case GrantType.refresh_token:
                AddRefreshTokenParameters(oAuth2);
                break;
            }
        }
示例#8
0
 internal Users(ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     Request.Resource = Uri.Users;
 }
示例#9
0
 internal Users(RestRequest request, ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + Uri.Users;
 }
示例#10
0
 internal Activities(RestRequest request, ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     _soundCloudApi   = soundCloudApi;
     Request          = request;
     Request.Resource = Request.Resource + Uri.Activities;
 }
 internal WebProfiles(RestRequest request, ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + Uri.WebProfiles;
 }
 protected ResourceBase(ISoundCloudApiInternal soundCloudApi)
 {
     Request.RequestFormat  = DataFormat.Json;
     Request.JsonSerializer = new SoundCloudJsonSerializer();
     _soundCloudApi         = soundCloudApi;
 }
 internal SharedToEmails(RestRequest request, ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + Uri.SharedToEmails;
 }
 internal Playlists(ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     Request.Resource = Uri.Playlists;
 }
示例#15
0
 internal AllOwn(RestRequest request, ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + Uri.AllOwn;
 }
示例#16
0
 internal Favorite(RestRequest request, int userId, ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + string.Format(Uri.Favorites + "{{{0}}}", UrlParameter.Id);
     Request.AddParameter(UrlParameter.Id, userId, ParameterType.UrlSegment);
 }
 internal TracksAfiliated(RestRequest request, ISoundCloudApiInternal soundCloudApiInternal) : base(soundCloudApiInternal)
 {
     Request          = request;
     Request.Resource = Request.Resource + Uri.TracksAfiliated;
 }
示例#18
0
 internal Me(ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     _soundCloudApi   = soundCloudApi;
     Request.Resource = Uri.Me;
 }
示例#19
0
 internal Connections(RestRequest request, ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + Uri.Connections;
 }
示例#20
0
 public Apps(ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     Request.Resource = Uri.Apps;
 }
示例#21
0
 internal Tracks(ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     Request.Resource = Uri.Tracks;
 }
示例#22
0
 internal Comment(int commentId, ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     Request.Resource = Request.Resource + string.Format(Uri.Comments + "{{{0}}}", UrlParameter.Id);
     Request.AddParameter(UrlParameter.Id, commentId, ParameterType.UrlSegment);
 }
 internal PendingTracks(RestRequest request, ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + Uri.PendingTracks;
 }
示例#24
0
 internal Groups(RestRequest request, ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + Uri.Groups;
 }
示例#25
0
 internal Groups(ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     Request.Resource = Uri.Groups;
 }
 internal Contributors(RestRequest request, ISoundCloudApiInternal soundCloudApi)
     : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + Uri.Contributors;
 }
示例#27
0
 public Playlist(int playlistId, ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     _soundCloudApi   = soundCloudApi;
     Request.Resource = string.Format(Uri.Playlists + "{{{0}}}", UrlParameter.Id);
     Request.AddParameter(UrlParameter.Id, playlistId, ParameterType.UrlSegment);
 }
示例#28
0
 internal Followings(RestRequest request, ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + Uri.Followings;
 }
示例#29
0
 public Track(int trackId, ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     _soundCloudApi   = soundCloudApi;
     Request.Resource = string.Format(Uri.Tracks + "{{{0}}}", UrlParameter.Id);
     Request.AddParameter(UrlParameter.Id, trackId, ParameterType.UrlSegment);
 }
 internal Playlists(RestRequest request, ISoundCloudApiInternal soundCloudApi) : base(soundCloudApi)
 {
     Request          = request;
     Request.Resource = Request.Resource + Uri.Playlists;
 }