Merge pull request #2350 from wing328/csharp_comment

[C#] escape HTML special character in Model's summary and value
This commit is contained in:
wing328 2016-03-10 14:49:50 +08:00
commit deea3f5c72
17 changed files with 2414 additions and 1885 deletions

View File

@ -63,9 +63,9 @@ namespace {{packageName}}.Model
{{#vars}}{{^isEnum}}
/// <summary>
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
/// </summary>{{#description}}
/// <value>{{{description}}}</value>{{/description}}
/// <value>{{description}}</value>{{/description}}
[DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})]
public {{{datatype}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }
{{/isEnum}}{{/vars}}

View File

@ -1303,6 +1303,18 @@
"xml": {
"name": "Return"
}
},
"Name": {
"descripton": "Model for testing reserved words",
"properties": {
"name": {
"type": "integer",
"format": "int32"
}
},
"xml": {
"name": "Name"
}
}
}
}

View File

@ -53,19 +53,6 @@ namespace IO.Swagger.Test
}
/// <summary>
/// Test UpdatePet
/// </summary>
[Test]
public void UpdatePetTest()
{
// TODO: add unit test for the method 'UpdatePet'
Pet body = null; // TODO: replace null with proper value
instance.UpdatePet(body);
}
/// <summary>
/// Test AddPet
/// </summary>
@ -79,6 +66,33 @@ namespace IO.Swagger.Test
}
/// <summary>
/// Test AddPetUsingByteArray
/// </summary>
[Test]
public void AddPetUsingByteArrayTest()
{
// TODO: add unit test for the method 'AddPetUsingByteArray'
byte[] body = null; // TODO: replace null with proper value
instance.AddPetUsingByteArray(body);
}
/// <summary>
/// Test DeletePet
/// </summary>
[Test]
public void DeletePetTest()
{
// TODO: add unit test for the method 'DeletePet'
long? petId = null; // TODO: replace null with proper value
string apiKey = null; // TODO: replace null with proper value
instance.DeletePet(petId, apiKey);
}
/// <summary>
/// Test FindPetsByStatus
/// </summary>
@ -118,50 +132,6 @@ namespace IO.Swagger.Test
Assert.IsInstanceOf<Pet> (response, "response is Pet");
}
/// <summary>
/// Test UpdatePetWithForm
/// </summary>
[Test]
public void UpdatePetWithFormTest()
{
// TODO: add unit test for the method 'UpdatePetWithForm'
string petId = null; // TODO: replace null with proper value
string name = null; // TODO: replace null with proper value
string status = null; // TODO: replace null with proper value
instance.UpdatePetWithForm(petId, name, status);
}
/// <summary>
/// Test DeletePet
/// </summary>
[Test]
public void DeletePetTest()
{
// TODO: add unit test for the method 'DeletePet'
long? petId = null; // TODO: replace null with proper value
string apiKey = null; // TODO: replace null with proper value
instance.DeletePet(petId, apiKey);
}
/// <summary>
/// Test UploadFile
/// </summary>
[Test]
public void UploadFileTest()
{
// TODO: add unit test for the method 'UploadFile'
long? petId = null; // TODO: replace null with proper value
string additionalMetadata = null; // TODO: replace null with proper value
Stream file = null; // TODO: replace null with proper value
instance.UploadFile(petId, additionalMetadata, file);
}
/// <summary>
/// Test GetPetByIdInObject
/// </summary>
@ -189,15 +159,45 @@ namespace IO.Swagger.Test
}
/// <summary>
/// Test AddPetUsingByteArray
/// Test UpdatePet
/// </summary>
[Test]
public void AddPetUsingByteArrayTest()
public void UpdatePetTest()
{
// TODO: add unit test for the method 'AddPetUsingByteArray'
byte[] body = null; // TODO: replace null with proper value
// TODO: add unit test for the method 'UpdatePet'
Pet body = null; // TODO: replace null with proper value
instance.AddPetUsingByteArray(body);
instance.UpdatePet(body);
}
/// <summary>
/// Test UpdatePetWithForm
/// </summary>
[Test]
public void UpdatePetWithFormTest()
{
// TODO: add unit test for the method 'UpdatePetWithForm'
string petId = null; // TODO: replace null with proper value
string name = null; // TODO: replace null with proper value
string status = null; // TODO: replace null with proper value
instance.UpdatePetWithForm(petId, name, status);
}
/// <summary>
/// Test UploadFile
/// </summary>
[Test]
public void UploadFileTest()
{
// TODO: add unit test for the method 'UploadFile'
long? petId = null; // TODO: replace null with proper value
string additionalMetadata = null; // TODO: replace null with proper value
Stream file = null; // TODO: replace null with proper value
instance.UploadFile(petId, additionalMetadata, file);
}

View File

@ -53,6 +53,19 @@ namespace IO.Swagger.Test
}
/// <summary>
/// Test DeleteOrder
/// </summary>
[Test]
public void DeleteOrderTest()
{
// TODO: add unit test for the method 'DeleteOrder'
string orderId = null; // TODO: replace null with proper value
instance.DeleteOrder(orderId);
}
/// <summary>
/// Test FindOrdersByStatus
/// </summary>
@ -90,19 +103,6 @@ namespace IO.Swagger.Test
Assert.IsInstanceOf<Object> (response, "response is Object");
}
/// <summary>
/// Test PlaceOrder
/// </summary>
[Test]
public void PlaceOrderTest()
{
// TODO: add unit test for the method 'PlaceOrder'
Order body = null; // TODO: replace null with proper value
var response = instance.PlaceOrder(body);
Assert.IsInstanceOf<Order> (response, "response is Order");
}
/// <summary>
/// Test GetOrderById
/// </summary>
@ -117,16 +117,16 @@ namespace IO.Swagger.Test
}
/// <summary>
/// Test DeleteOrder
/// Test PlaceOrder
/// </summary>
[Test]
public void DeleteOrderTest()
public void PlaceOrderTest()
{
// TODO: add unit test for the method 'DeleteOrder'
string orderId = null; // TODO: replace null with proper value
instance.DeleteOrder(orderId);
// TODO: add unit test for the method 'PlaceOrder'
Order body = null; // TODO: replace null with proper value
var response = instance.PlaceOrder(body);
Assert.IsInstanceOf<Order> (response, "response is Order");
}
}

View File

@ -92,6 +92,32 @@ namespace IO.Swagger.Test
}
/// <summary>
/// Test DeleteUser
/// </summary>
[Test]
public void DeleteUserTest()
{
// TODO: add unit test for the method 'DeleteUser'
string username = null; // TODO: replace null with proper value
instance.DeleteUser(username);
}
/// <summary>
/// Test GetUserByName
/// </summary>
[Test]
public void GetUserByNameTest()
{
// TODO: add unit test for the method 'GetUserByName'
string username = null; // TODO: replace null with proper value
var response = instance.GetUserByName(username);
Assert.IsInstanceOf<User> (response, "response is User");
}
/// <summary>
/// Test LoginUser
/// </summary>
@ -118,19 +144,6 @@ namespace IO.Swagger.Test
}
/// <summary>
/// Test GetUserByName
/// </summary>
[Test]
public void GetUserByNameTest()
{
// TODO: add unit test for the method 'GetUserByName'
string username = null; // TODO: replace null with proper value
var response = instance.GetUserByName(username);
Assert.IsInstanceOf<User> (response, "response is User");
}
/// <summary>
/// Test UpdateUser
/// </summary>
@ -145,19 +158,6 @@ namespace IO.Swagger.Test
}
/// <summary>
/// Test DeleteUser
/// </summary>
[Test]
public void DeleteUserTest()
{
// TODO: add unit test for the method 'DeleteUser'
string username = null; // TODO: replace null with proper value
instance.DeleteUser(username);
}
}
}

View File

@ -6,7 +6,9 @@ SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://nuget.org/nuget.exe', '.\nuget.exe')"
.\nuget.exe install vendor/packages.config -o vendor
copy vendor/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll
copy vendor/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll
if not exist ".\bin" mkdir bin
%CSCPATH%\csc /reference:bin/Newtonsoft.Json.dll;bin/RestSharp.dll /target:library /out:bin/IO.Swagger.dll /recurse:src\*.cs /doc:bin/IO.Swagger.xml
copy vendor\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
copy vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll bin\RestSharp.dll
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\RestSharp.dll /target:library /out:bin\IO.Swagger.dll /recurse:src\*.cs /doc:bin\IO.Swagger.xml

