/* * 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; namespace IO.Swagger.Api { /// /// Represents a collection of functions to interact with the API endpoints /// public interface IKeyValueApiApi : IApiAccessor { #region Synchronous Operations /// /// /// /// /// /// /// Thrown when fails to make API call /// /// /// void KeyValueApiCreateOrderUpdate (string key, string value); /// /// /// /// /// /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object(void) ApiResponse KeyValueApiCreateOrderUpdateWithHttpInfo (string key, string value); #endregion Synchronous Operations #region Asynchronous Operations /// /// /// /// /// /// /// Thrown when fails to make API call /// /// /// Task of void System.Threading.Tasks.Task KeyValueApiCreateOrderUpdateAsync (string key, string value); /// /// /// /// /// /// /// Thrown when fails to make API call /// /// /// Task of ApiResponse System.Threading.Tasks.Task> KeyValueApiCreateOrderUpdateAsyncWithHttpInfo (string key, string value); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class KeyValueApiApi : IKeyValueApiApi { private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class /// using Configuration object /// /// An instance of Configuration /// public KeyValueApiApi(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 KeyValueApiCreateOrderUpdate (string key, string value) { KeyValueApiCreateOrderUpdateWithHttpInfo(key, value); } /// /// /// /// Thrown when fails to make API call /// /// /// ApiResponse of Object(void) public ApiResponse KeyValueApiCreateOrderUpdateWithHttpInfo (string key, string value) { // verify the required parameter 'key' is set if (key == null) throw new ApiException(400, "Missing required parameter 'key' when calling KeyValueApiApi->KeyValueApiCreateOrderUpdate"); // verify the required parameter 'value' is set if (value == null) throw new ApiException(400, "Missing required parameter 'value' when calling KeyValueApiApi->KeyValueApiCreateOrderUpdate"); string localVarPath = "/v1/keyvalues"; Dictionary localVarQueryParams = new Dictionary(); Dictionary localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); Dictionary 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[] { }; string localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (key != null) localVarQueryParams.Add("key", Configuration.ApiClient.ParameterToString(key)); // query parameter if (value != null) localVarQueryParams.Add("value", Configuration.ApiClient.ParameterToString(value)); // query parameter // make the HTTP request HttpResponseMessage localVarResponse = Configuration.ApiClient.CallApi(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("KeyValueApiCreateOrderUpdate", 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 KeyValueApiCreateOrderUpdateAsync (string key, string value) { await KeyValueApiCreateOrderUpdateAsyncWithHttpInfo(key, value); } /// /// /// /// Thrown when fails to make API call /// /// /// Task of ApiResponse public async System.Threading.Tasks.Task> KeyValueApiCreateOrderUpdateAsyncWithHttpInfo (string key, string value) { // verify the required parameter 'key' is set if (key == null) throw new ApiException(400, "Missing required parameter 'key' when calling KeyValueApiApi->KeyValueApiCreateOrderUpdate"); // verify the required parameter 'value' is set if (value == null) throw new ApiException(400, "Missing required parameter 'value' when calling KeyValueApiApi->KeyValueApiCreateOrderUpdate"); string localVarPath = "/v1/keyvalues"; Dictionary localVarQueryParams = new Dictionary(); Dictionary localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); Dictionary 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[] { }; string localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (key != null) localVarQueryParams.Add("key", Configuration.ApiClient.ParameterToString(key)); // query parameter if (value != null) localVarQueryParams.Add("value", Configuration.ApiClient.ParameterToString(value)); // query parameter // make the HTTP request HttpResponseMessage localVarResponse = await Configuration.ApiClient.CallApiAsync(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarHttpContentType); int localVarStatusCode = (int) localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("KeyValueApiCreateOrderUpdate", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), null); } } }