update csharp test case to use another petstore spec

This commit is contained in:
wing328
2016-04-14 00:04:26 +08:00
parent aa04bbb92e
commit 5c632e9862
12 changed files with 580 additions and 1475 deletions

View File

@@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l csharp -o samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient"
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l csharp -o samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient"
java $JAVA_OPTS -jar $executable $ags

View File

@@ -65,18 +65,6 @@ 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>
@@ -126,30 +114,6 @@ string apiKey = null; // TODO: replace null with proper value
Assert.IsInstanceOf<Pet> (response, "response is Pet");
}
/// <summary>
/// Test GetPetByIdInObject
/// </summary>
[Test]
public void GetPetByIdInObjectTest()
{
// TODO: add unit test for the method 'GetPetByIdInObject'
long? petId = null; // TODO: replace null with proper value
var response = instance.GetPetByIdInObject(petId);
Assert.IsInstanceOf<InlineResponse200> (response, "response is InlineResponse200");
}
/// <summary>
/// Test PetPetIdtestingByteArraytrueGet
/// </summary>
[Test]
public void PetPetIdtestingByteArraytrueGetTest()
{
// TODO: add unit test for the method 'PetPetIdtestingByteArraytrueGet'
long? petId = null; // TODO: replace null with proper value
var response = instance.PetPetIdtestingByteArraytrueGet(petId);
Assert.IsInstanceOf<byte[]> (response, "response is byte[]");
}
/// <summary>
/// Test UpdatePet
/// </summary>
@@ -169,7 +133,7 @@ string apiKey = null; // TODO: replace null with proper value
public void UpdatePetWithFormTest()
{
// TODO: add unit test for the method 'UpdatePetWithForm'
string petId = null; // TODO: replace null with proper value
long? 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);
@@ -185,9 +149,9 @@ string status = null; // TODO: replace null with proper value
// 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
System.IO.Stream file = null; // TODO: replace null with proper value
instance.UploadFile(petId, additionalMetadata, file);
Stream file = null; // TODO: replace null with proper value
var response = instance.UploadFile(petId, additionalMetadata, file);
Assert.IsInstanceOf<ApiResponse> (response, "response is ApiResponse");
}
}

View File

@@ -65,18 +65,6 @@ namespace IO.Swagger.Test
}
/// <summary>
/// Test FindOrdersByStatus
/// </summary>
[Test]
public void FindOrdersByStatusTest()
{
// TODO: add unit test for the method 'FindOrdersByStatus'
string status = null; // TODO: replace null with proper value
var response = instance.FindOrdersByStatus(status);
Assert.IsInstanceOf<List<Order>> (response, "response is List<Order>");
}
/// <summary>
/// Test GetInventory
/// </summary>
@@ -88,17 +76,6 @@ namespace IO.Swagger.Test
Assert.IsInstanceOf<Dictionary<string, int?>> (response, "response is Dictionary<string, int?>");
}
/// <summary>
/// Test GetInventoryInObject
/// </summary>
[Test]
public void GetInventoryInObjectTest()
{
// TODO: add unit test for the method 'GetInventoryInObject'
var response = instance.GetInventoryInObject();
Assert.IsInstanceOf<Object> (response, "response is Object");
}
/// <summary>
/// Test GetOrderById
/// </summary>
@@ -106,7 +83,7 @@ namespace IO.Swagger.Test
public void GetOrderByIdTest()
{
// TODO: add unit test for the method 'GetOrderById'
string orderId = null; // TODO: replace null with proper value
long? orderId = null; // TODO: replace null with proper value
var response = instance.GetOrderById(orderId);
Assert.IsInstanceOf<Order> (response, "response is Order");
}

View File

