/* * 后台API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: Admin * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using RestSharp; 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 IStockApi : IApiAccessor { #region Synchronous Operations /// /// 调仓接口,用于直营店 /// /// /// /// /// Thrown when fails to make API call /// 请求参数 /// 访问令牌 /// void StockChangeStock (StockAct act, string authorization); /// /// 调仓接口,用于直营店 /// /// /// /// /// Thrown when fails to make API call /// 请求参数 /// 访问令牌 /// ApiResponse of Object(void) ApiResponse StockChangeStockWithHttpInfo (StockAct act, string authorization); /// /// 出库单数据 /// /// /// /// /// Thrown when fails to make API call /// /// 访问令牌 /// List<OutStockOrderResp> List StockGetOutStockOrderList (OutStockOrderRequest request, string authorization); /// /// 出库单数据 /// /// /// /// /// Thrown when fails to make API call /// /// 访问令牌 /// ApiResponse of List<OutStockOrderResp> ApiResponse> StockGetOutStockOrderListWithHttpInfo (OutStockOrderRequest request, string authorization); #endregion Synchronous Operations #region Asynchronous Operations /// /// 调仓接口,用于直营店 /// /// /// /// /// Thrown when fails to make API call /// 请求参数 /// 访问令牌 /// Task of void System.Threading.Tasks.Task StockChangeStockAsync (StockAct act, string authorization); /// /// 调仓接口,用于直营店 /// /// /// /// /// Thrown when fails to make API call /// 请求参数 /// 访问令牌 /// Task of ApiResponse System.Threading.Tasks.Task> StockChangeStockAsyncWithHttpInfo (StockAct act, string authorization); /// /// 出库单数据 /// /// /// /// /// Thrown when fails to make API call /// /// 访问令牌 /// Task of List<OutStockOrderResp> System.Threading.Tasks.Task> StockGetOutStockOrderListAsync (OutStockOrderRequest request, string authorization); /// /// 出库单数据 /// /// /// /// /// Thrown when fails to make API call /// /// 访问令牌 /// Task of ApiResponse (List<OutStockOrderResp>) System.Threading.Tasks.Task>> StockGetOutStockOrderListAsyncWithHttpInfo (OutStockOrderRequest request, string authorization); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class StockApi : IStockApi { private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class. /// /// public StockApi(String basePath) { this.Configuration = new IO.Swagger.Client.Configuration { BasePath = basePath }; ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; } /// /// Initializes a new instance of the class /// using Configuration object /// /// An instance of Configuration /// public StockApi(IO.Swagger.Client.Configuration configuration = null) { if (configuration == null) // use the default one in Configuration this.Configuration = IO.Swagger.Client.Configuration.Default; else this.Configuration = configuration; ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory; } /// /// Gets the base path of the API client. /// /// The base path public String GetBasePath() { return this.Configuration.ApiClient.RestClient.BaseUrl.ToString(); } /// /// Sets the base path of the API client. /// /// The base path [Obsolete("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] public void SetBasePath(String basePath) { // do nothing } /// /// Gets or sets the configuration object /// /// An instance of the Configuration public IO.Swagger.Client.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; } } /// /// Gets the default header. /// /// Dictionary of HTTP header [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] public IDictionary DefaultHeader() { return new ReadOnlyDictionary(this.Configuration.DefaultHeader); } /// /// Add default header. /// /// Header field name. /// Header field value. /// [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] public void AddDefaultHeader(string key, string value) { this.Configuration.AddDefaultHeader(key, value); } /// /// 调仓接口,用于直营店 /// /// Thrown when fails to make API call /// 请求参数 /// 访问令牌 /// public void StockChangeStock (StockAct act, string authorization) { StockChangeStockWithHttpInfo(act, authorization); } /// /// 调仓接口,用于直营店 /// /// Thrown when fails to make API call /// 请求参数 /// 访问令牌 /// ApiResponse of Object(void) public ApiResponse StockChangeStockWithHttpInfo (StockAct act, string authorization) { // verify the required parameter 'act' is set if (act == null) throw new ApiException(400, "Missing required parameter 'act' when calling StockApi->StockChangeStock"); // verify the required parameter 'authorization' is set if (authorization == null) throw new ApiException(400, "Missing required parameter 'authorization' when calling StockApi->StockChangeStock"); var localVarPath = "/api/Admin/Stock/ChangeStock"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (authorization != null) localVarHeaderParams.Add("Authorization", this.Configuration.ApiClient.ParameterToString(authorization)); // header parameter if (act != null && act.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(act); // http body (model) parameter } else { localVarPostBody = act; // byte array } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("StockChangeStock", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } /// /// 调仓接口,用于直营店 /// /// Thrown when fails to make API call /// 请求参数 /// 访问令牌 /// Task of void public async System.Threading.Tasks.Task StockChangeStockAsync (StockAct act, string authorization) { await StockChangeStockAsyncWithHttpInfo(act, authorization); } /// /// 调仓接口,用于直营店 /// /// Thrown when fails to make API call /// 请求参数 /// 访问令牌 /// Task of ApiResponse public async System.Threading.Tasks.Task> StockChangeStockAsyncWithHttpInfo (StockAct act, string authorization) { // verify the required parameter 'act' is set if (act == null) throw new ApiException(400, "Missing required parameter 'act' when calling StockApi->StockChangeStock"); // verify the required parameter 'authorization' is set if (authorization == null) throw new ApiException(400, "Missing required parameter 'authorization' when calling StockApi->StockChangeStock"); var localVarPath = "/api/Admin/Stock/ChangeStock"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (authorization != null) localVarHeaderParams.Add("Authorization", this.Configuration.ApiClient.ParameterToString(authorization)); // header parameter if (act != null && act.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(act); // http body (model) parameter } else { localVarPostBody = act; // byte array } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("StockChangeStock", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), null); } /// /// 出库单数据 /// /// Thrown when fails to make API call /// /// 访问令牌 /// List<OutStockOrderResp> public List StockGetOutStockOrderList (OutStockOrderRequest request, string authorization) { ApiResponse> localVarResponse = StockGetOutStockOrderListWithHttpInfo(request, authorization); return localVarResponse.Data; } /// /// 出库单数据 /// /// Thrown when fails to make API call /// /// 访问令牌 /// ApiResponse of List<OutStockOrderResp> public ApiResponse< List > StockGetOutStockOrderListWithHttpInfo (OutStockOrderRequest request, string authorization) { // verify the required parameter 'request' is set if (request == null) throw new ApiException(400, "Missing required parameter 'request' when calling StockApi->StockGetOutStockOrderList"); // verify the required parameter 'authorization' is set if (authorization == null) throw new ApiException(400, "Missing required parameter 'authorization' when calling StockApi->StockGetOutStockOrderList"); var localVarPath = "/api/Admin/Stock/GetOutStockOrderList"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "application/xml", "text/xml" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (authorization != null) localVarHeaderParams.Add("Authorization", this.Configuration.ApiClient.ParameterToString(authorization)); // header parameter if (request != null && request.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(request); // http body (model) parameter } else { localVarPostBody = request; // byte array } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("StockGetOutStockOrderList", localVarResponse); if (exception != null) throw exception; } return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } /// /// 出库单数据 /// /// Thrown when fails to make API call /// /// 访问令牌 /// Task of List<OutStockOrderResp> public async System.Threading.Tasks.Task> StockGetOutStockOrderListAsync (OutStockOrderRequest request, string authorization) { ApiResponse> localVarResponse = await StockGetOutStockOrderListAsyncWithHttpInfo(request, authorization); return localVarResponse.Data; } /// /// 出库单数据 /// /// Thrown when fails to make API call /// /// 访问令牌 /// Task of ApiResponse (List<OutStockOrderResp>) public async System.Threading.Tasks.Task>> StockGetOutStockOrderListAsyncWithHttpInfo (OutStockOrderRequest request, string authorization) { // verify the required parameter 'request' is set if (request == null) throw new ApiException(400, "Missing required parameter 'request' when calling StockApi->StockGetOutStockOrderList"); // verify the required parameter 'authorization' is set if (authorization == null) throw new ApiException(400, "Missing required parameter 'authorization' when calling StockApi->StockGetOutStockOrderList"); var localVarPath = "/api/Admin/Stock/GetOutStockOrderList"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json", "text/json", "application/xml", "text/xml" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (authorization != null) localVarHeaderParams.Add("Authorization", this.Configuration.ApiClient.ParameterToString(authorization)); // header parameter if (request != null && request.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(request); // http body (model) parameter } else { localVarPostBody = request; // byte array } // make the HTTP request IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("StockGetOutStockOrderList", localVarResponse); if (exception != null) throw exception; } return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } } }