Ejemplo n.º 1
0
 internal ExploreApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, IExploreCategoryConverter exploreCategoryConverter, ITrackConverter trackConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.paginationValidator = paginationValidator;
     this.exploreCategoryConverter = exploreCategoryConverter;
     this.trackConverter = trackConverter;
 }
Ejemplo n.º 2
0
 internal static TCollection GetCollectionBatch <TCollection, TResponse>(
     this ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, string prefix, string command, int offset, int limit)
     where TCollection : class, IEntityCollection <TResponse>
 {
     paginationValidator.Validate(offset, limit);
     return(soundCloudRawClient.Request <TCollection>(prefix, command, HttpMethod.Get, new Dictionary <string, object>().SetPagination(offset, limit)));
 }
Ejemplo n.º 3
0
 internal ExploreApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, IExploreCategoryConverter exploreCategoryConverter, ITrackConverter trackConverter)
 {
     this.soundCloudRawClient      = soundCloudRawClient;
     this.paginationValidator      = paginationValidator;
     this.exploreCategoryConverter = exploreCategoryConverter;
     this.trackConverter           = trackConverter;
 }
Ejemplo n.º 4
0
 public SubresourceFactory(
     ISoundCloudRawClient soundCloudRawClient,
     IPaginationValidator paginationValidator,
     ITrackConverter trackConverter,
     IUserConverter userConverter,
     IPlaylistConverter playlistConverter,
     ICommentConverter commentConverter,
     IGroupConverter groupConverter,
     IWebProfileConverter webProfileConverter,
     IConnectionConverter connectionConverter,
     IActivityResultConverter activityResultConverter,
     IApplicationConverter applicationConverter,
     IExploreCategoryConverter exploreCategoryConverter)
 {
     this.soundCloudRawClient      = soundCloudRawClient;
     this.paginationValidator      = paginationValidator;
     this.trackConverter           = trackConverter;
     this.userConverter            = userConverter;
     this.playlistConverter        = playlistConverter;
     this.commentConverter         = commentConverter;
     this.groupConverter           = groupConverter;
     this.webProfileConverter      = webProfileConverter;
     this.connectionConverter      = connectionConverter;
     this.activityResultConverter  = activityResultConverter;
     this.applicationConverter     = applicationConverter;
     this.exploreCategoryConverter = exploreCategoryConverter;
 }
 public SubresourceFactory(
     ISoundCloudRawClient soundCloudRawClient,
     IPaginationValidator paginationValidator,
     ITrackConverter trackConverter,
     IUserConverter userConverter,
     IPlaylistConverter playlistConverter,
     ICommentConverter commentConverter,
     IGroupConverter groupConverter,
     IWebProfileConverter webProfileConverter,
     IConnectionConverter connectionConverter,
     IActivityResultConverter activityResultConverter,
     IApplicationConverter applicationConverter,
     IExploreCategoryConverter exploreCategoryConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.paginationValidator = paginationValidator;
     this.trackConverter = trackConverter;
     this.userConverter = userConverter;
     this.playlistConverter = playlistConverter;
     this.commentConverter = commentConverter;
     this.groupConverter = groupConverter;
     this.webProfileConverter = webProfileConverter;
     this.connectionConverter = connectionConverter;
     this.activityResultConverter = activityResultConverter;
     this.applicationConverter = applicationConverter;
     this.exploreCategoryConverter = exploreCategoryConverter;
 }
Ejemplo n.º 6
0
 internal TracksApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, ITrackConverter trackConverter, ISearchParametersBuilder searchParametersBuilder)
 {
     this.soundCloudRawClient     = soundCloudRawClient;
     this.paginationValidator     = paginationValidator;
     this.trackConverter          = trackConverter;
     this.searchParametersBuilder = searchParametersBuilder;
 }
Ejemplo n.º 7
0
 internal MeApi(
     ISoundCloudRawClient soundCloudRawClient, 
     IPaginationValidator paginationValidator, 
     IUserConverter userConverter, 
     ITrackConverter trackConverter, 
     IPlaylistConverter playlistConverter, 
     ICommentConverter commentConverter, 
     IGroupConverter groupConverter, 
     IWebProfileConverter webProfileConverter,
     IConnectionConverter connectionConverter,
     IActivityResultConverter activityResultConverter)
     : base(
         null, 
         soundCloudRawClient, 
         paginationValidator, 
         userConverter, 
         trackConverter, 
         playlistConverter, 
         commentConverter, 
         groupConverter, 
         webProfileConverter,
         prefix)
 {
     this.connectionConverter = connectionConverter;
     this.activityResultConverter = activityResultConverter;
 }
Ejemplo n.º 8
0
 internal MeApi(
     ISoundCloudRawClient soundCloudRawClient,
     IPaginationValidator paginationValidator,
     IUserConverter userConverter,
     ITrackConverter trackConverter,
     IPlaylistConverter playlistConverter,
     ICommentConverter commentConverter,
     IGroupConverter groupConverter,
     IWebProfileConverter webProfileConverter,
     IConnectionConverter connectionConverter,
     IActivityResultConverter activityResultConverter)
     : base(
         null,
         soundCloudRawClient,
         paginationValidator,
         userConverter,
         trackConverter,
         playlistConverter,
         commentConverter,
         groupConverter,
         webProfileConverter,
         prefix)
 {
     this.connectionConverter     = connectionConverter;
     this.activityResultConverter = activityResultConverter;
 }
        internal static void Validate(this IPaginationValidator paginationValidator, int offset, int limit)
        {
            string errorMessage;

            if (!paginationValidator.IsValid(offset, limit, out errorMessage))
            {
                throw new SoundCloudApiException(errorMessage);
            }
        }
        internal TracksSearcher(SCFilter filter, IPaginationValidator paginationValidator, Func<Dictionary<string, object>, SCTrack[]> search)
        {
            if (filter == SCFilter.Private)
            {
                throw new ArgumentException("Can't search private tracks", "filter");
            }

            this.filter = filter;
            this.paginationValidator = paginationValidator;
            this.search = search;

            searchParameters = new Dictionary<string, object> ();
            Reset();
        }
Ejemplo n.º 11
0
        internal AppApi(
            string applicationId,
            IPaginationValidator paginationValidator,
            ISoundCloudRawClient soundCloudRawClient,
            IApplicationConverter applicationConverter,
            ITrackConverter trackConverter)
        {
            this.paginationValidator  = paginationValidator;
            this.soundCloudRawClient  = soundCloudRawClient;
            this.applicationConverter = applicationConverter;
            this.trackConverter       = trackConverter;

            prefix = string.Format("apps/{0}", applicationId);
        }