View File

@ -17,6 +17,28 @@ namespace IO.Swagger.Api
{
#region Synchronous Operations
/// <summary>
/// Delete purchase order by ID
/// </summary>
/// <remarks>
/// For valid response try integer IDs with value &lt; 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></returns>
void DeleteOrder (string orderId);
/// <summary>
/// Delete purchase order by ID
/// </summary>
/// <remarks>
/// For valid response try integer IDs with value &lt; 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>ApiResponse of Object(void)</returns>
ApiResponse<Object> DeleteOrderWithHttpInfo (string orderId);
/// <summary>
/// Finds orders by status
/// </summary>
@ -79,28 +101,6 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object</returns>
ApiResponse<Object> GetInventoryInObjectWithHttpInfo ();
/// <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>Order</returns>
Order PlaceOrder (Order body = null);
/// <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>ApiResponse of Order</returns>
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body = null);
/// <summary>
/// Find purchase order by ID
/// </summary>
@ -124,15 +124,30 @@ namespace IO.Swagger.Api
ApiResponse<Order> GetOrderByIdWithHttpInfo (string orderId);
/// <summary>
/// Delete purchase order by ID
/// Place an order for a pet
/// </summary>
/// <remarks>
/// For valid response try integer IDs with value &lt; 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></returns>
void DeleteOrder (string orderId);
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Order</returns>
Order PlaceOrder (Order body = null);
/// <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>ApiResponse of Order</returns>
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body = null);
#endregion Synchronous Operations
#region Asynchronous Operations
/// <summary>
/// Delete purchase order by ID
@ -142,12 +157,19 @@ namespace IO.Swagger.Api
/// </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>ApiResponse of Object(void)</returns>
ApiResponse<Object> DeleteOrderWithHttpInfo (string orderId);
/// <returns>Task of void</returns>
System.Threading.Tasks.Task DeleteOrderAsync (string orderId);
#endregion Synchronous Operations
#region Asynchronous Operations
/// <summary>
/// Delete purchase order by ID
/// </summary>
/// <remarks>
/// For valid response try integer IDs with value &lt; 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>
/// Finds orders by status
@ -211,28 +233,6 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse (Object)</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> GetInventoryInObjectAsyncWithHttpInfo ();
/// <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 = null);
/// <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 = null);
/// <summary>
/// Find purchase order by ID
/// </summary>
@ -256,26 +256,26 @@ namespace IO.Swagger.Api
System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (string orderId);
/// <summary>
/// Delete purchase order by ID
/// Place an order for a pet
/// </summary>
/// <remarks>
/// For valid response try integer IDs with value &lt; 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);
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Task of Order</returns>
System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body = null);
/// <summary>
/// Delete purchase order by ID
/// Place an order for a pet
/// </summary>
/// <remarks>
/// For valid response try integer IDs with value &lt; 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);
/// <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 = null);
#endregion Asynchronous Operations
@ -357,6 +357,162 @@ namespace IO.Swagger.Api
}
/// <summary>
/// Delete purchase order by ID For valid response try integer IDs with value &lt; 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></returns>
public void DeleteOrder (string orderId)
{
DeleteOrderWithHttpInfo(orderId);
}
/// <summary>
/// Delete purchase order by ID For valid response try integer IDs with value &lt; 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>ApiResponse of Object(void)</returns>
public ApiResponse<Object> DeleteOrderWithHttpInfo (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/{orderId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Delete purchase order by ID For valid response try integer IDs with value &lt; 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 &lt; 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 DeleteOrder");
var localVarPath = "/store/order/{orderId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", 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 (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Finds orders by status A single status value can be provided as a string
/// </summary>
@ -853,6 +1009,190 @@ namespace IO.Swagger.Api
}
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value &lt;= 5 or &gt; 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>Order</returns>
public Order GetOrderById (string orderId)
{
ApiResponse<Order> localVarResponse = GetOrderByIdWithHttpInfo(orderId);
return localVarResponse.Data;
}
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value &lt;= 5 or &gt; 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>ApiResponse of Order</returns>
public ApiResponse< Order > GetOrderByIdWithHttpInfo (string 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/{orderId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// authentication (test_api_key_header) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_header")))
{
localVarHeaderParams["test_api_key_header"] = Configuration.GetApiKeyWithPrefix("test_api_key_header");
}
// authentication (test_api_key_query) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query")))
{
localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Order>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
}
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value &lt;= 5 or &gt; 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 (string orderId)
{
ApiResponse<Order> localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId);
return localVarResponse.Data;
}
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value &lt;= 5 or &gt; 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 (string orderId)
{
// verify the required parameter 'orderId' is set
if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById");
var localVarPath = "/store/order/{orderId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// authentication (test_api_key_header) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_header")))
{
localVarHeaderParams["test_api_key_header"] = Configuration.GetApiKeyWithPrefix("test_api_key_header");
}
// authentication (test_api_key_query) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query")))
{
localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query");
}
// 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 (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Order>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
}
/// <summary>
/// Place an order for a pet
/// </summary>
@ -1043,346 +1383,6 @@ namespace IO.Swagger.Api
}
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value &lt;= 5 or &gt; 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>Order</returns>
public Order GetOrderById (string orderId)
{
ApiResponse<Order> localVarResponse = GetOrderByIdWithHttpInfo(orderId);
return localVarResponse.Data;
}
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value &lt;= 5 or &gt; 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>ApiResponse of Order</returns>
public ApiResponse< Order > GetOrderByIdWithHttpInfo (string 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/{orderId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// authentication (test_api_key_header) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_header")))
{
localVarHeaderParams["test_api_key_header"] = Configuration.GetApiKeyWithPrefix("test_api_key_header");
}
// authentication (test_api_key_query) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query")))
{
localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Order>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
}
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value &lt;= 5 or &gt; 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 (string orderId)
{
ApiResponse<Order> localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId);
return localVarResponse.Data;
}
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value &lt;= 5 or &gt; 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 (string orderId)
{
// verify the required parameter 'orderId' is set
if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById");
var localVarPath = "/store/order/{orderId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// authentication (test_api_key_header) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_header")))
{
localVarHeaderParams["test_api_key_header"] = Configuration.GetApiKeyWithPrefix("test_api_key_header");
}
// authentication (test_api_key_query) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("test_api_key_query")))
{
localVarQueryParams["test_api_key_query"] = Configuration.GetApiKeyWithPrefix("test_api_key_query");
}
// 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 (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Order>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(Order) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
}
/// <summary>
/// Delete purchase order by ID For valid response try integer IDs with value &lt; 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></returns>
public void DeleteOrder (string orderId)
{
DeleteOrderWithHttpInfo(orderId);
}
/// <summary>
/// Delete purchase order by ID For valid response try integer IDs with value &lt; 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>ApiResponse of Object(void)</returns>
public ApiResponse<Object> DeleteOrderWithHttpInfo (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/{orderId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <summary>
/// Delete purchase order by ID For valid response try integer IDs with value &lt; 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 &lt; 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 DeleteOrder");
var localVarPath = "/store/order/{orderId}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", 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 (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
}
}

View File

@ -83,6 +83,50 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body = null);
/// <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></returns>
void DeleteUser (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>ApiResponse of Object(void)</returns>
ApiResponse<Object> DeleteUserWithHttpInfo (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>User</returns>
User GetUserByName (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>ApiResponse of User</returns>
ApiResponse<User> GetUserByNameWithHttpInfo (string username);
/// <summary>
/// Logs user into the system
/// </summary>
@ -127,28 +171,6 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> LogoutUserWithHttpInfo ();
/// <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>User</returns>
User GetUserByName (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>ApiResponse of User</returns>
ApiResponse<User> GetUserByNameWithHttpInfo (string username);
/// <summary>
/// Updated user
/// </summary>
@ -173,28 +195,6 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body = null);
/// <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></returns>
void DeleteUser (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>ApiResponse of Object(void)</returns>
ApiResponse<Object> DeleteUserWithHttpInfo (string username);
#endregion Synchronous Operations
#region Asynchronous Operations
@ -265,6 +265,50 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body = null);
/// <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>
@ -309,28 +353,6 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> LogoutUserAsyncWithHttpInfo ();
/// <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>
/// Updated user
/// </summary>
@ -355,28 +377,6 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body = null);
/// <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);
#endregion Asynchronous Operations
}
@ -943,6 +943,320 @@ namespace IO.Swagger.Api
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></returns>
public void DeleteUser (string username)
{
DeleteUserWithHttpInfo(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>ApiResponse of Object(void)</returns>
public ApiResponse<Object> DeleteUserWithHttpInfo (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 Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling DeleteUser: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling DeleteUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
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 DeleteUser");
var localVarPath = "/user/{username}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
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 (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling DeleteUser: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling DeleteUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
/// <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>User</returns>
public User GetUserByName (string username)
{
ApiResponse<User> localVarResponse = GetUserByNameWithHttpInfo(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>ApiResponse of User</returns>
public ApiResponse< User > GetUserByNameWithHttpInfo (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 Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling GetUserByName: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling GetUserByName: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<User>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
/// <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 GetUserByName");
var localVarPath = "/user/{username}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
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 (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling GetUserByName: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling GetUserByName: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<User>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
/// <summary>
/// Logs user into the system
/// </summary>
@ -1245,164 +1559,6 @@ namespace IO.Swagger.Api
null);
}
/// <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>User</returns>
public User GetUserByName (string username)
{
ApiResponse<User> localVarResponse = GetUserByNameWithHttpInfo(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>ApiResponse of User</returns>
public ApiResponse< User > GetUserByNameWithHttpInfo (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 Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling GetUserByName: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling GetUserByName: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<User>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
/// <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 GetUserByName");
var localVarPath = "/user/{username}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
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 (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling GetUserByName: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling GetUserByName: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<User>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(User) Configuration.ApiClient.Deserialize(localVarResponse, typeof(User)));
}
/// <summary>
/// Updated user This can only be done by the logged in user.
/// </summary>
@ -1577,162 +1733,6 @@ namespace IO.Swagger.Api
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></returns>
public void DeleteUser (string username)
{
DeleteUserWithHttpInfo(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>ApiResponse of Object(void)</returns>
public ApiResponse<Object> DeleteUserWithHttpInfo (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 Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
localVarPathParams, localVarHttpContentType);
int localVarStatusCode = (int) localVarResponse.StatusCode;
if (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling DeleteUser: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling DeleteUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
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 DeleteUser");
var localVarPath = "/user/{username}";
var localVarPathParams = new Dictionary<String, String>();
var localVarQueryParams = new Dictionary<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", "application/xml"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
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 (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling DeleteUser: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling DeleteUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
null);
}
}
}

View File

@ -0,0 +1,113 @@
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace IO.Swagger.Model
{
/// <summary>
///
/// </summary>
[DataContract]
public partial class ModelReturn : IEquatable<ModelReturn>
{
/// <summary>
/// Initializes a new instance of the <see cref="ModelReturn" /> class.
/// Initializes a new instance of the <see cref="ModelReturn" />class.
/// </summary>
/// <param name="_Return">_Return.</param>
public ModelReturn(int? _Return = null)
{
this._Return = _Return;
}
/// <summary>
/// Gets or Sets _Return
/// </summary>
[DataMember(Name="return", EmitDefaultValue=false)]
public int? _Return { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class ModelReturn {\n");
sb.Append(" _Return: ").Append(_Return).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
// credit: http://stackoverflow.com/a/10454552/677735
return this.Equals(obj as ModelReturn);
}
/// <summary>
/// Returns true if ModelReturn instances are equal
/// </summary>
/// <param name="other">Instance of ModelReturn to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(ModelReturn other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return
(
this._Return == other._Return ||
this._Return != null &&
this._Return.Equals(other._Return)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
// credit: http://stackoverflow.com/a/263416/677735
unchecked // Overflow is fine, just wrap
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this._Return != null)
hash = hash * 59 + this._Return.GetHashCode();
return hash;
}
}
}
}

View File

@ -0,0 +1,113 @@
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace IO.Swagger.Model
{
/// <summary>
///
/// </summary>
[DataContract]
public partial class Name : IEquatable<Name>
{
/// <summary>
/// Initializes a new instance of the <see cref="Name" /> class.
/// Initializes a new instance of the <see cref="Name" />class.
/// </summary>
/// <param name="_Name">_Name.</param>
public Name(int? _Name = null)
{
this._Name = _Name;
}
/// <summary>
/// Gets or Sets _Name
/// </summary>
[DataMember(Name="name", EmitDefaultValue=false)]
public int? _Name { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class Name {\n");
sb.Append(" _Name: ").Append(_Name).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
// credit: http://stackoverflow.com/a/10454552/677735
return this.Equals(obj as Name);
}
/// <summary>
/// Returns true if Name instances are equal
/// </summary>
/// <param name="other">Instance of Name to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(Name other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return
(
this._Name == other._Name ||
this._Name != null &&
this._Name.Equals(other._Name)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
// credit: http://stackoverflow.com/a/263416/677735
unchecked // Overflow is fine, just wrap
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this._Name != null)
hash = hash * 59 + this._Name.GetHashCode();
return hash;
}
}
}
}

View File

@ -62,6 +62,9 @@
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\InlineResponse200.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\ObjectReturn.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\SpecialModelName.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\ModelReturn.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Name.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Task.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

View File

@ -3,15 +3,8 @@
<MonoDevelop.Ide.Workbench ActiveDocument="TestPet.cs">
<Files>
<File FileName="TestPet.cs" Line="189" Column="4" />
<File FileName="TestOrder.cs" Line="88" Column="47" />
<File FileName="TestOrder.cs" Line="1" Column="1" />
</Files>
<Pads>
<Pad Id="MonoDevelop.NUnit.TestPad">
<State name="__root__">
<Node name="SwaggerClientTest" expanded="True" />
</State>
</Pad>
</Pads>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />

View File

@ -7,12 +7,3 @@
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.swagger-logo.png
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll
/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll

View File

@ -0,0 +1,166 @@
package io.swagger.model;
import java.util.Objects;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.model.Tag;
import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-10T09:43:22.889+08:00")
public class InlineResponse200 {
private List<Tag> tags = new ArrayList<Tag>();
private Long id = null;
private Object category = null;
public enum StatusEnum {
AVAILABLE("available"),
PENDING("pending"),
SOLD("sold");
private String value;
StatusEnum(String value) {
this.value = value;
}
@Override
@JsonValue
public String toString() {
return value;
}
}
private StatusEnum status = null;
private String name = null;
private List<String> photoUrls = new ArrayList<String>();
/**
**/
@JsonProperty("tags")
public List<Tag> getTags() {
return tags;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
}
/**
**/
@JsonProperty("id")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
**/
@JsonProperty("category")
public Object getCategory() {
return category;
}
public void setCategory(Object category) {
this.category = category;
}
/**
* pet status in the store
**/
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
/**
**/
@JsonProperty("name")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
/**
**/
@JsonProperty("photoUrls")
public List<String> getPhotoUrls() {
return photoUrls;
}
public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InlineResponse200 inlineResponse200 = (InlineResponse200) o;
return Objects.equals(tags, inlineResponse200.tags) &&
Objects.equals(id, inlineResponse200.id) &&
Objects.equals(category, inlineResponse200.category) &&
Objects.equals(status, inlineResponse200.status) &&
Objects.equals(name, inlineResponse200.name) &&
Objects.equals(photoUrls, inlineResponse200.photoUrls);
}
@Override
public int hashCode() {
return Objects.hash(tags, id, category, status, name, photoUrls);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InlineResponse200 {\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,68 @@
package io.swagger.model;
import java.util.Objects;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-10T09:43:22.889+08:00")
public class ModelReturn {
private Integer _return = null;
/**
**/
@JsonProperty("return")
public Integer getReturn() {
return _return;
}
public void setReturn(Integer _return) {
this._return = _return;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelReturn _return = (ModelReturn) o;
return Objects.equals(_return, _return._return);
}
@Override
public int hashCode() {
return Objects.hash(_return);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelReturn {\n");
sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,68 @@
package io.swagger.model;
import java.util.Objects;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-10T09:43:22.889+08:00")
public class SpecialModelName {
private Long specialPropertyName = null;
/**
**/
@JsonProperty("$special[property.name]")
public Long getSpecialPropertyName() {
return specialPropertyName;
}
public void setSpecialPropertyName(Long specialPropertyName) {
this.specialPropertyName = specialPropertyName;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SpecialModelName specialModelName = (SpecialModelName) o;
return Objects.equals(specialPropertyName, specialModelName.specialPropertyName);
}
@Override
public int hashCode() {
return Objects.hash(specialPropertyName);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SpecialModelName {\n");
sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}