@@ -36,27 +36,6 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> DeleteOrderWithHttpInfo (string orderId);
/// <summary>
/// Finds orders by status
/// </summary>
/// <remarks>
/// A single status value can be provided as a string
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
/// <returns>List&lt;Order&gt;</returns>
List<Order> FindOrdersByStatus (string status = null);
/// <summary>
/// Finds orders by status
/// </summary>
/// <remarks>
/// A single status value can be provided as a string
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
/// <returns>ApiResponse of List&lt;Order&gt;</returns>
ApiResponse<List<Order>> FindOrdersByStatusWithHttpInfo (string status = null);
/// <summary>
/// Returns pet inventories by status
/// </summary>
/// <remarks>
@@ -76,25 +55,6 @@ namespace IO.Swagger.Api
/// <returns>ApiResponse of Dictionary&lt;string, int?&gt;</returns>
ApiResponse<Dictionary<string, int?>> GetInventoryWithHttpInfo ();
/// <summary>
/// Fake endpoint to test arbitrary object return by &#39;Get inventory&#39;
/// </summary>
/// <remarks>
/// Returns an arbitrary object which is actually a map of status codes to quantities
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>Object</returns>
Object GetInventoryInObject ();
/// <summary>
/// Fake endpoint to test arbitrary object return by &#39;Get inventory&#39;
/// </summary>
/// <remarks>
/// Returns an arbitrary object which is actually a map of status codes to quantities
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of Object</returns>
ApiResponse<Object> GetInventoryInObjectWithHttpInfo ();
/// <summary>
/// Find purchase order by ID
/// </summary>
/// <remarks>
@@ -103,7 +63,7 @@ namespace IO.Swagger.Api
/// <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>
Order GetOrderById (string orderId);
Order GetOrderById (long? orderId);
/// <summary>
/// Find purchase order by ID
@@ -114,7 +74,7 @@ namespace IO.Swagger.Api
/// <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>
ApiResponse<Order> GetOrderByIdWithHttpInfo (string orderId);
ApiResponse<Order> GetOrderByIdWithHttpInfo (long? orderId);
/// <summary>
/// Place an order for a pet
/// </summary>
@@ -122,9 +82,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet (optional)</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Order</returns>
Order PlaceOrder (Order body = null);
Order PlaceOrder (Order body);
/// <summary>
/// Place an order for a pet
@@ -133,9 +93,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet (optional)</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>ApiResponse of Order</returns>
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body = null);
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body);
#endregion Synchronous Operations
#region Asynchronous Operations
/// <summary>
@@ -160,27 +120,6 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> DeleteOrderAsyncWithHttpInfo (string orderId);
/// <summary>
/// Finds orders by status
/// </summary>
/// <remarks>
/// A single status value can be provided as a string
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
/// <returns>Task of List&lt;Order&gt;</returns>
System.Threading.Tasks.Task<List<Order>> FindOrdersByStatusAsync (string status = null);
/// <summary>
/// Finds orders by status
/// </summary>
/// <remarks>
/// A single status value can be provided as a string
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
/// <returns>Task of ApiResponse (List&lt;Order&gt;)</returns>
System.Threading.Tasks.Task<ApiResponse<List<Order>>> FindOrdersByStatusAsyncWithHttpInfo (string status = null);
/// <summary>
/// Returns pet inventories by status
/// </summary>
/// <remarks>
@@ -200,25 +139,6 @@ namespace IO.Swagger.Api
/// <returns>Task of ApiResponse (Dictionary&lt;string, int?&gt;)</returns>
System.Threading.Tasks.Task<ApiResponse<Dictionary<string, int?>>> GetInventoryAsyncWithHttpInfo ();
/// <summary>
/// Fake endpoint to test arbitrary object return by &#39;Get inventory&#39;
/// </summary>
/// <remarks>
/// Returns an arbitrary object which is actually 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 Object</returns>
System.Threading.Tasks.Task<Object> GetInventoryInObjectAsync ();
/// <summary>
/// Fake endpoint to test arbitrary object return by &#39;Get inventory&#39;
/// </summary>
/// <remarks>
/// Returns an arbitrary object which is actually 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 (Object)</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> GetInventoryInObjectAsyncWithHttpInfo ();
/// <summary>
/// Find purchase order by ID
/// </summary>
/// <remarks>
@@ -227,7 +147,7 @@ namespace IO.Swagger.Api
/// <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 (string orderId);
System.Threading.Tasks.Task<Order> GetOrderByIdAsync (long? orderId);
/// <summary>
/// Find purchase order by ID
@@ -238,7 +158,7 @@ namespace IO.Swagger.Api
/// <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 (string orderId);
System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (long? orderId);
/// <summary>
/// Place an order for a pet
/// </summary>
@@ -246,9 +166,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet (optional)</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Task of Order</returns>
System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body = null);
System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body);
/// <summary>
/// Place an order for a pet
@@ -257,9 +177,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet (optional)</param>
/// <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);
System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body);
#endregion Asynchronous Operations
}
@@ -388,8 +308,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -458,8 +378,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -489,163 +409,6 @@ namespace IO.Swagger.Api
null);
}
/// <summary>
/// Finds orders by status A single status value can be provided as a string
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
/// <returns>List&lt;Order&gt;</returns>
public List<Order> FindOrdersByStatus (string status = null)
{
ApiResponse<List<Order>> localVarResponse = FindOrdersByStatusWithHttpInfo(status);
return localVarResponse.Data;
}
/// <summary>
/// Finds orders by status A single status value can be provided as a string
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
/// <returns>ApiResponse of List&lt;Order&gt;</returns>
public ApiResponse< List<Order> > FindOrdersByStatusWithHttpInfo (string status = null)
{
var localVarPath = "/store/findByStatus";
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 (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter
// authentication (test_api_client_id) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id")))
{
localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id");
}
// authentication (test_api_client_secret) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret")))
{
localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret");
}
// 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 FindOrdersByStatus: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling FindOrdersByStatus: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<List<Order>>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(List<Order>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<Order>)));
}
/// <summary>
/// Finds orders by status A single status value can be provided as a string
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
/// <returns>Task of List&lt;Order&gt;</returns>
public async System.Threading.Tasks.Task<List<Order>> FindOrdersByStatusAsync (string status = null)
{
ApiResponse<List<Order>> localVarResponse = await FindOrdersByStatusAsyncWithHttpInfo(status);
return localVarResponse.Data;
}
/// <summary>
/// Finds orders by status A single status value can be provided as a string
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="status">Status value that needs to be considered for query (optional, default to placed)</param>
/// <returns>Task of ApiResponse (List&lt;Order&gt;)</returns>
public async System.Threading.Tasks.Task<ApiResponse<List<Order>>> FindOrdersByStatusAsyncWithHttpInfo (string status = null)
{
var localVarPath = "/store/findByStatus";
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 (status != null) localVarQueryParams.Add("status", Configuration.ApiClient.ParameterToString(status)); // query parameter
// authentication (test_api_client_id) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id")))
{
localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id");
}
// authentication (test_api_client_secret) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret")))
{
localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret");
}
// 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 FindOrdersByStatus: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling FindOrdersByStatus: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<List<Order>>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(List<Order>) Configuration.ApiClient.Deserialize(localVarResponse, typeof(List<Order>)));
}
/// <summary>
/// Returns pet inventories by status Returns a map of status codes to quantities
/// </summary>
@@ -680,8 +443,7 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -751,8 +513,7 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -786,153 +547,13 @@ namespace IO.Swagger.Api
}
/// <summary>
/// Fake endpoint to test arbitrary object return by &#39;Get inventory&#39; Returns an arbitrary object which is actually a map of status codes to quantities
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>Object</returns>
public Object GetInventoryInObject ()
{
ApiResponse<Object> localVarResponse = GetInventoryInObjectWithHttpInfo();
return localVarResponse.Data;
}
/// <summary>
/// Fake endpoint to test arbitrary object return by &#39;Get inventory&#39; Returns an arbitrary object which is actually a map of status codes to quantities
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of Object</returns>
public ApiResponse< Object > GetInventoryInObjectWithHttpInfo ()
{
var localVarPath = "/store/inventory?response&#x3D;arbitrary_object";
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");
// 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) 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 GetInventoryInObject: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(Object) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object)));
}
/// <summary>
/// Fake endpoint to test arbitrary object return by &#39;Get inventory&#39; Returns an arbitrary object which is actually 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 Object</returns>
public async System.Threading.Tasks.Task<Object> GetInventoryInObjectAsync ()
{
ApiResponse<Object> localVarResponse = await GetInventoryInObjectAsyncWithHttpInfo();
return localVarResponse.Data;
}
/// <summary>
/// Fake endpoint to test arbitrary object return by &#39;Get inventory&#39; Returns an arbitrary object which is actually 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 (Object)</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> GetInventoryInObjectAsyncWithHttpInfo ()
{
var localVarPath = "/store/inventory?response&#x3D;arbitrary_object";
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");
// 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 (localVarStatusCode >= 400)
throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.Content, localVarResponse.Content);
else if (localVarStatusCode == 0)
throw new ApiException (localVarStatusCode, "Error calling GetInventoryInObject: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
return new ApiResponse<Object>(localVarStatusCode,
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
(Object) Configuration.ApiClient.Deserialize(localVarResponse, typeof(Object)));
}
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value &lt;&#x3D; 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)
public Order GetOrderById (long? orderId)
{
ApiResponse<Order> localVarResponse = GetOrderByIdWithHttpInfo(orderId);
return localVarResponse.Data;
@@ -944,7 +565,7 @@ namespace IO.Swagger.Api
/// <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)
public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId)
{
// verify the required parameter 'orderId' is set
if (orderId == null)
@@ -965,8 +586,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -977,19 +598,6 @@ namespace IO.Swagger.Api
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// 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");
}
// 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");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@@ -1014,7 +622,7 @@ namespace IO.Swagger.Api
/// <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)
public async System.Threading.Tasks.Task<Order> GetOrderByIdAsync (long? orderId)
{
ApiResponse<Order> localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId);
return localVarResponse.Data;
@@ -1027,7 +635,7 @@ namespace IO.Swagger.Api
/// <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)
public async System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (long? orderId)
{
// verify the required parameter 'orderId' is set
if (orderId == null)
@@ -1048,8 +656,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1060,17 +668,6 @@ namespace IO.Swagger.Api
localVarPathParams.Add("format", "json");
if (orderId != null) localVarPathParams.Add("orderId", Configuration.ApiClient.ParameterToString(orderId)); // path parameter
// 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");
}
// 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");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
@@ -1093,9 +690,9 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>Order</returns>
public Order PlaceOrder (Order body = null)
public Order PlaceOrder (Order body)
{
ApiResponse<Order> localVarResponse = PlaceOrderWithHttpInfo(body);
return localVarResponse.Data;
@@ -1105,10 +702,13 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">order placed for purchasing the pet</param>
/// <returns>ApiResponse of Order</returns>
public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body = null)
public ApiResponse< Order > PlaceOrderWithHttpInfo (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>();
@@ -1125,8 +725,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1144,18 +744,6 @@ namespace IO.Swagger.Api
localVarPostBody = body; // byte array
}
// authentication (test_api_client_id) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id")))
{
localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id");
}
// authentication (test_api_client_secret) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret")))
{
localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
@@ -1179,9 +767,9 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <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 = null)
public async System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body)
{
ApiResponse<Order> localVarResponse = await PlaceOrderAsyncWithHttpInfo(body);
return localVarResponse.Data;
@@ -1192,10 +780,13 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <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 = null)
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>();
@@ -1212,8 +803,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1231,16 +822,6 @@ namespace IO.Swagger.Api
localVarPostBody = body; // byte array
}
// authentication (test_api_client_id) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_id")))
{
localVarHeaderParams["x-test_api_client_id"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_id");
}
// authentication (test_api_client_secret) required
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("x-test_api_client_secret")))
{
localVarHeaderParams["x-test_api_client_secret"] = Configuration.GetApiKeyWithPrefix("x-test_api_client_secret");
}
// make the HTTP request
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,