Ejemplo n.º 12
0
        internal AppApi(
            string applicationId, 
            IPaginationValidator paginationValidator, 
            ISoundCloudRawClient soundCloudRawClient, 
            IApplicationConverter applicationConverter,
            ITrackConverter trackConverter)
        {
            this.paginationValidator = paginationValidator;
            this.soundCloudRawClient = soundCloudRawClient;
            this.applicationConverter = applicationConverter;
            this.trackConverter = trackConverter;

            prefix = string.Format("apps/{0}", applicationId);
        }
        internal TracksSearcher(SCFilter filter, IPaginationValidator paginationValidator, Func <Dictionary <string, object>, SCTrack[]> search)
        {
            if (filter == SCFilter.Private)
            {
                throw new ArgumentException("Can't search private tracks", "filter");
            }

            this.filter = filter;
            this.paginationValidator = paginationValidator;
            this.search = search;

            searchParameters = new Dictionary <string, object> ();
            Reset();
        }
        public SubresourceFactoryBuilder()
        {
            var dateTimeConverter = new DateTimeConverter();
            var tagListConverter = new TagListConverter();

            userConverter = new UserConverter();
            applicationConverter = new ApplicationConverter();
            trackConverter = new TrackConverter(userConverter, tagListConverter, applicationConverter, dateTimeConverter);
            commentConverter = new CommentConverter(userConverter, dateTimeConverter);
            playlistConverter = new PlaylistConverter(userConverter, trackConverter, tagListConverter, dateTimeConverter);
            paginationValidator = new PaginationValidator();
            groupConverter = new GroupConverter(userConverter, dateTimeConverter);
            webProfileConverter = new WebProfileConverter(dateTimeConverter);
            connectionConverter = new ConnectionConverter(dateTimeConverter);
            activityResultConverter = new ActivityResultConverter(trackConverter, commentConverter, userConverter, playlistConverter, dateTimeConverter);
        }
        public SubresourceFactoryBuilder()
        {
            var dateTimeConverter = new DateTimeConverter();
            var tagListConverter  = new TagListConverter();

            userConverter           = new UserConverter();
            applicationConverter    = new ApplicationConverter();
            trackConverter          = new TrackConverter(userConverter, tagListConverter, applicationConverter, dateTimeConverter);
            commentConverter        = new CommentConverter(userConverter, dateTimeConverter);
            playlistConverter       = new PlaylistConverter(userConverter, trackConverter, tagListConverter, dateTimeConverter);
            paginationValidator     = new PaginationValidator();
            groupConverter          = new GroupConverter(userConverter, dateTimeConverter);
            webProfileConverter     = new WebProfileConverter(dateTimeConverter);
            connectionConverter     = new ConnectionConverter(dateTimeConverter);
            activityResultConverter = new ActivityResultConverter(trackConverter, commentConverter, userConverter, playlistConverter, dateTimeConverter);
        }
Ejemplo n.º 16
0
        internal GroupApi(
            string groupId,
            ISoundCloudRawClient soundCloudRawClient,
            IPaginationValidator paginationValidator,
            IGroupConverter groupConverter,
            IUserConverter userConverter,
            ITrackConverter trackConverter)
        {
            this.soundCloudRawClient = soundCloudRawClient;
            this.paginationValidator = paginationValidator;
            this.groupConverter      = groupConverter;
            this.userConverter       = userConverter;
            this.trackConverter      = trackConverter;

            prefix = string.Format("groups/{0}", groupId);
        }
        public SubresourceFactoryBuilder()
        {
            var dateTimeConverter = new DateTimeConverter();
            var tagListConverter  = new TagListConverter();

            userConverter           = new UserConverter();
            applicationConverter    = new ApplicationConverter();
            trackConverter          = new TrackConverter(userConverter, tagListConverter, applicationConverter, dateTimeConverter);
            commentConverter        = new CommentConverter(userConverter, dateTimeConverter);
            playlistConverter       = new PlaylistConverter(userConverter, trackConverter, tagListConverter, dateTimeConverter);
            paginationValidator     = new PaginationValidator();
            groupConverter          = new GroupConverter(userConverter, dateTimeConverter);
            webProfileConverter     = new WebProfileConverter(dateTimeConverter);
            connectionConverter     = new ConnectionConverter(dateTimeConverter);
            activityResultConverter = new ActivityResultConverter(trackConverter, commentConverter, userConverter, playlistConverter, dateTimeConverter);
            searchParametersBuilder = new CompositeSearchParametersBuilder(new IVersionDependentSearchParametersBuilder[] { new V1SearchParametersBuilder(), new V2SearchParametersBuilder() });
        }
Ejemplo n.º 18
0
        internal TrackApi(
            string trackId,
            ISoundCloudRawClient soundCloudRawClient,
            IPaginationValidator paginationValidator,
            ITrackConverter trackConverter,
            IUserConverter userConverter,
            ICommentConverter commentConverter)
        {
            this.trackId             = trackId;
            this.soundCloudRawClient = soundCloudRawClient;
            this.paginationValidator = paginationValidator;
            this.trackConverter      = trackConverter;
            this.userConverter       = userConverter;
            this.commentConverter    = commentConverter;

            prefix = string.Format("tracks/{0}", trackId);
        }
Ejemplo n.º 19
0
        internal TrackApi(
            string trackId, 
            ISoundCloudRawClient soundCloudRawClient, 
            IPaginationValidator paginationValidator, 
            ITrackConverter trackConverter, 
            IUserConverter userConverter,
            ICommentConverter commentConverter)
        {
            this.trackId = trackId;
            this.soundCloudRawClient = soundCloudRawClient;
            this.paginationValidator = paginationValidator;
            this.trackConverter = trackConverter;
            this.userConverter = userConverter;
            this.commentConverter = commentConverter;

            prefix = string.Format("tracks/{0}", trackId);
        }
Ejemplo n.º 20
0
        internal UserApi(
            string userId,
            ISoundCloudRawClient soundCloudRawClient,
            IPaginationValidator paginationValidator,
            IUserConverter userConverter,
            ITrackConverter trackConverter,
            IPlaylistConverter playlistConverter,
            ICommentConverter commentConverter,
            IGroupConverter groupConverter,
            IWebProfileConverter webProfileConverter,
            string customPrefix = null)
        {
            this.userId = userId;
            this.soundCloudRawClient = soundCloudRawClient;
            this.paginationValidator = paginationValidator;
            this.userConverter       = userConverter;
            this.trackConverter      = trackConverter;
            this.playlistConverter   = playlistConverter;
            this.commentConverter    = commentConverter;
            this.groupConverter      = groupConverter;
            this.webProfileConverter = webProfileConverter;

            prefix = string.IsNullOrEmpty(customPrefix) ? string.Format("users/{0}", userId) : customPrefix;
        }
Ejemplo n.º 21
0
        internal UserApi(
            string userId, 
            ISoundCloudRawClient soundCloudRawClient, 
            IPaginationValidator paginationValidator, 
            IUserConverter userConverter, 
            ITrackConverter trackConverter, 
            IPlaylistConverter playlistConverter,
            ICommentConverter commentConverter,
            IGroupConverter groupConverter,
            IWebProfileConverter webProfileConverter,
            string customPrefix = null)
        {
            this.userId = userId;
            this.soundCloudRawClient = soundCloudRawClient;
            this.paginationValidator = paginationValidator;
            this.userConverter = userConverter;
            this.trackConverter = trackConverter;
            this.playlistConverter = playlistConverter;
            this.commentConverter = commentConverter;
            this.groupConverter = groupConverter;
            this.webProfileConverter = webProfileConverter;

            prefix = string.IsNullOrEmpty(customPrefix) ? string.Format("users/{0}", userId) : customPrefix;
        }
        public override void SetUp()
        {
            base.SetUp();

            paginationValidator = new PaginationValidator();
        }
Ejemplo n.º 23
0
 internal TracksApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, ITrackConverter trackConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.paginationValidator = paginationValidator;
     this.trackConverter      = trackConverter;
 }
Ejemplo n.º 24
0
        public override void SetUp()
        {
            base.SetUp();

            paginationValidator = new PaginationValidator();
        }
Ejemplo n.º 25
0
 internal UsersApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, IUserConverter userConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.paginationValidator = paginationValidator;
     this.userConverter = userConverter;
 }
Ejemplo n.º 26
0
 internal TracksApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, ITrackConverter trackConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.paginationValidator = paginationValidator;
     this.trackConverter = trackConverter;
 }
Ejemplo n.º 27
0
 internal GroupsApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, IGroupConverter groupConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.paginationValidator = paginationValidator;
     this.groupConverter      = groupConverter;
 }
Ejemplo n.º 28
0
 internal GroupsApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, IGroupConverter groupConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.paginationValidator = paginationValidator;
     this.groupConverter = groupConverter;
 }
Ejemplo n.º 29
0
 internal UsersApi(ISoundCloudRawClient soundCloudRawClient, IPaginationValidator paginationValidator, IUserConverter userConverter)
 {
     this.soundCloudRawClient = soundCloudRawClient;
     this.paginationValidator = paginationValidator;
     this.userConverter       = userConverter;
 }