forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 2.3.0
This commit is contained in:
commit
942c77b530
@ -210,8 +210,8 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
|||||||
setSupportsAsync(Boolean.TRUE);
|
setSupportsAsync(Boolean.TRUE);
|
||||||
setSupportsUWP(Boolean.FALSE);
|
setSupportsUWP(Boolean.FALSE);
|
||||||
setNetStandard(Boolean.TRUE);
|
setNetStandard(Boolean.TRUE);
|
||||||
additionalProperties.put("supportsAsync", this.supportsUWP);
|
additionalProperties.put("supportsAsync", this.supportsAsync);
|
||||||
additionalProperties.put("supportsUWP", this.supportsAsync);
|
additionalProperties.put("supportsUWP", this.supportsUWP);
|
||||||
additionalProperties.put("netStandard", this.netStandard);
|
additionalProperties.put("netStandard", this.netStandard);
|
||||||
|
|
||||||
//Tests not yet implemented for .NET Standard codegen
|
//Tests not yet implemented for .NET Standard codegen
|
||||||
|
@ -128,6 +128,111 @@ namespace IO.Swagger.Api
|
|||||||
/// <returns>ApiResponse of Object(void)</returns>
|
/// <returns>ApiResponse of Object(void)</returns>
|
||||||
ApiResponse<Object> TestEnumParametersWithHttpInfo (List<string> enumFormStringArray = null, string enumFormString = null, List<string> enumHeaderStringArray = null, string enumHeaderString = null, List<string> enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null);
|
ApiResponse<Object> TestEnumParametersWithHttpInfo (List<string> enumFormStringArray = null, string enumFormString = null, List<string> enumHeaderStringArray = null, string enumHeaderString = null, List<string> enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null);
|
||||||
#endregion Synchronous Operations
|
#endregion Synchronous Operations
|
||||||
|
#region Asynchronous Operations
|
||||||
|
/// <summary>
|
||||||
|
/// To test \"client\" model
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// To test \"client\" model
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">client model</param>
|
||||||
|
/// <returns>Task of ModelClient</returns>
|
||||||
|
System.Threading.Tasks.Task<ModelClient> TestClientModelAsync (ModelClient body);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To test \"client\" model
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// To test \"client\" model
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">client model</param>
|
||||||
|
/// <returns>Task of ApiResponse (ModelClient)</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestClientModelAsyncWithHttpInfo (ModelClient body);
|
||||||
|
/// <summary>
|
||||||
|
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="number">None</param>
|
||||||
|
/// <param name="_double">None</param>
|
||||||
|
/// <param name="patternWithoutDelimiter">None</param>
|
||||||
|
/// <param name="_byte">None</param>
|
||||||
|
/// <param name="integer">None (optional)</param>
|
||||||
|
/// <param name="int32">None (optional)</param>
|
||||||
|
/// <param name="int64">None (optional)</param>
|
||||||
|
/// <param name="_float">None (optional)</param>
|
||||||
|
/// <param name="_string">None (optional)</param>
|
||||||
|
/// <param name="binary">None (optional)</param>
|
||||||
|
/// <param name="date">None (optional)</param>
|
||||||
|
/// <param name="dateTime">None (optional)</param>
|
||||||
|
/// <param name="password">None (optional)</param>
|
||||||
|
/// <param name="callback">None (optional)</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="number">None</param>
|
||||||
|
/// <param name="_double">None</param>
|
||||||
|
/// <param name="patternWithoutDelimiter">None</param>
|
||||||
|
/// <param name="_byte">None</param>
|
||||||
|
/// <param name="integer">None (optional)</param>
|
||||||
|
/// <param name="int32">None (optional)</param>
|
||||||
|
/// <param name="int64">None (optional)</param>
|
||||||
|
/// <param name="_float">None (optional)</param>
|
||||||
|
/// <param name="_string">None (optional)</param>
|
||||||
|
/// <param name="binary">None (optional)</param>
|
||||||
|
/// <param name="date">None (optional)</param>
|
||||||
|
/// <param name="dateTime">None (optional)</param>
|
||||||
|
/// <param name="password">None (optional)</param>
|
||||||
|
/// <param name="callback">None (optional)</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null);
|
||||||
|
/// <summary>
|
||||||
|
/// To test enum parameters
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// To test enum parameters
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="enumFormStringArray">Form parameter enum test (string array) (optional)</param>
|
||||||
|
/// <param name="enumFormString">Form parameter enum test (string) (optional, default to -efg)</param>
|
||||||
|
/// <param name="enumHeaderStringArray">Header parameter enum test (string array) (optional)</param>
|
||||||
|
/// <param name="enumHeaderString">Header parameter enum test (string) (optional, default to -efg)</param>
|
||||||
|
/// <param name="enumQueryStringArray">Query parameter enum test (string array) (optional)</param>
|
||||||
|
/// <param name="enumQueryString">Query parameter enum test (string) (optional, default to -efg)</param>
|
||||||
|
/// <param name="enumQueryInteger">Query parameter enum test (double) (optional)</param>
|
||||||
|
/// <param name="enumQueryDouble">Query parameter enum test (double) (optional)</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task TestEnumParametersAsync (List<string> enumFormStringArray = null, string enumFormString = null, List<string> enumHeaderStringArray = null, string enumHeaderString = null, List<string> enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To test enum parameters
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// To test enum parameters
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="enumFormStringArray">Form parameter enum test (string array) (optional)</param>
|
||||||
|
/// <param name="enumFormString">Form parameter enum test (string) (optional, default to -efg)</param>
|
||||||
|
/// <param name="enumHeaderStringArray">Header parameter enum test (string array) (optional)</param>
|
||||||
|
/// <param name="enumHeaderString">Header parameter enum test (string) (optional, default to -efg)</param>
|
||||||
|
/// <param name="enumQueryStringArray">Query parameter enum test (string array) (optional)</param>
|
||||||
|
/// <param name="enumQueryString">Query parameter enum test (string) (optional, default to -efg)</param>
|
||||||
|
/// <param name="enumQueryInteger">Query parameter enum test (double) (optional)</param>
|
||||||
|
/// <param name="enumQueryDouble">Query parameter enum test (double) (optional)</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> TestEnumParametersAsyncWithHttpInfo (List<string> enumFormStringArray = null, string enumFormString = null, List<string> enumHeaderStringArray = null, string enumHeaderString = null, List<string> enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null);
|
||||||
|
#endregion Asynchronous Operations
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -314,6 +419,82 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To test \"client\" model To test \"client\" model
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">client model</param>
|
||||||
|
/// <returns>Task of ModelClient</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ModelClient> TestClientModelAsync (ModelClient body)
|
||||||
|
{
|
||||||
|
ApiResponse<ModelClient> localVarResponse = await TestClientModelAsyncWithHttpInfo(body);
|
||||||
|
return localVarResponse.Data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To test \"client\" model To test \"client\" model
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">client model</param>
|
||||||
|
/// <returns>Task of ApiResponse (ModelClient)</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestClientModelAsyncWithHttpInfo (ModelClient body)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel");
|
||||||
|
|
||||||
|
var localVarPath = "./fake";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
String[] localVarHttpContentTypes = new String[] {
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
String[] localVarHttpHeaderAccepts = new String[] {
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (body != null && body.GetType() != typeof(byte[]))
|
||||||
|
{
|
||||||
|
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localVarPostBody = body; // byte array
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("TestClientModel", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ApiResponse<ModelClient>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
(ModelClient) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -438,6 +619,130 @@ namespace IO.Swagger.Api
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="number">None</param>
|
||||||
|
/// <param name="_double">None</param>
|
||||||
|
/// <param name="patternWithoutDelimiter">None</param>
|
||||||
|
/// <param name="_byte">None</param>
|
||||||
|
/// <param name="integer">None (optional)</param>
|
||||||
|
/// <param name="int32">None (optional)</param>
|
||||||
|
/// <param name="int64">None (optional)</param>
|
||||||
|
/// <param name="_float">None (optional)</param>
|
||||||
|
/// <param name="_string">None (optional)</param>
|
||||||
|
/// <param name="binary">None (optional)</param>
|
||||||
|
/// <param name="date">None (optional)</param>
|
||||||
|
/// <param name="dateTime">None (optional)</param>
|
||||||
|
/// <param name="password">None (optional)</param>
|
||||||
|
/// <param name="callback">None (optional)</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null)
|
||||||
|
{
|
||||||
|
await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="number">None</param>
|
||||||
|
/// <param name="_double">None</param>
|
||||||
|
/// <param name="patternWithoutDelimiter">None</param>
|
||||||
|
/// <param name="_byte">None</param>
|
||||||
|
/// <param name="integer">None (optional)</param>
|
||||||
|
/// <param name="int32">None (optional)</param>
|
||||||
|
/// <param name="int64">None (optional)</param>
|
||||||
|
/// <param name="_float">None (optional)</param>
|
||||||
|
/// <param name="_string">None (optional)</param>
|
||||||
|
/// <param name="binary">None (optional)</param>
|
||||||
|
/// <param name="date">None (optional)</param>
|
||||||
|
/// <param name="dateTime">None (optional)</param>
|
||||||
|
/// <param name="password">None (optional)</param>
|
||||||
|
/// <param name="callback">None (optional)</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'number' is set
|
||||||
|
if (number == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters");
|
||||||
|
// verify the required parameter '_double' is set
|
||||||
|
if (_double == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters");
|
||||||
|
// verify the required parameter 'patternWithoutDelimiter' is set
|
||||||
|
if (patternWithoutDelimiter == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters");
|
||||||
|
// verify the required parameter '_byte' is set
|
||||||
|
if (_byte == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter '_byte' when calling FakeApi->TestEndpointParameters");
|
||||||
|
|
||||||
|
var localVarPath = "./fake";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
String[] localVarHttpContentTypes = new String[] {
|
||||||
|
"application/xml; charset=utf-8",
|
||||||
|
"application/json; charset=utf-8"
|
||||||
|
};
|
||||||
|
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
String[] localVarHttpHeaderAccepts = new String[] {
|
||||||
|
"application/xml; charset=utf-8",
|
||||||
|
"application/json; charset=utf-8"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (integer != null) localVarFormParams.Add("integer", Configuration.ApiClient.ParameterToString(integer)); // form parameter
|
||||||
|
if (int32 != null) localVarFormParams.Add("int32", Configuration.ApiClient.ParameterToString(int32)); // form parameter
|
||||||
|
if (int64 != null) localVarFormParams.Add("int64", Configuration.ApiClient.ParameterToString(int64)); // form parameter
|
||||||
|
if (number != null) localVarFormParams.Add("number", Configuration.ApiClient.ParameterToString(number)); // form parameter
|
||||||
|
if (_float != null) localVarFormParams.Add("float", Configuration.ApiClient.ParameterToString(_float)); // form parameter
|
||||||
|
if (_double != null) localVarFormParams.Add("double", Configuration.ApiClient.ParameterToString(_double)); // form parameter
|
||||||
|
if (_string != null) localVarFormParams.Add("string", Configuration.ApiClient.ParameterToString(_string)); // form parameter
|
||||||
|
if (patternWithoutDelimiter != null) localVarFormParams.Add("pattern_without_delimiter", Configuration.ApiClient.ParameterToString(patternWithoutDelimiter)); // form parameter
|
||||||
|
if (_byte != null) localVarFormParams.Add("byte", Configuration.ApiClient.ParameterToString(_byte)); // form parameter
|
||||||
|
if (binary != null) localVarFormParams.Add("binary", Configuration.ApiClient.ParameterToString(binary)); // form parameter
|
||||||
|
if (date != null) localVarFormParams.Add("date", Configuration.ApiClient.ParameterToString(date)); // form parameter
|
||||||
|
if (dateTime != null) localVarFormParams.Add("dateTime", Configuration.ApiClient.ParameterToString(dateTime)); // form parameter
|
||||||
|
if (password != null) localVarFormParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // form parameter
|
||||||
|
if (callback != null) localVarFormParams.Add("callback", Configuration.ApiClient.ParameterToString(callback)); // form parameter
|
||||||
|
|
||||||
|
// authentication (http_basic_test) required
|
||||||
|
// http basic authentication required
|
||||||
|
if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password))
|
||||||
|
{
|
||||||
|
localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password);
|
||||||
|
}
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("TestEndpointParameters", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// To test enum parameters To test enum parameters
|
/// To test enum parameters To test enum parameters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -518,6 +823,92 @@ namespace IO.Swagger.Api
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To test enum parameters To test enum parameters
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="enumFormStringArray">Form parameter enum test (string array) (optional)</param>
|
||||||
|
/// <param name="enumFormString">Form parameter enum test (string) (optional, default to -efg)</param>
|
||||||
|
/// <param name="enumHeaderStringArray">Header parameter enum test (string array) (optional)</param>
|
||||||
|
/// <param name="enumHeaderString">Header parameter enum test (string) (optional, default to -efg)</param>
|
||||||
|
/// <param name="enumQueryStringArray">Query parameter enum test (string array) (optional)</param>
|
||||||
|
/// <param name="enumQueryString">Query parameter enum test (string) (optional, default to -efg)</param>
|
||||||
|
/// <param name="enumQueryInteger">Query parameter enum test (double) (optional)</param>
|
||||||
|
/// <param name="enumQueryDouble">Query parameter enum test (double) (optional)</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task TestEnumParametersAsync (List<string> enumFormStringArray = null, string enumFormString = null, List<string> enumHeaderStringArray = null, string enumHeaderString = null, List<string> enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null)
|
||||||
|
{
|
||||||
|
await TestEnumParametersAsyncWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To test enum parameters To test enum parameters
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="enumFormStringArray">Form parameter enum test (string array) (optional)</param>
|
||||||
|
/// <param name="enumFormString">Form parameter enum test (string) (optional, default to -efg)</param>
|
||||||
|
/// <param name="enumHeaderStringArray">Header parameter enum test (string array) (optional)</param>
|
||||||
|
/// <param name="enumHeaderString">Header parameter enum test (string) (optional, default to -efg)</param>
|
||||||
|
/// <param name="enumQueryStringArray">Query parameter enum test (string array) (optional)</param>
|
||||||
|
/// <param name="enumQueryString">Query parameter enum test (string) (optional, default to -efg)</param>
|
||||||
|
/// <param name="enumQueryInteger">Query parameter enum test (double) (optional)</param>
|
||||||
|
/// <param name="enumQueryDouble">Query parameter enum test (double) (optional)</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> TestEnumParametersAsyncWithHttpInfo (List<string> enumFormStringArray = null, string enumFormString = null, List<string> enumHeaderStringArray = null, string enumHeaderString = null, List<string> enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
var localVarPath = "./fake";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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 (enumQueryStringArray != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("csv", "enum_query_string_array", enumQueryStringArray)); // query parameter
|
||||||
|
if (enumQueryString != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_string", enumQueryString)); // query parameter
|
||||||
|
if (enumQueryInteger != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "enum_query_integer", enumQueryInteger)); // query parameter
|
||||||
|
if (enumHeaderStringArray != null) localVarHeaderParams.Add("enum_header_string_array", Configuration.ApiClient.ParameterToString(enumHeaderStringArray)); // header parameter
|
||||||
|
if (enumHeaderString != null) localVarHeaderParams.Add("enum_header_string", Configuration.ApiClient.ParameterToString(enumHeaderString)); // header parameter
|
||||||
|
if (enumFormStringArray != null) localVarFormParams.Add("enum_form_string_array", Configuration.ApiClient.ParameterToString(enumFormStringArray)); // form parameter
|
||||||
|
if (enumFormString != null) localVarFormParams.Add("enum_form_string", Configuration.ApiClient.ParameterToString(enumFormString)); // form parameter
|
||||||
|
if (enumQueryDouble != null) localVarFormParams.Add("enum_query_double", Configuration.ApiClient.ParameterToString(enumQueryDouble)); // form parameter
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("TestEnumParameters", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
null);
|
null);
|
||||||
|
@ -203,6 +203,186 @@ namespace IO.Swagger.Api
|
|||||||
/// <returns>ApiResponse of ApiResponse</returns>
|
/// <returns>ApiResponse of ApiResponse</returns>
|
||||||
ApiResponse<ApiResponse> UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null);
|
ApiResponse<ApiResponse> UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null);
|
||||||
#endregion Synchronous Operations
|
#endregion Synchronous Operations
|
||||||
|
#region Asynchronous Operations
|
||||||
|
/// <summary>
|
||||||
|
/// Add a new pet to the store
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">Pet object that needs to be added to the store</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task AddPetAsync (Pet body);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a new pet to the store
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">Pet object that needs to be added to the store</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> AddPetAsyncWithHttpInfo (Pet body);
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a pet
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">Pet id to delete</param>
|
||||||
|
/// <param name="apiKey"> (optional)</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a pet
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">Pet id to delete</param>
|
||||||
|
/// <param name="apiKey"> (optional)</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null);
|
||||||
|
/// <summary>
|
||||||
|
/// Finds Pets by status
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Multiple status values can be provided with comma separated strings
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="status">Status values that need to be considered for filter</param>
|
||||||
|
/// <returns>Task of List<Pet></returns>
|
||||||
|
System.Threading.Tasks.Task<List<Pet>> FindPetsByStatusAsync (List<string> status);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds Pets by status
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Multiple status values can be provided with comma separated strings
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="status">Status values that need to be considered for filter</param>
|
||||||
|
/// <returns>Task of ApiResponse (List<Pet>)</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<List<Pet>>> FindPetsByStatusAsyncWithHttpInfo (List<string> status);
|
||||||
|
/// <summary>
|
||||||
|
/// Finds Pets by tags
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="tags">Tags to filter by</param>
|
||||||
|
/// <returns>Task of List<Pet></returns>
|
||||||
|
System.Threading.Tasks.Task<List<Pet>> FindPetsByTagsAsync (List<string> tags);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds Pets by tags
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="tags">Tags to filter by</param>
|
||||||
|
/// <returns>Task of ApiResponse (List<Pet>)</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<List<Pet>>> FindPetsByTagsAsyncWithHttpInfo (List<string> tags);
|
||||||
|
/// <summary>
|
||||||
|
/// Find pet by ID
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Returns a single pet
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">ID of pet to return</param>
|
||||||
|
/// <returns>Task of Pet</returns>
|
||||||
|
System.Threading.Tasks.Task<Pet> GetPetByIdAsync (long? petId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Find pet by ID
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Returns a single pet
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">ID of pet to return</param>
|
||||||
|
/// <returns>Task of ApiResponse (Pet)</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Pet>> GetPetByIdAsyncWithHttpInfo (long? petId);
|
||||||
|
/// <summary>
|
||||||
|
/// Update an existing pet
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">Pet object that needs to be added to the store</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task UpdatePetAsync (Pet body);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update an existing pet
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">Pet object that needs to be added to the store</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> UpdatePetAsyncWithHttpInfo (Pet body);
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a pet in the store with form data
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">ID of pet that needs to be updated</param>
|
||||||
|
/// <param name="name">Updated name of the pet (optional)</param>
|
||||||
|
/// <param name="status">Updated status of the pet (optional)</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a pet in the store with form data
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">ID of pet that needs to be updated</param>
|
||||||
|
/// <param name="name">Updated name of the pet (optional)</param>
|
||||||
|
/// <param name="status">Updated status of the pet (optional)</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null);
|
||||||
|
/// <summary>
|
||||||
|
/// uploads an image
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">ID of pet to update</param>
|
||||||
|
/// <param name="additionalMetadata">Additional data to pass to server (optional)</param>
|
||||||
|
/// <param name="file">file to upload (optional)</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse> UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// uploads an image
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">ID of pet to update</param>
|
||||||
|
/// <param name="additionalMetadata">Additional data to pass to server (optional)</param>
|
||||||
|
/// <param name="file">file to upload (optional)</param>
|
||||||
|
/// <returns>Task of ApiResponse (ApiResponse)</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<ApiResponse>> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null);
|
||||||
|
#endregion Asynchronous Operations
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -396,6 +576,89 @@ namespace IO.Swagger.Api
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a new pet to the store
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">Pet object that needs to be added to the store</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task AddPetAsync (Pet body)
|
||||||
|
{
|
||||||
|
await AddPetAsyncWithHttpInfo(body);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add a new pet to the store
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">Pet object that needs to be added to the store</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> AddPetAsyncWithHttpInfo (Pet body)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet");
|
||||||
|
|
||||||
|
var localVarPath = "./pet";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
String[] localVarHttpContentTypes = new String[] {
|
||||||
|
"application/json",
|
||||||
|
"application/xml"
|
||||||
|
};
|
||||||
|
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
String[] localVarHttpHeaderAccepts = new String[] {
|
||||||
|
"application/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (body != null && body.GetType() != typeof(byte[]))
|
||||||
|
{
|
||||||
|
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localVarPostBody = body; // byte array
|
||||||
|
}
|
||||||
|
|
||||||
|
// authentication (petstore_auth) required
|
||||||
|
// oauth required
|
||||||
|
if (!String.IsNullOrEmpty(Configuration.AccessToken))
|
||||||
|
{
|
||||||
|
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("AddPet", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deletes a pet
|
/// Deletes a pet
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -472,6 +735,83 @@ namespace IO.Swagger.Api
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a pet
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">Pet id to delete</param>
|
||||||
|
/// <param name="apiKey"> (optional)</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null)
|
||||||
|
{
|
||||||
|
await DeletePetAsyncWithHttpInfo(petId, apiKey);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a pet
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">Pet id to delete</param>
|
||||||
|
/// <param name="apiKey"> (optional)</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if (petId == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet");
|
||||||
|
|
||||||
|
var localVarPath = "./pet/{petId}";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
|
||||||
|
if (apiKey != null) localVarHeaderParams.Add("api_key", Configuration.ApiClient.ParameterToString(apiKey)); // header parameter
|
||||||
|
|
||||||
|
// authentication (petstore_auth) required
|
||||||
|
// oauth required
|
||||||
|
if (!String.IsNullOrEmpty(Configuration.AccessToken))
|
||||||
|
{
|
||||||
|
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("DeletePet", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finds Pets by status Multiple status values can be provided with comma separated strings
|
/// Finds Pets by status Multiple status values can be provided with comma separated strings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -546,6 +886,81 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds Pets by status Multiple status values can be provided with comma separated strings
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="status">Status values that need to be considered for filter</param>
|
||||||
|
/// <returns>Task of List<Pet></returns>
|
||||||
|
public async System.Threading.Tasks.Task<List<Pet>> FindPetsByStatusAsync (List<string> status)
|
||||||
|
{
|
||||||
|
ApiResponse<List<Pet>> localVarResponse = await FindPetsByStatusAsyncWithHttpInfo(status);
|
||||||
|
return localVarResponse.Data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds Pets by status Multiple status values can be provided with comma separated strings
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="status">Status values that need to be considered for filter</param>
|
||||||
|
/// <returns>Task of ApiResponse (List<Pet>)</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<List<Pet>>> FindPetsByStatusAsyncWithHttpInfo (List<string> status)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'status' is set
|
||||||
|
if (status == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'status' when calling PetApi->FindPetsByStatus");
|
||||||
|
|
||||||
|
var localVarPath = "./pet/findByStatus";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (status != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("csv", "status", status)); // query parameter
|
||||||
|
|
||||||
|
// authentication (petstore_auth) required
|
||||||
|
// oauth required
|
||||||
|
if (!String.IsNullOrEmpty(Configuration.AccessToken))
|
||||||
|
{
|
||||||
|
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("FindPetsByStatus", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ApiResponse<List<Pet>>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
(List<Pet>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<Pet>)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
/// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -620,6 +1035,81 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="tags">Tags to filter by</param>
|
||||||
|
/// <returns>Task of List<Pet></returns>
|
||||||
|
public async System.Threading.Tasks.Task<List<Pet>> FindPetsByTagsAsync (List<string> tags)
|
||||||
|
{
|
||||||
|
ApiResponse<List<Pet>> localVarResponse = await FindPetsByTagsAsyncWithHttpInfo(tags);
|
||||||
|
return localVarResponse.Data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="tags">Tags to filter by</param>
|
||||||
|
/// <returns>Task of ApiResponse (List<Pet>)</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<List<Pet>>> FindPetsByTagsAsyncWithHttpInfo (List<string> tags)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'tags' is set
|
||||||
|
if (tags == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'tags' when calling PetApi->FindPetsByTags");
|
||||||
|
|
||||||
|
var localVarPath = "./pet/findByTags";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (tags != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("csv", "tags", tags)); // query parameter
|
||||||
|
|
||||||
|
// authentication (petstore_auth) required
|
||||||
|
// oauth required
|
||||||
|
if (!String.IsNullOrEmpty(Configuration.AccessToken))
|
||||||
|
{
|
||||||
|
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("FindPetsByTags", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ApiResponse<List<Pet>>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
(List<Pet>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<Pet>)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Find pet by ID Returns a single pet
|
/// Find pet by ID Returns a single pet
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -694,6 +1184,80 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Find pet by ID Returns a single pet
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">ID of pet to return</param>
|
||||||
|
/// <returns>Task of Pet</returns>
|
||||||
|
public async System.Threading.Tasks.Task<Pet> GetPetByIdAsync (long? petId)
|
||||||
|
{
|
||||||
|
ApiResponse<Pet> localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId);
|
||||||
|
return localVarResponse.Data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Find pet by ID Returns a single pet
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">ID of pet to return</param>
|
||||||
|
/// <returns>Task of ApiResponse (Pet)</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Pet>> GetPetByIdAsyncWithHttpInfo (long? petId)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if (petId == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById");
|
||||||
|
|
||||||
|
var localVarPath = "./pet/{petId}";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
|
||||||
|
|
||||||
|
// authentication (api_key) required
|
||||||
|
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
|
||||||
|
{
|
||||||
|
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
|
||||||
|
}
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("GetPetById", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ApiResponse<Pet>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
(Pet) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update an existing pet
|
/// Update an existing pet
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -776,6 +1340,89 @@ namespace IO.Swagger.Api
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update an existing pet
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">Pet object that needs to be added to the store</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task UpdatePetAsync (Pet body)
|
||||||
|
{
|
||||||
|
await UpdatePetAsyncWithHttpInfo(body);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update an existing pet
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">Pet object that needs to be added to the store</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> UpdatePetAsyncWithHttpInfo (Pet body)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet");
|
||||||
|
|
||||||
|
var localVarPath = "./pet";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
String[] localVarHttpContentTypes = new String[] {
|
||||||
|
"application/json",
|
||||||
|
"application/xml"
|
||||||
|
};
|
||||||
|
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
String[] localVarHttpHeaderAccepts = new String[] {
|
||||||
|
"application/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (body != null && body.GetType() != typeof(byte[]))
|
||||||
|
{
|
||||||
|
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localVarPostBody = body; // byte array
|
||||||
|
}
|
||||||
|
|
||||||
|
// authentication (petstore_auth) required
|
||||||
|
// oauth required
|
||||||
|
if (!String.IsNullOrEmpty(Configuration.AccessToken))
|
||||||
|
{
|
||||||
|
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("UpdatePet", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates a pet in the store with form data
|
/// Updates a pet in the store with form data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -856,6 +1503,87 @@ namespace IO.Swagger.Api
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a pet in the store with form data
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">ID of pet that needs to be updated</param>
|
||||||
|
/// <param name="name">Updated name of the pet (optional)</param>
|
||||||
|
/// <param name="status">Updated status of the pet (optional)</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null)
|
||||||
|
{
|
||||||
|
await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a pet in the store with form data
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">ID of pet that needs to be updated</param>
|
||||||
|
/// <param name="name">Updated name of the pet (optional)</param>
|
||||||
|
/// <param name="status">Updated status of the pet (optional)</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if (petId == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm");
|
||||||
|
|
||||||
|
var localVarPath = "./pet/{petId}";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
String[] localVarHttpContentTypes = new String[] {
|
||||||
|
"application/x-www-form-urlencoded"
|
||||||
|
};
|
||||||
|
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
String[] localVarHttpHeaderAccepts = new String[] {
|
||||||
|
"application/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
|
||||||
|
if (name != null) localVarFormParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // form parameter
|
||||||
|
if (status != null) localVarFormParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // form parameter
|
||||||
|
|
||||||
|
// authentication (petstore_auth) required
|
||||||
|
// oauth required
|
||||||
|
if (!String.IsNullOrEmpty(Configuration.AccessToken))
|
||||||
|
{
|
||||||
|
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("UpdatePetWithForm", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// uploads an image
|
/// uploads an image
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -936,5 +1664,86 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// uploads an image
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">ID of pet to update</param>
|
||||||
|
/// <param name="additionalMetadata">Additional data to pass to server (optional)</param>
|
||||||
|
/// <param name="file">file to upload (optional)</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse> UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null)
|
||||||
|
{
|
||||||
|
ApiResponse<ApiResponse> localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file);
|
||||||
|
return localVarResponse.Data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// uploads an image
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="petId">ID of pet to update</param>
|
||||||
|
/// <param name="additionalMetadata">Additional data to pass to server (optional)</param>
|
||||||
|
/// <param name="file">file to upload (optional)</param>
|
||||||
|
/// <returns>Task of ApiResponse (ApiResponse)</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<ApiResponse>> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if (petId == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile");
|
||||||
|
|
||||||
|
var localVarPath = "./pet/{petId}/uploadImage";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object localVarPostBody = null;
|
||||||
|
|
||||||
|
// to determine the Content-Type header
|
||||||
|
String[] localVarHttpContentTypes = new String[] {
|
||||||
|
"multipart/form-data"
|
||||||
|
};
|
||||||
|
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
String[] localVarHttpHeaderAccepts = new String[] {
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (petId != null) localVarPathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter
|
||||||
|
if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter
|
||||||
|
if (file != null) localVarFileParams.Add("file", Configuration.ApiClient.ParameterToFile("file", file));
|
||||||
|
|
||||||
|
// authentication (petstore_auth) required
|
||||||
|
// oauth required
|
||||||
|
if (!String.IsNullOrEmpty(Configuration.AccessToken))
|
||||||
|
{
|
||||||
|
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("UploadFile", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ApiResponse<ApiResponse>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
(ApiResponse) Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,6 +107,90 @@ namespace IO.Swagger.Api
|
|||||||
/// <returns>ApiResponse of Order</returns>
|
/// <returns>ApiResponse of Order</returns>
|
||||||
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body);
|
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body);
|
||||||
#endregion Synchronous Operations
|
#endregion Synchronous Operations
|
||||||
|
#region Asynchronous Operations
|
||||||
|
/// <summary>
|
||||||
|
/// Delete purchase order by ID
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task DeleteOrderAsync (string orderId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete purchase order by ID
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> DeleteOrderAsyncWithHttpInfo (string orderId);
|
||||||
|
/// <summary>
|
||||||
|
/// Returns pet inventories by status
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Returns a map of status codes to quantities
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <returns>Task of Dictionary<string, int?></returns>
|
||||||
|
System.Threading.Tasks.Task<Dictionary<string, int?>> GetInventoryAsync ();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns pet inventories by status
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Returns a map of status codes to quantities
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <returns>Task of ApiResponse (Dictionary<string, int?>)</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Dictionary<string, int?>>> GetInventoryAsyncWithHttpInfo ();
|
||||||
|
/// <summary>
|
||||||
|
/// Find purchase order by ID
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||||
|
/// <returns>Task of Order</returns>
|
||||||
|
System.Threading.Tasks.Task<Order> GetOrderByIdAsync (long? orderId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Find purchase order by ID
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||||
|
/// <returns>Task of ApiResponse (Order)</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (long? orderId);
|
||||||
|
/// <summary>
|
||||||
|
/// Place an order for a pet
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">order placed for purchasing the pet</param>
|
||||||
|
/// <returns>Task of Order</returns>
|
||||||
|
System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Place an order for a pet
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">order placed for purchasing the pet</param>
|
||||||
|
/// <returns>Task of ApiResponse (Order)</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body);
|
||||||
|
#endregion Asynchronous Operations
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -285,6 +369,74 @@ namespace IO.Swagger.Api
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId)
|
||||||
|
{
|
||||||
|
await DeleteOrderAsyncWithHttpInfo(orderId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> DeleteOrderAsyncWithHttpInfo (string orderId)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'orderId' is set
|
||||||
|
if (orderId == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder");
|
||||||
|
|
||||||
|
var localVarPath = "./store/order/{order_id}";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("DeleteOrder", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns pet inventories by status Returns a map of status codes to quantities
|
/// Returns pet inventories by status Returns a map of status codes to quantities
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -352,6 +504,73 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns pet inventories by status Returns a map of status codes to quantities
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <returns>Task of Dictionary<string, int?></returns>
|
||||||
|
public async System.Threading.Tasks.Task<Dictionary<string, int?>> GetInventoryAsync ()
|
||||||
|
{
|
||||||
|
ApiResponse<Dictionary<string, int?>> localVarResponse = await GetInventoryAsyncWithHttpInfo();
|
||||||
|
return localVarResponse.Data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns pet inventories by status Returns a map of status codes to quantities
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <returns>Task of ApiResponse (Dictionary<string, int?>)</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Dictionary<string, int?>>> GetInventoryAsyncWithHttpInfo ()
|
||||||
|
{
|
||||||
|
|
||||||
|
var localVarPath = "./store/inventory";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
|
||||||
|
// authentication (api_key) required
|
||||||
|
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("api_key")))
|
||||||
|
{
|
||||||
|
localVarHeaderParams["api_key"] = Configuration.GetApiKeyWithPrefix("api_key");
|
||||||
|
}
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("GetInventory", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ApiResponse<Dictionary<string, int?>>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
(Dictionary<string, int?>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary<string, int?>)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -420,6 +639,75 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||||
|
/// <returns>Task of Order</returns>
|
||||||
|
public async System.Threading.Tasks.Task<Order> GetOrderByIdAsync (long? orderId)
|
||||||
|
{
|
||||||
|
ApiResponse<Order> localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId);
|
||||||
|
return localVarResponse.Data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||||
|
/// <returns>Task of ApiResponse (Order)</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (long? orderId)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'orderId' is set
|
||||||
|
if (orderId == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
|
||||||
|
|
||||||
|
var localVarPath = "./store/order/{order_id}";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (orderId != null) localVarPathParams.Add("order_id", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("GetOrderById", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ApiResponse<Order>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
(Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Place an order for a pet
|
/// Place an order for a pet
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -495,5 +783,81 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Place an order for a pet
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">order placed for purchasing the pet</param>
|
||||||
|
/// <returns>Task of Order</returns>
|
||||||
|
public async System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body)
|
||||||
|
{
|
||||||
|
ApiResponse<Order> localVarResponse = await PlaceOrderAsyncWithHttpInfo(body);
|
||||||
|
return localVarResponse.Data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Place an order for a pet
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">order placed for purchasing the pet</param>
|
||||||
|
/// <returns>Task of ApiResponse (Order)</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder");
|
||||||
|
|
||||||
|
var localVarPath = "./store/order";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (body != null && body.GetType() != typeof(byte[]))
|
||||||
|
{
|
||||||
|
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localVarPostBody = body; // byte array
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("PlaceOrder", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ApiResponse<Order>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
(Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,6 +195,178 @@ namespace IO.Swagger.Api
|
|||||||
/// <returns>ApiResponse of Object(void)</returns>
|
/// <returns>ApiResponse of Object(void)</returns>
|
||||||
ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body);
|
ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body);
|
||||||
#endregion Synchronous Operations
|
#endregion Synchronous Operations
|
||||||
|
#region Asynchronous Operations
|
||||||
|
/// <summary>
|
||||||
|
/// Create user
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This can only be done by the logged in user.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">Created user object</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task CreateUserAsync (User body);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create user
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This can only be done by the logged in user.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">Created user object</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body);
|
||||||
|
/// <summary>
|
||||||
|
/// Creates list of users with given input array
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">List of user object</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates list of users with given input array
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">List of user object</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body);
|
||||||
|
/// <summary>
|
||||||
|
/// Creates list of users with given input array
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">List of user object</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates list of users with given input array
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">List of user object</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body);
|
||||||
|
/// <summary>
|
||||||
|
/// Delete user
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This can only be done by the logged in user.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">The name that needs to be deleted</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task DeleteUserAsync (string username);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete user
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This can only be done by the logged in user.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">The name that needs to be deleted</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> DeleteUserAsyncWithHttpInfo (string username);
|
||||||
|
/// <summary>
|
||||||
|
/// Get user by user name
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
|
||||||
|
/// <returns>Task of User</returns>
|
||||||
|
System.Threading.Tasks.Task<User> GetUserByNameAsync (string username);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get user by user name
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
|
||||||
|
/// <returns>Task of ApiResponse (User)</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<User>> GetUserByNameAsyncWithHttpInfo (string username);
|
||||||
|
/// <summary>
|
||||||
|
/// Logs user into the system
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">The user name for login</param>
|
||||||
|
/// <param name="password">The password for login in clear text</param>
|
||||||
|
/// <returns>Task of string</returns>
|
||||||
|
System.Threading.Tasks.Task<string> LoginUserAsync (string username, string password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Logs user into the system
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">The user name for login</param>
|
||||||
|
/// <param name="password">The password for login in clear text</param>
|
||||||
|
/// <returns>Task of ApiResponse (string)</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<string>> LoginUserAsyncWithHttpInfo (string username, string password);
|
||||||
|
/// <summary>
|
||||||
|
/// Logs out current logged in user session
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task LogoutUserAsync ();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Logs out current logged in user session
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
///
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> LogoutUserAsyncWithHttpInfo ();
|
||||||
|
/// <summary>
|
||||||
|
/// Updated user
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This can only be done by the logged in user.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">name that need to be deleted</param>
|
||||||
|
/// <param name="body">Updated user object</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
System.Threading.Tasks.Task UpdateUserAsync (string username, User body);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updated user
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This can only be done by the logged in user.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">name that need to be deleted</param>
|
||||||
|
/// <param name="body">Updated user object</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body);
|
||||||
|
#endregion Asynchronous Operations
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -380,6 +552,81 @@ namespace IO.Swagger.Api
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create user This can only be done by the logged in user.
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">Created user object</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task CreateUserAsync (User body)
|
||||||
|
{
|
||||||
|
await CreateUserAsyncWithHttpInfo(body);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create user This can only be done by the logged in user.
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">Created user object</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser");
|
||||||
|
|
||||||
|
var localVarPath = "./user";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (body != null && body.GetType() != typeof(byte[]))
|
||||||
|
{
|
||||||
|
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localVarPostBody = body; // byte array
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("CreateUser", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates list of users with given input array
|
/// Creates list of users with given input array
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -454,6 +701,81 @@ namespace IO.Swagger.Api
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates list of users with given input array
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">List of user object</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body)
|
||||||
|
{
|
||||||
|
await CreateUsersWithArrayInputAsyncWithHttpInfo(body);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates list of users with given input array
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">List of user object</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput");
|
||||||
|
|
||||||
|
var localVarPath = "./user/createWithArray";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (body != null && body.GetType() != typeof(byte[]))
|
||||||
|
{
|
||||||
|
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localVarPostBody = body; // byte array
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("CreateUsersWithArrayInput", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates list of users with given input array
|
/// Creates list of users with given input array
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -528,6 +850,81 @@ namespace IO.Swagger.Api
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates list of users with given input array
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">List of user object</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body)
|
||||||
|
{
|
||||||
|
await CreateUsersWithListInputAsyncWithHttpInfo(body);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates list of users with given input array
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="body">List of user object</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput");
|
||||||
|
|
||||||
|
var localVarPath = "./user/createWithList";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (body != null && body.GetType() != typeof(byte[]))
|
||||||
|
{
|
||||||
|
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localVarPostBody = body; // byte array
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("CreateUsersWithListInput", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delete user This can only be done by the logged in user.
|
/// Delete user This can only be done by the logged in user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -595,6 +992,74 @@ namespace IO.Swagger.Api
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete user This can only be done by the logged in user.
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">The name that needs to be deleted</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task DeleteUserAsync (string username)
|
||||||
|
{
|
||||||
|
await DeleteUserAsyncWithHttpInfo(username);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete user This can only be done by the logged in user.
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">The name that needs to be deleted</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> DeleteUserAsyncWithHttpInfo (string username)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser");
|
||||||
|
|
||||||
|
var localVarPath = "./user/{username}";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("DeleteUser", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get user by user name
|
/// Get user by user name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -663,6 +1128,75 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get user by user name
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
|
||||||
|
/// <returns>Task of User</returns>
|
||||||
|
public async System.Threading.Tasks.Task<User> GetUserByNameAsync (string username)
|
||||||
|
{
|
||||||
|
ApiResponse<User> localVarResponse = await GetUserByNameAsyncWithHttpInfo(username);
|
||||||
|
return localVarResponse.Data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get user by user name
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
|
||||||
|
/// <returns>Task of ApiResponse (User)</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<User>> GetUserByNameAsyncWithHttpInfo (string username)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName");
|
||||||
|
|
||||||
|
var localVarPath = "./user/{username}";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("GetUserByName", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ApiResponse<User>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
(User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Logs user into the system
|
/// Logs user into the system
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -737,6 +1271,81 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Logs user into the system
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">The user name for login</param>
|
||||||
|
/// <param name="password">The password for login in clear text</param>
|
||||||
|
/// <returns>Task of string</returns>
|
||||||
|
public async System.Threading.Tasks.Task<string> LoginUserAsync (string username, string password)
|
||||||
|
{
|
||||||
|
ApiResponse<string> localVarResponse = await LoginUserAsyncWithHttpInfo(username, password);
|
||||||
|
return localVarResponse.Data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Logs user into the system
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">The user name for login</param>
|
||||||
|
/// <param name="password">The password for login in clear text</param>
|
||||||
|
/// <returns>Task of ApiResponse (string)</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<string>> LoginUserAsyncWithHttpInfo (string username, string password)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->LoginUser");
|
||||||
|
// verify the required parameter 'password' is set
|
||||||
|
if (password == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'password' when calling UserApi->LoginUser");
|
||||||
|
|
||||||
|
var localVarPath = "./user/login";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (username != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "username", username)); // query parameter
|
||||||
|
if (password != null) localVarQueryParams.AddRange(Configuration.ApiClient.ParameterToKeyValuePairs("", "password", password)); // query parameter
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("LoginUser", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ApiResponse<string>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
(string) Configuration.ApiClient.Deserialize(localVarResponse, typeof(string)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Logs out current logged in user session
|
/// Logs out current logged in user session
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -798,6 +1407,68 @@ namespace IO.Swagger.Api
|
|||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Logs out current logged in user session
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task LogoutUserAsync ()
|
||||||
|
{
|
||||||
|
await LogoutUserAsyncWithHttpInfo();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Logs out current logged in user session
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> LogoutUserAsyncWithHttpInfo ()
|
||||||
|
{
|
||||||
|
|
||||||
|
var localVarPath = "./user/logout";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("LogoutUser", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updated user This can only be done by the logged in user.
|
/// Updated user This can only be done by the logged in user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -873,6 +1544,87 @@ namespace IO.Swagger.Api
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updated user This can only be done by the logged in user.
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">name that need to be deleted</param>
|
||||||
|
/// <param name="body">Updated user object</param>
|
||||||
|
/// <returns>Task of void</returns>
|
||||||
|
public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body)
|
||||||
|
{
|
||||||
|
await UpdateUserAsyncWithHttpInfo(username, body);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updated user This can only be done by the logged in user.
|
||||||
|
/// </summary>
|
||||||
|
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||||
|
/// <param name="username">name that need to be deleted</param>
|
||||||
|
/// <param name="body">Updated user object</param>
|
||||||
|
/// <returns>Task of ApiResponse</returns>
|
||||||
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body)
|
||||||
|
{
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if (username == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser");
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if (body == null)
|
||||||
|
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser");
|
||||||
|
|
||||||
|
var localVarPath = "./user/{username}";
|
||||||
|
var localVarPathParams = new Dictionary<String, String>();
|
||||||
|
var localVarQueryParams = new List<KeyValuePair<String, String>>();
|
||||||
|
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||||
|
var localVarFormParams = new Dictionary<String, String>();
|
||||||
|
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||||
|
Object 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/xml",
|
||||||
|
"application/json"
|
||||||
|
};
|
||||||
|
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||||
|
if (localVarHttpHeaderAccept != null)
|
||||||
|
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||||
|
|
||||||
|
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
|
||||||
|
if (body != null && body.GetType() != typeof(byte[]))
|
||||||
|
{
|
||||||
|
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localVarPostBody = body; // byte array
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// make the HTTP request
|
||||||
|
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||||
|
Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||||
|
localVarPathParams, localVarHttpContentType);
|
||||||
|
|
||||||
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
|
if (ExceptionFactory != null)
|
||||||
|
{
|
||||||
|
Exception exception = ExceptionFactory("UpdateUser", localVarResponse);
|
||||||
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()),
|
||||||
null);
|
null);
|
||||||
|
@ -187,7 +187,33 @@ namespace IO.Swagger.Client
|
|||||||
|
|
||||||
return (Object) response;
|
return (Object) response;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Makes the asynchronous HTTP request.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">URL path.</param>
|
||||||
|
/// <param name="method">HTTP method.</param>
|
||||||
|
/// <param name="queryParams">Query parameters.</param>
|
||||||
|
/// <param name="postBody">HTTP body (POST request).</param>
|
||||||
|
/// <param name="headerParams">Header parameters.</param>
|
||||||
|
/// <param name="formParams">Form parameters.</param>
|
||||||
|
/// <param name="fileParams">File parameters.</param>
|
||||||
|
/// <param name="pathParams">Path parameters.</param>
|
||||||
|
/// <param name="contentType">Content type.</param>
|
||||||
|
/// <returns>The Task instance.</returns>
|
||||||
|
public async System.Threading.Tasks.Task<Object> CallApiAsync(
|
||||||
|
String path, Method method, List<KeyValuePair<String, String>> queryParams, Object postBody,
|
||||||
|
Dictionary<String, String> headerParams, Dictionary<String, String> formParams,
|
||||||
|
Dictionary<String, FileParameter> fileParams, Dictionary<String, String> pathParams,
|
||||||
|
String contentType)
|
||||||
|
{
|
||||||
|
var request = PrepareRequest(
|
||||||
|
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
||||||
|
pathParams, contentType);
|
||||||
|
InterceptRequest(request);
|
||||||
|
var response = await RestClient.Execute(request);
|
||||||
|
InterceptResponse(request, response);
|
||||||
|
return (Object)response;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Escape string (url-encoded).
|
/// Escape string (url-encoded).
|
||||||
@ -377,7 +403,7 @@ namespace IO.Swagger.Client
|
|||||||
/// <param name="source">Object to be casted</param>
|
/// <param name="source">Object to be casted</param>
|
||||||
/// <param name="dest">Target type</param>
|
/// <param name="dest">Target type</param>
|
||||||
/// <returns>Casted object</returns>
|
/// <returns>Casted object</returns>
|
||||||
public static object ConvertType<T>(T source, Type dest) where T : class
|
public static dynamic ConvertType(dynamic source, Type dest)
|
||||||
{
|
{
|
||||||
return Convert.ChangeType(source, dest);
|
return Convert.ChangeType(source, dest);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ namespace IO.Swagger.Client
|
|||||||
/// Gets or sets the error content (body json object)
|
/// Gets or sets the error content (body json object)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The error content (Http response body).</value>
|
/// <value>The error content (Http response body).</value>
|
||||||
public object ErrorContent { get; private set; }
|
public dynamic ErrorContent { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ApiException"/> class.
|
/// Initializes a new instance of the <see cref="ApiException"/> class.
|
||||||
@ -50,7 +50,7 @@ namespace IO.Swagger.Client
|
|||||||
/// <param name="errorCode">HTTP status code.</param>
|
/// <param name="errorCode">HTTP status code.</param>
|
||||||
/// <param name="message">Error message.</param>
|
/// <param name="message">Error message.</param>
|
||||||
/// <param name="errorContent">Error content.</param>
|
/// <param name="errorContent">Error content.</param>
|
||||||
public ApiException(int errorCode, string message, object errorContent = null) : base(message)
|
public ApiException(int errorCode, string message, dynamic errorContent = null) : base(message)
|
||||||
{
|
{
|
||||||
this.ErrorCode = errorCode;
|
this.ErrorCode = errorCode;
|
||||||
this.ErrorContent = errorContent;
|
this.ErrorContent = errorContent;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user