/* * FHT.Core.API 1.0 * * ̨group.apiVersion:1.0 * * OpenAPI spec version: v1 * Contact: fht@fht360.com * Generated by: https://github.com/swagger-api/swagger-codegen.git */ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Net.Http; using IO.Swagger.Client; using IO.Swagger.Model; namespace IO.Swagger.Api { /// /// Represents a collection of functions to interact with the API endpoints /// public interface ICollectionItemApiApi : IApiAccessor { #region Synchronous Operations /// /// /// /// /// /// /// Thrown when fails to make API call /// /// void CollectionItemApiCreateCollectionItem (CollectionItemInputModel collectionItemInputModel); /// /// /// /// /// /// /// Thrown when fails to make API call /// /// ApiResponse of Object(void) ApiResponse CollectionItemApiCreateCollectionItemWithHttpInfo (CollectionItemInputModel collectionItemInputModel); /// /// /// /// /// /// /// Thrown when fails to make API call /// 收藏目标编号 /// 收藏目标编号 /// void CollectionItemApiDelete (List targetIds, string collectionType); /// /// /// /// /// /// /// Thrown when fails to make API call /// 收藏目标编号 /// 收藏目标编号 /// ApiResponse of Object(void) ApiResponse CollectionItemApiDeleteWithHttpInfo (List targetIds, string collectionType); /// /// /// /// /// /// /// Thrown when fails to make API call /// 检索条件 (optional, default to ) /// 展示条数 (optional, default to 10) /// 起始位置 (optional, default to 0) /// QueryResultGenericItemViewModelCollectionItemViewModel QueryResultGenericItemViewModelCollectionItemViewModel CollectionItemApiGetCollectionItemsOfUser (string q = null, int? limit = null, int? offset = null); /// /// /// /// /// /// /// Thrown when fails to make API call /// 检索条件 (optional, default to ) /// 展示条数 (optional, default to 10) /// 起始位置 (optional, default to 0) /// ApiResponse of QueryResultGenericItemViewModelCollectionItemViewModel ApiResponse CollectionItemApiGetCollectionItemsOfUserWithHttpInfo (string q = null, int? limit = null, int? offset = null); #endregion Synchronous Operations #region Asynchronous Operations /// /// /// /// /// /// /// Thrown when fails to make API call /// /// Task of void System.Threading.Tasks.Task CollectionItemApiCreateCollectionItemAsync (CollectionItemInputModel collectionItemInputModel); /// /// /// /// /// /// /// Thrown when fails to make API call /// /// Task of ApiResponse System.Threading.Tasks.Task> CollectionItemApiCreateCollectionItemAsyncWithHttpInfo (CollectionItemInputModel collectionItemInputModel); /// /// /// /// /// /// /// Thrown when fails to make API call /// 收藏目标编号 /// 收藏目标编号 /// Task of void System.Threading.Tasks.Task CollectionItemApiDeleteAsync (List targetIds, string collectionType); /// /// /// /// /// /// /// Thrown when fails to make API call /// 收藏目标编号 /// 收藏目标编号 /// Task of ApiResponse System.Threading.Tasks.Task> CollectionItemApiDeleteAsyncWithHttpInfo (List targetIds, string collectionType); /// /// /// /// /// /// /// Thrown when fails to make API call /// 检索条件 (optional, default to ) /// 展示条数 (optional, default to 10) /// 起始位置 (optional, default to 0) /// Task of QueryResultGenericItemViewModelCollectionItemViewModel System.Threading.Tasks.Task CollectionItemApiGetCollectionItemsOfUserAsync (string q = null, int? limit = null, int? offset = null); /// /// /// /// /// /// /// Thrown when fails to make API call /// 检索条件 (optional, default to ) /// 展示条数 (optional, default to 10) /// 起始位置 (optional, default to 0) /// Task of ApiResponse (QueryResultGenericItemViewModelCollectionItemViewModel) System.Threading.Tasks.Task> CollectionItemApiGetCollectionItemsOfUserAsyncWithHttpInfo (string q = null, int? limit = null, int? offset = null); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class CollectionItemApiApi : ICollectionItemApiApi { private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class /// using Configuration object /// /// An instance of Configuration /// public CollectionItemApiApi(Configuration configuration) { this.Configuration = configuration; ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; // ensure API client has configuration ready if (Configuration.ApiClient.Configuration == null) { this.Configuration.ApiClient.Configuration = this.Configuration; } } /// /// Gets or sets the configuration object /// /// An instance of the Configuration public Configuration Configuration {get; set;} /// /// Provides a factory method hook for the creation of exceptions. /// public IO.Swagger.Client.ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); } return _exceptionFactory; } set { _exceptionFactory = value; } } /// /// /// /// Thrown when fails to make API call /// /// public void CollectionItemApiCreateCollectionItem (CollectionItemInputModel collectionItemInputModel) { CollectionItemApiCreateCollectionItemWithHttpInfo(collectionItemInputModel); } /// /// /// /// Thrown when fails to make API call /// /// ApiResponse of Object(void) public ApiResponse CollectionItemApiCreateCollectionItemWithHttpInfo (CollectionItemInputModel collectionItemInputModel) { // verify the required parameter 'collectionItemInputModel' is set if (collectionItemInputModel == null) throw new ApiException(400, "Missing required parameter 'collectionItemInputModel' when calling CollectionItemApiApi->CollectionItemApiCreateCollectionItem"); var localVarPath = "/v1/collectionitems"; var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); string localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/vnd.fht360.enumAsString+json", "application/vnd.fht360.preserveCircularReference+json", "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); localVarPostBody = Configuration.ApiClient.Serialize(collectionItemInputModel); // http body (model) parameter // make the HTTP request var localVarResponse = Configuration.ApiClient.CallApi(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("CollectionItemApiCreateCollectionItem", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); } /// /// /// /// Thrown when fails to make API call /// /// Task of void public async System.Threading.Tasks.Task CollectionItemApiCreateCollectionItemAsync (CollectionItemInputModel collectionItemInputModel) { await CollectionItemApiCreateCollectionItemAsyncWithHttpInfo(collectionItemInputModel); } /// /// /// /// Thrown when fails to make API call /// /// Task of ApiResponse public async System.Threading.Tasks.Task> CollectionItemApiCreateCollectionItemAsyncWithHttpInfo (CollectionItemInputModel collectionItemInputModel) { // verify the required parameter 'collectionItemInputModel' is set if (collectionItemInputModel == null) throw new ApiException(400, "Missing required parameter 'collectionItemInputModel' when calling CollectionItemApiApi->CollectionItemApiCreateCollectionItem"); var localVarPath = "/v1/collectionitems"; var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); string localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/vnd.fht360.enumAsString+json", "application/vnd.fht360.preserveCircularReference+json", "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); localVarPostBody = Configuration.ApiClient.Serialize(collectionItemInputModel); // http body (model) parameter // make the HTTP request var localVarResponse = await Configuration.ApiClient.CallApiAsync(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("CollectionItemApiCreateCollectionItem", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); } /// /// /// /// Thrown when fails to make API call /// 收藏目标编号 /// 收藏目标编号 /// public void CollectionItemApiDelete (List targetIds, string collectionType) { CollectionItemApiDeleteWithHttpInfo(targetIds, collectionType); } /// /// /// /// Thrown when fails to make API call /// 收藏目标编号 /// 收藏目标编号 /// ApiResponse of Object(void) public ApiResponse CollectionItemApiDeleteWithHttpInfo (List targetIds, string collectionType) { // verify the required parameter 'targetIds' is set if (targetIds == null) throw new ApiException(400, "Missing required parameter 'targetIds' when calling CollectionItemApiApi->CollectionItemApiDelete"); // verify the required parameter 'collectionType' is set if (collectionType == null) throw new ApiException(400, "Missing required parameter 'collectionType' when calling CollectionItemApiApi->CollectionItemApiDelete"); var localVarPath = "/v1/collectionitems/_delete"; var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); string localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/vnd.fht360.enumAsString+json", "application/vnd.fht360.preserveCircularReference+json", "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (collectionType != null) localVarQueryParams.Add("collectionType", Configuration.ApiClient.ParameterToString(collectionType)); // query parameter localVarPostBody = Configuration.ApiClient.Serialize(targetIds); // http body (model) parameter // make the HTTP request var localVarResponse = Configuration.ApiClient.CallApi(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("CollectionItemApiDelete", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); } /// /// /// /// Thrown when fails to make API call /// 收藏目标编号 /// 收藏目标编号 /// Task of void public async System.Threading.Tasks.Task CollectionItemApiDeleteAsync (List targetIds, string collectionType) { await CollectionItemApiDeleteAsyncWithHttpInfo(targetIds, collectionType); } /// /// /// /// Thrown when fails to make API call /// 收藏目标编号 /// 收藏目标编号 /// Task of ApiResponse public async System.Threading.Tasks.Task> CollectionItemApiDeleteAsyncWithHttpInfo (List targetIds, string collectionType) { // verify the required parameter 'targetIds' is set if (targetIds == null) throw new ApiException(400, "Missing required parameter 'targetIds' when calling CollectionItemApiApi->CollectionItemApiDelete"); // verify the required parameter 'collectionType' is set if (collectionType == null) throw new ApiException(400, "Missing required parameter 'collectionType' when calling CollectionItemApiApi->CollectionItemApiDelete"); var localVarPath = "/v1/collectionitems/_delete"; var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); string localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/vnd.fht360.enumAsString+json", "application/vnd.fht360.preserveCircularReference+json", "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (collectionType != null) localVarQueryParams.Add("collectionType", Configuration.ApiClient.ParameterToString(collectionType)); // query parameter localVarPostBody = Configuration.ApiClient.Serialize(targetIds); // http body (model) parameter // make the HTTP request var localVarResponse = await Configuration.ApiClient.CallApiAsync(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("CollectionItemApiDelete", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); } /// /// /// /// Thrown when fails to make API call /// 检索条件 (optional, default to ) /// 展示条数 (optional, default to 10) /// 起始位置 (optional, default to 0) /// QueryResultGenericItemViewModelCollectionItemViewModel public QueryResultGenericItemViewModelCollectionItemViewModel CollectionItemApiGetCollectionItemsOfUser (string q = null, int? limit = null, int? offset = null) { ApiResponse localVarResponse = CollectionItemApiGetCollectionItemsOfUserWithHttpInfo(q, limit, offset); return localVarResponse.Data; } /// /// /// /// Thrown when fails to make API call /// 检索条件 (optional, default to ) /// 展示条数 (optional, default to 10) /// 起始位置 (optional, default to 0) /// ApiResponse of QueryResultGenericItemViewModelCollectionItemViewModel public ApiResponse< QueryResultGenericItemViewModelCollectionItemViewModel > CollectionItemApiGetCollectionItemsOfUserWithHttpInfo (string q = null, int? limit = null, int? offset = null) { var localVarPath = "/v1/collectionitems/GetCollectionItemsOfUser"; var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); string localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/vnd.fht360.enumAsString+json", "application/vnd.fht360.preserveCircularReference+json", "application/json", "text/json", "application/xml", "text/xml" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (q != null) localVarQueryParams.Add("q", Configuration.ApiClient.ParameterToString(q)); // query parameter if (limit != null) localVarQueryParams.Add("limit", Configuration.ApiClient.ParameterToString(limit)); // query parameter if (offset != null) localVarQueryParams.Add("offset", Configuration.ApiClient.ParameterToString(offset)); // query parameter // make the HTTP request var localVarResponse = Configuration.ApiClient.CallApi(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("CollectionItemApiGetCollectionItemsOfUser", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (QueryResultGenericItemViewModelCollectionItemViewModel) Configuration.ApiClient.Deserialize(localVarResponse.Content.ReadAsStringAsync().Result, typeof(QueryResultGenericItemViewModelCollectionItemViewModel))); } /// /// /// /// Thrown when fails to make API call /// 检索条件 (optional, default to ) /// 展示条数 (optional, default to 10) /// 起始位置 (optional, default to 0) /// Task of QueryResultGenericItemViewModelCollectionItemViewModel public async System.Threading.Tasks.Task CollectionItemApiGetCollectionItemsOfUserAsync (string q = null, int? limit = null, int? offset = null) { ApiResponse localVarResponse = await CollectionItemApiGetCollectionItemsOfUserAsyncWithHttpInfo(q, limit, offset); return localVarResponse.Data; } /// /// /// /// Thrown when fails to make API call /// 检索条件 (optional, default to ) /// 展示条数 (optional, default to 10) /// 起始位置 (optional, default to 0) /// Task of ApiResponse (QueryResultGenericItemViewModelCollectionItemViewModel) public async System.Threading.Tasks.Task> CollectionItemApiGetCollectionItemsOfUserAsyncWithHttpInfo (string q = null, int? limit = null, int? offset = null) { var localVarPath = "/v1/collectionitems/GetCollectionItemsOfUser"; var localVarQueryParams = new Dictionary(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); string localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { }; String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/vnd.fht360.enumAsString+json", "application/vnd.fht360.preserveCircularReference+json", "application/json", "text/json", "application/xml", "text/xml" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (q != null) localVarQueryParams.Add("q", Configuration.ApiClient.ParameterToString(q)); // query parameter if (limit != null) localVarQueryParams.Add("limit", Configuration.ApiClient.ParameterToString(limit)); // query parameter if (offset != null) localVarQueryParams.Add("offset", Configuration.ApiClient.ParameterToString(offset)); // query parameter // make the HTTP request var localVarResponse = await Configuration.ApiClient.CallApiAsync(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("CollectionItemApiGetCollectionItemsOfUser", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), (QueryResultGenericItemViewModelCollectionItemViewModel) Configuration.ApiClient.Deserialize(await localVarResponse.Content.ReadAsStringAsync(), typeof(QueryResultGenericItemViewModelCollectionItemViewModel))); } } }