예제 #1
0
        /// <summary>
        /// Get my user information
        /// </summary>
        /// <exception cref="OpenMAL.API.Client.ApiException">
        /// Thrown when fails to make API call
        /// </exception>
        /// <param name="userName">You can only specify `@me`.</param>
        /// <param name="fields">(optional)</param>
        /// <returns>ApiResponse of User</returns>
        public OpenMAL.API.Client.ApiResponse <User> UsersUserIdGetWithHttpInfo(string userName, string fields = default(string))
        {
            // verify the required parameter 'userName' is set
            if (userName == null)
            {
                throw new OpenMAL.API.Client.ApiException(400, "Missing required parameter 'userName' when calling UserApi->UsersUserIdGet");
            }

            OpenMAL.API.Client.RequestOptions localVarRequestOptions = new OpenMAL.API.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "*/*",
                "application/json"
            };

            var localVarContentType = OpenMAL.API.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = OpenMAL.API.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("user_name", OpenMAL.API.Client.ClientUtils.ParameterToString(userName)); // path parameter
            if (fields != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "fields", fields));
            }

            // authentication (main_auth) required oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get <User>("/users/{user_name}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("UsersUserIdGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #2
0
        /// <summary>
        /// Get manga list
        /// </summary>
        /// <exception cref="OpenMAL.API.Client.ApiException">
        /// Thrown when fails to make API call
        /// </exception>
        /// <param name="q">Search. (optional)</param>
        /// <param name="limit">The maximum value is 100. (optional, default to 100)</param>
        /// <param name="offset">(optional, default to 0)</param>
        /// <param name="fields">(optional)</param>
        /// <returns>ApiResponse of MangaList</returns>
        public OpenMAL.API.Client.ApiResponse <MangaList> MangaGetWithHttpInfo(string q = default(string), int?limit = default(int?), int?offset = default(int?), string fields = default(string))
        {
            OpenMAL.API.Client.RequestOptions localVarRequestOptions = new OpenMAL.API.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "*/*",
                "application/json"
            };

            var localVarContentType = OpenMAL.API.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = OpenMAL.API.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (q != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "q", q));
            }
            if (limit != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
            }
            if (offset != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "offset", offset));
            }
            if (fields != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "fields", fields));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get <MangaList>("/manga", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("MangaGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #3
0
        /// <summary>
        /// Get manga list
        /// </summary>
        /// <exception cref="OpenMAL.API.Client.ApiException">
        /// Thrown when fails to make API call
        /// </exception>
        /// <param name="q">Search. (optional)</param>
        /// <param name="limit">The maximum value is 100. (optional, default to 100)</param>
        /// <param name="offset">(optional, default to 0)</param>
        /// <param name="fields">(optional)</param>
        /// <returns>Task of ApiResponse (MangaList)</returns>
        public async System.Threading.Tasks.Task <OpenMAL.API.Client.ApiResponse <MangaList> > MangaGetAsyncWithHttpInfo(string q = default(string), int?limit = default(int?), int?offset = default(int?), string fields = default(string))
        {
            OpenMAL.API.Client.RequestOptions localVarRequestOptions = new OpenMAL.API.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "*/*",
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (q != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "q", q));
            }
            if (limit != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
            }
            if (offset != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "offset", offset));
            }
            if (fields != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "fields", fields));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <MangaList>("/manga", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("MangaGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #4
0
        /// <summary>
        /// Get manga details
        /// </summary>
        /// <exception cref="OpenMAL.API.Client.ApiException">
        /// Thrown when fails to make API call
        /// </exception>
        /// <param name="mangaId"></param>
        /// <param name="fields">(optional)</param>
        /// <returns>ApiResponse of MangaForDetails</returns>
        public OpenMAL.API.Client.ApiResponse <MangaForDetails> MangaMangaIdGetWithHttpInfo(int mangaId, string fields = default(string))
        {
            OpenMAL.API.Client.RequestOptions localVarRequestOptions = new OpenMAL.API.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "*/*",
                "application/json"
            };

            var localVarContentType = OpenMAL.API.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = OpenMAL.API.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("manga_id", OpenMAL.API.Client.ClientUtils.ParameterToString(mangaId)); // path parameter
            if (fields != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "fields", fields));
            }

            // authentication (main_auth) required oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get <MangaForDetails>("/manga/{manga_id}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("MangaMangaIdGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #5