View File

@@ -21,9 +21,9 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">Created user object</param>
/// <returns></returns>
void CreateUser (User body = null);
void CreateUser (User body);
/// <summary>
/// Create user
@@ -32,9 +32,9 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">Created user object</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> CreateUserWithHttpInfo (User body = null);
ApiResponse<Object> CreateUserWithHttpInfo (User body);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@@ -42,9 +42,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object (optional)</param>
/// <param name="body">List of user object</param>
/// <returns></returns>
void CreateUsersWithArrayInput (List<User> body = null);
void CreateUsersWithArrayInput (List<User> body);
/// <summary>
/// Creates list of users with given input array
@@ -53,9 +53,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object (optional)</param>
/// <param name="body">List of user object</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body = null);
ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@@ -63,9 +63,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object (optional)</param>
/// <param name="body">List of user object</param>
/// <returns></returns>
void CreateUsersWithListInput (List<User> body = null);
void CreateUsersWithListInput (List<User> body);
/// <summary>
/// Creates list of users with given input array
@@ -74,9 +74,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object (optional)</param>
/// <param name="body">List of user object</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body = null);
ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body);
/// <summary>
/// Delete user
/// </summary>
@@ -126,10 +126,10 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">The user name for login (optional)</param>
/// <param name="password">The password for login in clear text (optional)</param>
/// <param name="username">The user name for login</param>
/// <param name="password">The password for login in clear text</param>
/// <returns>string</returns>
string LoginUser (string username = null, string password = null);
string LoginUser (string username, string password);
/// <summary>
/// Logs user into the system
@@ -138,10 +138,10 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">The user name for login (optional)</param>
/// <param name="password">The password for login in clear text (optional)</param>
/// <param name="username">The user name for login</param>
/// <param name="password">The password for login in clear text</param>
/// <returns>ApiResponse of string</returns>
ApiResponse<string> LoginUserWithHttpInfo (string username = null, string password = null);
ApiResponse<string> LoginUserWithHttpInfo (string username, string password);
/// <summary>
/// Logs out current logged in user session
/// </summary>
@@ -169,9 +169,9 @@ namespace IO.Swagger.Api
/// </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 (optional)</param>
/// <param name="body">Updated user object</param>
/// <returns></returns>
void UpdateUser (string username, User body = null);
void UpdateUser (string username, User body);
/// <summary>
/// Updated user
@@ -181,9 +181,9 @@ namespace IO.Swagger.Api
/// </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 (optional)</param>
/// <param name="body">Updated user object</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body = null);
ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body);
#endregion Synchronous Operations
#region Asynchronous Operations
/// <summary>
@@ -193,9 +193,9 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">Created user object</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task CreateUserAsync (User body = null);
System.Threading.Tasks.Task CreateUserAsync (User body);
/// <summary>
/// Create user
@@ -204,9 +204,9 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">Created user object</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body = null);
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@@ -214,9 +214,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object (optional)</param>
/// <param name="body">List of user object</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body = null);
System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body);
/// <summary>
/// Creates list of users with given input array
@@ -225,9 +225,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object (optional)</param>
/// <param name="body">List of user object</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body = null);
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@@ -235,9 +235,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object (optional)</param>
/// <param name="body">List of user object</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body = null);
System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body);
/// <summary>
/// Creates list of users with given input array
@@ -246,9 +246,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object (optional)</param>
/// <param name="body">List of user object</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body = null);
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body);
/// <summary>
/// Delete user
/// </summary>
@@ -298,10 +298,10 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">The user name for login (optional)</param>
/// <param name="password">The password for login in clear text (optional)</param>
/// <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 = null, string password = null);
System.Threading.Tasks.Task<string> LoginUserAsync (string username, string password);
/// <summary>
/// Logs user into the system
@@ -310,10 +310,10 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">The user name for login (optional)</param>
/// <param name="password">The password for login in clear text (optional)</param>
/// <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 = null, string password = null);
System.Threading.Tasks.Task<ApiResponse<string>> LoginUserAsyncWithHttpInfo (string username, string password);
/// <summary>
/// Logs out current logged in user session
/// </summary>
@@ -341,9 +341,9 @@ namespace IO.Swagger.Api
/// </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 (optional)</param>
/// <param name="body">Updated user object</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task UpdateUserAsync (string username, User body = null);
System.Threading.Tasks.Task UpdateUserAsync (string username, User body);
/// <summary>
/// Updated user
@@ -353,9 +353,9 @@ namespace IO.Swagger.Api
/// </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 (optional)</param>
/// <param name="body">Updated user object</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body = null);
System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body);
#endregion Asynchronous Operations
}
@@ -450,9 +450,9 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">Created user object</param>
/// <returns></returns>
public void CreateUser (User body = null)
public void CreateUser (User body)
{
CreateUserWithHttpInfo(body);
}
@@ -461,10 +461,13 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">Created user object</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> CreateUserWithHttpInfo (User body = null)
public ApiResponse<Object> CreateUserWithHttpInfo (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>();
@@ -481,8 +484,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -523,9 +526,9 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">Created user object</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task CreateUserAsync (User body = null)
public async System.Threading.Tasks.Task CreateUserAsync (User body)
{
await CreateUserAsyncWithHttpInfo(body);
@@ -535,10 +538,13 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">Created user object</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body = null)
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>();
@@ -555,8 +561,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -597,9 +603,9 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">List of user object</param>
/// <returns></returns>
public void CreateUsersWithArrayInput (List<User> body = null)
public void CreateUsersWithArrayInput (List<User> body)
{
CreateUsersWithArrayInputWithHttpInfo(body);
}
@@ -608,10 +614,13 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">List of user object</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body = null)
public ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (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>();
@@ -628,8 +637,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -670,9 +679,9 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">List of user object</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body = null)
public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body)
{
await CreateUsersWithArrayInputAsyncWithHttpInfo(body);
@@ -682,10 +691,13 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <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 = null)
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>();
@@ -702,8 +714,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -744,9 +756,9 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">List of user object</param>
/// <returns></returns>
public void CreateUsersWithListInput (List<User> body = null)
public void CreateUsersWithListInput (List<User> body)
{
CreateUsersWithListInputWithHttpInfo(body);
}
@@ -755,10 +767,13 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">List of user object</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body = null)
public ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (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>();
@@ -775,8 +790,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -817,9 +832,9 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="body">List of user object</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body = null)
public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body)
{
await CreateUsersWithListInputAsyncWithHttpInfo(body);
@@ -829,10 +844,13 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <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 = null)
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>();
@@ -849,8 +867,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -925,8 +943,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -937,13 +955,6 @@ namespace IO.Swagger.Api
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
// authentication (test_http_basic) 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) Configuration.ApiClient.CallApi(localVarPath,
@@ -1002,8 +1013,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1014,12 +1025,6 @@ namespace IO.Swagger.Api
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
// authentication (test_http_basic) 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,
@@ -1078,8 +1083,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1149,8 +1154,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1184,10 +1189,10 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="password">The password for login in clear text (optional)</param>
/// <param name="username">The user name for login</param>
/// <param name="password">The password for login in clear text</param>
/// <returns>string</returns>
public string LoginUser (string username = null, string password = null)
public string LoginUser (string username, string password)
{
ApiResponse<string> localVarResponse = LoginUserWithHttpInfo(username, password);
return localVarResponse.Data;
@@ -1197,11 +1202,17 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="password">The password for login in clear text (optional)</param>
/// <param name="username">The user name for login</param>
/// <param name="password">The password for login in clear text</param>
/// <returns>ApiResponse of string</returns>
public ApiResponse< string > LoginUserWithHttpInfo (string username = null, string password = null)
public ApiResponse< string > LoginUserWithHttpInfo (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>();
@@ -1218,8 +1229,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1254,10 +1265,10 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="password">The password for login in clear text (optional)</param>
/// <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 = null, string password = null)
public async System.Threading.Tasks.Task<string> LoginUserAsync (string username, string password)
{
ApiResponse<string> localVarResponse = await LoginUserAsyncWithHttpInfo(username, password);
return localVarResponse.Data;
@@ -1268,11 +1279,17 @@ namespace IO.Swagger.Api
/// 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 (optional)</param>
/// <param name="password">The password for login in clear text (optional)</param>
/// <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 = null, string password = null)
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>();
@@ -1289,8 +1306,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1354,8 +1371,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1418,8 +1435,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1453,9 +1470,9 @@ namespace IO.Swagger.Api
/// </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 (optional)</param>
/// <param name="body">Updated user object</param>
/// <returns></returns>
public void UpdateUser (string username, User body = null)
public void UpdateUser (string username, User body)
{
UpdateUserWithHttpInfo(username, body);
}
@@ -1465,13 +1482,16 @@ namespace IO.Swagger.Api
/// </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 (optional)</param>
/// <param name="body">Updated user object</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body = null)
public ApiResponse<Object> UpdateUserWithHttpInfo (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>();
@@ -1488,8 +1508,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1532,9 +1552,9 @@ namespace IO.Swagger.Api
/// </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 (optional)</param>
/// <param name="body">Updated user object</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body = null)
public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body)
{
await UpdateUserAsyncWithHttpInfo(username, body);
@@ -1545,13 +1565,16 @@ namespace IO.Swagger.Api
/// </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 (optional)</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 = null)
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>();
@@ -1568,8 +1591,8 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/json",
"application/xml"
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)

View File

@@ -0,0 +1,142 @@
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 ApiResponse : IEquatable<ApiResponse>
{
/// <summary>
/// Initializes a new instance of the <see cref="ApiResponse" /> class.
/// Initializes a new instance of the <see cref="ApiResponse" />class.
/// </summary>
/// <param name="Code">Code.</param>
/// <param name="Type">Type.</param>
/// <param name="Message">Message.</param>
public ApiResponse(int? Code = null, string Type = null, string Message = null)
{
this.Code = Code;
this.Type = Type;
this.Message = Message;
}
/// <summary>
/// Gets or Sets Code
/// </summary>
[DataMember(Name="code", EmitDefaultValue=false)]
public int? Code { get; set; }
/// <summary>
/// Gets or Sets Type
/// </summary>
[DataMember(Name="type", EmitDefaultValue=false)]
public string Type { get; set; }
/// <summary>
/// Gets or Sets Message
/// </summary>
[DataMember(Name="message", EmitDefaultValue=false)]
public string Message { 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 ApiResponse {\n");
sb.Append(" Code: ").Append(Code).Append("\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" Message: ").Append(Message).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 ApiResponse);
}
/// <summary>
/// Returns true if ApiResponse instances are equal
/// </summary>
/// <param name="other">Instance of ApiResponse to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(ApiResponse other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return
(
this.Code == other.Code ||
this.Code != null &&
this.Code.Equals(other.Code)
) &&
(
this.Type == other.Type ||
this.Type != null &&
this.Type.Equals(other.Type)
) &&
(
this.Message == other.Message ||
this.Message != null &&
this.Message.Equals(other.Message)
);
}
/// <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.Code != null)
hash = hash * 59 + this.Code.GetHashCode();
if (this.Type != null)
hash = hash * 59 + this.Type.GetHashCode();
if (this.Message != null)
hash = hash * 59 + this.Message.GetHashCode();
return hash;
}
}
}
}

View File

@@ -47,19 +47,29 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="Order" /> class.
/// Initializes a new instance of the <see cref="Order" />class.
/// </summary>
/// <param name="Id">Id.</param>
/// <param name="PetId">PetId.</param>
/// <param name="Quantity">Quantity.</param>
/// <param name="ShipDate">ShipDate.</param>
/// <param name="Status">Order Status.</param>
/// <param name="Complete">Complete.</param>
/// <param name="Complete">Complete (default to false).</param>
public Order(long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null)
public Order(long? Id = null, long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null)
{
this.Id = Id;
this.PetId = PetId;
this.Quantity = Quantity;
this.ShipDate = ShipDate;
this.Status = Status;
// use default value if no "Complete" provided
if (Complete == null)
{
this.Complete = false;
}
else
{
this.Complete = Complete;
}
}
@@ -68,7 +78,7 @@ namespace IO.Swagger.Model
/// Gets or Sets Id
/// </summary>
[DataMember(Name="id", EmitDefaultValue=false)]
public long? Id { get; private set; }
public long? Id { get; set; }
/// <summary>
/// Gets or Sets PetId

View File

@@ -70,6 +70,7 @@
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Cat.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\Dog.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\FormatTest.cs" />
<Compile Include="Lib\SwaggerClient\src\main\csharp\IO\Swagger\Model\ApiResponse.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

View File

@@ -73,6 +73,9 @@ namespace SwaggerClientTest.TestOrder
}
/* comment out the test case as the method is not defined in original petstore spec
* we will re-enable this after updating the petstore server
*
/// <summary>
/// Test GetInvetoryInObject
/// </summary>
@@ -93,7 +96,7 @@ namespace SwaggerClientTest.TestOrder
Assert.IsInstanceOf (typeof(int?), Int32.Parse(entry.Value));
}
}
}*/
}
}

View File

@@ -158,6 +158,9 @@ namespace SwaggerClientTest.TestPet
}
/* comment out the test case as the method is not defined in original petstore spec
* we will re-enable this after updating the petstore server
*
/// <summary>
/// Test GetPetByIdInObject
/// </summary>
@@ -187,8 +190,11 @@ namespace SwaggerClientTest.TestPet
Assert.AreEqual (56, (int)category ["id"]);
Assert.AreEqual ("sample category name2", (string) category["name"]);
}
}*/
/* comment out the test case as the method is not defined in original petstore spec
* we will re-enable this after updating the petstore server
*
/// <summary>
/// Test GetPetByIdWithByteArray
/// </summary>
@@ -201,8 +207,11 @@ namespace SwaggerClientTest.TestPet
PetApi petApi = new PetApi (c1);
byte[] response = petApi.PetPetIdtestingByteArraytrueGet (petId);
Assert.IsInstanceOf<byte[]> (response, "Response is byte array");
}
}*/
/* comment out the test case as the method is not defined in original petstore spec
* we will re-enable this after updating the petstore server
*
/// <summary>
/// Test AddPetUsingByteArray
/// </summary>
@@ -216,7 +225,7 @@ namespace SwaggerClientTest.TestPet
Pet p = createPet ();
byte[] petByteArray = GetBytes ((string)petApi.Configuration.ApiClient.Serialize (p));
petApi.AddPetUsingByteArray (petByteArray);
}
}*/
/// <summary>
/// Test UpdatePetWithForm
@@ -225,7 +234,7 @@ namespace SwaggerClientTest.TestPet
public void TestUpdatePetWithForm ()
{
PetApi petApi = new PetApi ();
petApi.UpdatePetWithForm (petId.ToString(), "new form name", "pending");
petApi.UpdatePetWithForm (petId, "new form name", "pending");
Pet response = petApi.GetPetById (petId);
Assert.IsInstanceOf<Pet> (response, "Response is a Pet");
@@ -239,7 +248,7 @@ namespace SwaggerClientTest.TestPet
Assert.AreEqual (56, response.Category.Id);
// test optional parameter
petApi.UpdatePetWithForm (petId.ToString(), "new form name2");
petApi.UpdatePetWithForm (petId, "new form name2");
Pet response2 = petApi.GetPetById (petId);
Assert.AreEqual ("new form name2", response2.Name);
}

View File

@@ -1,9 +1,9 @@
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.swagger-logo.png
/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/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll
/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb
/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