0
파일: ForumApi.cs 프로젝트: Arko109/OpenMAL
        /// <summary>
        /// Get forum topic detail
        /// </summary>
        /// <exception cref="OpenMAL.API.Client.ApiException">
        /// Thrown when fails to make API call
        /// </exception>
        /// <param name="topicId"></param>
        /// <param name="limit">(optional, default to 100)</param>
        /// <param name="offset">(optional, default to 0)</param>
        /// <returns>ApiResponse of ForumTopic</returns>
        public OpenMAL.API.Client.ApiResponse <ForumTopic> ForumTopicGetWithHttpInfo(int topicId, int?limit = default(int?), int?offset = default(int?))
        {
            OpenMAL.API.Client.RequestOptions localVarRequestOptions = new OpenMAL.API.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "*/*",
                "application/json"
            };

            var localVarContentType = OpenMAL.API.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = OpenMAL.API.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("topic_id", OpenMAL.API.Client.ClientUtils.ParameterToString(topicId)); // path parameter
            if (limit != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
            }
            if (offset != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "offset", offset));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get <ForumTopic>("/forum/topic/{topic_id}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ForumTopicGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #6
0
파일: ForumApi.cs 프로젝트: Arko109/OpenMAL
        /// <summary>
        /// Get forum topic detail
        /// </summary>
        /// <exception cref="OpenMAL.API.Client.ApiException">
        /// Thrown when fails to make API call
        /// </exception>
        /// <param name="topicId"></param>
        /// <param name="limit">(optional, default to 100)</param>
        /// <param name="offset">(optional, default to 0)</param>
        /// <returns>Task of ApiResponse (ForumTopic)</returns>
        public async System.Threading.Tasks.Task <OpenMAL.API.Client.ApiResponse <ForumTopic> > ForumTopicGetAsyncWithHttpInfo(int topicId, int?limit = default(int?), int?offset = default(int?))
        {
            OpenMAL.API.Client.RequestOptions localVarRequestOptions = new OpenMAL.API.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "*/*",
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            localVarRequestOptions.PathParameters.Add("topic_id", OpenMAL.API.Client.ClientUtils.ParameterToString(topicId)); // path parameter
            if (limit != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
            }
            if (offset != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "offset", offset));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <ForumTopic>("/forum/topic/{topic_id}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ForumTopicGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #7
0
파일: ForumApi.cs 프로젝트: Arko109/OpenMAL
        /// <summary>
        /// Get forum boards
        /// </summary>
        /// <exception cref="OpenMAL.API.Client.ApiException">
        /// Thrown when fails to make API call
        /// </exception>
        /// <returns>ApiResponse of ForumBoards</returns>
        public OpenMAL.API.Client.ApiResponse <ForumBoards> ForumBoardsGetWithHttpInfo()
        {
            OpenMAL.API.Client.RequestOptions localVarRequestOptions = new OpenMAL.API.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "*/*",
                "application/json"
            };

            var localVarContentType = OpenMAL.API.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = OpenMAL.API.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get <ForumBoards>("/forum/boards", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ForumBoardsGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #8
0
파일: ForumApi.cs 프로젝트: Arko109/OpenMAL
        /// <summary>
        /// Get forum boards
        /// </summary>
        /// <exception cref="OpenMAL.API.Client.ApiException">
        /// Thrown when fails to make API call
        /// </exception>
        /// <returns>Task of ApiResponse (ForumBoards)</returns>
        public async System.Threading.Tasks.Task <OpenMAL.API.Client.ApiResponse <ForumBoards> > ForumBoardsGetAsyncWithHttpInfo()
        {
            OpenMAL.API.Client.RequestOptions localVarRequestOptions = new OpenMAL.API.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "*/*",
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <ForumBoards>("/forum/boards", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ForumBoardsGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #9
0
파일: ForumApi.cs 프로젝트: Arko109/OpenMAL
        /// <summary>
        /// Get forum topics
        /// </summary>
        /// <exception cref="OpenMAL.API.Client.ApiException">
        /// Thrown when fails to make API call
        /// </exception>
        /// <param name="boardId">(optional)</param>
        /// <param name="subboardId">(optional)</param>
        /// <param name="limit">(optional, default to 100)</param>
        /// <param name="offset">(optional, default to 0)</param>
        /// <param name="sort">Currently, only \"recent\" can be set. (optional, default to "recent")</param>
        /// <param name="q">(optional)</param>
        /// <param name="topicUserName">(optional)</param>
        /// <param name="userName">(optional)</param>
        /// <returns>ApiResponse of ForumTopics</returns>
        public OpenMAL.API.Client.ApiResponse <ForumTopics> ForumTopicsGetWithHttpInfo(int?boardId = default(int?), int?subboardId = default(int?), int?limit = default(int?), int?offset = default(int?), string sort = default(string), string q = default(string), string topicUserName = default(string), string userName = default(string))
        {
            OpenMAL.API.Client.RequestOptions localVarRequestOptions = new OpenMAL.API.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "*/*",
                "application/json"
            };

            var localVarContentType = OpenMAL.API.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = OpenMAL.API.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (boardId != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "board_id", boardId));
            }
            if (subboardId != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "subboard_id", subboardId));
            }
            if (limit != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
            }
            if (offset != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "offset", offset));
            }
            if (sort != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "sort", sort));
            }
            if (q != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "q", q));
            }
            if (topicUserName != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "topic_user_name", topicUserName));
            }
            if (userName != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "user_name", userName));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get <ForumTopics>("/forum/topics", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ForumTopicsGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #10
0
        /// <summary>
        /// Get manga ranking The returned manga contains the `ranking` field.
        /// </summary>
        /// <exception cref="OpenMAL.API.Client.ApiException">
        /// Thrown when fails to make API call
        /// </exception>
        /// <param name="rankingType">
        /// | value | | | - -- - | - -- - | | all | All | | manga | Top Manga | | novels | Top
        /// Novels | | oneshots | Top One-shots | | doujin | Top Doujinshi | | manhwa | Top Manhwa |
        /// | manhua | Top Manhua | | bypopularity | Most Popular | | favorite | Most Favorited |
        /// </param>
        /// <param name="limit">The maximum value is 500. (optional, default to 100)</param>
        /// <param name="offset">(optional, default to 0)</param>
        /// <param name="fields">(optional)</param>
        /// <returns>ApiResponse of MangaListForRanking</returns>
        public OpenMAL.API.Client.ApiResponse <MangaListForRanking> MangaRankingGetWithHttpInfo(string rankingType, int?limit = default(int?), int?offset = default(int?), string fields = default(string))
        {
            // verify the required parameter 'rankingType' is set
            if (rankingType == null)
            {
                throw new OpenMAL.API.Client.ApiException(400, "Missing required parameter 'rankingType' when calling MangaApi->MangaRankingGet");
            }

            OpenMAL.API.Client.RequestOptions localVarRequestOptions = new OpenMAL.API.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "*/*",
                "application/json"
            };

            var localVarContentType = OpenMAL.API.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = OpenMAL.API.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "ranking_type", rankingType));
            if (limit != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
            }
            if (offset != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "offset", offset));
            }
            if (fields != null)
            {
                localVarRequestOptions.QueryParameters.Add(OpenMAL.API.Client.ClientUtils.ParameterToMultiMap("", "fields", fields));
            }

            // authentication (main_auth) required oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get <MangaListForRanking>("/manga/ranking", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("MangaRankingGet", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }